User:Clear Arrow/global.js

(function($, mw) {	'use strict';	var _skin = '',	_init = function {		var url;		if (window.location.href.indexOf('useskin=') == -1) return;		url = _parseURL(window.location.href);		// Si existe propagateskin, se propagará este en los siguientes enlaces en lugar del useskin (p.ej. enlaces para if (url.query.useskin) { _skin = (url.query.propagateskin || url.query.useskin); }		if (_skin) { $(document.body).bind('click.skinpropagation', _clicEvent); $('form').bind('submit.skinpropagation', _submitEvent); }	},	_parseURL = function(url) { var ret = { base:, qs:, query: {}, hash: '' }, loc = url.indexOf('#'), paras, i, p;		if (loc != -1) { ret.hash = url.substr(loc + 1); url = url.substr(0, loc); }		loc = url.indexOf('?'); if (loc != -1) { ret.qs = url.substr(loc + 1); url = url.substr(0, loc); paras = ret.qs.split('&'); for (i = 0; i < paras.length; i++) { p = paras[i].split('='); if (p.length == 2) { ret.query[p[0]] = p[1]; }			}		}		ret.base = url; return ret; },	_getURL = function(url) { var nurl, p;		nurl = url.base + '?'; for (p in url.query) { if (url.query.hasOwnProperty(p) && (url.query[p] || url.query[p] === '')) { nurl += p + '=' + url.query[p] + '&'; }		}		nurl = nurl.substr(0, nurl.length - 1); if (url.hash) { nurl += '#' + url.hash; }		return nurl; },	_clicEvent = function(e) { var url, thisloc; if (e.target.tagName.toLowerCase != 'a') return; if (e.target.href.indexOf(mw.config.get('wgServer')) !== 0) return; url = _parseURL(e.target.href); thisloc = _parseURL(window.location.href); // Si es enlace a sección, no hacer nada if (url.base == thisloc.base && url.qs == thisloc.qs && url.hash) { return; }		if (url.query.useskin && url.query.useskin != _skin) { url.query.propagateskin = _skin; } else { url.query.useskin = _skin; }		e.target.href = _getURL(url); },	_submitEvent = function(e) { var url; if (this.action.indexOf(mw.config.get('wgServer')) !== 0) return; if (this.method.toLowerCase == 'post') { url = _parseURL(this.action); url.query.useskin = _skin; this.action = _getURL(url); } else { $('').val(_skin).appendTo(this); }	},	_addUseSkin = function(url, skin) { var nurl = _parseURL(url); nurl.query.useskin = skin; nurl.query.propagateskin = false; return _getURL(nurl); };	window.SkinPropagation = { addUseSkin: _addUseSkin };	$(_init); })(jQuery, mw);

if (wgCanonicalSpecialPageName == 'Chat') importScriptPage('ChatOptions/code.js', "dev");

window.ajaxSpecialPages = ["Recentchanges", "WikiActivity", "Watchlist", "Log", "Contributions"]; window.ajaxIndicator = 'http://images2.wikia.nocookie.net/__cb20100609110347/software/images/a/a9/Indicator.gif'; window.ajaxRefresh = 30000; window.AjaxRCRefreshText = 'Auto-refresh'; window.AjaxRCRefreshHoverText = 'Actualiza automáticamente la página'; importScriptPage("MediaWiki:ChatHacks.js", "dev"); window.pseudoVector = { loadCss: true, addReadTab: true, addContributionsTab: false, disableWatchIcon: false, visualEditorIcons: false, blacklist: [ 'es.pokemon.wikia.com', 'es.mario.wikia.com', 'es.kirby.wikia.com', "community.wikia.com" ] }; importArticles({   type: 'script',    articles: [        'u:dev:PortableCSSPad/code.js',        'u:dev:WHAM/code.2.js',        'u:dev:View_Source/code.js',        'u:dev:WallGreetingButton/code.js',        'u:dev:RevealAnonIP/usercode.js',        'u:dev:RelatedDiscussionsModule/code.js',        'u:dev:PurgeButton/code.js',        "u:dev:RecentChangesMultiple/code.2.js",        'u:dev:MiniComplete/code.js',        'u:dev:QuickDiff/code.js',        'u:dev:ViewRemoved/code.js',        'u:dev:AjaxRC/code.js',        'u:dev:MediaWiki:Wikimarks/code.js',        "u:dev:MediaWiki:BotoneraPopups/BotoneraPopups.js",        "u:dev:MediaWiki:BotoneraPopups/WikiArticle.js",        'u:dev:Pseudo-Vector.js',        'u:dev:UserWikiInfo/code.js',        "u:dev:MediaWiki:BotoneraPopups/UILang/es.js",        "u:dev:MediaWiki:BotoneraPopups/code.js",        'u:dev:QuickTools/es/advanced.js'    ] });

$(function {    $('.wds-global-navigation__user-menu:not(a)').on('click', function  { window.location.replace('/wiki/Special:MyPage'); });   var oasis;    if (window.location.href.indexOf('?') != -1) {        oasis = window.location.href + '&useskin=wikia';    }    else {        oasis = window.location.href + '?useskin=wikia';    }    $('#p-tb ul').append('Usar oasis'); });

if ({ edit:1, submit:1 }[mw.config.get('wgAction')]) { mw.loader.using('mediawiki.action.edit', function {		if (mw.toolbar) {			mw.toolbar.addButton( 'http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png', 'Redirección', '#REDIRECT ',				'', 'Texto', 'mw-editbutton-redirect' );			mw.toolbar.addButton( 'http://upload.wikimedia.org/wikipedia/commons/b/b6/Button_category_link.png', 'Categoría', '[[Category:',			   ']]', 'Texto', 'mw-editbutton-category' );			mw.toolbar.addButton( 'http://upload.wikimedia.org/wikipedia/commons/9/9e/Btn_toolbar_gallery.png', 'Galería', '',				'Imágenes', 'mw-editbutton-gallery' );		}	}); }