2013-10-28 16:00:20 -04:00
< ?
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
<!DOCTYPE html>
< html >
2013-11-01 22:44:51 -04:00
< head >
< title > Scratch HTML5 vs. Flash< / title >
< meta charset = "utf-8" >
< link href = "player.css" type = "text/css" rel = "stylesheet" / >
2013-11-04 01:11:05 -05:00
< link href = "compare.css" type = "text/css" rel = "stylesheet" / >
2013-11-01 22:44:51 -04:00
< script src = "//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" > < / script >
< script src = "//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" > < / script >
< script src = "js/util/Timer.js" > < / script >
< script src = "js/util/OffsetBuffer.js" > < / script >
< script src = "js/util/Color.js" > < / script >
< script src = "js/util/Rectangle.js" > < / script >
< script src = "js/Sprite.js" > < / script >
< script src = "js/Reporter.js" > < / script >
< script src = "js/Stage.js" > < / script >
< script src = "js/sound/WAVFile.js" > < / script >
< script src = "js/sound/SoundDecoder.js" > < / script >
< script src = "js/sound/SoundBank.js" > < / script >
< script src = "js/sound/NotePlayer.js" > < / script >
< script src = "soundbank/Instr.js" > < / script >
< script src = "js/IO.js" > < / script >
< script src = "js/primitives/VarListPrims.js" > < / script >
< script src = "js/primitives/MotionAndPenPrims.js" > < / script >
< script src = "js/primitives/LooksPrims.js" > < / script >
< script src = "js/primitives/SensingPrims.js" > < / script >
< script src = "js/primitives/SoundPrims.js" > < / script >
< script src = "js/primitives/Primitives.js" > < / script >
< script src = "js/Interpreter.js" > < / script >
< script src = "js/Runtime.js" > < / script >
< script src = "js/Scratch.js" > < / script >
< script type = "text/javascript" >
if (window.location.hash) {
var project_id = parseInt(window.location.hash.substr(1));
} else {
var project_id = 10000160; // Default project for display
}
< / script >
< script >
2013-11-04 01:11:05 -05:00
var flashLog = null;
2013-11-01 22:44:51 -04:00
$(function() {
// The flashvars tell flash about the project data (and autostart=true)
var flashvars = {
server: encodeURIComponent('scratch.mit.edu'),
2013-11-04 01:11:05 -05:00
debugOps: true,
debugOpCmd: 'debugFlash',
2013-11-01 22:44:51 -04:00
project_id: project_id
};
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
var params = {
allowscriptaccess: 'always',
allowfullscreen: 'false',
wmode: 'direct',
menu: 'false'
};
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
var flashPlayer = null;
//var swf_url = "http://cdn.scratch.mit.edu/scratchr2/static/Scratch.swf";
var swf_url = "http://jiggler.media.mit.edu/shanemc/scratchr2/static/Scratch.swf";
2013-11-04 01:11:05 -05:00
swfobject.embedSWF(swf_url, "flashScratch", "482", "402", "10.2.0",
2013-11-01 22:44:51 -04:00
"http://cdn.scratch.mit.edu/scratchr2/static/expressInstall.swf",
flashvars, params, null, function(e) {
$('#flashScratch').css('visibility', 'visible');
if (e.success) flashPlayer = e.ref;
});
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
$('#trigger_green_flag, #greenSlide').click(function() {
flashPlayer.ASstartRunning();
});
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
// Stop button behavior
$('#trigger_stop').click(function() {
flashPlayer.ASstopRunning();
});
2013-11-04 01:11:05 -05:00
flashLog = $('#flashDebug');
var jsLog = $('#jsDebug');
interp.debugOps = true;
interp.debugFunc = function(opCount, opName, args) {
var text = opCount + ': '+opName+'('+args.join(', ')+')';
jsLog.val(jsLog.val() + text + "\n");
}
// Setup synchronized scrolling
flashLog.scroll(function() {
jsLog.scrollTop(flashLog.scrollTop());
});
jsLog.scroll(function() {
flashLog.scrollTop(jsLog.scrollTop());
});
2013-11-01 22:44:51 -04:00
});
2013-11-04 01:11:05 -05:00
function debugFlash(opCount, opName, args) {
var text = opCount + ': '+opName+'('+args.join(', ')+')';
flashLog.val(flashLog.val() + text + "\n");
}
2013-11-01 22:44:51 -04:00
< / script >
< / head >
< body >
2013-11-04 01:11:05 -05:00
< div class = "playerContainer" >
2013-11-04 21:52:33 -05:00
< div id = "up" > ▲ < / div >
< div id = "ui-top" >
< div id = "info" > Loading… < / div >
< button id = "trigger_stop" > ■ < / button >
< button id = "trigger_green_flag" > ⚑ < / button >
< div class = "clearer" > < / div >
< / div >
< div id = "left" > ◀ < / div >
2013-11-01 22:44:51 -04:00
< div id = "overContainer" >
2013-11-04 21:52:33 -05:00
< div id = "greenSlide" > < div id = "greenSlideFg" > < img src = "img/greenflag.png" > < / div > < / div >
< div id = "container" > < / div >
2013-11-01 22:44:51 -04:00
< / div >
2013-11-04 21:52:33 -05:00
< div id = "right" > ▶ < / div >
< div id = "ui-bottom" >
< span id = "address-hint" > http://scratch.mit.edu/projects/< / span > < input type = "text" name = "project_id" id = "project_id" placeholder = "10000160" / > < button id = 'go_project' > → < / button > < / div >
< div id = "down" > ▼ < / div >
2013-11-04 01:11:05 -05:00
< textarea id = "jsDebug" > < / textarea >
2013-10-28 16:00:20 -04:00
< / div >
2013-11-04 01:11:05 -05:00
< div class = "playerContainer" >
2013-11-01 22:44:51 -04:00
< div id = "flashScratch" style = "text-align:center;visibility:hidden;" >
< p style = "color:#aaa;font-size:22px;margin-top:14px;line-height:28px;" > Oh Noes! Scratch project cannot display.< br / > Flash player is disabled, missing, or less than version 10.2.< / p >
< a href = "http://www.adobe.com/go/getflashplayer" >
< img src = "http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt = "Get Adobe Flash player" target = "_blank" / >
< / a >
< / div >
2013-11-04 01:11:05 -05:00
< textarea id = "flashDebug" > < / textarea >
2013-10-28 16:00:20 -04:00
< / div >
2013-11-01 22:44:51 -04:00
< / body >
2013-10-28 16:00:20 -04:00
< / html >