Header left.png

Difference between revisions of "MediaWiki:Common.js"

From Systems Group
Jump to: navigation, search
(Created page with "Any JavaScript here will be loaded for all users on every page load.: alert(mw.config.get('wgArticleId'));")
 
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
alert(mw.config.get('wgArticleId'));
+
var eggTimer;
 +
 
 +
if (mw.config.get('wgArticleId') == 236) {
 +
  var element = document.querySelector(".image");
 +
  element.onmouseover = function() {
 +
  eggTimer = setTimeout(function() {egg();}, 5000);
 +
  };
 +
 
 +
  element.onmouseout = function() {
 +
  clearTimeout(eggTimer);
 +
  };
 +
}
 +
 
 +
function egg()
 +
{
 +
    var bioDiv = document.getElementById("nkrns-bio");
 +
    bioDiv.innerHTML = "Personally defeated Dwayne \"The Rock\" Johnson in an arm wrestling contest<br/>Is such a fan of Microsoft that I had Windows installed in my own home and cars<br/>" +
 +
                      "Survived being struck by an atomic bomb by hiding in a refrigerator<br/>Invented Australia, but not New Zealand<br/>" +
 +
                      "Personally responsible for the extinction of a small, aquatic species that you probably have not heard of (because they’re extinct)<br />" +
 +
                      "Came up with an idea for a website that allowed people in Harvard to add each other as friends, but it was stolen from me<br />" +
 +
                      "Single-handedly defeated Kerafyrm<br />Once installed Microsoft Office 2013 alongside Microsoft Office 2010 despite overwhelming evidence that it \"cannot be done\"<br />" +
 +
                      "Later apologized to Dwayne for potentially ruining his image<br />Once ate an entire fiery hawaiian pizza without crying";
 +
}

Latest revision as of 20:13, 28 July 2014

/* Any JavaScript here will be loaded for all users on every page load. */
var eggTimer;

if (mw.config.get('wgArticleId') == 236) {
  var element = document.querySelector(".image");
  element.onmouseover = function() {
   eggTimer = setTimeout(function() {egg();}, 5000);
  };

  element.onmouseout = function() {
   clearTimeout(eggTimer);
  };
}

function egg()
{
    var bioDiv = document.getElementById("nkrns-bio");
    bioDiv.innerHTML = "Personally defeated Dwayne \"The Rock\" Johnson in an arm wrestling contest<br/>Is such a fan of Microsoft that I had Windows installed in my own home and cars<br/>" +
                       "Survived being struck by an atomic bomb by hiding in a refrigerator<br/>Invented Australia, but not New Zealand<br/>" +
                       "Personally responsible for the extinction of a small, aquatic species that you probably have not heard of (because they’re extinct)<br />" +
                       "Came up with an idea for a website that allowed people in Harvard to add each other as friends, but it was stolen from me<br />" +
                       "Single-handedly defeated Kerafyrm<br />Once installed Microsoft Office 2013 alongside Microsoft Office 2010 despite overwhelming evidence that it \"cannot be done\"<br />" +
                       "Later apologized to Dwayne for potentially ruining his image<br />Once ate an entire fiery hawaiian pizza without crying";
}