Skip to content

Commit

Permalink
patch $$ not being defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Bertier committed Mar 23, 2014
1 parent 29e4e65 commit fcdfce2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
15 changes: 10 additions & 5 deletions BBReload.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
function BBLoadScript() {
var jA = document.createElement('script');
jA.setAttribute('id', 'BeachBallSource');
jA.setAttribute('type', 'text/javascript');
jA.setAttribute('src', 'https://raw.github.com/Xenko/BeachBall/beta/BeachBall.js');

setTimeout(function() {document.body.appendChild(jA);}, 1000);
if (typeof($$) != 'undefined') {
var jA = document.createElement('script');
jA.setAttribute('id', 'BeachBallSource');
jA.setAttribute('type', 'text/javascript');
jA.setAttribute('src', 'https://raw.github.com/Xenko/BeachBall/beta/BeachBall.js');

document.body.appendChild(jA);
return;
} else setTimeout(BBLoadScript,1000);
}

function BBDoReload() {
Expand All @@ -16,4 +20,5 @@ function BBDoReload() {
BBLoadScript();
}


$('#optionsItems').append('<br> <div class="minifloatbox"> <a onclick="BBDoReload()"> <h4>Reload BeachBall</h4> </a></div>');
24 changes: 14 additions & 10 deletions BeachBall.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,16 +1253,20 @@ function BeachBallMainProgram() {
}

BeachBall.StartLoop = function () {
BeachBall.Timeout = setTimeout(BeachBallMainProgram, BeachBall.Settings['RefreshRate'].setting);
BeachBall.Timeout = setTimeout(typeof($$) == 'undefined' ? BeachBall.StartLoop : BeachBallMainProgram, BeachBall.Settings['RefreshRate'].setting);
}

//Program Startup
BeachBall.LoadSettings();
BeachBall.LoadAutoclickFav();
BeachBall.CreateMenu();
BeachBall.SpyRefresh();
Molpy.Notify('BeachBall version ' + BeachBall.version + ' loaded for SandCastle Builder version ' + BeachBall.SCBversion, 1);
if (BeachBall.storage == 0) {
Molpy.Notify('No Local Storage Available. BeachBall settings will NOT be saved.',1);
BeachBall.StartProgram = function() {
//Program Startup
BeachBall.LoadSettings();
BeachBall.LoadAutoclickFav();
BeachBall.CreateMenu();
BeachBall.SpyRefresh();
Molpy.Notify('BeachBall version ' + BeachBall.version + ' loaded for SandCastle Builder version ' + BeachBall.SCBversion, 1);
if (BeachBall.storage == 0) {
Molpy.Notify('No Local Storage Available. BeachBall settings will NOT be saved.',1);
}
BeachBall.StartLoop();
}
BeachBall.StartLoop();

BeachBall.StartProgram();

0 comments on commit fcdfce2

Please sign in to comment.