User:TheGoldenPatrik1/global.js

/** * @Name           Global.js * @Author          TheGoldenPatrik1 * @Description    Scripts imported for global use. * @Protect */ // Config var config = mw.config.get([   'wgCityId' ]); // Custom Edit Buttons if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { 'speedTip': 'Signature', 'tagOpen': '' }; } // Test (function {    var config = mw.config.get([ 'wgCanonicalSpecialPageName', 'wgSassParams' ]);   if ( window.ContribsButtonsLoaded || config.wgCanonicalSpecialPageName !== 'Contributions' ) {       return;    }    var colors;    function css  {        var color = config.wgSassParams['color-buttons'];        mw.util.addCSS( 'body.mw-special-Contributions #VSTFReportButtons .VSTFReportButton,\ body.mw-special-Contributions #contentSub:not(.contentSub) a,\ body.mw-special-Contributions #contentSub #contentSubSub a {\ background:' + color + ';\ }\ body.mw-special-Contributions #VSTFReportButtons .VSTFReportButton:active,\ body.mw-special-Contributions #VSTFReportButtons .VSTFReportButton:focus,\ body.mw-special-Contributions #VSTFReportButtons .VSTFReportButton:hover,\ body.mw-special-Contributions #contentSub:not(.contentSub) a:active,\ body.mw-special-Contributions #contentSub:not(.contentSub) a:focus,\ body.mw-special-Contributions #contentSub:not(.contentSub) a:hover,\ body.mw-special-Contributions #contentSub #contentSubSub a:active,\ body.mw-special-Contributions #contentSub #contentSubSub a:focus,\ body.mw-special-Contributions #contentSub #contentSubSub a:hover {\ background:' + colors.parse(color).lighten(12) + ';\ }'       );    }    function hookHandler (colorData) {        colors = colorData;        css;    }    function init  {        mw.hook('dev.colors').add(hookHandler);        importArticle({ type: 'script', article: 'u:dev:MediaWiki:Colors/code.js' });   }    init; }); // KillFeaturedVideos $('#WikiaMainContentContainer > div[itemprop="video"]').remove; // Configurations window.batchDeleteDelay = 500; window.massProtectDelay = 500; window.nullEditDelay = 500; window.massCategorizationDelay = 750; window.massEditConfig = { editInterval: 750 }; window.WHAMDelay = 400; window.WHAMDeleteReason = 'Cleanup'; window.WHAMBlockReason = 'Vandalism'; window.AjaxUndoMinor = true; window.AutoCreateUserPagesConfig = { content: { 2: ,       3: ,        1202: ''    },    summary: 'Automatic' }; window.customCodeQuickLinks = { replaceAllDefaultLinks: false, linkSet: { userFiles: [ {               name: 'Universal.css', href: '//c.wikia.com/wiki/User:TheGoldenPatrik1/universal.css' },           {                name: 'Sandbox', href: mw.util.getUrl('Special:MyPage/Sandbox') },           {                name: 'To Do List', href: mw.util.getUrl('User:TheGoldenPatrik1/To Do List') }       ],        siteFiles: [ {               name: 'Themes.css', href: mw.util.getUrl('MediaWiki:Themes.css') },           {                name: 'Staff.css', href: mw.util.getUrl('MediaWiki:Staff.css') },           {                name: 'ProfileTags', href: mw.util.getUrl('MediaWiki:ProfileTags') }       ],    } }; window.AjaxThreadDeleteConfig = { fastDelete: true, reason: 'Cleanup' }; window.AjaxDelete = { deleteReasons: { 'Unused Redirect': 'Redirect', 'Spam': 'Spam', 'Cleanup': 'Cleanup', 'Marked for Deletion': 'MFD', 'Housekeeping': 'Housekeeping' },   imageDeleteReasons: { 'Spam': 'Spam', 'Unused': 'Unused', 'Housekeeping': 'Housekeeping', 'Cleanup': 'Cleanup' },   autoCheckWatch: false }; window.announcementsIgnore = { option: 'opt-out-all', exceptWikiIds: [ 177,       1399015,        1542998    ] }; window.unsafeScriptsConfig = { 'usesitejs': false, 'usesitecss': false, 'useusercss': false }; window.dev = window.dev || {}; window.dev.editSummaries = { css: false, select: [ 'Summaries', 'CVN', [ 'Vandalism', 'Spam' ],       'VSTF', [ '+4 Reports from Wikia Watchers', '+5 Reports from Wikia Watchers', '+6 Reports from Wikia Watchers', '+7 Reports from Wikia Watchers', '+8 Reports from Wikia Watchers' ],       'Portability', [ 'Creating Portable Infobox Draft', 'Creating Themes for Portable Infoboxes', 'Importing Themes for Portable Infoboxes' ],       'Standard', [ 'Marking for Deletion', 'Whatlinkshere', 'Miscellaneous Cleanup', 'Formatting' ]   ] }; window.globalNavButtons = [ //Debug {   text: 'Debug', url: new mw.Uri.extend({debug: '1'}).toString, isMain: true, whoIsMain: false, shortName: 'd' }, { text: 'Site JS', url: new mw.Uri.extend({usesitejs: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 's-js' }, {   text: 'User JS', url: new mw.Uri.extend({useuserjs: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 'u-js' }, {   text: 'Site CSS', url: new mw.Uri.extend({usesitecss: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 's-css' }, {   text: 'User CSS', url: new mw.Uri.extend({useusercss: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 'u-css' }, {   text: 'All JS', url: new mw.Uri.extend({usesitejs: '0', useuserjs: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 'a-js' }, {   text: 'All CSS', url: new mw.Uri.extend({usesitecss: '0', useusercss: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 'a-css' }, {   text: 'Everything', url: new mw.Uri.extend({usesitejs: '0', useuserjs: '0', usesitecss: '0', useusercss: '0'}).toString, isMain: false, whoIsMain: 'd', shortName: 'eve' }, //Actions {   text: 'Purge', url: new mw.Uri.extend({action: 'purge'}).toString, isMain: true, whoIsMain: false, shortName: 'a' }, { text: 'Raw', url: new mw.Uri.extend({action: 'raw'}).toString, isMain: false, whoIsMain: 'a', shortName: 'a-r' }, {   text: 'QQX', url: new mw.Uri.extend({uselang: 'qqx'}).toString, isMain: false, whoIsMain: 'a', shortName: 'a-qqx' }, //Pages {   text: 'Pages', url: mw.util.getUrl('Special:AllPages'), isMain: true, whoIsMain: false, shortName: 'p' }, { text: 'RC', url: mw.util.getUrl('Special:Recentchanges'), isMain: false, whoIsMain: 'p', shortName: 'rc' }, {   text: 'Prefindex', url: mw.util.getUrl('Special:PrefixIndex'), isMain: false, whoIsMain: 'p', shortName: 'pref' }, {   text: 'Shortpages', url: mw.util.getUrl('Special:Shortpages'), isMain: false, whoIsMain: 'p', shortName: 'sp' }, {   text: 'Watchlist', url: '//thegoldenpatrik1.wikia.com/wiki/Watchlist', isMain: false, whoIsMain: 'p', shortName: 't-w' }, //Contact {   text: 'SC', url: mw.util.getUrl('Special:Contact/general'), isMain: true, whoIsMain: false, shortName: 'c' }, { text: 'S:C/bug', url: mw.util.getUrl('Special:Contact/bug'), isMain: false, whoIsMain: 'c', shortName: 'c-b' }, {   text: 'S:C/feedback', url: mw.util.getUrl('Special:Contact/feedback'), isMain: false, whoIsMain: 'c', shortName: 'c-f' }, {   text: 'CC S:C', url: '//c.wikia.com/wiki/Special:Contact/general', isMain: false, whoIsMain: 'c', shortName: 's-c' }, //Logs {   text: 'Logs', url: mw.util.getUrl('Special:Log'), isMain: true, whoIsMain: false, shortName: 'l' }, { text: 'URL', url: mw.util.getUrl('Special:Log/rights'), isMain: false, whoIsMain: 'l', shortName: 'url' }, {   text: 'DL', url: mw.util.getUrl('Special:Log/delete'), isMain: false, whoIsMain: 'l', shortName: 'dl' }, {   text: 'PL', url: mw.util.getUrl('Special:Log/protect'), isMain: false, whoIsMain: 'l', shortName: 'pl' }, {   text: 'BL', url: mw.util.getUrl('Special:Log/block'), isMain: false, whoIsMain: 'l', shortName: 'bl' }, {   text: 'ML', url: mw.util.getUrl('Special:Log/move'), isMain: false, whoIsMain: 'l', shortName: 'ml' }, {   text: 'CC URL', url: '//c.wikia.com/wiki/Special:Log/rights', isMain: false, whoIsMain: 'l', shortName: 'cc-url' }, {   text: 'Admins', url: mw.util.getUrl('Special:ListAdmins'), isMain: false, whoIsMain: 'l', shortName: 'la' }, //VSTF {   text: 'VSTF', url: '//vstf.wikia.com/wiki/Special:Recentchanges', isMain: true, whoIsMain: false, shortName: 'v' }, { text: 'Spam', url: '//vstf.wikia.com/wiki/Report:Spam', isMain: false, whoIsMain: 'v', shortName: 'v-s' }, {   text: 'Vandalism', url: '//vstf.wikia.com/wiki/Report:Vandalism', isMain: false, whoIsMain: 'v', shortName: 'v-v' }, {   text: 'Profiles', url: '//vstf.wikia.com/wiki/Report:User_profile_headers', isMain: false, whoIsMain: 'v', shortName: 'v-p' }, {   text: 'Wikis', url: '//vstf.wikia.com/wiki/Report:Wiki', isMain: false, whoIsMain: 'v', shortName: 'v-w' }, {   text: 'Biglist', url: '//vstf.wikia.com/wiki/Report:Spam/Biglist', isMain: false, whoIsMain: 'v', shortName: 'v-b' }]; // Device Specific Imports require(['wikia.browserDetect'], function(detect) {   if (detect.isMobile) {        importArticles({ type: 'script', articles: [ 'u:dev:ChromeToolbarColor.js', 'u:dev:MobileEditor.js', 'u:dev:UnsafeScripts/code.js' ]       });    } else {        importArticles({ type: 'script', articles: [ 'u:dev:FindAndReplace/code.js', 'u:dev:PortableCSSPad/code.js', 'u:dev:Standard Edit Summary/code.js', 'u:dev:StickySummary.js' ]       });    } }); // General Imports importArticles({   type: 'script',    articles: [        'u:dev:AjaxBatchDelete.js',        'u:dev:AjaxDelete/code.js',        'u:dev:AjaxThreadDelete/code.js',        'u:dev:AjaxUndo/code.js',        'u:dev:AnchoredRollback/code.js',        'u:dev:AnnouncementsIgnore.js',        'u:dev:BlogLink/code.js',        'u:dev:CodeQuickLinks/code.js',        'u:dev:EditConflictAlert/code.js',        'u:dev:FileLogs.js',        'u:dev:GlobalEditcount/code.js',        'u:dev:GlobalNavButtons.js',        'u:dev:LastEdited/code.js',        'u:dev:LinkToDiscussionsProfileIfTheyDontHaveLivePosts/code.js',        'u:dev:MassCategorization/code.js',        'u:dev:MassEdit/code.js',        'u:dev:MassNullEdit/code.js',        'u:dev:MassProtect/code.js',        'u:dev:MastheadGender/code.js',        'u:dev:PageCreator/code2.js',        'u:dev:PageEditInfo/code.js',        'u:dev:ProtectionIcons.js',        'u:dev:QuickDiff/code.js', 'u:dev:RevealAnonIP/usercode.js', 'u:dev:SeeMoreActivityButton/code.js', 'u:dev:ShowUserGroups.js', 'u:dev:UnhideUserMasthead/code.js', 'u:dev:UserAccountAge/code2.js', 'u:dev:VanguardTools.js', 'u:dev:ViewDeleted/code.js', 'u:dev:View Source/code.js', 'u:dev:VSTFReport.js', 'u:dev:WallGreetingButton/code.js', 'u:dev:WHAM/code.2.js', 'u:dev:WLHEditLinks/code.js', 'u:kocka:User:KockaAdmiralac/AutoCreateUserPages.javascript', 'u:kocka:User:KockaAdmiralac/LinkModifications.javascript', 'u:thegoldenpatrik1:BlankUndo.js', 'u:thegoldenpatrik1:Rollback.js', 'u:thegoldenpatrik1:SignatureCreator.js' ] }); // Wiki Specific Imports /* if (['193260', '65099'].indexOf(config.wgCityId) !== -1) {   importArticle( {           type: 'style', article: 'u:dev:MediaWiki:FANSUN.css' },       {            type: 'script', article: 'u:dev:FANSUN.js' }   ); }