Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
510d9627
Commit
510d9627
authored
Sep 24, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve a couple of XML literal strings.
parent
8beffc6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
35 deletions
+35
-35
tests/jsunit/xml_test.js
tests/jsunit/xml_test.js
+7
-7
tests/playground.html
tests/playground.html
+28
-28
No files found.
tests/jsunit/xml_test.js
View file @
510d9627
...
...
@@ -20,22 +20,22 @@
'
use strict
'
;
var
XML_TEXT
=
[
'
<xml xmlns="http://www.w3.org/1999/xhtml">
'
,
'
<block type="controls_repeat_ext" i
d="10" i
nline="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" i
d="139" i
nline="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" i
d="78" i
nline="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
);
...
...
tests/playground.html
View file @
510d9627
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment