User:Cizagna/global.js

// ***************************************************************** // 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; } };

/* 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' ); 		} ); } }*/

// ***************************************************************** // Alternating skin tabs function skinview { var skinlink = document.location.href; var antiskin; if ( skinlink.indexOf( '?' ) == -1 ) { skinlink += '?useskin='; } else { skinlink += '&useskin='; } 	switch ( skin ) { case 'awesome': case 'monaco_old': case 'monaco': case 'oasis': case 'wikia': antiskin = 'monobook'; break; case 'uncyclopedia': case 'wowwiki': case 'lostbook': case 'monobook': antiskin = 'wikia'; break; case 'answers': return; } 	addTabForXSkin ( 'ca-skin', skinlink + antiskin , 'View ' + antiskin + ' skin' , 'CS' ); } addOnloadHook ( skinview );