Skip to content

Commit

Permalink
Add startup code for use with macgap binary release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Malone committed Sep 11, 2014
1 parent d8fb931 commit a772c61
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion full/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@
localStorage["pr2"]=15;
localStorage["qa2"]=5;
}
if(typeof(macgap)!="undefined") {
// Add some handlers if using MacGap binary
macgap.menu.getItem("Help").submenu().getItem("JS Timer Help").setCallback(
function() { goHelp(); } );
macgap.menu.getItem("Run").submenu().getItem('Preset 1').setCallback(
function() { document.getElementById('preset0').click(); } );
macgap.menu.getItem("Run").submenu().getItem('Preset 2').setCallback(
function() { document.getElementById('preset1').click(); } );
macgap.menu.getItem("Run").submenu().getItem('Preset 3').setCallback(
function() { document.getElementById('preset2').click(); } );
macgap.menu.getItem("Run").submenu().getItem('Demo').setCallback(
function() { document.getElementById('demo').click(); } );
macgap.menu.getItem("Run").submenu().getItem('Clock').setCallback(
function() { showClock(); } );
} // End macgap setup
setupGui();
updateDisplay();
}
Expand All @@ -160,7 +175,9 @@

function handleKey(evt) {
var theKey=(evt.which) ? evt.which : evt.keyCode;
evt.preventDefault();
if(theKey>111 && theKey< 116) {
evt.preventDefault();
}
var running=0;
if (document.getElementById('gui').style.visibility=='hidden') {
var running=1;
Expand Down

0 comments on commit a772c61

Please sign in to comment.