User:UltimateSupreme/global.js

// /* 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" ) { if( server.indexOf( '://' ) == -1 ) url = 'http://' + server + '.wikia.com' + url; else url = server + url; } return importScriptURI(url); }

function importStylesheetPage( page, server ) { var url = '/index.php?title=' + encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') + '&action=raw&ctype=text/css'; if( typeof server == "string" ) { if( server.indexOf( '://' ) == -1 ) url = 'http://' + server + '.wikia.com' + url; else url = server + url; } return importStylesheetURI(url); } //-// // START: CSS/JS Includes // // STATE: alpha           // // IE Compatible? // //-// /* var include = { js: { included: { url: {}, wikipage: {} }, // Raw Function: Do not use. raw: function( src, text ) { var js = document.createElement( 'script' ); if( js.setAttribute ) { js.setAttribute( 'type', 'text/javascript' ); if( typeof src == "string" ) js.setAttribute( 'src', src ); } else { js.type = 'text/javascript'; if( typeof src == "string" ) js.src = src; } if( typeof text == "string" ) { var textNode = document.createTextNode( text ); js.appendChild( textNode ); } document.getElementsByTagName('head')[0].appendChild( js ); }, url: function( url ) { if( include.js.included.url[url] ) return; include.js.included.url[url] = true; include.js.raw( url, undefined ); }, wikipage: function( pageTitle, server, expandTemplates ) { var url = '/index.php?title=' + encodeURIComponent( pageTitle.replace( / /g, '_' ) ) + '&action=raw&ctype=text/javascript'; if( typeof server == "string" ) { if( server.indexOf( '://' ) == -1 ) url = 'http://' + server + '.wikia.com' + url; else url = server + url; } if( expandTemplates != false ) url = url + '&templates=expand'; include.js.url( url ); }, code: function( code ) { include.js.raw( undefined, code ); } }, css: { included: { url: {}, wikipage: {} }, // Raw Function: Do not use. raw: function( text ) { var css = document.createElement( 'style' ); if( css.setAttribute ) { css.setAttribute( 'type', 'text/css' ); } else { css.type = 'text/css'; } if( typeof text == "string" ) { var textNode = document.createTextNode( text ); css.appendChild( textNode ); } document.getElementsByTagName('head')[0].appendChild( css ); }, url: function( url ) { if( include.css.included.url[url] ) return; include.css.included.url[url] = true; include.css.raw( '@import "' + url + '";' ); }, wikipage: function( pageTitle, server, expandTemplates ) { var url = '/index.php?title=' + encodeURI( pageTitle ) + '&action=raw&ctype=text/css'; if( typeof server == "string" ) { if( server.indexOf( '://' ) == -1 ) url = 'http://' + server + '.wikia.com' + url; else url = server + url; } if( expandTemplates != false ) url = url + '&templates=expand'; include.css.url( url ); }, code: function( code ) { include.css.raw( code ); } } };

function queryString(key, dataOnly) { var re = RegExp('[&?]'+key+'=([^&]*)'); var matches; matches = re.exec(document.location); if( !matches ) matches = re.exec(document.location); if( matches ) if( matches.length > 1 ) return decodeURI(matches[1]); return ( dataOnly ? '' : null ); }; //

// DO NOT COPY THIS! //'This code is hosted off the Wiki-Tools servers, if you wish to enable a syntax highlighting editor, download editarea from sourceforge and host it on your own. You can probably do this off your own computer or even off a POW server if you have Firefox.'

//

/*include.js.url( 'http://skins.wiki-tools.com/libs/editarea/edit_area/edit_area_compressor.php?plugins' ); function initEditArea { var wpTextbox1 = document.getElementById( 'wpTextbox1' ); if( wpTextbox1 ) { editAreaLoader.init({ id: "wpTextbox1", min_width: 250, min_height: 100, syntax: "wikitext", start_highlight: true, allow_resize: "both", allow_toggle: true, plugins: "syntax_selection, charmap, importtext", toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font, |, change_smooth_selection, highlight, reset_highlight, |, charmap, |, syntax_selection, |, importtext, |, help", syntax_selection_allow: "wikitext,html,xml,js,css,php,python", charmap_default: "arrows", yui_build_dir: "http://skins.wiki-tools.com/libs/yui/build" }); } }*/

// /* var ACGinitialized; var mwNamespaces; var mwGroups; if( !ACGinitialized ) { var cancelAnime = true; if( !mwNamespaces ) var overrideNamespaces = 'User:Dantman/namespaces.js'; if( !mwGroups ) var overrideGroups = 'User:Dantman/groups.js'; //include.js.wikipage( 'MediaWiki:Anime-Common.js', 'anime' ); /*Wii note: Please replace spaces with tabs.*/ //include.css.wikipage( 'MediaWiki:Tabs.css', 'anime' );      include.css.wikipage( 'MediaWiki:Searchswitch.css', 'anime' ); /*End Wii note*/ /*} include.js.wikipage( 'User:Dantman/global.config.js', 'www' );*/

//include.js.url( 'http://localhost:6670/SSwap.js' ); //include.js.url( 'http://localhost:6670/treeview.js' );

if ( ( skin === "oasis" || skin === "wikia" ) && wgAction !== "edit" ) { importStylesheetPage("User:Dantman/global.css", "community"); jQuery(function($) {       $(' Recent Changes').insertAfter("#WikiHeader .buttons .wikia-button[data-id=wikiactivity]").before(' ');    }); }

/* */

/* Auto updating recent changes opt-in * See w:c:dev:AjaxRC for info & attribution */

AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; importScriptPage('AjaxRC/code.js', 'dev');

/* Custom edit buttons * Original by User:Grunny */

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/7/73/Button_code_nowiki.png?1", "speedTip": "code+nowiki", "tagOpen": " ", "sampleText": "Insert code here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/29/Button_user.png?1", "speedTip": "Global user template", "tagOpen": "", "tagClose": "", "sampleText": ""};

/* Add stuff to user menu */

function UserContribsMenuItem { $('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('Contributions'); } addOnloadHook(UserContribsMenuItem);

function FollowingMenuItem { $('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('Followed pages'); } addOnloadHook(FollowingMenuItem);

/* Get rid of lame touchscreen CSS */

$('link[media=screen]')[0].disabled=true;

/* */

importScriptPage('FixWantedFiles/code.js', 'dev'); importScriptPage('PurgeButton/code.js', 'dev' ); importScriptPage( 'InactiveUsers/code.js', 'dev' ) ; importScriptPage( 'AjaxBatchDelete/code.js', 'dev' ) ; /** * Kill image lightbox by User:Mathmagician, 6 August 2012 * http://community.wikia.com/wiki/User:Mathmagician/killImageLightbox.js * - Kills image lightbox so that clicking an image takes you to the File: * - Videos use the same LightboxLoader.handleClick method that images do, *    so if that method is deleted, then videos can no longer be played, *    but this version uses a trick/hack to make sure that if a video is *     clicked, then the LightboxLoader.handleClick is still called properly */ $(function {    if ("oasis" != skin && "wikia" != skin) return;

var clickedVideo = false;

function killImageLightbox { // hack to not kill lightbox for videos if (window.LightboxLoader && !LightboxLoader.handleClickOverride) { LightboxLoader.handleClickOverride = LightboxLoader.handleClick; LightboxLoader.handleClick = function { if (clickedVideo) { clickedVideo = false; LightboxLoader.handleClickOverride.apply(this, arguments); }           };        }    }    // playing it safe... killImageLightbox; setTimeout(killImageLightbox, 2000); setTimeout(killImageLightbox, 5000); setTimeout(killImageLightbox, 8000);

// hack to not kill lightbox for videos $('a[data-video-name]').click(function {        clickedVideo = true;        console.log('clickedVideo == true');    }); // href to File: page $('a[data-image-name]') .each(function {        var $this = $(this);        var e = encodeURIComponent($this.attr('data-image-name').replace(/ /g, '_'));        $this.attr('href', '/wiki/File:' + e);    }); });

/* - */ /* -- END infile scripts --- */ /* - */ } /* */