Skip to content

Commit

Permalink
v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
fontainejp committed Jan 8, 2020
1 parent e9c7057 commit a858ce4
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 41 deletions.
39 changes: 35 additions & 4 deletions www/blocs&generateurs/ffau/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Blockly.Blocks['style'] = {
],
"previousStatement": "header",
"nextStatement": "header",
"colour": 290
"colour": 120
});
}
};
Expand All @@ -81,7 +81,7 @@ Blockly.Blocks['stylearg'] = {
],
"previousStatement": "args",
"nextStatement": "args",
"colour": 290
"colour": 120
});
}
};
Expand Down Expand Up @@ -113,7 +113,7 @@ Blockly.Blocks['cssitem'] = {
],
"previousStatement": "style",
"nextStatement": "style",
"colour": 290
"colour": 120
});
}
};
Expand Down Expand Up @@ -143,7 +143,7 @@ Blockly.Blocks['othercss'] = {
],
"previousStatement": "stylecontent",
"nextStatement": "stylecontent",
"colour": 290
"colour": 120
});
}
};
Expand Down Expand Up @@ -602,6 +602,37 @@ Blockly.html['borderrad'] = function (block) {
var content = block.getFieldValue('content');
return 'border-radius: ' + fullEscape(content) + ';\n';
};
// Border Collapse
Blockly.Blocks['bordercollapse'] = {
init: function () {
this.jsonInit({
"message0": 'border-collapse: %1 ;',
"args0": [
{
"type": "field_dropdown",
"name": "content",
"options": [
[
"collapse",
"collapse"
],
[
"separate",
"separate"
]
]
}
],
"previousStatement": "stylecontent",
"nextStatement": "stylecontent",
"colour": 290
});
}
};
Blockly.html['bordercollapse'] = function (block) {
var content = block.getFieldValue('content');
return 'border-collapse: ' + fullEscape(content) + ';\n';
};
// Width height number selector
Blockly.Blocks['widthheightnum'] = {
init: function () {
Expand Down
48 changes: 18 additions & 30 deletions www/blocs&generateurs/ffau/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Blockly.Blocks['html'] = {
"check": "document"
}
],
"colour": 210
"colour": "#4a235a"
});
}
};
Expand Down Expand Up @@ -95,7 +95,7 @@ Blockly.Blocks['head'] = {init:function(){
],
"previousStatement": "document",
"nextStatement": "document",
"colour": 210
"colour": "#4a235a"
});
}
};
Expand All @@ -114,11 +114,11 @@ Blockly.Blocks['title'] = {
this.setInputsInline(false);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(210)}
this.setColour("#4a235a")}
};
Blockly.html['title'] = function (block) {
var text_content = block.getFieldValue('_text');
return '<title>' + text_content + '</title>\n <meta charset="utf-8">\n';
return '<title>' + text_content + '</title>\n<meta charset="utf-8">\n';
};
// Link bootstrap.css
Blockly.Blocks['bootstrap'] = {
Expand All @@ -128,10 +128,10 @@ Blockly.Blocks['bootstrap'] = {
this.setInputsInline(false);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(210)}
this.setColour("#4a235a")}
};
Blockly.html['bootstrap'] = function (block) {
return '<link rel="stylesheet" href="css/bootstrap.min.3.3.6.css">'
return '<script src="js/jquery.min.2.1.3.js"></script>\n<script src="js/bootstrap.min.3.3.6.js"></script>\n<link rel="stylesheet" href="css/bootstrap.min.3.3.6.css">\n'
};
// Link FontAwesome.css
Blockly.Blocks['fontawesome'] = {
Expand All @@ -141,10 +141,10 @@ Blockly.Blocks['fontawesome'] = {
this.setInputsInline(false);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(210)}
this.setColour("#4a235a")}
};
Blockly.html['fontawesome'] = function (block) {
return '<link rel="stylesheet" href="css/fontawesome.css">';
return '<link rel="stylesheet" href="css/fontawesome.css">\n';
};
// Body tag
Blockly.Blocks['body'] = {
Expand All @@ -164,7 +164,7 @@ Blockly.Blocks['body'] = {
}
],
"previousStatement": "document",
"colour": 210
"colour": "#4a235a"
});
}
};
Expand Down Expand Up @@ -200,7 +200,7 @@ Blockly.Blocks['button'] = {
Blockly.html['button'] = function (block) {
var statements_content = Blockly.html.statementToCode(block, 'content');
var block_modifier = Blockly.html.statementToCode(block, 'modifier', Blockly.html.ORDER_ATOMIC);
var code = '<button' + (block_modifier ? " " + block_modifier.trim() : "") + '>\n' + statements_content + '</button>\n';
var code = '\n<button' + (block_modifier ? " " + block_modifier.trim() : "") + '>' + statements_content + '</button>\n';
return code;
};
// Icon tag
Expand All @@ -223,7 +223,7 @@ Blockly.Blocks['icon'] = {
};
Blockly.html['icon'] = function (block) {
var text_content = block.getFieldValue('content');
var code = '<i class="' + text_content + '"></i>\n';
var code = '<i class="' + text_content + '"></i>';
return code;
};
// Divider tag
Expand Down Expand Up @@ -256,7 +256,7 @@ Blockly.Blocks['divider'] = {
"html",
"form"
],
"colour": 210
"colour": "#4a235a"
});
}
};
Expand All @@ -273,7 +273,7 @@ Blockly.Blocks['linebreak'] = {
"message0": '<br>',
"previousStatement": "html",
"nextStatement": "html",
"colour": 210
"colour": "#4a235a"
});
}
};
Expand All @@ -294,7 +294,7 @@ Blockly.Blocks['hline'] = {
],
"previousStatement": "html",
"nextStatement": "html",
"colour": 210
"colour": "#4a235a"
});
}
};
Expand Down Expand Up @@ -418,7 +418,7 @@ Blockly.Blocks['emptytext'] = {
};
Blockly.html['emptytext'] = function (block) {
var text_content = block.getFieldValue('content');
return '\n' + looseEscape(text_content) + '\n';
return looseEscape(text_content)
};
// Text modifier
Blockly.Blocks['textmod'] = {
Expand Down Expand Up @@ -537,7 +537,7 @@ Blockly.Blocks['paragraph'] = {
Blockly.html['paragraph'] = function (block) {
var statements_content = Blockly.html.statementToCode(block, 'content');
var block_modifier = Blockly.html.statementToCode(block, 'modifier');
return '<p' + (block_modifier ? " " + block_modifier.trim() : "") + '>' + statements_content + '</p>\n';
return '<p' + (block_modifier ? " " + block_modifier.trim() : "") + '>\n' + statements_content + '\n</p>\n';
};
// Header tag
Blockly.Blocks['header'] = {
Expand Down Expand Up @@ -635,7 +635,7 @@ Blockly.html['link'] = function (block) {
if (isNewTabUrl(bareLink)) {
target = ' target="_blank"';
}
return '<a href="' + link + '"' + target + (block_modifier ? " " + block_modifier.trim() : "") + '>' + text + '</a>\n';
return '\n<a href="' + link + '"' + target + (block_modifier ? " " + block_modifier.trim() : "") + '>' + text + '</a>\n';
};
// Span tag
Blockly.Blocks['span'] = {
Expand Down Expand Up @@ -663,7 +663,7 @@ Blockly.Blocks['span'] = {
Blockly.html['span'] = function (block) {
var content = Blockly.html.statementToCode(block, 'content');
var block_modifier = Blockly.html.statementToCode(block, 'modifier', Blockly.html.ORDER_ATOMIC);
return '<span' + (block_modifier ? " " + block_modifier.trim() : "") + '>' + content + '</span>';
return '\n<span' + (block_modifier ? " " + block_modifier.trim() : "") + '>' + content + '</span>\n';
};
//////////////////////// Table ////////////////////////
// Table tag
Expand Down Expand Up @@ -890,10 +890,6 @@ Blockly.Blocks['input'] = {
"date",
"date"
],
[
"datetime-local",
"datetime-local"
],
[
"email",
"email"
Expand All @@ -902,10 +898,6 @@ Blockly.Blocks['input'] = {
"hidden",
"hidden"
],
[
"month",
"month"
],
[
"number",
"number"
Expand All @@ -929,10 +921,6 @@ Blockly.Blocks['input'] = {
[
"time",
"time"
],
[
"week",
"week"
]
]
},
Expand Down
15 changes: 8 additions & 7 deletions www/ffau.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<div role="tabpanel" id="blocklyDiv" class="tab-pane fade in active" style="position: relative;"></div>
<div role="tabpanel" id="content_code" class="tab-pane fade" onChange="update()"></div>
</div>
<iframe id="blockly_r" style="border-top:none"></iframe>
<iframe id="blockly_r" style="border:none"></iframe>
</div>
<!-- modal -->
<div class="modal fade" id="configModal" tabindex="-1" role="dialog" aria-labelledby="configModalLabel" aria-hidden="true">
Expand Down Expand Up @@ -395,7 +395,7 @@
</div>
</div>
<xml id="toolbox" style="display:none">
<category colour="210" name="Structure">
<category colour="#4a235a" name="Structure">
<block type="html"></block>
<block type="head"></block>
<block type="title"></block>
Expand All @@ -405,12 +405,11 @@
<block type="divider"></block>
<block type="linebreak"></block>
<block type="hline"></block>
<block type="base"></block>
</category>
<category colour="65" name="Texte">
<block type="emptytext"></block>
<block type="icon"></block>
<category colour="65" name="bloc">
<category colour="65" name="en-bloc">
<block type="paragraph"></block>
<block type="paragraph">
<value name='content'>
<block type="emptytext">
Expand All @@ -425,6 +424,7 @@
<block type="textmod"></block>
<block type="button"></block>
<block type="link"></block>
<block type="icon"></block>
</category>
</category>
<category colour="20" name="Table">
Expand Down Expand Up @@ -456,12 +456,12 @@
<block type="class"></block>
<block type="id"></block>
<block type="emptyarg"></block>
</category>
<category colour="290" name="CSS">
<block type="style"></block>
<block type="stylearg"></block>
<block type="cssitem"></block>
<block type="othercss"></block>
</category>
<category colour="290" name="CSS">
<category colour="290" name="Texte">
<block type="fontsize"></block>
<block type="fontweight"></block>
Expand All @@ -486,6 +486,7 @@
<block type="border-new"></block>
<block type="borderedge-new"></block>
<block type="borderrad"></block>
<block type="bordercollapse"></block>
</category>
</category>
</xml>
Expand Down
Binary file added www/media/lamadrama.mp4
Binary file not shown.

0 comments on commit a858ce4

Please sign in to comment.