diff --git a/tests/generators/index.html b/tests/generators/index.html index e1e5a1720..dbff605dc 100644 --- a/tests/generators/index.html +++ b/tests/generators/index.html @@ -75,6 +75,7 @@ 'use strict'; var demoWorkspace = null; +var outputCode = ''; function start() { demoWorkspace = Blockly.inject('blocklyDiv', @@ -111,11 +112,10 @@ function loadSelected() { // Clear before adding all of the blocks. demoWorkspace.clear(); - var boxList = document.getElementById('checkboxes'); - var inputChildren = boxList.getElementsByTagName('input'); - for (var i = 0; i < inputChildren.length; i++) { - if (inputChildren[i].checked) { - var testUrl = inputChildren[i].value; + var boxList = document.getElementsByClassName('suite_checkbox'); + for (var i = 0; i < boxList.length; i++) { + if (boxList[i].checked) { + var testUrl = boxList[i].value; if (testUrl) { var xmlText = fetchFile(testUrl); if (xmlText !== null) { @@ -195,18 +195,16 @@ function fromXml(filename, xmlText, opt_append) { } function checkAll() { - var boxList = document.getElementById('checkboxes'); - var inputChildren = boxList.getElementsByTagName('input'); - for (var i = 0; i < inputChildren.length; i++) { - inputChildren[i].checked = true; + var boxList = document.getElementsByClassName('suite_checkbox'); + for (var i = 0; i < boxList.length; i++) { + boxList[i].checked = true; } } function uncheckAll() { - var boxList = document.getElementById('checkboxes'); - var inputChildren = boxList.getElementsByTagName('input'); - for (var i = 0; i < inputChildren.length; i++) { - inputChildren[i].checked = false; + var boxList = document.getElementsByClassName('suite_checkbox'); + for (var i = 0; i < boxList.length; i++) { + boxList[i].checked = false; } } @@ -229,26 +227,31 @@ function toJavaScript() { var code = '\'use strict\';\n\n' code += Blockly.JavaScript.workspaceToCode(demoWorkspace); setOutput(code); + outputCode = code; } function toPython() { var code = Blockly.Python.workspaceToCode(demoWorkspace); setOutput(code); + outputCode = code; } function toPhp() { var code = Blockly.PHP.workspaceToCode(demoWorkspace); setOutput(code); + outputCode = code; } function toLua() { var code = Blockly.Lua.workspaceToCode(demoWorkspace); setOutput(code); + outputCode = code; } function toDart() { var code = Blockly.Dart.workspaceToCode(demoWorkspace); setOutput(code); + outputCode = code; } function changeIndex() { @@ -394,16 +397,16 @@ h1 {

- Logic
- Loops 1 (repeat, while, foreach)
- Loops 2 (count)
- Loops 3 (continue, break)
- Math
- Text
- Lists
- Colour
- Variables
- Functions
+ Logic
+ Loops 1 (repeat, while, foreach)
+ Loops 2 (count)
+ Loops 3 (continue, break)
+ Math
+ Text
+ Lists
+ Colour
+ Variables
+ Functions