-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathindex.html
More file actions
184 lines (152 loc) · 7.8 KB
/
index.html
File metadata and controls
184 lines (152 loc) · 7.8 KB
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
<!DOCTYPE html>
<html>
<head>
<!-- Loading notice -->
<style>
#loading {
position: absolute;
top: 40%;
width: 33%;
left: 33%;
text-align: center;
background-color: #CCC;
border-radius: 10px;
padding: 20px;
animation: loading 2s alternate infinite;
border: 1px solid #000;
}
@keyframes loading {
from {
background-color: #CCC;
}
to {
background-color: #0C0;
}
}
</style>
<meta charset="UTF-8">
<meta name="description" content="Write, run, debug and share python code in your browser" />
<meta name="author" content="pddring">
<title>Create with code</title>
<!-- See http://blog.withcode.uk/about/license-and-acknowledgements/ for libraries used-->
<script src="lib/cm/codemirror.js"></script>
<script src="lib/cm/active-line.js"></script>
<link rel="stylesheet" href="lib/cm/codemirror.css">
<link rel="stylesheet" href="lib/cm/cobalt.css">
<link rel="stylesheet" href="lib/cm/blackboard.css">
<link rel="stylesheet" href="styles.css">
<script src="lib/cm/python.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="lib/lib.js"></script>
<script src="lib/skulpt/skulpt.min.js"></script>
<script src="lib/skulpt/skulpt-stdlib.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="lib/jq/jquery.ui.touch-punch.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<link href='https://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- Animated link-->
<div>
To save and share your code please visit <a href="https://create.withcode.uk" target="_blank">create.withcode.uk</a>. Tutorials and resources available at <a href="http://blog.withcode.uk" target="_blank">blog.withcode.uk</a>
<a class="nounderline" href="https://create.withcode.uk" target="_blank">
<h1 id="title" onmouseover="animateTitle('create.withcode.uk', 'title_text')"><span class="brackets">{</span><span id="title_text">withcode.uk</span><span class="brackets">}</span></h1>
</a>
</div>
<div id="loading">
Loading... please wait
</div>
<div id="holder" class="holder" style="display:none">
<span id="file_tabs"><span class="file_tab file_tab_selected">mycode.py</span></span>
<pre>
<div id="editor">
</div>
</pre>
</div>
<script>
PythonIDE.files['mycode.py'] = 'from microbit import *\ndisplay.scroll("Hello world")';
PythonIDE.currentFile = 'mycode.py';
PythonIDE.updateFileTabs();
</script>
<div id="hintBar"></div>
<span id="footer">
<img alt="Click to show/hide tool buttons" title="Show/hide tools" class="toolButton" src="media/tools.png" id="btn_tools">
<img title="Run" alt="Click to run your code" id="btn_run" class="toolButton hiddenButton" src="media/play.png">
<img alt="Stop running" title="Stop" class="toolButton hiddenButton" src="media/stop.png" id="btn_stopRunning">
<img title="Console" alt="Show python output" id="btn_show_output" class="toolButton hiddenButton" src="media/console.png">
<img title="Settings" alt="Customize the screen" id="btn_show_settings" class="toolButton hiddenButton" src="media/settings.png">
<img title="Code recovery" alt="Recover your code from a previous session" id="btn_show_recover" class="toolButton hiddenButton" src="media/recover.png">
</span>
<div id="recover" title="Recover" style="display:none"></div>
<div id="dlg" title="mycode.py" style="display:none">
<div id="output"></div>
</div>
<div id="file_settings" title="File" style="display:none">
<p>Be careful: if you choose to delete a file, you will not be able to recover it unless you've saved a copy</p>
<label for="txt_file_name">Rename file:</label>
<input id="txt_file_name" name="txt_file_name" value="">
<button id="btn_file_rename">Rename</button>
<button id="btn_file_delete">Delete</button>
<button id="btn_file_cancel">Cancel</button>
</div>
<div id="settings" title="Settings" style="display:none">
<h3>Text size</h3>
<label for="txt_code_size">Code font size:</label>
<input type="text" id="txt_code_size" readonly>
<div id="slider_code_size" class="slider"></div>
<label for="txt_output_size">Output font size:</label>
<input type="text" id="txt_output_size" readonly>
<div id="slider_output_size" class="slider"></div>
<h3>Editor colours</h3>
<div id="radio_code_style">
<p>Lighter colours are great for coding at day time. Some people prefer coding at night:</p>
<input type="radio" id="radio_code_style_light" name="radio_code_style" checked="checked">
<label for="radio_code_style_light">Light</label>
<input type="radio" id="radio_code_style_dusk" name="radio_code_style">
<label for="radio_code_style_dusk">Dusk</label>
<input type="radio" id="radio_code_style_dark" name="radio_code_style">
<label for="radio_code_style_dark">Dark</label>
</div>
<h3>Output console colours</h3>
<p>Darker colours look more like a command prompt. Lighter colours look more like an app window:</p>
<div id="radio_output_style">
<input type="radio" id="radio_output_style_light" name="radio_output_style">
<label for="radio_output_style_light">Light</label>
<input type="radio" id="radio_output_style_dusk" name="radio_output_style">
<label for="radio_output_style_dusk">Dusk</label>
<input type="radio" id="radio_output_style_dark" name="radio_output_style" checked="checked">
<label for="radio_output_style_dark">Dark</label>
</div>
<h3>Run mode</h3>
<p>Running your code line by line can be a useful way of finding bugs</p>
<div id="radio_run_mode">
<input type="radio" id="radio_run_mode_all" name="radio_run_mode" checked="checked">
<label for="radio_run_mode_all">Whole program</label>
<input type="radio" id="radio_run_mode_single" name="radio_run_mode">
<label for="radio_run_mode_single">Step through single line</label>
<input type="radio" id="radio_run_mode_anim" name="radio_run_mode">
<label for="radio_run_mode_anim">Animate line by line</label>
</div>
<p>Choosing a longer time between animating each line helps you understand and explain your code as it runs</p>
<label for="txt_step_anim_time">Time delay between running each line:</label>
<input type="text" id="txt_step_anim_time" readonly>
<div id="slider_step_anim_time" class="slider"></div>
<p>Making your output window transparent helps you see your code underneath</p>
<label for="txt_output_transparency">Output window transparency</label>
<input type="text" id="txt_output_transparency" readonly>
<div id="slider_output_transparency" class="slider"></div>
</div>
<script>
var toolsVisible = false;
// load python IDE
$(function() {
$('#loading').hide();
$('#holder').show();
PythonIDE.init();
});
</script>
</body>
</html>