Commit 12b7dd96 authored by carlosperate's avatar carlosperate

Removed soy template from arduino app

parent 59bd0ef6
...@@ -3,16 +3,17 @@ ...@@ -3,16 +3,17 @@
* *
* Based on the "Code" app developed by: fraser@google.com (Neil Fraser) * Based on the "Code" app developed by: fraser@google.com (Neil Fraser)
* *
* @fileoverview JavaScript for Blockly's Code application. * @fileoverview JavaScript for Blockly's Arduino Code application.
*/ */
'use strict';
// Supported languages. // Supported languages.
BlocklyApps.LANGUAGES = //BlocklyApps.LANGUAGES =
['en']; // ['en'];
BlocklyApps.LANG = BlocklyApps.getLang(); //BlocklyApps.LANG = BlocklyApps.getLang();
document.write('<script type="text/javascript" src="generated/' + //document.write('<script src="generated/' + BlocklyApps.LANG + '.js"></script>\n');
BlocklyApps.LANG + '.js"></script>\n');
/** /**
* Create a namespace for the application. * Create a namespace for the application.
...@@ -87,7 +88,7 @@ Arduino.renderContent = function() { ...@@ -87,7 +88,7 @@ Arduino.renderContent = function() {
content.textContent = code; content.textContent = code;
if (typeof prettyPrintOne == 'function') { if (typeof prettyPrintOne == 'function') {
code = content.innerHTML; code = content.innerHTML;
code = prettyPrintOne(code, 'js'); code = prettyPrintOne(code, 'cpp');
content.innerHTML = code; content.innerHTML = code;
} }
} }
...@@ -97,7 +98,7 @@ Arduino.renderContent = function() { ...@@ -97,7 +98,7 @@ Arduino.renderContent = function() {
* Initialize Blockly. Called on page load. * Initialize Blockly. Called on page load.
*/ */
Arduino.init = function() { Arduino.init = function() {
BlocklyApps.init(); //BlocklyApps.init();
var rtl = BlocklyApps.isRtl(); var rtl = BlocklyApps.isRtl();
var container = document.getElementById('content_area'); var container = document.getElementById('content_area');
...@@ -129,12 +130,12 @@ Arduino.init = function() { ...@@ -129,12 +130,12 @@ Arduino.init = function() {
rtl: rtl, rtl: rtl,
toolbox: toolbox}); toolbox: toolbox});
BlocklyApps.loadBlocks(''); //BlocklyApps.loadBlocks('');
if ('BlocklyStorage' in window) { //if ('BlocklyStorage' in window) {
// Hook a save function onto unload. // // Hook a save function onto unload.
BlocklyStorage.backupOnUnload(); // BlocklyStorage.backupOnUnload();
} //}
Arduino.tabClick(Arduino.selected); Arduino.tabClick(Arduino.selected);
Blockly.fireUiEvent(window, 'resize'); Blockly.fireUiEvent(window, 'resize');
...@@ -153,15 +154,12 @@ Arduino.init = function() { ...@@ -153,15 +154,12 @@ Arduino.init = function() {
window.setTimeout(BlocklyApps.importPrettify, 1); window.setTimeout(BlocklyApps.importPrettify, 1);
}; };
if (window.location.pathname.match(/readonly.html$/)) {
window.addEventListener('load', BlocklyApps.initReadonly);
} else {
window.addEventListener('load', Arduino.init); window.addEventListener('load', Arduino.init);
}
/** /**
* Execute the user's code. * Execute the user's code.
* Just a quick and dirty eval. Catch infinite loops.
*/ */
Arduino.loadToArduino = function() { Arduino.loadToArduino = function() {
// TODO // TODO
......
// This file was automatically generated from common.soy.
// Please don't edit this file by hand.
if (typeof apps == 'undefined') { var apps = {}; }
apps.messages = function(opt_data, opt_ignored, opt_ijData) {
return '<div style="display: none"><span id="subtitle">a visual programming environment</span><span id="blocklyMessage">Blockly</span><span id="codeTooltip">See generated JavaScript code.</span><span id="linkTooltip">Save and link to blocks.</span><span id="runTooltip">Run the program defined by the blocks in the workspace.</span><span id="runProgram">Run Program</span><span id="resetProgram">Reset</span><span id="dialogOk">OK</span><span id="dialogCancel">Cancel</span><span id="catLogic">Logic</span><span id="catLoops">Loops</span><span id="catMath">Math</span><span id="catText">Text</span><span id="catLists">Lists</span><span id="catColour">Colour</span><span id="catVariables">Variables</span><span id="catProcedures">Functions</span><span id="httpRequestError">There was a problem with the request.</span><span id="linkAlert">Share your blocks with this link:\\n\\n%1</span><span id="hashError">Sorry, \'%1\' doesn\'t correspond with any saved program.</span><span id="xmlError">Could not load your saved file. Perhaps it was created with a different version of Blockly?</span><span id="listVariable">list</span><span id="textVariable">text</span></div>';
};
apps.dialog = function(opt_data, opt_ignored, opt_ijData) {
return '<div id="dialogShadow" class="dialogAnimate"></div><div id="dialogBorder"></div><div id="dialog"></div>';
};
apps.codeDialog = function(opt_data, opt_ignored, opt_ijData) {
return '<div id="dialogCode" class="dialogHiddenContent"><pre id="containerCode"></pre>' + apps.ok(null, null, opt_ijData) + '</div>';
};
apps.storageDialog = function(opt_data, opt_ignored, opt_ijData) {
return '<div id="dialogStorage" class="dialogHiddenContent"><div id="containerStorage"></div>' + apps.ok(null, null, opt_ijData) + '</div>';
};
apps.ok = function(opt_data, opt_ignored, opt_ijData) {
return '<div class="farSide" style="padding: 1ex 3ex 0"><button class="secondary" onclick="BlocklyApps.hideDialog(true)">OK</button></div>';
};
;
// This file was automatically generated from template.soy.
// Please don't edit this file by hand.
if (typeof codepage == 'undefined') { var codepage = {}; }
codepage.messages = function(opt_data, opt_ignored, opt_ijData) {
return apps.messages(null, null, opt_ijData) + '<div style="display: none"><span id="Code_badXml">Error parsing XML:\\n%1\\n\\nSelect \'OK\' to abandon your changes or \'Cancel\' to further edit the XML.</span><span id="Code_badCode">Program error:\\n%1</span><span id="Code_timeout">Maximum execution iterations exceeded.</span><span id="Code_discard">Delete all %1 blocks?</span></div>';
};
codepage.start = function(opt_data, opt_ignored, opt_ijData) {
return codepage.messages(null, null, opt_ijData) + '<script type="text/javascript" src="../../blockly_uncompressed.js"><\/script><script type="text/javascript" src="../../blocks_compressed.js"><\/script><script type="text/javascript" src="../../generators/arduino.js"><\/script><script type="text/javascript" src="../../generators/arduino/base.js"><\/script><script type="text/javascript" src="../../generators/arduino/io.js"><\/script><script type="text/javascript" src="../../generators/arduino/lists.js"><\/script><script type="text/javascript" src="../../generators/arduino/logic.js"><\/script><script type="text/javascript" src="../../generators/arduino/loops.js"><\/script><script type="text/javascript" src="../../generators/arduino/math.js"><\/script><script type="text/javascript" src="../../generators/arduino/procedures.js"><\/script><script type="text/javascript" src="../../generators/arduino/servo.js"><\/script><script type="text/javascript" src="../../generators/arduino/spi.js"><\/script><script type="text/javascript" src="../../generators/arduino/stepper.js"><\/script><script type="text/javascript" src="../../generators/arduino/text.js"><\/script><script type="text/javascript" src="../../generators/arduino/time.js"><\/script><script type="text/javascript" src="../../generators/arduino/variables.js"><\/script><script type="text/javascript" src="../../' + soy.$$escapeHtml(opt_ijData.langSrc) + '"><\/script><table width="100%" height="100%"><tr><td><h1><span id="title"><a href="../index.html?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '">Blockly</a> : Code</span></h1></td><td class="farSide"><select id="languageMenu"></select></td></tr><tr><td colspan=2><table width="100%"><tr id="tabRow" height="1em"><td id="tab_blocks" class="tabon">Blocks</td><td class="tabmin">&nbsp;</td><td id="tab_arduino" class="taboff">Arduino</td><td class="tabmin">&nbsp;</td><td id="tab_xml" class="taboff">XML</td><td class="tabmax"><button id="trashButton" class="notext" title="Discard all blocks."><img src=\'../../media/1x1.gif\' class="trash icon21"></button> <button id="linkButton" class="notext" title="Save and link to blocks."><img src=\'../../media/1x1.gif\' class="link icon21"></button> <button id="runButton" class="notext primary" title="Run the program defined by the blocks in the workspace."><img src=\'../../media/1x1.gif\' class="run icon21"></button></td></tr></table></td></tr><tr><td height="99%" colspan=2 id="content_area">' + codepage.toolbox(null, null, opt_ijData) + '</td></tr></table><div id="content_blocks" class="content"></div><pre id="content_arduino" class="content"></pre><textarea id="content_xml" class="content" wrap="off"></textarea>' + apps.dialog(null, null, opt_ijData) + apps.storageDialog(null, null, opt_ijData);
};
codepage.toolbox = function(opt_data, opt_ignored, opt_ijData) {
return '<xml id="toolbox" style="display: none"><category name="Logic"><block type="controls_if"></block><block type="logic_compare"></block><block type="logic_operation"></block><block type="logic_negate"></block><block type="logic_boolean"></block><block type="logic_null"></block><block type="logic_ternary"></block></category><category name="Loops"><block type="controls_repeat_ext"><value name="TIMES"><block type="math_number"><field name="NUM">10</field></block></value></block><block type="controls_whileUntil"></block><block type="controls_for"><value name="FROM"><block type="math_number"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number"><field name="NUM">10</field></block></value><value name="BY"><block type="math_number"><field name="NUM">1</field></block></value></block><block type="controls_forEach"></block><block type="controls_flow_statements"></block></category><category name="Math"><block type="math_number"></block><block type="math_arithmetic"></block><block type="math_single"></block><block type="math_trig"></block><block type="math_constant"></block><block type="math_number_property"></block><block type="math_change"><value name="DELTA"><block type="math_number"><field name="NUM">1</field></block></value></block><block type="math_round"></block><block type="math_on_list"></block><block type="math_modulo"></block><block type="math_constrain"><value name="LOW"><block type="math_number"><field name="NUM">1</field></block></value><value name="HIGH"><block type="math_number"><field name="NUM">100</field></block></value></block><block type="math_random_int"><value name="FROM"><block type="math_number"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number"><field name="NUM">100</field></block></value></block><block type="math_random_float"></block><block type="base_map"></block></category><category name="Text"><block type="text"></block><block type="text_join"></block><block type="text_append"><value name="TEXT"><block type="text"></block></value></block><block type="text_length"></block><block type="text_isEmpty"></block><block type="text_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">text</field></block></value></block><block type="text_charAt"><value name="VALUE"><block type="variables_get"><field name="VAR">text</field></block></value></block><block type="text_getSubstring"><value name="STRING"><block type="variables_get"><field name="VAR">text</field></block></value></block><block type="text_changeCase"></block><block type="text_trim"></block><block type="text_print"></block><block type="text_prompt_ext"><value name="TEXT"><block type="text"></block></value></block></category><category name="Lists"><block type="lists_create_empty"></block><block type="lists_create_with"></block><block type="lists_repeat"><value name="NUM"><block type="math_number"><field name="NUM">5</field></block></value></block><block type="lists_length"></block><block type="lists_isEmpty"></block><block type="lists_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">list</field></block></value></block><block type="lists_getIndex"><value name="VALUE"><block type="variables_get"><field name="VAR">list</field></block></value></block><block type="lists_setIndex"><value name="LIST"><block type="variables_get"><field name="VAR">list</field></block></value></block><block type="lists_getSublist"><value name="LIST"><block type="variables_get"><field name="VAR">list</field></block></value></block></category><category name="Variables"><block type="variables_get"></block><block type="variables_set"></block><block type="variables_set_type"></block></category><category name="Functions" custom="PROCEDURE"></category><category name="Input/Output"><block type="io_digitalwrite"></block><block type="io_digitalread"></block><block type="io_builtin_led"></block><block type="io_analogwrite"></block><block type="io_analogread"></block><block type="io_highlow"></block></category><category name="Time"><block type="time_delay"></block><block type="time_delaymicros"></block><block type="time_millis"></block><block type="time_micros"></block></category><category name="Servo"><block type="servo_write"></block><block type="servo_read"></block></category><category name="Stepper"><block type="stepper_config"></block><block type="stepper_step"></block></category><category name="Comms"><block type="spi_config"></block><block type="spi_transfer"></block></category></xml>';
};
codepage.readonly = function(opt_data, opt_ignored, opt_ijData) {
return codepage.messages(null, null, opt_ijData) + '<script type="text/javascript" src="../../blockly_compressed.js"><\/script><script type="text/javascript" src="../../blocks_compressed.js"><\/script><script type="text/javascript" src="../../generators/arduino.js"><\/script><script type="text/javascript" src="../../generators/arduino/base.js"><\/script><script type="text/javascript" src="../../generators/arduino/io.js"><\/script><script type="text/javascript" src="../../generators/arduino/lists.js"><\/script><script type="text/javascript" src="../../generators/arduino/logic.js"><\/script><script type="text/javascript" src="../../generators/arduino/loops.js"><\/script><script type="text/javascript" src="../../generators/arduino/math.js"><\/script><script type="text/javascript" src="../../generators/arduino/procedures.js"><\/script><script type="text/javascript" src="../../generators/arduino/servo.js"><\/script><script type="text/javascript" src="../../generators/arduino/spi.js"><\/script><script type="text/javascript" src="../../generators/arduino/stepper.js"><\/script><script type="text/javascript" src="../../generators/arduino/text.js"><\/script><script type="text/javascript" src="../../generators/arduino/time.js"><\/script><script type="text/javascript" src="../../generators/arduino/variables.js"><\/script><script type="text/javascript" src="../../' + soy.$$escapeHtml(opt_ijData.langSrc) + '"><\/script><div id="blockly"></div>';
};
...@@ -6,16 +6,318 @@ ...@@ -6,16 +6,318 @@
<title>Blockly : Arduino Code</title> <title>Blockly : Arduino Code</title>
<link rel="stylesheet" type="text/css" href="../common.css"> <link rel="stylesheet" type="text/css" href="../common.css">
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="../_soy/soyutils.js"></script> <!--script type="text/javascript" src="../_soy/soyutils.js"></script-->
<script type="text/javascript" src="../common.js"></script> <script src="../common.js"></script>
<script type="text/javascript" src="arduino.js"></script> <script src="arduino.js"></script>
<!--script type="text/javascript" src="/storage.js"></script--> <!--script src="../../blockly_compressed.js"></script-->
<script src="../../blockly_uncompressed.js"></script>
<!--script src="../../blocks_compressed.js"></script-->
<script src="../../blocks/logic.js"></script>
<script src="../../blocks/loops.js"></script>
<script src="../../blocks/math.js"></script>
<script src="../../blocks/text.js"></script>
<script src="../../blocks/lists.js"></script>
<script src="../../blocks/colour.js"></script>
<script src="../../blocks/variables.js"></script>
<script src="../../blocks/procedures.js"></script>
<script src="../../generators/arduino.js"></script>
<script src="../../generators/arduino/base.js"></script>
<script src="../../generators/arduino/io.js"></script>
<script src="../../generators/arduino/lists.js"></script>
<script src="../../generators/arduino/logic.js"></script>
<script src="../../generators/arduino/loops.js"></script>
<script src="../../generators/arduino/math.js"></script>
<script src="../../generators/arduino/procedures.js"></script>
<script src="../../generators/arduino/servo.js"></script>
<script src="../../generators/arduino/spi.js"></script>
<script src="../../generators/arduino/stepper.js"></script>
<script src="../../generators/arduino/text.js"></script>
<script src="../../generators/arduino/time.js"></script>
<script src="../../generators/arduino/variables.js"></script>
<script src="../../msg/js/en.js"></script>
</head> </head>
<body> <body>
<script type="text/javascript">
document.write(codepage.start({}, null, <div style="display: none">
{lang: BlocklyApps.LANG, <span id="blocklyMessage">Blockly</span>
langSrc: BlocklyApps.languagePack()}));
</script> <!-- Buttons and tooltips. -->
<span id="codeTooltip">See generated JavaScript code.</span>
<span id="linkTooltip">Save and link to blocks.</span>
<span id="runTooltip">Run the program defined by the blocks in the workspace.</span>
<span id="runProgram">Run Program</span>
<span id="resetProgram">Reset</span>
<span id="dialogOk">OK</span>
<span id="dialogCancel">Cancel</span>
<!-- Default variable names. -->
<span id="listVariable">list</span>
<span id="textVariable">text</span>
<span id="Code_badXml">Error parsing XML:\n%1\n\nSelect 'OK' to abandon your changes or 'Cancel' to further edit the XML.</span>
<span id="Code_badCode">Program error:\n%1</span>
<span id="Code_timeout">Maximum execution iterations exceeded.</span>
<span id="Code_discard">Delete all %1 blocks?</span>
</div>
<table width="100%" height="100%">
<tr>
<td>
<h1>
<span id="title">
<a href="https://developers.google.com/blockly/">Blockly</a> &gt;
<span id="title">Arduino</span>
</span>
</h1>
</td>
<td class="farSide">
<select id="languageMenu"></select>
</td>
</tr>
<tr>
<td colspan=2>
<table width="100%">
<tr id="tabRow" height="1em">
<td id="tab_blocks" class="tabon">Blocks</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_arduino" class="taboff">Arduino</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_xml" class="taboff">XML</td>
<td class="tabmax">
<button id="trashButton" class="notext" title="Discard all blocks">
<img src='../../media/1x1.gif' class="trash icon21">
</button>
<button id="linkButton" class="notext" title="Save and link to blocks">
<img src='../../media/1x1.gif' class="link icon21">
</button>
<button id="runButton" class="notext primary" title="Run the program defined by the blocks in the workspace">
<img src='../../media/1x1.gif' class="run icon21">
</button>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="99%" colspan=2 id="content_area">
</td>
</tr>
</table>
<xml id="toolbox" style="display: none">
<category name="Logic">
<block type="controls_if"></block>
<block type="logic_compare"></block>
<block type="logic_operation"></block>
<block type="logic_negate"></block>
<block type="logic_boolean"></block>
<block type="logic_null"></block>
<block type="logic_ternary"></block>
</category>
<category name="Loops">
<block type="controls_repeat_ext">
<value name="TIMES">
<block type="math_number">
<field name="NUM">10</field>
</block>
</value>
</block>
<block type="controls_whileUntil"></block>
<block type="controls_for">
<value name="FROM">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="TO">
<block type="math_number">
<field name="NUM">10</field>
</block>
</value>
<value name="BY">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
<block type="controls_forEach"></block>
<block type="controls_flow_statements"></block>
</category>
<category name="Math">
<block type="math_number"></block>
<block type="math_arithmetic"></block>
<block type="math_single"></block>
<block type="math_trig"></block>
<block type="math_constant"></block>
<block type="math_number_property"></block>
<block type="math_change">
<value name="DELTA">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
<block type="math_round"></block>
<block type="math_on_list"></block>
<block type="math_modulo"></block>
<block type="math_constrain">
<value name="LOW">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="HIGH">
<block type="math_number">
<field name="NUM">100</field>
</block>
</value>
</block>
<block type="math_random_int">
<value name="FROM">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="TO">
<block type="math_number">
<field name="NUM">100</field>
</block>
</value>
</block>
<block type="math_random_float"></block>
<block type="base_map"></block>
</category>
<category name="Text">
<block type="text"></block>
<block type="text_join"></block>
<block type="text_append">
<value name="TEXT">
<block type="text"></block>
</value>
</block>
<block type="text_length"></block>
<block type="text_isEmpty"></block>
<block type="text_indexOf">
<value name="VALUE">
<block type="variables_get">
<field name="VAR" class="textVar">text</field>
</block>
</value>
</block>
<block type="text_charAt">
<value name="VALUE">
<block type="variables_get">
<field name="VAR" class="textVar">text</field>
</block>
</value>
</block>
<block type="text_getSubstring">
<value name="STRING">
<block type="variables_get">
<field name="VAR" class="textVar">text</field>
</block>
</value>
</block>
<block type="text_changeCase"></block>
<block type="text_trim"></block>
<block type="text_print"></block>
<block type="text_prompt_ext">
<value name="TEXT">
<block type="text"></block>
</value>
</block>
</category>
<category name="Lists">
<block type="lists_create_empty"></block>
<block type="lists_create_with"></block>
<block type="lists_repeat">
<value name="NUM">
<block type="math_number">
<field name="NUM">5</field>
</block>
</value>
</block>
<block type="lists_length"></block>
<block type="lists_isEmpty"></block>
<block type="lists_indexOf">
<value name="VALUE">
<block type="variables_get">
<field name="VAR" class="listVar">list</field>
</block>
</value>
</block>
<block type="lists_getIndex">
<value name="VALUE">
<block type="variables_get">
<field name="VAR" class="listVar">list</field>
</block>
</value>
</block>
<block type="lists_setIndex">
<value name="LIST">
<block type="variables_get">
<field name="VAR" class="listVar">list</field>
</block>
</value>
</block>
<block type="lists_getSublist">
<value name="LIST">
<block type="variables_get">
<field name="VAR" class="listVar">list</field>
</block>
</value>
</block>
</category>
<category name="Variables">
<block type="variables_get"></block>
<block type="variables_set"></block>
<block type="variables_set_type"></block>
</category>
<category name="Functions" custom="PROCEDURE"></category>
<category name="Input/Output">
<block type="io_digitalwrite"></block>
<block type="io_digitalread"></block>
<block type="io_builtin_led"></block>
<block type="io_analogwrite"></block>
<block type="io_analogread"></block>
<block type="io_highlow"></block>
</category>
<category name="Time">
<block type="time_delay"></block>
<block type="time_delaymicros"></block>
<block type="time_millis"></block>
<block type="time_micros"></block>
</category>
<category name="Servo">
<block type="servo_write"></block>
<block type="servo_read"></block>
</category>
<category name="Stepper">
<block type="stepper_config"></block>
<block type="stepper_step"></block>
</category>
<category name="Comms">
<block type="spi_config"></block>
<block type="spi_transfer"></block>
</category>
</xml>
<div id="content_blocks" class="content"></div>
<pre id="content_arduino" class="content"></pre>
<textarea id="content_xml" class="content" wrap="off"></textarea>
<div id="dialogShadow" class="dialogAnimate"></div>
<div id="dialogBorder"></div>
<div id="dialog"></div>
<div id="dialogStorage" class="dialogHiddenContent">
<div id="containerStorage"></div>
<div class="farSide" style="padding: 1ex 3ex 0">
<button class="secondary" onclick="BlocklyApps.hideDialog(true)">OK</button>
</div>
</div>
</body> </body>
</html> </html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="google" value="notranslate">
<title>Blockly : Code Readonly</title>
<script type="text/javascript" src="../_soy/soyutils.js"></script>
<script type="text/javascript" src="../common.js"></script>
<script type="text/javascript" src="code.js"></script>
<style>
html, body {
background-color: #fff;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
}
#blockly>svg {
border: none;
}
#blockly {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<script type="text/javascript">
document.write(codepage.readonly({}, null,
{langSrc: BlocklyApps.languagePack()}));
</script>
</body>
</html>
{namespace codepage}
/**
* This is a Closure Template.
*
* To regenerate just en.js, run this command:
* java -jar ../_soy/SoyToJsSrcCompiler.jar --outputPathFormat generated/en.js --srcs ../common.soy,template.soy
*
* To regenerate all files, see: trunk/apps/common.soy
*/
/**
* Translated messages for use in JavaScript.
*/
{template .messages}
{call apps.messages /}
<div style="display: none">
<span id="Code_badXml">{msg meaning="Code.badXml" desc="alert - Message shown when the user tries switching from the XML tab after entering XML text that could not be parsed. This asks whether they wish to abandon the XML they added. If they select 'OK' (or the translated equivalent), the XML is cleared, and the other tab is shown. If they select 'Cancel', they remain on the XML tab with the bad XML.\n\nUsed in JavaScript <code>window.confirm()</code>."}Error parsing XML:\n%1\n\nSelect 'OK' to abandon your changes or 'Cancel' to further edit the XML.{/msg}</span>
<span id="Code_badCode">{msg meaning="Code.badCode" desc="alert - Message shown if an error occurs while interpreting the user program. The error description follows."}Program error:\n%1{/msg}</span>
<span id="Code_timeout">{msg meaning="Code.timeout" desc="alert - Message shown if the program has run for more than the permitted number of steps. This exists so that programs with infinite loops do not run forever."}Maximum execution iterations exceeded.{/msg}</span>
<span id="Code_discard">{msg meaning="Code.discard" desc="alert - Message shown after the user clicks on the 'discard all' icon. Selecting 'OK' (or the translated equivalent) causes all of the blocks to be discarded. Selecting 'Cancel' prevents blocks from being deleted.\n\nParameters:\n* %1 - number of blocks to be deleted. It is always an integer greater than or equal to 2."}Delete all %1 blocks?{/msg}</span>
</div>
{/template}
/**
* Web page structure.
*/
{template .start}
{call .messages /}
<script type="text/javascript" src="../../blockly_uncompressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../generators/arduino.js"></script>
<script type="text/javascript" src="../../generators/arduino/base.js"></script>
<script type="text/javascript" src="../../generators/arduino/io.js"></script>
<script type="text/javascript" src="../../generators/arduino/lists.js"></script>
<script type="text/javascript" src="../../generators/arduino/logic.js"></script>
<script type="text/javascript" src="../../generators/arduino/loops.js"></script>
<script type="text/javascript" src="../../generators/arduino/math.js"></script>
<script type="text/javascript" src="../../generators/arduino/procedures.js"></script>
<script type="text/javascript" src="../../generators/arduino/servo.js"></script>
<script type="text/javascript" src="../../generators/arduino/spi.js"></script>
<script type="text/javascript" src="../../generators/arduino/stepper.js"></script>
<script type="text/javascript" src="../../generators/arduino/text.js"></script>
<script type="text/javascript" src="../../generators/arduino/time.js"></script>
<script type="text/javascript" src="../../generators/arduino/variables.js"></script>
<script type="text/javascript" src="../../{$ij.langSrc}"></script>
<table width="100%" height="100%">
<tr>
<td>
<h1>
<span id="title">
<a href="../index.html?lang={$ij.lang}">{msg meaning="Apps.blocklyMessage" desc="IBID"}Blockly{/msg}</a>
{sp}:{sp}
{{msg meaning="Code.title" desc="title - Title of this application, indicating that it is for writing arbitrary programs.\n{lb}{lb}Identical|Code{rb}{rb}"}}
Code
{{/msg}}
</span>
</h1>
</td>
<td class="farSide">
<select id="languageMenu"></select>
</td>
</tr>
<tr>
<td colspan=2>
<table width="100%">
<tr id="tabRow" height="1em">
<td id="tab_blocks" class="tabon">{{msg meaning="Code.blocks" desc="tab text - Displays and allows editing of the user's program as blocks.\n{lb}{lb}Identical|Blocks{rb}{rb}"}}Blocks{{/msg}}</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_arduino" class="taboff">Arduino</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_xml" class="taboff">XML</td>
<td class="tabmax">
<button id="trashButton" class="notext" title="{msg meaning="Code.trashTooltip" desc="tooltip - Clicking on this causes the user program to be discarded."}Discard all blocks.{/msg}">
<img src='../../media/1x1.gif' class="trash icon21">
</button>{sp}
<button id="linkButton" class="notext" title="{msg meaning="Apps.linkTooltip" desc="IBID."}Save and link to blocks.{/msg}">
<img src='../../media/1x1.gif' class="link icon21">
</button>{sp}
<button id="runButton" class="notext primary" title="{msg meaning="Apps.runTooltip" desc="IBID"}Run the program defined by the blocks in the workspace.{/msg}">
<img src='../../media/1x1.gif' class="run icon21">
</button>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="99%" colspan=2 id="content_area">
{call .toolbox /}
</td>
</tr>
</table>
<div id="content_blocks" class="content"></div>
<pre id="content_arduino" class="content"></pre>
<textarea id="content_xml" class="content" wrap="off"></textarea>
{call apps.dialog /}
{call apps.storageDialog /}
{/template}
/**
* Toolbox.
*/
{template .toolbox}
<xml id="toolbox" style="display: none">
<category name="{msg meaning="Apps.catLogic" desc="IBID"}Logic{/msg}">
<block type="controls_if"></block>
<block type="logic_compare"></block>
<block type="logic_operation"></block>
<block type="logic_negate"></block>
<block type="logic_boolean"></block>
<block type="logic_null"></block>
<block type="logic_ternary"></block>
</category>
<category name="{msg meaning="Apps.catLoops" desc="IBID"}Loops{/msg}">
<block type="controls_repeat_ext">
<value name="TIMES">
<block type="math_number">
<field name="NUM">10</field>
</block>
</value>
</block>
<block type="controls_whileUntil"></block>
<block type="controls_for">
<value name="FROM">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="TO">
<block type="math_number">
<field name="NUM">10</field>
</block>
</value>
<value name="BY">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
<block type="controls_forEach"></block>
<block type="controls_flow_statements"></block>
</category>
<category name="{msg meaning="Apps.catMath" desc="IBID"}Math{/msg}">
<block type="math_number"></block>
<block type="math_arithmetic"></block>
<block type="math_single"></block>
<block type="math_trig"></block>
<block type="math_constant"></block>
<block type="math_number_property"></block>
<block type="math_change">
<value name="DELTA">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
<block type="math_round"></block>
<block type="math_on_list"></block>
<block type="math_modulo"></block>
<block type="math_constrain">
<value name="LOW">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="HIGH">
<block type="math_number">
<field name="NUM">100</field>
</block>
</value>
</block>
<block type="math_random_int">
<value name="FROM">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="TO">
<block type="math_number">
<field name="NUM">100</field>
</block>
</value>
</block>
<block type="math_random_float"></block>
<block type="base_map"></block>
</category>
<category name="{msg meaning="Apps.catText" desc="IBID"}Text{/msg}">
<block type="text"></block>
<block type="text_join"></block>
<block type="text_append">
<value name="TEXT">
<block type="text"></block>
</value>
</block>
<block type="text_length"></block>
<block type="text_isEmpty"></block>
<block type="text_indexOf">
<value name="VALUE">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.textVariable" desc="IBID"}text{/msg}</field>
</block>
</value>
</block>
<block type="text_charAt">
<value name="VALUE">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.textVariable" desc="IBID"}text{/msg}</field>
</block>
</value>
</block>
<block type="text_getSubstring">
<value name="STRING">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.textVariable" desc="IBID"}text{/msg}</field>
</block>
</value>
</block>
<block type="text_changeCase"></block>
<block type="text_trim"></block>
<block type="text_print"></block>
<block type="text_prompt_ext">
<value name="TEXT">
<block type="text"></block>
</value>
</block>
</category>
<category name="{msg meaning="Apps.catLists" desc="IBID"}Lists{/msg}">
<block type="lists_create_empty"></block>
<block type="lists_create_with"></block>
<block type="lists_repeat">
<value name="NUM">
<block type="math_number">
<field name="NUM">5</field>
</block>
</value>
</block>
<block type="lists_length"></block>
<block type="lists_isEmpty"></block>
<block type="lists_indexOf">
<value name="VALUE">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
</block>
</value>
</block>
<block type="lists_getIndex">
<value name="VALUE">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
</block>
</value>
</block>
<block type="lists_setIndex">
<value name="LIST">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
</block>
</value>
</block>
<block type="lists_getSublist">
<value name="LIST">
<block type="variables_get">
<field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
</block>
</value>
</block>
</category>
<category name="{msg meaning="Apps.catVariables" desc="IBID"}Variables{/msg}">
<block type="variables_get"></block>
<block type="variables_set"></block>
<block type="variables_set_type"></block>
</category>
<category name="{msg meaning="Apps.catProcedures" desc="IBID"}Functions{/msg}" custom="PROCEDURE"></category>
<category name="{msg meaning="Apps.catIO" desc="IBID"}Input/Output{/msg}">
<block type="io_digitalwrite"></block>
<block type="io_digitalread"></block>
<block type="io_builtin_led"></block>
<block type="io_analogwrite"></block>
<block type="io_analogread"></block>
<block type="io_highlow"></block>
</category>
<category name="{msg meaning="Apps.catTime" desc="IBID"}Time{/msg}">
<block type="time_delay"></block>
<block type="time_delaymicros"></block>
<block type="time_millis"></block>
<block type="time_micros"></block>
</category>
<category name="{msg meaning="Apps.catServo" desc="IBID"}Servo{/msg}">
<block type="servo_write"></block>
<block type="servo_read"></block>
</category>
<category name="{msg meaning="Apps.catStepper" desc="IBID"}Stepper{/msg}">
<block type="stepper_config"></block>
<block type="stepper_step"></block>
</category>
<category name="{msg meaning="Apps.catStepper" desc="IBID"}Comms{/msg}">
<block type="spi_config"></block>
<block type="spi_transfer"></block>
</category>
</xml>
{/template}
/**
* Readonly Blockly in an iframe.
*/
{template .readonly}
{call .messages /}
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../generators/arduino.js"></script>
<script type="text/javascript" src="../../generators/arduino/base.js"></script>
<script type="text/javascript" src="../../generators/arduino/io.js"></script>
<script type="text/javascript" src="../../generators/arduino/lists.js"></script>
<script type="text/javascript" src="../../generators/arduino/logic.js"></script>
<script type="text/javascript" src="../../generators/arduino/loops.js"></script>
<script type="text/javascript" src="../../generators/arduino/math.js"></script>
<script type="text/javascript" src="../../generators/arduino/procedures.js"></script>
<script type="text/javascript" src="../../generators/arduino/servo.js"></script>
<script type="text/javascript" src="../../generators/arduino/spi.js"></script>
<script type="text/javascript" src="../../generators/arduino/stepper.js"></script>
<script type="text/javascript" src="../../generators/arduino/text.js"></script>
<script type="text/javascript" src="../../generators/arduino/time.js"></script>
<script type="text/javascript" src="../../generators/arduino/variables.js"></script>
<script type="text/javascript" src="../../{$ij.langSrc}"></script>
<div id="blockly"></div>
{/template}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment