mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Improve a couple of XML literal strings.
This commit is contained in:
parent
8beffc6c33
commit
510d96276e
2 changed files with 35 additions and 35 deletions
|
@ -20,22 +20,22 @@
|
|||
'use strict';
|
||||
|
||||
var XML_TEXT = ['<xml xmlns="http://www.w3.org/1999/xhtml">',
|
||||
' <block type="controls_repeat_ext" id="10" inline="true" x="21" y="23">',
|
||||
' <block type="controls_repeat_ext" inline="true" x="21" y="23">',
|
||||
' <value name="TIMES">',
|
||||
' <block type="math_number" id="11">',
|
||||
' <block type="math_number">',
|
||||
' <field name="NUM">10</field>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
' <statement name="DO">',
|
||||
' <block type="variables_set" id="139" inline="true">',
|
||||
' <block type="variables_set" inline="true">',
|
||||
' <field name="VAR">item</field>',
|
||||
' <value name="VALUE">',
|
||||
' <block type="lists_create_empty" id="171"></block>',
|
||||
' <block type="lists_create_empty"></block>',
|
||||
' </value>',
|
||||
' <next>',
|
||||
' <block type="text_print" id="78" inline="false">',
|
||||
' <block type="text_print" inline="false">',
|
||||
' <value name="TEXT">',
|
||||
' <block type="text" id="189">',
|
||||
' <block type="text">',
|
||||
' <field name="TEXT">Hello</field>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
|
@ -44,7 +44,7 @@ var XML_TEXT = ['<xml xmlns="http://www.w3.org/1999/xhtml">',
|
|||
' </block>',
|
||||
' </statement>',
|
||||
' </block>',
|
||||
'</xml>'].join('/n');
|
||||
'</xml>'].join('\n');
|
||||
|
||||
function test_textToDom() {
|
||||
var dom = Blockly.Xml.textToDom(XML_TEXT);
|
||||
|
|
|
@ -147,34 +147,34 @@ function spaghetti(n) {
|
|||
console.timeEnd('Spaghetti domToWorkspace');
|
||||
}
|
||||
var spaghettiXml = [
|
||||
' <block type="controls_if" inline="false" x="30" y="30">' +
|
||||
' <value name="IF0">' +
|
||||
' <block type="logic_compare" inline="true">' +
|
||||
' <field name="OP">EQ</field>' +
|
||||
' <value name="A">' +
|
||||
' <block type="math_arithmetic" inline="true">' +
|
||||
' <field name="OP">MULTIPLY</field>' +
|
||||
' <value name="A">' +
|
||||
' <block type="math_number">' +
|
||||
' <field name="NUM">6</field>' +
|
||||
' </block>' +
|
||||
' </value>' +
|
||||
' <value name="B">' +
|
||||
' <block type="math_number">' +
|
||||
' <field name="NUM">7</field>' +
|
||||
' </block>' +
|
||||
' </value>' +
|
||||
' </block>' +
|
||||
' </value>' +
|
||||
' <value name="B">' +
|
||||
' <block type="math_number">' +
|
||||
' <field name="NUM">42</field>' +
|
||||
' </block>' +
|
||||
' </value>' +
|
||||
' </block>' +
|
||||
' </value>' +
|
||||
' <statement name="DO0"></statement>' +
|
||||
' <next></next>' +
|
||||
' <block type="controls_if">',
|
||||
' <value name="IF0">',
|
||||
' <block type="logic_compare">',
|
||||
' <field name="OP">EQ</field>',
|
||||
' <value name="A">',
|
||||
' <block type="math_arithmetic">',
|
||||
' <field name="OP">MULTIPLY</field>',
|
||||
' <value name="A">',
|
||||
' <block type="math_number">',
|
||||
' <field name="NUM">6</field>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
' <value name="B">',
|
||||
' <block type="math_number">',
|
||||
' <field name="NUM">7</field>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
' <value name="B">',
|
||||
' <block type="math_number">',
|
||||
' <field name="NUM">42</field>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
' </block>',
|
||||
' </value>',
|
||||
' <statement name="DO0"></statement>',
|
||||
' <next></next>',
|
||||
' </block>'].join('\n');
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue