forked from processing/Processing-Hour-Of-Code
/
index.html
238 lines (187 loc) · 7.4 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
---
layout: default
title: Editor
class: editor
---
{% include header.html %}
<div id="interface">
<div id="canvasContainer">
<div id="editorCanvasBox">
<canvas id="editorCanvas"></canvas>
<div id="horizontalRuler"></div>
<div id="verticalRuler"></div>
<a id="toggleRulers" class="btn btn-default btn-sm" title="Display or hide rulers.">
<span class="glyphicon glyphicon-pencil"></span> Toggle Rulers
</a>
</div>
</div>
<div id="videoContainer">
<div id="hint" class="hint">Hints will appear here.</div>
<div id="video" style="width: 100%; height: 100%;"></div>
<div id="videoCommandsContainer">
<div id="videoCommands" class="btn-group">
<a id="restartButton" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-refresh"></span> Restart
</a>
<a id="jumpBack" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-time"></span> Back 10 Sec.
</a>
<a id="jumpExercise" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-edit"></span> Jump to Exercise
</a>
<a id="jumpLesson" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-edit"></span> Jump to Lesson
</a>
<a id="jumpEnd" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-fast-forward"></span> Jump to End
</a>
<!--
<a id="pauseButton" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-pause"></span> Pause
</a> -->
</div>
</div>
</div>
<div id="editorContainer">
<div id="colorPicker"></div>
<div id="editor"></div>
<div id="editorCommands" class="btn-group">
<div class="btn-group dropup" id="resetButton">
<button class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown" data-hover="dropdown" data-delay="10">
<span class="glyphicon glyphicon-flash"></span> Code
</button>
<ul class="dropdown-menu">
<li><a href="#" id="resetExample" title="Reset to Dan's example">Dan's Example Code</a></li>
<li><a href="#" id="resetLastLesson" title="Reload my final code from the previous lesson">My Code from Last Lesson</a></li>
<li><a href="#" id="resetLastGood" title="Reload code from the last successful run">Last Good Run</a></li>
</ul>
</div>
<button id="nextButton" class="btn btn-default btn-sm" title="Move to the next lesson.">
<span class="glyphicon glyphicon-forward"></span> Next Lesson
</button>
<button id="shareButton" class="btn btn-default btn-sm" title="Share your work!">
<span class="glyphicon glyphicon-share-alt"></span>
Share
</button>
<button id="runButton" class="btn btn-default btn-sm" title="Run the current code.">
<span class="glyphicon glyphicon-play"></span>
Run Code
</button>
</div>
</div>
</div>
<!-- Modal Error Window -->
<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalTitle" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="errorModalTitle">Don't Panic!</h4>
</div>
<div class="modal-body">
Looks like there's a problem with your code. You can reset the editor to the last working run or fix it yourself using hints below.
</div>
<div class="modal-body" id="errorModalText">
</div>
<div class="modal-footer">
<button class="btn btn-default" id="modalResetCode">
<span class="glyphicon glyphicon-flash"></span> Reset Code
</button>
<button class="btn btn-default" data-dismiss="modal">
<span class="glyphicon glyphicon-ok"></span> Continue
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Modal Error Window -->
<!-- Modal Share Window -->
<div class="modal fade" id="shareModal" tabindex="-1" role="dialog" aria-labelledby="shareModalTitle" aria-hidden="true" data-url="http://hello.processing.org/">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="shareModalTitle">Share</h4>
</div>
<div class="modal-body">
You can copy or bookmark the link below to revisit your creation at any time. You can also use any of the social buttons to share your work with the world!
</div>
<div class="modal-body" id="shareModalLink">
<a href="http://hello.processing.org" target="_blank">http://hello.processing.org/</a>
</div>
<div class="modal-footer">
<button class="btn btn-default" id="modalFacebookButton">
<span class="glyphicon glyphicon-share-alt"></span> Facebook
</button>
<button class="btn btn-default" id="modalGoogleButton">
<span class="glyphicon glyphicon-share-alt"></span> Google+
</button>
<button class="btn btn-default" id="modalTwitterButton">
<span class="glyphicon glyphicon-share-alt"></span> Twitter
</button>
<button class="btn btn-default" id="modalHourButton">
<span class="glyphicon glyphicon-share-alt"></span> Hour of Code
</button>
<button class="btn btn-default" data-dismiss="modal">
<span class="glyphicon glyphicon-ok"></span> Close
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Modal Share Window -->
<!-- Hints Content -->
<div id="hints">
<div data-index="1">
{% include hint_1.html %}
</div>
<div data-index="2">
{% include hint_2.html %}
</div>
<div data-index="3">
{% include hint_3.html %}
</div>
<div data-index="4">
{% include hint_4.html %}
</div>
<div data-index="5">
{% include hint_5.html %}
</div>
<div data-index="6">
{% include hint_6.html %}
</div>
</div>
<!-- End Hints -->
<!-- Example Scripts -->
<script type="application/processing" data-index="2">
{% include example_2.pde %}
</script>
<script type="application/processing" data-index="3">
{% include example_3.pde %}
</script>
<script type="application/processing" data-index="4">
{% include example_4.pde %}
</script>
<script type="application/processing" data-index="5">
{% include example_5.pde %}
</script>
<!-- End Examples -->
<!-- Snippets -->
<div id="snippets">
{% include snippets_2.html %}
{% include snippets_3.html %}
{% include snippets_4.html %}
{% include snippets_5.html %}
</div>
<!-- End Snippets -->
<script src="/js/vendor/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/vendor/popcorn-complete.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/script.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/editor.js" type="text/javascript" charset="utf-8"></script>
<script>
var Range = require("ace/range").Range;
// Make sure the user doesn't lose their work by accident
window.onbeforeunload = function(e) {
return 'Are you sure you want to leave?';
};
</script>