udance4ever

SplashScreenPlugin

Jun 10th, 2021
842
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var old_lewcid_splash_restart=restart;
  2.  
  3. restart = function()
  4. {   if (document.getElementById("SplashScreen"))
  5.         document.getElementById("SplashScreen").style.display = "none";
  6.       if (document.getElementById("contentWrapper"))
  7.         document.getElementById("contentWrapper").style.display = "block";
  8.    
  9.     old_lewcid_splash_restart();
  10.    
  11.     if (splashScreenInstall)
  12.        {if(config.options.chkAutoSave)
  13.             {saveChanges();}
  14.         displayMessage("TW SplashScreen has been installed, please save and refresh your TW.");
  15.         }
  16. }
  17.  
  18.  
  19. var oldText = store.getTiddlerText("MarkupPreHead");
  20. if (oldText.indexOf("SplashScreen")==-1)
  21.    {var siteTitle = store.getTiddlerText("SiteTitle");
  22.    var splasher='\n\n<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>'+siteTitle +'</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>';
  23.    if (! store.tiddlerExists("MarkupPreHead"))
  24.        {var myTiddler = store.createTiddler("MarkupPreHead");}
  25.    else
  26.       {var myTiddler = store.getTiddler("MarkupPreHead");}
  27.       myTiddler.set(myTiddler.title,oldText+splasher,config.options.txtUserName,null,null);
  28.       store.setDirty(true);
  29.       var splashScreenInstall = true;
  30. }
RAW Paste Data