From 2786143669479ff69883ed6bf61be78c740d48c1 Mon Sep 17 00:00:00 2001 From: Hardmath123 <hardmath123@gmail.com> Date: Mon, 4 Nov 2013 18:52:33 -0800 Subject: [PATCH] Fixed clicking bug and added changes to the COMPARE page. --- compare.html | 40 ++++++++++++++++++---------------------- js/IO.js | 1 + js/Sprite.js | 7 ++++--- player.css | 2 +- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/compare.html b/compare.html index 1e89b26..fd4b25c 100644 --- a/compare.html +++ b/compare.html @@ -7,16 +7,9 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past <head> <title>Scratch HTML5 vs. Flash</title> <meta charset="utf-8"> - <style type="text/css"> - body { - background: #222; - color: #fff; - margin: 0; - } - </style> <link href="player.css" type="text/css" rel="stylesheet" /> - <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="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> + <script src="http://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> @@ -89,14 +82,23 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past </head> <body> <div style="display: inline-block;"> - <div id="up"> </div> - <div id="left"> </div> - <div id="overContainer"> - <div id="greenSlide"><div id="greenSlideFg"><img src="img/greenflag.png"></div></div> - <div id="container"></div> + <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="right"> </div> - <div id="down"> </div> + <div id="left">◀</div> + <div id="overContainer"> + <div id="greenSlide"><div id="greenSlideFg"><img src="img/greenflag.png"></div></div> + <div id="container"></div> + </div> + <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> + </div> <div style="display: inline-block;"> <div id="flashScratch" style="text-align:center;visibility:hidden;"> @@ -106,11 +108,5 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past </a> </div> </div> - <div id="info">Loading...</div> - - <button id="trigger_green_flag">Green flag</button> - <button id="trigger_stop">Stop</button> - - <input type="text" name="project_id" id="project_id" /><button id='go_project'>Go!</button> </body> </html> diff --git a/js/IO.js b/js/IO.js index b9a726c..bcb336b 100644 --- a/js/IO.js +++ b/js/IO.js @@ -27,6 +27,7 @@ var IO = function() { // In production, simply use the local path (no proxy) // since we won't be hampered by the same-origin policy. this.base = 'proxy.php?resource=internalapi/'; + //this.base = 'http://scratch.mit.edu/internalapi/'; // Final base this.project_base = this.base + 'project/'; this.project_suffix = '/get/'; this.asset_base = this.base + 'asset/'; diff --git a/js/Sprite.js b/js/Sprite.js index 48a1a64..e9eb141 100644 --- a/js/Sprite.js +++ b/js/Sprite.js @@ -196,9 +196,10 @@ Sprite.prototype.updateCostume = function() { Sprite.prototype.onClick = function(evt) { // TODO - needs work!! - var boxOffset = $('#container').offset(); - var mouseX = runtime.mousePos[0] + 240 + boxOffset.left; - var mouseY = 180 - runtime.mousePos[1] + boxOffset.top; + + // We don't need boxOffset anymore. + var mouseX = runtime.mousePos[0] + 240; + var mouseY = 180 - runtime.mousePos[1]; if (this.mesh.src.indexOf('.svg') == -1) { // HACK - if the image SRC doesn't indicate it's an SVG, diff --git a/player.css b/player.css index fc91ea4..f64944b 100644 --- a/player.css +++ b/player.css @@ -2,7 +2,7 @@ body { background: #fff; color: #333; margin: 0; - padding: 30px; + padding: 0px; font-family: sans-serif; } /* Wrapper wraps the entire player, and the text below and above. Ideally,