User:Yechezkelb/global.js

//blankspecial (NewPagesUser) if (mw.config.get('wgCanonicalSpecialPageName') === 'Blankpage' && mw.util.getParamValue('blankspecial') === 'newpagesuser') { $('.page-header__title').text('NewPagesUser'); document.title = 'NewPagesUser | ' + mw.config.get('wgSiteName') + ' | Fandom'; $('#mw-content-text').html(' '); } //CreateSpecialPage window.pageNames = [ 'NewPagesUser', 'RecentChangesMultiple' ]; window.pageData = [ ' ',   'rcm div' ]; window.pagePurpose = [ 'Page for NewPagesUser', 'Page for RecentChangesMultiple' ]; //CustomHeaderDropdown window.CustomHeaderLinks = [ {       text: 'Common JS', href: mw.util.getUrl('Special:MyPage/common.js') },   {        text: 'Discussions RC', href: mw.util.getUrl('Special:DiscussionsRC') },   {        text: 'Alert', click: function { alert('Huzzah, this is useless!'); }   } ]; //Article imports importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CreateSpecialPage/code.js',        'u:dev:MediaWiki:CustomHeaderDropdown.js',        'u:dev:MediaWiki:FileUsageAuto-update/code.js',        //Start: Will not work with UCP        'u:dev:MediaWiki:PageRenameAuto-update/code.js',        //End: Will not work with UCP        'u:dev:MediaWiki:MassEdit/code.js',        'u:dev:MediaWiki:QuickDelete/code.js',        'u:dev:MediaWiki:GlobalEditcount/code.js',        'u:dev:MediaWiki:InfoboxEditorPreview.js',        'u:dev:MediaWiki:FindAndReplace/code.js',        'u:dev:MediaWiki:RailWAM/code.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:MassProtect/code.js',        'u:dev:MediaWiki:UserAndIPTools.js',        'u:dev:MediaWiki:QuickIW/code.js',        'u:dev:MediaWiki:ContribsLink/code.js',        'u:dev:MediaWiki:NewPagesUser.js',        'u:dev:MediaWiki:CreateSpecialPage/code.js', 'u:dev:MediaWiki:CategoryRenameAuto-update/code.js', 'u:dev:MediaWiki:ListSubpages.js', 'u:dev:MediaWiki:UsernameAvailability/code.js', ] }); //!bang code $('.wds-global-navigation__search-input').on('keyup', function{ var txt = $(this).val, m = txt.match(/^\!([a-z]+) /), namespaces; if (m) { namespaces = { t: "Template", mw: "MediaWiki", s: "Special", h: "Help", m: "Module", f: "File", u: "User", p: "Project", c: "Category", ut: "User Talk", ht: "Help Talk", };		if (namespaces.hasOwnProperty(m[1])) { $(this).val(namespaces[m[1]] + ":" + txt.substr(m[1].length + 2)); }	} }); //!bang for user page $('.wds-global-navigation__search-input').on('keyup', function{ var txt = $(this).val, m = txt.match(/^\!([a-z]+) /), namespaces; if (m) { namespaces = { yb: "User:Yechezkelb" };       if (namespaces.hasOwnProperty(m[1])) { $(this).val(namespaces[m[1]] + txt.substr(m[1].length + 2)); }   } });