index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="google" value="notranslate">
  6. <title>Blockly Demo:</title>
  7. <link rel="stylesheet" href="style.css">
  8. <script src="/storage.js"></script>
  9. <script src="../../blockly_compressed.js"></script>
  10. <script src="../../blocks_compressed.js"></script>
  11. <script src="../../javascript_compressed.js"></script>
  12. <script src="../../python_compressed.js"></script>
  13. <script src="../../php_compressed.js"></script>
  14. <script src="../../lua_compressed.js"></script>
  15. <script src="../../dart_compressed.js"></script>
  16. <script src="code.js"></script>
  17. </head>
  18. <body>
  19. <table width="100%" height="100%">
  20. <tr>
  21. <td>
  22. <h1><a href="https://developers.google.com/blockly/">Blockly</a>&rlm; &gt;
  23. <a href="../index.html">Demos</a>&rlm; &gt;
  24. <span id="title">...</span>
  25. </h1>
  26. </td>
  27. <td class="farSide">
  28. <select id="languageMenu"></select>
  29. </td>
  30. </tr>
  31. <tr>
  32. <td colspan=2>
  33. <table width="100%">
  34. <tr id="tabRow" height="1em">
  35. <td id="tab_blocks" class="tabon">...</td>
  36. <td class="tabmin">&nbsp;</td>
  37. <td id="tab_javascript" class="taboff">JavaScript</td>
  38. <td class="tabmin">&nbsp;</td>
  39. <td id="tab_python" class="taboff">Python</td>
  40. <td class="tabmin">&nbsp;</td>
  41. <td id="tab_php" class="taboff">PHP</td>
  42. <td class="tabmin">&nbsp;</td>
  43. <td id="tab_lua" class="taboff">Lua</td>
  44. <td class="tabmin">&nbsp;</td>
  45. <td id="tab_dart" class="taboff">Dart</td>
  46. <td class="tabmin">&nbsp;</td>
  47. <td id="tab_xml" class="taboff">XML</td>
  48. <td class="tabmax">
  49. <button id="trashButton" class="notext" title="...">
  50. <img src='../../media/1x1.gif' class="trash icon21">
  51. </button>
  52. <button id="linkButton" class="notext" title="...">
  53. <img src='../../media/1x1.gif' class="link icon21">
  54. </button>
  55. <button id="runButton" class="notext primary" title="...">
  56. <img src='../../media/1x1.gif' class="run icon21">
  57. </button>
  58. </td>
  59. </tr>
  60. </table>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td height="99%" colspan=2 id="content_area">
  65. </td>
  66. </tr>
  67. </table>
  68. <div id="content_blocks" class="content"></div>
  69. <pre id="content_javascript" class="content"></pre>
  70. <pre id="content_python" class="content"></pre>
  71. <pre id="content_php" class="content"></pre>
  72. <pre id="content_lua" class="content"></pre>
  73. <pre id="content_dart" class="content"></pre>
  74. <textarea id="content_xml" class="content" wrap="off"></textarea>
  75. <xml id="toolbox" style="display: none">
  76. <category name="{catLogic}" colour="210">
  77. <block type="controls_if"></block>
  78. <block type="logic_compare"></block>
  79. <block type="logic_operation"></block>
  80. <block type="logic_negate"></block>
  81. <block type="logic_boolean"></block>
  82. <block type="logic_null"></block>
  83. <block type="logic_ternary"></block>
  84. </category>
  85. <category name="{catLoops}" colour="120">
  86. <block type="controls_repeat_ext">
  87. <value name="TIMES">
  88. <shadow type="math_number">
  89. <field name="NUM">10</field>
  90. </shadow>
  91. </value>
  92. </block>
  93. <block type="controls_whileUntil"></block>
  94. <block type="controls_for">
  95. <value name="FROM">
  96. <shadow type="math_number">
  97. <field name="NUM">1</field>
  98. </shadow>
  99. </value>
  100. <value name="TO">
  101. <shadow type="math_number">
  102. <field name="NUM">10</field>
  103. </shadow>
  104. </value>
  105. <value name="BY">
  106. <shadow type="math_number">
  107. <field name="NUM">1</field>
  108. </shadow>
  109. </value>
  110. </block>
  111. <block type="controls_forEach"></block>
  112. <block type="controls_flow_statements"></block>
  113. </category>
  114. <category name="{catMath}" colour="230">
  115. <block type="math_number"></block>
  116. <block type="math_arithmetic">
  117. <value name="A">
  118. <shadow type="math_number">
  119. <field name="NUM">1</field>
  120. </shadow>
  121. </value>
  122. <value name="B">
  123. <shadow type="math_number">
  124. <field name="NUM">1</field>
  125. </shadow>
  126. </value>
  127. </block>
  128. <block type="math_single">
  129. <value name="NUM">
  130. <shadow type="math_number">
  131. <field name="NUM">9</field>
  132. </shadow>
  133. </value>
  134. </block>
  135. <block type="math_trig">
  136. <value name="NUM">
  137. <shadow type="math_number">
  138. <field name="NUM">45</field>
  139. </shadow>
  140. </value>
  141. </block>
  142. <block type="math_constant"></block>
  143. <block type="math_number_property">
  144. <value name="NUMBER_TO_CHECK">
  145. <shadow type="math_number">
  146. <field name="NUM">0</field>
  147. </shadow>
  148. </value>
  149. </block>
  150. <block type="math_round">
  151. <value name="NUM">
  152. <shadow type="math_number">
  153. <field name="NUM">3.1</field>
  154. </shadow>
  155. </value>
  156. </block>
  157. <block type="math_on_list"></block>
  158. <block type="math_modulo">
  159. <value name="DIVIDEND">
  160. <shadow type="math_number">
  161. <field name="NUM">64</field>
  162. </shadow>
  163. </value>
  164. <value name="DIVISOR">
  165. <shadow type="math_number">
  166. <field name="NUM">10</field>
  167. </shadow>
  168. </value>
  169. </block>
  170. <block type="math_constrain">
  171. <value name="VALUE">
  172. <shadow type="math_number">
  173. <field name="NUM">50</field>
  174. </shadow>
  175. </value>
  176. <value name="LOW">
  177. <shadow type="math_number">
  178. <field name="NUM">1</field>
  179. </shadow>
  180. </value>
  181. <value name="HIGH">
  182. <shadow type="math_number">
  183. <field name="NUM">100</field>
  184. </shadow>
  185. </value>
  186. </block>
  187. <block type="math_random_int">
  188. <value name="FROM">
  189. <shadow type="math_number">
  190. <field name="NUM">1</field>
  191. </shadow>
  192. </value>
  193. <value name="TO">
  194. <shadow type="math_number">
  195. <field name="NUM">100</field>
  196. </shadow>
  197. </value>
  198. </block>
  199. <block type="math_random_float"></block>
  200. </category>
  201. <category name="{catText}" colour="160">
  202. <block type="text"></block>
  203. <block type="text_join"></block>
  204. <block type="text_append">
  205. <value name="TEXT">
  206. <shadow type="text"></shadow>
  207. </value>
  208. </block>
  209. <block type="text_length">
  210. <value name="VALUE">
  211. <shadow type="text">
  212. <field name="TEXT">abc</field>
  213. </shadow>
  214. </value>
  215. </block>
  216. <block type="text_isEmpty">
  217. <value name="VALUE">
  218. <shadow type="text">
  219. <field name="TEXT"></field>
  220. </shadow>
  221. </value>
  222. </block>
  223. <block type="text_indexOf">
  224. <value name="VALUE">
  225. <block type="variables_get">
  226. <field name="VAR">{textVariable}</field>
  227. </block>
  228. </value>
  229. <value name="FIND">
  230. <shadow type="text">
  231. <field name="TEXT">abc</field>
  232. </shadow>
  233. </value>
  234. </block>
  235. <block type="text_charAt">
  236. <value name="VALUE">
  237. <block type="variables_get">
  238. <field name="VAR">{textVariable}</field>
  239. </block>
  240. </value>
  241. </block>
  242. <block type="text_getSubstring">
  243. <value name="STRING">
  244. <block type="variables_get">
  245. <field name="VAR">{textVariable}</field>
  246. </block>
  247. </value>
  248. </block>
  249. <block type="text_changeCase">
  250. <value name="TEXT">
  251. <shadow type="text">
  252. <field name="TEXT">abc</field>
  253. </shadow>
  254. </value>
  255. </block>
  256. <block type="text_trim">
  257. <value name="TEXT">
  258. <shadow type="text">
  259. <field name="TEXT">abc</field>
  260. </shadow>
  261. </value>
  262. </block>
  263. <block type="text_print">
  264. <value name="TEXT">
  265. <shadow type="text">
  266. <field name="TEXT">abc</field>
  267. </shadow>
  268. </value>
  269. </block>
  270. <block type="text_prompt_ext">
  271. <value name="TEXT">
  272. <shadow type="text">
  273. <field name="TEXT">abc</field>
  274. </shadow>
  275. </value>
  276. </block>
  277. </category>
  278. <category name="{catLists}" colour="260">
  279. <block type="lists_create_with">
  280. <mutation items="0"></mutation>
  281. </block>
  282. <block type="lists_create_with"></block>
  283. <block type="lists_repeat">
  284. <value name="NUM">
  285. <shadow type="math_number">
  286. <field name="NUM">5</field>
  287. </shadow>
  288. </value>
  289. </block>
  290. <block type="lists_length"></block>
  291. <block type="lists_isEmpty"></block>
  292. <block type="lists_indexOf">
  293. <value name="VALUE">
  294. <block type="variables_get">
  295. <field name="VAR">{listVariable}</field>
  296. </block>
  297. </value>
  298. </block>
  299. <block type="lists_getIndex">
  300. <value name="VALUE">
  301. <block type="variables_get">
  302. <field name="VAR">{listVariable}</field>
  303. </block>
  304. </value>
  305. </block>
  306. <block type="lists_setIndex">
  307. <value name="LIST">
  308. <block type="variables_get">
  309. <field name="VAR">{listVariable}</field>
  310. </block>
  311. </value>
  312. </block>
  313. <block type="lists_getSublist">
  314. <value name="LIST">
  315. <block type="variables_get">
  316. <field name="VAR">{listVariable}</field>
  317. </block>
  318. </value>
  319. </block>
  320. <block type="lists_split">
  321. <value name="DELIM">
  322. <shadow type="text">
  323. <field name="TEXT">,</field>
  324. </shadow>
  325. </value>
  326. </block>
  327. <block type="lists_sort"></block>
  328. </category>
  329. <category name="{catColour}" colour="20">
  330. <block type="colour_picker"></block>
  331. <block type="colour_random"></block>
  332. <block type="colour_rgb">
  333. <value name="RED">
  334. <shadow type="math_number">
  335. <field name="NUM">100</field>
  336. </shadow>
  337. </value>
  338. <value name="GREEN">
  339. <shadow type="math_number">
  340. <field name="NUM">50</field>
  341. </shadow>
  342. </value>
  343. <value name="BLUE">
  344. <shadow type="math_number">
  345. <field name="NUM">0</field>
  346. </shadow>
  347. </value>
  348. </block>
  349. <block type="colour_blend">
  350. <value name="COLOUR1">
  351. <shadow type="colour_picker">
  352. <field name="COLOUR">#ff0000</field>
  353. </shadow>
  354. </value>
  355. <value name="COLOUR2">
  356. <shadow type="colour_picker">
  357. <field name="COLOUR">#3333ff</field>
  358. </shadow>
  359. </value>
  360. <value name="RATIO">
  361. <shadow type="math_number">
  362. <field name="NUM">0.5</field>
  363. </shadow>
  364. </value>
  365. </block>
  366. </category>
  367. <sep></sep>
  368. <category name="{catVariables}" colour="330" custom="VARIABLE"></category>
  369. <category name="{catFunctions}" colour="290" custom="PROCEDURE"></category>
  370. </xml>
  371. </body>
  372. </html>