-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.html
431 lines (398 loc) · 22.2 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
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link type="text/css" rel="stylesheet" href="css/jquery.enhsplitter.css"/>
<link type="text/css" rel="stylesheet" href="css/fba.css" />
<link type="text/css" rel="stylesheet" href="css/ycp.css" />
<link type="text/css" rel="stylesheet" href="css/scp.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/codemirror.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/addon/dialog/dialog.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/theme/material.min.css">
<link type="text/css" rel="stylesheet" href="css/style.css" />
</head>
<body>
<div id="screen">
<div id="desktop">
<a class="shorcut openapp" data-html="file"><span><i class="fa fa-file-code-o"></i></span><p>Code Editor</p></a>
<a class="shorcut openapp" data-html="calculator"><span><i class="fa fa-calculator"></i></span><p>Calculator</p></a>
<a class="shorcut openapp" data-html="console"><span><i class="fa fa-terminal"></i></span><p>Console</p></a>
<a class="shorcut openapp" data-html="games"><span><i class="fa fa-gamepad"></i></span><p>Games</p></a>
<a class="shorcut openapp" data-html="internet"><span><i class="fa fa-globe"></i></span><p>Internet Explorer</p></a>
<a class="shorcut openapp" data-html="music"><span><i class="fa fa-headphones"></i></span><p>Music Player</p></a>
<a class="shorcut openapp" data-html="photoshop"><span><i class="fa fa-photo"></i></span><p>Photoshop</p></a>
<a class="shorcut openapp" data-html="video"><span><i class="fa fa-play-circle"></i></span><p>Video Player</p></a>
</div>
<div id="taskbar">
<a href="https://github.com/bachors/HTML-Desktop-Template" target="_BLANK"><i class="fa fa-windows"></i></a>
<span id="date"></span>
</div>
</div>
<script src="//www.skulpt.org/static/skulpt.min.js" type="text/javascript"></script>
<script src="//www.skulpt.org/static/skulpt-stdlib.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/codemirror.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/mode/xml/xml.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/mode/javascript/javascript.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/mode/css/css.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/mode/clike/clike.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/mode/php/php.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/mode/htmlmixed/htmlmixed.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/addon/dialog/dialog.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/addon/search/searchcursor.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/addon/search/search.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/phaser/2.4.8/phaser.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="js/jquery.enhsplitter.js"></script>
<script src="js/fba.js"></script>
<script src="js/ycp.js"></script>
<script src="js/scp.js"></script>
<script>
var html = {
file: '<div class="window active" data-taskbar="file">' +
' <div class="toolbar">' +
' <div class="row">' +
' <i class="fa fa-code-fork"></i>' +
' <span id="rf"></span>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel maximize"><i class="fa fa-window-maximize"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board"><div id="fba"></div></div>' +
' </div>',
internet: '<div class="window active" data-taskbar="internet">' +
' <div class="toolbar">' +
' <div class="row">' +
' <i class="fa fa-globe"></i>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel maximize"><i class="fa fa-window-maximize"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board"><div id="addressbar">' +
' <div class="input">' +
' <input type="url" id="addr" placeholder="URL">' +
' </div><div class="input">' +
' <input type="text" placeholder="Search">' +
' </div>' +
' </div>' +
' <div id="site"></div></div>' +
' </div>',
video: '<div class="window active" data-taskbar="video">' +
' <div class="toolbar black">' +
' <div class="row">' +
' <i class="fa fa-play-circle"></i> <span id="ycp-rf"></span>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel maximize"><i class="fa fa-window-maximize"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board" id="ycp" data-ycp_title="Demo - Bachors.com" data-ycp_channel="UCoiS7s7HrE7bHNuzERi-FCQ"></div>' +
' </div>',
console: '<div class="window active" data-taskbar="console">' +
' <div class="toolbar">' +
' <div class="row">' +
' <i class="fa fa-terminal"></i>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel maximize"><i class="fa fa-window-maximize"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board"><textarea id="yourcode" autocorrect="off" spellcheck="false">-----------------------------------' +
'\nSkulpt Python\n' +
'-----------------------------------\n#>> print "Hello World"</textarea></div>' +
' </div>',
music: '<div class="window active" data-taskbar="music">' +
' <div class="toolbar black">' +
' <div class="row">' +
' <i class="fa fa-headphones"></i> <span id="scp-rf"></span>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel maximize"><i class="fa fa-window-maximize"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board" id="scp"></div>' +
' </div>',
photoshop: '<div class="window active" data-taskbar="photoshop">' +
' <div class="toolbar black">' +
' <div class="row">' +
' <i class="fa fa-photo"></i>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel maximize"><i class="fa fa-window-maximize"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board"><iframe src="https://pixlr.com/editor/"></iframe></div>' +
' </div>',
calculator: '<div class="window calculator active" data-taskbar="calculator">' +
' <div class="toolbar">' +
' <div class="row">' +
' <i class="fa fa-calculator"></i>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div class="board"><center><form name="sci-calc"><table cellspacing="0" cellpadding="1"><tr><td colspan="5" align="center"><input type="text" name="display" class="form-control" value="0" size="32" maxlength="36"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" exp " onclick="if (checkNum(this.form.display.value)) { exp(this.form) }"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" ln " onclick="if (checkNum(this.form.display.value)) { ln(this.form) }"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" sqrt " onclick="if (checkNum(this.form.display.value)) { sqrt(this.form) }"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" sq " onclick="if (checkNum(this.form.display.value)) { square(this.form) }"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" 7 " onclick="addChar(this.form.display, \'7\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" 8 " onclick="addChar(this.form.display, \'8\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" 9 " onclick="addChar(this.form.display, \'9\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" / " onclick="addChar(this.form.display, \'/\')"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" 4 " onclick="addChar(this.form.display, \'4\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" 5 " onclick="addChar(this.form.display, \'5\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" 6 " onclick="addChar(this.form.display, \'6\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" * " onclick="addChar(this.form.display, \'*\')"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" 1 " onclick="addChar(this.form.display, \'1\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" 2 " onclick="addChar(this.form.display, \'2\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" 3 " onclick="addChar(this.form.display, \'3\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" - " onclick="addChar(this.form.display, \'-\')"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" 0 " onclick="addChar(this.form.display, \'0\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" . " onclick="addChar(this.form.display, \'.\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" +/- " onclick="changeSign(this.form.display)"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" + " onclick="addChar(this.form.display, \'+\')"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" ( " onclick="addChar(this.form.display, \'(\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value="cos" onclick="if (checkNum(this.form.display.value)) { cos(this.form) }"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" sin" onclick="if (checkNum(this.form.display.value)) { sin(this.form) }"></td><td align="center"><input type="button" class="btn btn-primary klu" value=" tan" onclick="if (checkNum(this.form.display.value)) { tan(this.form) }"></td></tr><tr><td align="center"><input type="button" class="btn btn-primary klu" value=" ) " onclick="addChar(this.form.display, \')\')"></td><td align="center"><input type="button" class="btn btn-primary klu" value="AC" onclick="this.form.display.value = 0 "></td><td align="center"><input type="button" class="btn btn-primary klu" value="DEL" onclick="deleteChar(this.form.display)"></td><td align="center"><input type="button" class="btn btn-primary klu" value="=" name="enter" onclick="if (checkNum(this.form.display.value)) { compute(this.form) }"></td></tr></table></form></center></div>' +
' </div>',
games: '<div class="window games active" data-taskbar="games">' +
' <div class="toolbar">' +
' <div class="row">' +
' <i class="fa fa-gamepad"></i> <span>WannaCry</span>' +
' </div><div class="row">' +
' <a class="panel close"><i class="fa fa-times"></i></a>' +
' <a class="panel minimize"><i class="fa fa-minus"></i></a>' +
' </div>' +
' </div>' +
' <div id="manuk"></div>' +
' </div>'
}
function addChar(e,t){if(e.value==null||e.value=="0")e.value=t;else e.value+=t}function cos(e){e.display.value=Math.cos(e.display.value)}function sin(e){e.display.value=Math.sin(e.display.value)}function tan(e){e.display.value=Math.tan(e.display.value)}function sqrt(e){e.display.value=Math.sqrt(e.display.value)}function ln(e){e.display.value=Math.log(e.display.value)}function exp(e){e.display.value=Math.exp(e.display.value)}function deleteChar(e){e.value=e.value.substring(0,e.value.length-1)}function changeSign(e){if(e.value.substring(0,1)=="-")e.value=e.value.substring(1,e.value.length);else e.value="-"+e.value}function compute(form){form.display.value=eval(form.display.value)}function square(form){form.display.value=eval(form.display.value)*eval(form.display.value)}function checkNum(e){for(var t=0;t<e.length;t++){var n=e.substring(t,t+1);if(n<"0"||n>"9"){if(n!="/"&&n!="*"&&n!="+"&&n!="-"&&n!="."&&n!="("&&n!=")"){alert("entri yang tidak valid!");return false}}}return true}
$( function() {
$( ".openapp" ).click(function(){
if($('.showing').length){
$( ".showing" ).removeClass('active');
}
var data = $(this).data('html');
if(!$('#taskbar .' + data).length){
if($( ".window" )){
$( ".window" ).removeClass('active');
}
$('#desktop').append(html[data]);
if(data == 'file'){
fba({github:{user:'bachors',repos:['jQuery-File-Browser-Awesome','CI-FIle-Browser-Awesome','jQuery-Github-Repos-Feed','jQuery-iBacor-Facebook-Streaming','jQuery-Github-Feed','jQuery-Youtube-Channels-Playlist','jQuery-Awesome-Sosmed-Share-Button','Apps-Screenshot','PHP-sending-emails-to-multiple-recipients','kodepos-indonesia.sql','Img2Blob.js','Imap_parser.php','Visitor-Parser-JS','Chat-Realtime','jQuery-Stackoverflow-Search','jQuery-Prefix-Input','GSM-Arena-API','bintangin.js','ChatWs','jQuery-my-instagram-gallery','Soundcloud-Player','HTTP-Compression-Tester','htmlfromrss.js','jQuery-Facebook-Fans-Page-Albums','Disqusin.js','CodingDong','jQuery-My-Dribbble-Gallery','jQuery-iBacor-Google-Plus-Streaming','TVTeditor','TMDb7','bcralnit.js']},mode:{html:'text/html',css:'text/css',js:'text/javascript',php:'application/x-httpd-php',json:'application/json'}});
}else if(data == 'video'){
$("#ycp").ycp({
apikey : 'xxx',
autoplay : true
});
}else if(data == 'music'){
scp(
auto_play = true,
client_id = 'xxx'
);
}else if(data == 'games'){
// Initialize Phaser, and creates a 400x490px game
var game = new Phaser.Game(400, 490, Phaser.AUTO, 'manuk');
// Creates a new 'main' state that will contain the game
var mainState = {
// Function called first to load all the assets
preload: function() {
// Change the background color of the game
game.stage.backgroundColor = '#71c5cf';
// Load the bird sprite
game.load.image('bird', 'img/yg.png');
// Load the pipe sprite
game.load.image('pipe', 'img/dt.png');
},
// Fuction called after 'preload' to setup the game
create: function() {
// Set the physics system
game.physics.startSystem(Phaser.Physics.ARCADE);
// Display the bird on the screen
this.bird = this.game.add.sprite(100, 245, 'bird');
// Add gravity to the bird to make it fall
game.physics.arcade.enable(this.bird);
this.bird.body.gravity.y = 1000;
// Call the 'jump' Press the spacebar or double-tap to jump
this.game.input.onTap.add(this.jump, this);
// Create a group of 20 pipes
this.pipes = game.add.group();
this.pipes.enableBody = true;
this.pipes.createMultiple(20, 'pipe');
// Timer that calls 'addRowOfPipes' ever 1.5 seconds
this.timer = this.game.time.events.loop(1500, this.addRowOfPipes, this);
// Add a score label on the top left of the screen
this.score = 0;
this.labelScore = this.game.add.text(20, 20, "0", { font: "30px Arial", fill: "#ffffff" });
},
// This function is called 60 times per second
update: function() {
// If the bird is out of the world (too high or too low), call the 'restartGame' function
if (this.bird.inWorld == false)
this.restartGame();
// If the bird overlap any pipes, call 'restartGame'
game.physics.arcade.overlap(this.bird, this.pipes, this.restartGame, null, this);
},
// Make the bird jump
jump: function() {
// Add a vertical velocity to the bird
this.bird.body.velocity.y = -350;
},
// Restart the game
restartGame: function() {
// Start the 'main' state, which restarts the game
game.state.start('main');
},
// Add a pipe on the screen
addOnePipe: function(x, y) {
// Get the first dead pipe of our group
var pipe = this.pipes.getFirstDead();
// Set the new position of the pipe
pipe.reset(x, y);
// Add velocity to the pipe to make it move left
pipe.body.velocity.x = -200;
// Kill the pipe when it's no longer visible
pipe.checkWorldBounds = true;
pipe.outOfBoundsKill = true;
},
// Add a row of 6 pipes with a hole somewhere in the middle
addRowOfPipes: function() {
var hole = Math.floor(Math.random()*5)+1;
for (var i = 0; i < 8; i++)
if (i != hole && i != hole +1)
this.addOnePipe(400, i*60+10);
this.score += 1;
this.labelScore.text = this.score;
},
};
// Add and start the 'main' state to start the game
game.state.add('main', mainState);
game.state.start('main');
}
$('#taskbar').append('<a class="showing ' + data + ' active" data-minimize="yes">' + $(this).find('span').html() + '</a>');
$( ".window" ).draggable({
cancel: ".board"
});
$( ".window" ).resizable({
cancel: ".calculator, .games"
});
return false;
}
});
$( "body" ).on('click', '.window', function(){
var data = $(this).data('taskbar');
if($(this).hasClass("active") === false){
$( ".window" ).removeClass('active');
$( ".showing" ).removeClass('active');
$(this).addClass('active');
$('#taskbar .' + data).addClass('active');
}
return false;
});
$( "body" ).on('click', '.maximize', function(){
$(this).removeClass('maximize');
$(this).addClass('restore');
$(this).find('i').removeClass('fa-window-maximize');
$(this).find('i').addClass('fa-window-restore');
$(this).parent().parent().parent().css('width', '100%');
$(this).parent().parent().parent().css('top', '0px');
$(this).parent().parent().parent().css('left', '0px');
$(this).parent().parent().parent().css('height', '100%');
return false;
});
$( "body" ).on('click', '.restore', function(){
$(this).removeClass('restore');
$(this).addClass('maximize');
$(this).find('i').removeClass('fa-window-restore');
$(this).find('i').addClass('fa-window-maximize');
$(this).parent().parent().parent().css('width', '900px');
$(this).parent().parent().parent().css('top', '50px');
$(this).parent().parent().parent().css('left', '100px');
$(this).parent().parent().parent().css('height', '500px');
return false;
});
$( "body" ).on('click', '.close', function(){
$(this).parent().parent().parent().remove();
var i = $(this).parent().parent().parent().data('taskbar');
$('#taskbar .' + i).remove();
return false;
});
$( "body" ).on('click', '.minimize', function(){
$(this).parent().parent().parent().hide();
var i = $(this).parent().parent().parent().data('taskbar');
$('#taskbar .' + i).removeClass('active');
return false;
});
$( "body" ).on('click', '.showing', function(){
var x = $(this).index() - 2;
if($(this).data('minimize') == 'yes'){
$('.window').eq(x).hide();
$(this).data('minimize', 'no');
$(this).removeClass('active');
}else{
$('.window').eq(x).show();
$( ".window" ).removeClass('active');
$('.window').eq(x).addClass('active');
$(this).data('minimize', 'yes');
$('.showing').removeClass('active');
$(this).addClass('active');
}
return false;
});
$("body").on('keypress', '#addr', function(e){
if (e.which == 13) {
$('#site').html('<iframe id="loadurl"></iframe>');
SetFrameURL($(this).val());
return false;
}
});
$("body").on('keypress', '#yourcode', function(e){
if (e.which == 13) {
if(e.shiftKey){
document.getElementById("yourcode").value += '\n';
}else{
document.getElementById("yourcode").value += '\n';
var prog = document.getElementById("yourcode").value,
code = prog.split('#>> ');
runit(code[code.length - 1]);
document.getElementById("yourcode").value += '\n#>> ';
}
return false;
}
});
setTimeout(tampilkanwaktu, 1000);
});
function tampilkanwaktu() {
var sekarang = new Date();
var detik = sekarang.getSeconds();
var stringdetik = (detik < 10) ? "0" + (detik.toString()) : (detik.toString());
var menit = sekarang.getMinutes();
var stringmenit = (menit < 10) ? "0" + (menit.toString()) : (menit.toString());
var jam = sekarang.getHours();
var stringjam = (jam < 10) ? "0" + (jam.toString()) : (jam.toString());
var dn="AM"
if (stringjam>=12)
dn="PM"
$("#taskbar span").html(stringjam + ":" + stringmenit + " " + dn + "<br>" + sekarang.getDate() + "/" + sekarang.getMonth() + "/" + sekarang.getFullYear());
setTimeout(tampilkanwaktu, 1000);
}
function SetFrameURL(addr) {
//if (addr.substring(0, 7) != "//" && addr.substring(0, 8) != "https://") addr = "//" + addr;
var frame = document.getElementById('loadurl');
frame.src = addr;
}
function outf(text) {
var mypre = document.getElementById("yourcode");
mypre.value += text;
}
function builtinRead(x)
{
if (Sk.builtinFiles === undefined || Sk.builtinFiles["files"][x] === undefined)
throw "File not found: '" + x + "'";
return Sk.builtinFiles["files"][x];
}
function runit(prog) {
Sk.configure({output:outf,
read: builtinRead
});
try {
Sk.importMainWithBody("<stdin>",false,prog);
} catch (e) {
document.getElementById("yourcode").value += e + '\n';
}
}
</script>
</body>
</html>