-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
115 lines (84 loc) · 3.42 KB
/
index.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
113
114
<html lang="en">
<head>
<meta charset="utf-8">
<title>shuffle</title>
<meta name="description" content="janke shuffle">
<meta name="author" content="colevanderswands">
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
<link href="./guesses-history/modal.css" rel="stylesheet" />
<script src="./guesses-history/scripts.js"></script>
<script src="./guesses-history/global-vars.js"></script>
</head>
<body>
<div id="editor" style="position: relative; width: 800px; height: 400px;"></div>
<div id="controls"></div>
<br><br>
<div>
run it: <button onclick="open_in_pytut();">in python tutor</button> <button onclick="copy_it();">copy snippet</button> <br>
study it with: <button onclick="open_in('parsonizer');">parsonizer</button>
<button onclick="open_in('spot');">spot</button>
<br>
<button id="gen-perma" onclick="gen_permalink();">generate permalink:</button>
<input id="display-perma"></input><br>
</div>
<br/>
<hr>
<p> <a href="https://github.com/blocks-to-text/shuffle" target="_blank">shuffle source code</a>, powered by <a href="https://github.com/ajaxorg/ace" target="_blank"> ace</a>
<br>
<hr>
<hr>
<a href="http://github.com/blocks-to-text/top" target="_blank"><img src="https://user-images.githubusercontent.com/18554853/50098409-22575780-021c-11e9-99e1-962787adaded.png" width="40" height="40"></img> Blocks to Text</a>
<!-- begin guess history modal -->
<div id="guesses-history" style="display:none; overflow-y: hidden;">
<div style="padding-right: 5%; padding-left: 5%; padding-bottom: 5%; overflow-y: hidden;">
<div>
<div id="the-answer" class="prettyprint">
// no challenge loaded
</div>
</div>
<div >
<div id="the-guesses" style="height: 75vh; width: 100vh; overflow-y: auto">
no guesses yet
</div>
</div>
</div>
</div>
<div class="modal" style="overflow-y: hidden;">
<div class="modal-inner" style="height: 100%; width: 100%; overflow-y: hidden;">
<a data-modal-close>X</a>
<div class="modal-content" style="overflow-y: hidden;"></div>
</div>
</div>
<script src="./guesses-history/modal.js"></script>
<script>var modal = new VanillaModal.default();</script>
<!-- end guess history modal -->
<script src="./ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="./shuffling/solution-space.js"></script>
<script src="./shuffling/feedback.js"></script>
<script src="./shuffling/generate-challenge.js"></script>
<script src="./shuffling/handlers.js"></script>
<script src="./shuffling/modes.js"></script>
<script src="./linking/ctr-c.js"></script>
<script src="./linking/open-in-pytut.js"></script>
<script src="./linking/permalinking.js"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme('ace/theme/chrome');
editor.setFontSize(15);
editor.getSession().setMode('ace/mode/python');
editor.getSession().setTabSize(2);
spot_mode();
var mode = "spot";
var snippet;
var query = read_snippet_query();
if (query) {
snippet = query;
} else {
snippet = 'def table():\n return "table"\n\nprint ( table() )';
};
var challenge = generate_challenge(embed_snippet(snippet), 50);
editor.setValue(snippet);
init_modal(snippet);
</script>
</body>
</html>