index.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="google" value="notranslate">
  6. <title>Blockly Demo: RTL</title>
  7. <script src="../../blockly_compressed.js"></script>
  8. <script src="../../blocks_compressed.js"></script>
  9. <script src="../../msg/js/ar.js"></script>
  10. <style>
  11. body {
  12. background-color: #fff;
  13. font-family: sans-serif;
  14. }
  15. h1 {
  16. font-weight: normal;
  17. font-size: 140%;
  18. }
  19. #blocklyDiv {
  20. height: 600px;
  21. width: 800px;
  22. }
  23. </style>
  24. <script>
  25. function init() {
  26. var workspace = Blockly.inject('blocklyDiv',
  27. {media: '../../media/',
  28. rtl: true,
  29. toolbox: document.getElementById('toolbox')});
  30. Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'),
  31. workspace);
  32. //window.onbeforeunload = function() {
  33. // return 'Leaving this page will result in the loss of your work.';
  34. //};
  35. }
  36. </script>
  37. </head>
  38. <body onload="init()">
  39. <h1><a href="https://developers.google.com/blockly/">Blockly</a> &gt;
  40. <a href="../index.html">Demos</a> &gt; Right-to-Left</h1>
  41. <div id="blocklyDiv"></div>
  42. <xml id="toolbox" style="display: none">
  43. <category name="منطق">
  44. <block type="controls_if"></block>
  45. <block type="logic_compare"></block>
  46. <block type="logic_operation"></block>
  47. <block type="logic_negate"></block>
  48. <block type="logic_boolean"></block>
  49. <block type="logic_null"></block>
  50. <block type="logic_ternary"></block>
  51. </category>
  52. <category name="الحلقات">
  53. <block type="controls_repeat_ext">
  54. <value name="TIMES">
  55. <block type="math_number">
  56. <field name="NUM">10</field>
  57. </block>
  58. </value>
  59. </block>
  60. <block type="controls_whileUntil"></block>
  61. <block type="controls_for">
  62. <value name="FROM">
  63. <block type="math_number">
  64. <field name="NUM">1</field>
  65. </block>
  66. </value>
  67. <value name="TO">
  68. <block type="math_number">
  69. <field name="NUM">10</field>
  70. </block>
  71. </value>
  72. <value name="BY">
  73. <block type="math_number">
  74. <field name="NUM">1</field>
  75. </block>
  76. </value>
  77. </block>
  78. <block type="controls_forEach"></block>
  79. <block type="controls_flow_statements"></block>
  80. </category>
  81. <category name="رياضيات">
  82. <block type="math_number"></block>
  83. <block type="math_arithmetic"></block>
  84. <block type="math_single"></block>
  85. <block type="math_trig"></block>
  86. <block type="math_constant"></block>
  87. <block type="math_number_property"></block>
  88. <block type="math_round"></block>
  89. <block type="math_on_list"></block>
  90. <block type="math_modulo"></block>
  91. <block type="math_constrain">
  92. <value name="LOW">
  93. <block type="math_number">
  94. <field name="NUM">1</field>
  95. </block>
  96. </value>
  97. <value name="HIGH">
  98. <block type="math_number">
  99. <field name="NUM">100</field>
  100. </block>
  101. </value>
  102. </block>
  103. <block type="math_random_int">
  104. <value name="FROM">
  105. <block type="math_number">
  106. <field name="NUM">1</field>
  107. </block>
  108. </value>
  109. <value name="TO">
  110. <block type="math_number">
  111. <field name="NUM">100</field>
  112. </block>
  113. </value>
  114. </block>
  115. <block type="math_random_float"></block>
  116. </category>
  117. <category name="نص">
  118. <block type="text"></block>
  119. <block type="text_join"></block>
  120. <block type="text_append">
  121. <value name="TEXT">
  122. <block type="text"></block>
  123. </value>
  124. </block>
  125. <block type="text_length"></block>
  126. <block type="text_isEmpty"></block>
  127. <block type="text_indexOf"></block>
  128. <block type="text_charAt"></block>
  129. <block type="text_changeCase"></block>
  130. <block type="text_trim"></block>
  131. <block type="text_print"></block>
  132. <block type="text_prompt_ext">
  133. <value name="TEXT">
  134. <block type="text"></block>
  135. </value>
  136. </block>
  137. </category>
  138. <category name="قوائم">
  139. <block type="lists_create_empty"></block>
  140. <block type="lists_create_with"></block>
  141. <block type="lists_repeat">
  142. <value name="NUM">
  143. <block type="math_number">
  144. <field name="NUM">5</field>
  145. </block>
  146. </value>
  147. </block>
  148. <block type="lists_length"></block>
  149. <block type="lists_isEmpty"></block>
  150. <block type="lists_indexOf"></block>
  151. <block type="lists_getIndex"></block>
  152. <block type="lists_setIndex"></block>
  153. </category>
  154. <category name="لون">
  155. <block type="colour_picker"></block>
  156. <block type="colour_rgb"></block>
  157. <block type="colour_blend"></block>
  158. </category>
  159. <category name="متغيرات" custom="VARIABLE"></category>
  160. <category name="إجراءات" custom="PROCEDURE"></category>
  161. </xml>
  162. <xml id="startBlocks" style="display: none">
  163. <block type="controls_if" inline="false" x="-100" y="50">
  164. <value name="IF0">
  165. <block type="logic_compare" inline="true">
  166. <field name="OP">LT</field>
  167. <value name="A">
  168. <block type="variables_get">
  169. <field name="VAR">x</field>
  170. </block>
  171. </value>
  172. <value name="B">
  173. <block type="math_number">
  174. <field name="NUM">256</field>
  175. </block>
  176. </value>
  177. </block>
  178. </value>
  179. <statement name="DO0">
  180. <block type="variables_set" inline="false">
  181. <field name="VAR">x</field>
  182. <value name="VALUE">
  183. <block type="math_number">
  184. <field name="NUM">0</field>
  185. </block>
  186. </value>
  187. <next>
  188. <block type="text_print" inline="false">
  189. <value name="TEXT">
  190. <block type="text">
  191. <field name="TEXT">أكثر من لعبة</field>
  192. </block>
  193. </value>
  194. </block>
  195. </next>
  196. </block>
  197. </statement>
  198. </block>
  199. </xml>
  200. </body>
  201. </html>