Jump to content

User:Addshore/functions.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Addshore (talk | contribs) at 13:06, 6 November 2008 (Adding functions code). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//include_js function (might be used in here somewhere)
function include_js(includedscript) 
{
  var i;
  if (include_js.arguments.length>0) 
  {
    document.write('<'+'script type="text/javascript" src="'
                 + 'http://en.wikipedia.org/w/index.php?title=User:'+ includedscript + '.js'
                 + '&action=raw&ctype=text/javascript&dontcountme=s"></'+'script>');
    i=1;
    while (i < include_js.arguments.length)
    {
      if (typeof(include_js.arguments[i]) == "string" )
      {
        i++;
        if (i < include_js.arguments.length)
        {
          window[include_js.arguments[i-1]] = include_js.arguments[i];
          i++;
        } else {
          alert ("Variable "+ include_js.arguments[i-1] +" specified, but no value provided."); return; 
        } 
      } else {
          alert ("Bad name for variable"); return;
      }
    }
  } else { 
    alert ("No script name provided."); 
  }
}

//JSlauncher function (might be used in here somewhere)
function JSlauncher()
{
if (location.href.indexOf('&JScript=') != -1)
  {
  var target = location.href.split('&JScript=')[1];
  location.href = "javascript:" + target;
  }
}