User:Eirikr/common.js

/*

Orange links for missing langs
*/

// ⇒ Commented out since it seems to play funny with the per-browser prefs. // ⇒ 2013-01-29: Uncommenting since I'm not using per-browser prefs. //importScript('User:Yair rand/orangelinks2.js'); mw.loader.load('/w/index.php?title=User:Yair rand/orangelinks2.js&action=raw&ctype=text/javascript');

/*

Make and and redlinks in headers apparent in TOC
*/

//addOnloadHook jQuery( document ).ready(

function {    if(! document.getElementById) return; var toc = document.getElementById('toc'); if(! toc) return; if(! toc.getElementsByTagName) return; toc = toc.getElementsByTagName('a'); for(var i = 0; i < toc.length; ++i) {      var link = toc[i]; var target = link.hash.substr(1); if(! target || ! target.length) continue; target = document.getElementById(target); if(! target) continue; if(target.getElementsByTagName('a').length > 0) if(target.getElementsByTagName('a')[0].className == 'new') link.className = 'new'; var firstChild = target.childNodes[0]; if(firstChild.nodeType != Node.ELEMENT_NODE) continue; if(firstChild.tagName == 'S' || firstChild.tagName == 'STRIKE') {        var s = document.createElement('s'); while(link.childNodes.length > 0) s.appendChild(link.childNodes[0]); link.appendChild(s); }    }   }

);

/*

Edittools
*/

// mw.loader.load("http://en.wiktionary.org/w/index.php?title=User:Eirikr/edittools.js&action=raw&ctype=text/javascript"); // mw.loader.load('http://en.wiktionary.org/w/index.php?title=User:Eirikr/edittools.js&action=raw&ctype=text/javascript'); //importScript('User:Eirikr/edittools.js');

// This fails to run properly in certain cases due to a race condition -- we wrap this here to ensure the page has loaded first, *then* we run this. jQuery( document ).ready(    function         {             mw.loader.load('/w/index.php?title=User:Eirikr/edittools.js&action=raw&ctype=text/javascript');         }     );

/*

Disabling unwanted MediaWiki-specific keyboard shortcuts
*/ $( function {$( "[accesskey]" ).removeAttr( "accesskey" );});