MediaWiki:Common.js

/* // Wikia's own WikiaScriptLoader isn't automatically included in other skins such as monobook. // Presumably this is because they no longer support them. This checks to see if WikiaScriptLoader // function reference has been declared, and if it has not, it creates it. Backwards compatibility // for everybody! - Blame User:Tierrie @ DA Wiki if this works. Blame someone else if it breaks. // Note: This script is copied from DragonAge.Wikia.com

if(typeof WikiaScriptLoader === 'undefined') { var WikiaScriptLoader=WikiaScriptLoader?WikiaScriptLoader:function{var b=navigator.userAgent.toLowerCase;this.useDOMInjection=b.indexOf("opera")!=-1||b.indexOf("firefox")!=-1&&b.indexOf("/4.0b")==-1;this.isIE=b.indexOf("opera")==-1&&b.indexOf("msie")!=-1;this.headNode=document.getElementsByTagName("HEAD")[0]}; WikiaScriptLoader.prototype={loadScript:function(b,c){this.useDOMInjection?this.loadScriptDOMInjection(b,c):this.loadScriptDocumentWrite(b,c)},loadScriptDOMInjection:function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;var d=function{a.onloadDone=true;typeof c=="function"&&c};a.onloadDone=false;a.onload=d;a.onreadystatechange=function{a.readyState=="loaded"&&!a.onloadDone&&d};this.headNode.appendChild(a)},loadScriptDocumentWrite:function(b,c){document.write('<\/script>');var a=function{typeof c=="function"&&c};typeof c=="function"&&this.addHandler(window,"load",a)},loadScriptAjax:function(b,c){var a=this,d=this.getXHRObject;d.onreadystatechange=function{if(d.readyState==4){var e=d.responseText;if(a.isIE)eval(e);else{var f=document.createElement("script");f.type="text/javascript";f.text=e;a.headNode.appendChild(f)}typeof c=="function"&&c}};d.open("GET",b,true);d.send("")},loadCSS:function(b,c){var a=document.createElement("link"); a.rel="stylesheet";a.type="text/css";a.media=c||"";a.href=b;this.headNode.appendChild(a)},addHandler:function(b,c,a){if(window.addEventListener)window.addEventListener(c,a,false);else window.attachEvent&&window.attachEvent("on"+c,a)},getXHRObject:function{var b=false;try{b=new XMLHttpRequest}catch(c){for(var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"],d=a.length,e=0;e<d;e++){try{b=new ActiveXObject(a[e])}catch(f){continue}break}}return b}};window.wsl=new WikiaScriptLoader; }

/******************** Load Style Sheet

// Template:Questinfo importStylesheet('Template:Questinfo/Stylesheet.css');

// Template:Ambox importStylesheet("Template:Ambox/code.css");

// Template:Forum importStylesheet("Template:Forum/code.css");

/******************** Load Script Page

// w:c:dev:SkinSwitchButton importScriptPage('SkinSwitchButton/code.js', 'dev');

// ADVANCED AJAX AUTO-REFRESHING ARTICLES //importScriptPage('UWO_Script:Auto_Refresh.js');

// AJAX RC imported /* try to use dev.wikia.com version with getCookie and setCookie */ importScriptPage('AjaxRC/code.js', 'dev'); var ajaxIndicator = 'http://images1.wikia.nocookie.net/__cb20080505054258/wowwiki/images/0/0e/Progressbar.gif';

// Delete Bot importScriptPage('User:Grunny/bdel.js', 'firefly');

// Show/Hide Table from http://dev.wikia.com/wiki/Help:Dynamic_navigation importScriptPage('UWO_Script:ShowHide.js');

// http://dev.wikia.com/wiki/BotoneraPopups importScriptURI('http://dev.wikia.com/wiki/BotoneraPopups/Code/en.js?action=raw&ctype=text/javascript&templates=expand'); importStylesheetPage('BotoneraPopups/code.css', 'dev');

// All BioBrain Templates Scripts importScriptPage('Template:BioScript.js');

// All UW Templates Scripts importScriptPage('UW-Templates:Script.js');

/****************************** Temporarily Unused Script

/* // w:c:dev:ShowHide importScriptPage('ShowHide/code.js', 'dev');

// Automatically refreshing RecentChanges importScriptPage('AjaxRC/code.js', 'dev');

function importScriptPage(page, server) { var url = '/index.php?title=' + encodeURIComponent(page.replace(/ /g, '_')).replace('%2F', '/').replace('%3A', ':') + '&action=raw&ctype=text/javascript'; if (typeof server == "string") url = (server.indexOf('://') == -1) ? 'http://' + server + '.wikia.com' + url : server + url; return importScriptURI(url); }