-
Notifications
You must be signed in to change notification settings - Fork 2
/
exact.html
112 lines (111 loc) · 5.47 KB
/
exact.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!doctype html>
<html>
<head>
<meta charset = "utf-8">
<title>Text 2 Code</title>
<link rel = "stylesheet" href = "styles.css">
<script src="blockly/blockly_compressed.js"></script>
<script src="blockly/blocks_compressed.js"></script>
<script src="blockly/javascript_compressed.js"></script>
<script src="blockly/python_compressed.js"></script>
<script src="blockly/msg/js/en.js"></script>
<script src = "core/msg/en.js"></script>
<script src = "core/msg/hi.js"></script>
<script src = "core/msg/js.js"></script>
<script src = "core/msg/py.js"></script>
<script src="dist/text2code_blocks.js"></script>
</head>
<body>
<header>
<h1><span id = "textHeader">Text</span> <span id = "twoHeader">2</span> <span id = "codeTextHeader">Code</span></h1>
</header>
<div id = "all-content">
<form style = "text-align:right; font-size: x-large;">
Language:
<select id = "language" style = "text-align:right; font-size: x-large;">
<option value = "en">English</option>
<option value = "hi">हिंदी</option>
</select>
</form>
<div id = "blockly-div">
<xml xmlns="http://www.w3.org/1999/xhtml" id="toolbox" style="display: none;">
<category name="PseudoJS Input/Output" colour="160" data-name="TOOLBOX_CATEGORY_PSEUDO_JS_IO">
<block type="text_print"></block>
<block type="text_input"></block>
</category>
<category name="JavaScript Input/Output" colour="160" data-name="TOOLBOX_CATEGORY_JS_IO">
<block type="js_text_print"></block>
<block type="js_text_input"></block>
</category>
<category name="Variables" custom="VARIABLE" colour="330" data-name="TOOLBOX_CATEGORY_VARIABLES">
</category>
<category name="Math" colour="#5C68A6" data-name="TOOLBOX_CATEGORY_MATH">
<block type="math_number">
<field name="NUM">0</field>
</block>
<block type="math_arithmetic_basic">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</category>
<category name="PseudoJS Text" colour="160" data-name="TOOLBOX_CATEGORY_PSEUDO_JS_TEXT">
<block type="text"></block>
<block type="t2c_text_join"></block>
<!--<block type="before_substring"></block>
<block type="after_substring"></block>-->
<block type="text_length"></block>
<block type="t2c_text_indexof"></block>
<block type="t2c_text_charat"></block>
<block type="t2c_text_getsubstring"></block>
</category>
<category name="JavaScript Text" colour="160" data-name="TOOLBOX_CATEGORY_JS_TEXT">
<block type="text"></block>
<block type="t2c_text_join"></block>
<block type="text_length"></block>
<block type="js_text_indexof"></block>
<block type="js_text_charat"></block>
<block type="js_text_getsubstring"></block>
</category>
<category name = "Type in Code Blocks" colour="60" data-name="TOOLBOX_CATEGORY_TYPE_IN_CODE">
<block type = "code_expression"></block>
<block type = "code_statement"></block>
</category>
</xml>
</div>
<div id = "changeButtons" >
<button id = "convertToJSText2CodeButton" name = "BUTTON_RUN_CODE" >RUN BLOCK CODE!</button>
<button id = "convertTextToBlocksButton" name = "BUTTON_CONVERT_TEXT_TO_BLOCKS">Convert text to blocks</button>
<button id = "convertToJSButton" name = "BUTTON_CONVERT_TO_JS">Convert PseudoJS blocks to JavaScript blocks</button>
<button id = "convertXMLToBlocksButton" name = "BUTTON_CONVERT_XML_TO_BLOCKS">Convert XML to Blocks</button>
</div>
<h3 id = "outputAppearsBelow" name = "HEADING_OUTPUT_APPEARS_BELOW">Output will appear below</h3>
<pre>
<div id = "consoleDisplay">
</div>
</pre>
<div id = "text-code">
<form>
<textarea id = "textCodeBox" name = "TEXTAREA_CODE_APPEARS_BELOW" placeholder = "Code to appear here."></textarea>
<textarea id = "xmlData" name = "TEXTAREA_COPY_TEXT_HERE" placeholder="Copy text here to save/load blocks."></textarea>
</form>
</div>
</div>
<div>
<iframe height="400px" width="100%" src="https://repl.it/@jschanker/Text2Code-Strings-Exact?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
</div>
<footer>
<h3 id = "bottomText" name = "HEADING_BOTTOM_TEXT"><em>If you can describe the solution, you can code it. (At least that's the goal.)</em></h3>
</footer>
<script src = "dist/text2code_generators.js"></script>
<script src = "dist/text2code_core.js"></script>
</body>
</html>