-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathmain.html
More file actions
413 lines (298 loc) · 13.6 KB
/
main.html
File metadata and controls
413 lines (298 loc) · 13.6 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
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Python Programming Tutorials</title>
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet" media="screen">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
<link rel="stylesheet" href="{{ url_for('static', filename='js/editor/doc_brython.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='js/editor/console.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/brython_builtins.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/version_info.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/identifiers_re.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py2js.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_object.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_type.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_utils.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_generator.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_builtin_functions.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_bytes.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/py_set.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/js_objects.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/editor/stdlib_paths.js') }}"></script>
<script src="{{ url_for('static', filename='js/editor/ace.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/editor/ext-language_tools.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/editor/mode-python3.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/editor/python.js') }}" type="text/javascript" charset="utf-8"></script>
<!--<script src="{{ url_for('static', filename='js/editor/brython_dist.js') }}"></script>-->
<script src="{{ url_for('static', filename='js/editor/brython_dist.js') }}"></script>
<script type="text/python3" src="{{ url_for('static', filename='editor.py') }}"></script>
<script type="text/python3">
from browser import document as doc
from browser import html
import header
qs_lang,language = header.show('../')
# other translations
trans = {
'report_bugs':{'en':'Please report bugs in the ',
'es':'Poner los bugs en el ',
'fr':"Signalez les bugs dans l'"},
'test_page':{'en':'Tests page','es':'Página de pruebas','fr':'Page de tests'},
'run':{'en':'run','es':'ejecutar','fr':'ex?cuter'},
'clear':{'en':'clear','es':'borrar','fr':'effacer'}
}
for key in trans:
if key in doc:
doc[key].html = trans[key].get(language,trans[key]['en'])
# link to test page
if qs_lang:
tplink.href += '?lang=%s' %qs_lang
def set_debug(ev):
pass
# bindings
# next functions are defined in editor.py
doc['run'].bind('click',run)
# erase "main" div
def clear_main(ev):
doc['main'].text = ''
main_content = 'Zone with id="main" ; use it to test interaction with DOM elements'
# add "main" div
def add_main(ev):
global main_content
try:
# if "main" div already exists, save content and erase container
main_content = doc["main"].html
doc["main_container"].html = ""
doc["add_main"].text = 'Show "main" div'
except KeyError:
t = html.TABLE()
row = html.TR()
b = html.BUTTON('Clear')
b.bind('click', clear_main)
row <= html.TD(b)+html.TD(html.DIV(Id="main"))
t <= row
doc["main_container"] <= t
doc["main"].html = main_content
doc["add_main"].text = 'Hide "main" div'
</script>
<script>
function run_js(){
var cons = document.getElementById("console")
var jscode = cons.value
var t0 = (new Date()).getTime()
eval(jscode)
var t1 = (new Date()).getTime()
console.log("Javascript code run in "+(t1-t0)+" ms")
}
</script>
</head>
<header>
<div class="navbar-header">
<a class="navbar-brand" rel="home" href="/" title="Python Programming Tutorials ">
<img style="max-width:120px; margin-top: -7px;" src="{{ url_for('static', filename='images/mainlogo.png') }}">
</a>
</div>
<div class="container-fluid">
<ul class="nav nav-pills">
<a href="/dashboard/"><button type="button" class="btn btn-primary" style=" margin-top: 5px; margin-bottom: 5px; height:44px; margin-right: 15px">
<span class="glyphicon glyphicon-off"></span> Start Learning
</button></a>
<ul class="nav navbar-nav navbar-right">
{% if session.logged_in %}
<div style="margin-right: 10px; margin-left: 15px; margin-top: 5px; margin-bottom: 5px;" class="container-fluid">
<h5><a href="/support-donate/"> <span class="glyphicon glyphicon-heart"></span> Support </a>
<a href="/logout/"><span class="glyphicon glyphicon-log-out"></span> Logout</a></h5>
</div>
{% else %}
<div style="margin-right: 10px; margin-left: 15px; margin-top: 5px; margin-bottom: 5px;" class="container-fluid">
<h5>
<a href="/support-donate/"> <span class="glyphicon glyphicon-heart"></span> Support </a>
<a role="presentation" class="active" data-toggle="modal" data-target="#exampleModal" href="#"><span class="glyphicon glyphicon-log-in"></span> Login </a>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="exampleModalLabel">Login</h4>
</div>
<div class="modal-body">
<div class="container-fluid">
<form action="" class="form-inline" method="post">
<input type="text" class="form-control" placeholder="Username" name="username" value="{{
request.form.username }}">
<input type="password" class="form-control" placeholder="Password" name="password" value="{{
request.form.password }}">
<input class="btn btn-primary" type="submit" value="Login">
</form>
{% if error %}
<p class="error"><strong>Error:</strong> {{ error }}</p>
{% endif %}
<div class="container">
<br>
<p>No account? <a href='/register'>Register here</a>.</p>
<br>
{% for paragraph in Body_info %}
<p>{{ paragraph }}</p>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
<a role="presentation" class="active" data-toggle="modal" data-target="#register" href="#"><span class="glyphicon glyphicon-pencil"></span> Sign up</a><h5>
<div class="modal fade" id="register" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="exampleModalLabel">Register</h4>
</div>
<div class="modal-body">
<div class="container">
{% from "_formhelpers.html" import render_field %}
<form method=post action="/register">
<dl>
{{ render_field(form.username) }}
{{ render_field(form.email) }}
{{ render_field(form.password) }}
{{ render_field(form.confirm) }}
{{ render_field(form.accept_tos) }}
</dl>
<p><input type=submit value=Register>
</form>
{% if error %}
<p class="error"><strong>Error:</strong> {{ error }}</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
</ul>
</ul>
</div>
</header>
<body>
<div class="border-row" style="width:100%; margin-bottom: 15px;"> </div>
<!-- Flashed messages and actual body content -->
<div class="container" align="center" style="height:80%">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="row">
<div class="col-md-4">
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
{{ message }}
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<a href="/dashboard/">
<video autoplay="autoplay" muted="muted" poster="{{ url_for('static', filename='videos/python-programming-tutorials-main.png') }}" style="width:100%; max-height:80%" >
<source src="{{ url_for('static', filename='videos/python-programming-tutorials-main.mp4') }}" type="video/mp4" type="video/mp4">
<source src="{{ url_for('static', filename='videos/python-programming-tutorials-main.webm') }}" type="video/webm">
</video>
</a>
</div>
<div class="container-fluid" align="center" style="height:20%">
<a href="#two"><img style="height: 10%;max-height:80px; position: absolute; bottom: 0;" src="{{ url_for('static', filename='images/scrolldownarrow.png') }}"></a>
</div>
<div id="two" class="border-row" style="width:100%; margin-bottom: 10px;"> </div>
<body onload="brython({debug:1, cache:'version'})">
<div class="container" style="height:95%; max-width:1145px" >
<center>
<button type="button" class="btn btn-success" id="run" style=" margin-top: 5px; margin-bottom: 5px; height:44px; margin-right: 15px"><span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span> Run</button><a href="/dashboard/"><button type="button" class="btn btn-primary" style=" margin-top: 5px; margin-bottom: 5px; height:44px; margin-right: 15px">
<span class="glyphicon glyphicon-off"></span> Start Learning
</button></a></center>
<table id="banner" cellpadding=0 cellspacing=0>
<tr id="banner_row">
</tr>
</table>
<div id="container" style="max-height:80%">
<div id="left-div">
<div style="padding: 3px 3px 3px 3px;">
</div>
<div id="editor" style="width:100%;"></div>
</div>
<div id="right-div">
<div style="padding: 3px 3px 3px 3px;">
</div>
<div style="width:100%;height:100%;">
<textarea id="console"></textarea>
</div>
<p style="font-size:65%">Python 3 embedded console using <a href="http://brython.info/" target="_blank">Brython</a></p>
</div>
</div>
</div>
</body><br>
<!-- js inclues -->
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
<!-- Google Tracking -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-51891827-1', 'auto');
ga('send', 'pageview');
</script>
<script>
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
</body>
<footer id="footer" style="background-color: #ececec">
<div class="border-row" style="width:100%; margin-bottom: 15px;"> </div>
<div class="row">
<div class="col-md-2">
<ul style="list-style-type: none;">
<li><strong>About</strong></li>
<li><a href="/about">Mission</a></li>
<li><a href="/about/super-powers/">What Python means to me</a></li>
<li><a href="/about/technology/">Technology</a></li>
<li><a href="/contact/">Contact</a></li>
<li><a href="/support-donate/">Support this Website!</a></li>
<li>© 2015 Python Programming.</li>
</ul>
</div>
<div class="col-md-1"> </div>
<div class="col-md-2">
<ul style="list-style-type: none;">
<li><strong>Social</strong></li>
<!--<li><a href="/blog">Blog</a></li>-->
<li><a href="https://twitter.com/sentdex" target="_blank">Twitter</a></li>
<li><a href="http://www.youtube.com/user/sentdex?sub_confirmation=1" target="_blank">YouTube</a></li>
<li><a href="https://plus.google.com/+sentdex" target="_blank">Google+</a></li>
</ul>
</div>
<div class="col-md-1"> </div>
<div class="col-md-2"><ul style="list-style-type: none;">
<li><strong>Legal</strong></li>
<li><span><a href="/about/tos">Terms of Use</a></span></li>
<li><span><a href="/about/privacy-policy">Privacy Notice (updated Jan 22, 2015)</a></span></li>
</ul></div>
</div>
</div>
</footer>
</html>