Commit ced61e5c authored by daarond's avatar daarond

updating demos

parent ecddc5d0
......@@ -30,6 +30,7 @@ blockly/
|- blocks_compressed.js
|- dart_compressed.js
|- javascript_compressed.js
|- php_compressed.js
`- python_compressed.js
Instructions for fetching the optional Closure library may be found here:
......
......@@ -134,6 +134,7 @@
<select id="language">
<option value="JavaScript">JavaScript</option>
<option value="Python">Python</option>
<option value="PHP">PHP</option>
<option value="Dart">Dart</option>
</select>
</h3>
......
......@@ -243,7 +243,7 @@ Code.LANG = Code.getLang();
* List of tab names.
* @private
*/
Code.TABS_ = ['blocks', 'javascript', 'python', 'dart', 'xml'];
Code.TABS_ = ['blocks', 'javascript', 'php', 'python', 'dart', 'xml'];
Code.selected = 'blocks';
......@@ -318,6 +318,14 @@ Code.renderContent = function() {
code = prettyPrintOne(code, 'py');
content.innerHTML = code;
}
} else if (content.id == 'content_php') {
code = Blockly.PHP.workspaceToCode(Code.workspace);
content.textContent = code;
if (typeof prettyPrintOne == 'function') {
code = content.innerHTML;
code = prettyPrintOne(code, 'php');
content.innerHTML = code;
}
} else if (content.id == 'content_dart') {
code = Blockly.Dart.workspaceToCode(Code.workspace);
content.textContent = code;
......
......@@ -10,6 +10,7 @@
<script src="../../blocks_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../python_compressed.js"></script>
<script src="../../php_compressed.js"></script>
<script src="../../dart_compressed.js"></script>
<script src="code.js"></script>
</head>
......@@ -36,6 +37,8 @@
<td class="tabmin">&nbsp;</td>
<td id="tab_python" class="taboff">Python</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_php" class="taboff">PHP</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_dart" class="taboff">Dart</td>
<td class="tabmin">&nbsp;</td>
<td id="tab_xml" class="taboff">XML</td>
......@@ -61,6 +64,7 @@
</table>
<div id="content_blocks" class="content"></div>
<pre id="content_javascript" class="content"></pre>
<pre id="content_php" class="content"></pre>
<pre id="content_python" class="content"></pre>
<pre id="content_dart" class="content"></pre>
<textarea id="content_xml" class="content" wrap="off"></textarea>
......
......@@ -168,7 +168,7 @@
</td>
<td>
<div><a href="code/index.html">Code Editor</a></div>
<div>Export a Blockly program into JavaScript, Python, Dart or XML.</div>
<div>Export a Blockly program into JavaScript, Python, PHP, Dart or XML.</div>
</td>
</tr>
......
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