User:TheNozomi/global.js

var config = mw.config.get([   'wgCityId',    'wgContentLanguage',    'wgFormattedNamespaces' ]); var u = config.wgFormattedNamespaces[2]; var userpage; switch (config.wgContentLanguage) { case 'es': userpage = ''; break; default: userpage = ''; }

window.AutoCreateUserPagesConfig = { content: { 2:    userpage },   summary:   'Creating user page' };

window.UseCSS = { skin: '', init: function { if (window.location.href.indexOf('usesitecss=') == -1) return; var url = UseCSS.parseURL(window.location.href); if (url.query.usesitecss) { UseCSS.skin = (url.query.usewikicss || url.query.usesitecss); }		if (UseCSS.skin != '') { $(document.body).bind('click.usecss', UseCSS.clicEvent); $('form').bind('submit.usecss', UseCSS.submitEvent); }	},	parseURL: function(url) { var ret = {base:,qs:,query:{},hash:''}; var loc = url.indexOf('#'); 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); var paras = ret.qs.split('&'); for (var i = 0; i < paras.length; i++) { var p = paras[i].split('='); if (p.length == 2) { ret.query[p[0]] = p[1]; }			}		}		ret.base = url; return ret; },	getURL: function(url) { var nurl = url.base + '?'; for (var p in url.query) { nurl += p + '=' + url.query[p] + '&'; }		nurl = nurl.substr(0,nurl.length-1); if (url.hash != '') { nurl += '#'+ url.hash; }		return nurl; },	clicEvent: function(e) { if (e.target.tagName.toLowerCase != 'a') return; if (e.target.href.indexOf(window.wgServer) != 0) return; var url = UseCSS.parseURL(e.target.href); var thisloc = UseCSS.parseURL(window.location.href); if (url.base == thisloc.base && url.qs == thisloc.qs && url.hash != '') { return; }		if (url.query.usesitecss && url.query.usesitecss != UseCSS.skin) { url.query.usewikicss = UseCSS.skin; } else { url.query.usesitecss = UseCSS.skin; }		e.target.href = UseCSS.getURL(url); },	submitEvent: function(e) { if (this.action.indexOf(window.wgServer) != 0) return; if (this.method == 'post') { var url = UseCSS.parseURL(this.action); url.query.usesitecss = UseCSS.skin; this.action = UseCSS.getURL(url); } else { $(this).append(''); }	},	stop: function { $(document.body).unbind('click.usecss'); $('form').unbind('submit.usecss'); } }; $(UseCSS.init);

/* Resize image lightbox dynamically based on browser width */ $(function {   LightboxLoader.lightboxSettings.width = Math.round($(window).width * 0.85);    $(window).resize(function { LightboxLoader.lightboxSettings.width = Math.round($(window).width * 0.85); }); });

// Script imports var WHAMDelay = 100; importArticles({   type: 'script',    articles: [        'u:dev:PortableCSSPad/code.js',        'u:dev:Thread Inspection/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:HoverEditCount.js',        'u:dev:UnhideUserMasthead/code.js',        'u:dev:QuickDiff/code.js',        'u:dev:MediaWiki:View Source/code.js',        'u:dev:AjaxRedirect/code.js',        'u:thegoldenpatrik1:Rollback.js',        'u:dev:MastheadGender/code.js',        'u:dev:MediaWiki:MarkBlocked.js',        'u:dev:WHAM/code.2.js',        'u:dev:Nuke/code.js',        'u:dev:MediaWiki:MinimalTestModeAlert.js',        'u:dev:MediaWiki:ToggleTestMode/code.js',        'u:dev:MediaWiki:MobileEditor.js',        'u:dev:MediaWiki:CodeEditor.js',        'u:dev:FindAndReplace/code.js',        'u:dev:MediaWiki:DisableInfoboxBuilder.js',        'u:dev:MediaWiki:EditConflictAlert/code.js',        'u:dev:MediaWiki:PortableListUsers.js', 'u:dev:ListFiles/code.js', 'u:dev:DupImageList/code.js', 'u:dev:MediaWiki:FileLogs.js', 'u:dev:MediaWiki:WLHEditLinks/code.js', 'u:kocka:User:KockaAdmiralac/AutoCreateUserPages.javascript' ] });