User:Xd1358/global.js

// Fix for Blogs in Monobook. By wikia:User:Ciencia Al Poder if (window.wgNamespaceNumber == 500) { if (jQuery.prototype.jquery == '1.3.2') { importScriptURI(stylepath+'/common/jquery/jquery-1.4.2.js?'+wgStyleVersion); importScriptURI(stylepath+'/common/jquery/jquery.json-1.3.js?'+wgStyleVersion); importScriptURI(stylepath+'/common/jquery/jquery.cookies.2.1.0.js?'+wgStyleVersion); importScriptURI(stylepath+'/common/jquery/jquery.dump.js?'+wgStyleVersion); importScriptURI(stylepath+'/common/jquery/jquery.wikia.js?'+wgStyleVersion); importScriptURI(stylepath+'/common/jquery/jquery-ui-1.7.2.custom.js?'+wgStyleVersion); importScriptURI(stylepath+'/common/jquery/jquery.timeago.js?'+wgStyleVersion); }	if (!window.ArticleComments) { importScriptURI(wgExtensionsPath+'/wikia/ArticleComments/js/ArticleComments.js?'+wgStyleVersion); importStylesheetURI(wgExtensionsPath+'/wikia/ArticleComments/css/ArticleComments.css?'+wgStyleVersion); importStylesheetURI(wgExtensionsPath+'/wikia/Blogs/css/Blogs.css?'+wgStyleVersion); } }

// Adds an "Oasis"-button to Monobook; by User:Tm_T function add_skin_tab {   var URL = wgServer + wgScript + '?title=' + wgPageName + '&useskin=wikia' addPortletLink('p-cactions', URL, "oasis"); } addOnloadHook(add_skin_tab);

// Patch for MWSggest, broken by Wikia $(function {	if (!window.os_MWSuggestInit) {		importScriptURI(stylepath+'/common/mwsuggest.js?'+wgStyleVersion);	} });

//Something, by User:Tm_T -- Adding the editcount to p-personal function add_editcount {    var URL = '/wiki/Special:Editcount/'+wgUserName addPortletLink('p-personal', URL, "editcount"); } addOnloadHook(add_editcount);

// Adds a tab next to the regular edit tab which acts as a "section edit" button for the intro (useful on large pages). // Copied from wikipedia:Wikipedia:WikiProject User scripts/Scripts/Add edit section 0 with one slight modification. addOnloadHook(function {    var x;    if (!(x = document.getElementById('ca-edit') )) return;    var url;    if (!(url = x.getElementsByTagName('a')[0] )) return;    if (!(url = url.href )) return;    var y = addPortletLink('p-cactions', url+"&section=0", 'edit intro', 'ca-edit-0', 'Edit the lead section of this page', '0', x.nextSibling);   y.className = x.className;  // steal classes from the the edit tab...    // exception: don't steal the "selected" class unless actually editing section 0:    if (/(^| )selected( |$)/.test(y.className)) {        if (!document.editform || !document.editform.wpSection || document.editform.wpSection.value != "0") {           y.className = y.className.replace(/(^| )selected( |$)/g, "$1");            x.className += ' selected';        }    } });

// Adds a tab to the top of every page on the far right to allow for quickly purging the server cache. // Copied from Wikipedia, source page lost function add_purge_tab { // Only add for pages with the right string somewhere in the title if ((wgCanonicalNamespace != "Special") && (document.title.indexOf("Editing ") == -1)) {     var URL = '/index.php?title=' + wgCanonicalNamespace + ':' + wgTitle + '&action=purge' addPortletLink('p-cactions', URL, "purge"); } }