User:Cizagna/global.js

if( wgNamespaceNumber == -1 ) { importScriptPage('User:Cizagna/contribtools.js', 'community'); importScriptPage('User:Cizagna/filelisttools.js', 'community'); } else { importScriptPage('User:Cizagna/mwcustomeditbtns.js', 'community'); importScriptPage('User:Cizagna/forumtools.js', 'community'); importScriptPage('User:Cizagna/ajaxpatrollinks.js', 'community'); importScriptPage('FastDelete/code.js', 'dev'); // *****************************************************************	// Adds custom automatic one-click delete tabs to any deletable page. var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label' : 'S'}; if ( skin != 'answers' || wgAction != 'view' ) importScriptPage('EditIntroButton2/code.js', 'dev'); // *****************************************************************	// Subpages tab if(wgNamespaceNumber!=-1) addOnloadHook(function { addTabForXSkin('ca-subpages','/wiki/Special:Prefixindex/' + encodeURIComponent(wgPageName),'Show subages of ' + wgPageName,'SubP') } ); /* Fix for Blogs in Monobook */ 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); }	} }

// ***************************************************************** // Alternating skin tabs function skinview { var skinlink = document.location.href; var antiskin;

if(skinlink.indexOf('?')==-1) skinlink += '?'; else skinlink += '&'; skinlink += 'useskin=';

switch( skin ) { case 'awesome': case 'monaco_old': case 'monaco': antiskin = 'monobook'; break;

case 'uncyclopedia': case 'wowwiki': case 'lostbook': case 'monobook': antiskin = 'monaco'; break;

case 'answers': return; }

addTabForXSkin('ca-skin0',skinlink + antiskin,'View ' + antiskin + ' skin','CS');

switch( skin ) { case 'uncyclopedia': case 'wowwiki': case 'lostbook': case 'monobook': addTabForXSkin('ca-skin1',skinlink + antiskin + '&usetheme=custom','View ' + antiskin + ' custom skin','VMCS'); break; }	addTabForXSkin('ca-skin2',skinlink + 'wikia','View Wikia skin','VWS'); } addOnloadHook(skinview);

// ***************************************************************** // Add Tab For X Skin function addTabForXSkin(id,href,title,text) { if( !document.getElementById( id ) ) return; switch( skin ) { case 'answers': $( ' ' ).appendTo( '#qa_toolbox_advancedtools_wrapper' ); $( ' ' + text + ' ' ).appendTo( '#qa_toolbox_advancedtools' ); break;

case 'awesome': case 'monaco_old': case 'monaco': $( '' + text + '' ).appendTo( '#page_controls' ); break; case 'uncyclopedia': case 'wowwiki': case 'lostbook': case 'monobook': $( '' + text + '' ).appendTo( '#p-cactions > .pBody > ul' ); break; case 'oasis': case 'wikia': if( $('a[data-id="' + id + '"]').length == 0 ) return; atfxs = '' + text + ''; switch( wgNamespaceNumber ) { case 1: case 5: case 7: case 9: case 11: case 13: case 14: case 15: case 111: case 401: $('header.WikiaPageHeader > h2').before(atfxs); break; case 2: case 3: $('div.WikiaUserPagesHeader > ul.wikia-avatar').after(atfxs); break; case 500: case 502: $('div.WikiaUserPagesHeader > h1').after(atfxs); break; default: $('header.WikiaPageHeader > details').before(atfxs); break; }			break; } };