User:Moviesign/common.js

/* This first attempt to add a double-click even handler to the image did not work */ //var x = document.getElementsByClassName("portable-infobox")[0]; //if (x.length > 0) { //   var list = x.getElementsByTagName("FIGURE"); //   var i; var a; var img; //   for (i = 0; i < list.length; i++) { //       a = list[i].getElementsByTagName("A")[0]; //       img = a.getElementsByTagName("IMG")[0]; //       if (img.hasAttribute("data-image-name")) { //           a.addEventListener("dblclick", myFunction(img.getAttribute("data-image-name"))); //       } //    } //}

/* This code will enable the "info-icon" when you hover your mouse over an image inside a portable infobox. */ /* var portbox = document.getElementsByClassName("portable-infobox"); if (portbox.length > 0) { var list = portbox[0].getElementsByTagName("FIGURE"); var i;   for (i = 0; i < list.length; i++) { list[i].className += " article-thumb show-info-icon"; var img = list[i].getElementsByTagName("IMG")[0]; img.className += " thumbimage"; var node = document.createElement("A"); node.href = "/wiki/File:" + img.getAttribute("data-image-name"); node.className = "sprite info-icon"; if (list[i].getElementsByTagName("FIGCAPTION").length <= 0) { list[i].appendChild(document.createElement("FIGCAPTION")); }       list[i].getElementsByTagName("FIGCAPTION")[0].appendChild(node); } } //function myFunction(filename) { //   location.pathname = "/wiki/File:" + filename; //} /* Set to false to put QuickTools in My Tools window.QuickToolsAdvancedtop = false; */

importArticles({   type: 'script',    articles: [ /* This will allow a user to rename a category. Use with caution */        'u:dev:CategoryRenameAuto-update/code.js', /* This will allow a user to rename File: pages and update all links. */        'u:dev:MediaWiki:FileUsageAuto-update/code.js', /* This import will add buttons to switch between skins with one click         'u:dev:SkinSwitchButton/code.js', */ /* This import will add handy functions to a user's contributions page */        'u:dev:MediaWiki:WHAM/code.2.js', /* This import is an upgrade to WHAM with more tools (that doesn't work very well)        'u:dev:MediaWiki:QuickToolsv2/code.js', */ /* This import will open a modal dialog to view diffs and take action */        'u:dev:MediaWiki:QuickDiff/code.js', /* This import will add the forms to the DM's Helper Tool 3e page        'MediaWiki:DMsHelper3e.js' */    ] });

/* Only needed if WHAM is uncommented above */ WHAMBotMe = true; WHAMBotReason = "Cleanup"; WHAMDelay = 300; WHAMDeleteReason = "Housekeeping."; WHAMBlockReason = "Vandalism";