User:TheGoldenPatrik1/global.js

/***********************************************************************/ /***************************** Doc and Toc *****************************/ /***********************************************************************/ /* DOCUMENTATION * @Author  TheGoldenPatrik1 * @Purpose Scripts imported for global use * @Protect */ /* TABLE OF CONTENTS * Section 1 - Functions * Section 2 - Configurations * Section 3 - Imports */ /***********************************************************************/ /******************************* Functions *****************************/ /***********************************************************************/ /* Config */ var config = mw.config.get([   'wgCityId',    'wgUserName' ]);//End Config */

/* KillFeaturedVideos */ $('#WikiaMainContentContainer > div[itemprop="video"]').remove; //End KFV */

/* Page Info */ var headerContainer = $(' ', {   'class': 'page-header__info' }).prependTo('.page-header__contribution'); function appendHeader($el) { headerContainer.prepend($el); } mw.hook('LastEdited.inserted').add(appendHeader); mw.hook('PageCreator.render').add(appendHeader); //End PI */

/* SignatureButton | By Josephyr */ if (wgAction == 'edit' || wgAction == 'publish') { if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { 'speedTip': 'Signature', 'tagOpen': '' };   } }//End SB */

/* SignatureCreator */ mw.loader.using(['mediawiki.api']).then(function {   if ( config.wgUserName !== 'TheGoldenPatrik1' || !$('a[data-tracking-label="account.talk"]').exists || config.wgCityId === '65099' ) {       return;    }    var title = 'User:TheGoldenPatrik1/sig.css';    new mw.Api.get({ cb: Date.now, action: 'query', titles: title }).done(function(d) { var pages = d.query.pages; if (d.error || !pages[-1]) { return; } $('#WikiaBar .toolbar .tools').append(           $('').append( $('', {                   href: '#sig',                    id: 'ca-sig',                    text: 'Create Sig'                }) )       )            .click(function {                $.ajax({ type: 'POST', url: mw.util.wikiScript('api'), dataType: 'json', data: { action: 'edit', title: title, summary: 'Automatic', text: ' Pat rik ', format: 'json', token: mw.user.tokens.get('editToken') }               }).done(function(data) { if (data.edit.result === 'Success') { new BannerNotification('Signature created—add to list.', 'confirm').show; } else { new BannerNotification('An error occurred.', 'error').show; }               }).fail(function(data) { new BannerNotification('An error occurred.', 'error').show; });       });    }); });//End SC */

/***********************************************************************/ /**************************** Configurations ***************************/ /***********************************************************************/ window.batchDeleteDelay = 250; window.massProtectDelay = 500; window.nullEditDelay = 250; window.massCategorizationDelay = 750; window.massEditConfig = { editInterval: 750 }; window.WHAMDelay = 400; window.WHAMDeleteReason = 'Cleanup'; window.WHAMBlockReason = 'Vandalism'; 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: '/wiki/Special:MyPage/Sandbox' },           {                name: 'To Do List', href: '/wiki/User:TheGoldenPatrik1/To Do List' }       ],        siteFiles: [ {               name: 'Themes.css', href: '/wiki/MediaWiki:Themes.css' },           {                name: 'Staff.css', href: '/wiki/MediaWiki:Staff.css' },           {                name: 'ProfileTags', href: '/wiki/MediaWiki:ProfileTags' }       ],    } }; window.AjaxThreadDeleteConfig = { fastDelete: true, reason: 'Cleanup' }; window.AjaxDelete = { deleteReasons: { '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.dev = window.dev || {}; window.dev.editSummaries = { css: false, select: [ 'Summaries', 'Vandalism', [ 'Vandalism', 'Spam' ],       'VSTF', [ '+4 Reports from Wikia Watchers', '+5 Reports from Wikia Watchers', '+6 Reports from Wikia Watchers', '+7 Reports from Wikia Watchers' ],       'Portability', [ 'Creating Portable Infobox Draft', 'Creating Themes for Portable Infoboxes', 'Importing Themes for Portable Infoboxes' ],       'Standard', [ 'Creating', 'Cleanup', '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: '/wiki/Special:AllPages', isMain: true, whoIsMain: false, shortName: 'p' }, { text: 'RC', url: '/wiki/Special:Recentchanges', isMain: false, whoIsMain: 'p', shortName: 'rc' }, {   text: 'Prefindex', url: '/wiki/Special:PrefixIndex', isMain: false, whoIsMain: 'p', shortName: 'pref' }, {   text: 'Shortpages', url: '/wiki/Special:Shortpages', isMain: false, whoIsMain: 'p', shortName: 'sp' }, {   text: 'Test Code', url: '//thegoldenpatrik1.wikia.com/wiki/User:TheGoldenPatrik1/common.js', isMain: false, whoIsMain: 'p', shortName: 't-c' }, {   text: 'Watchlist', url: '//thegoldenpatrik1.wikia.com/wiki/Watchlist', isMain: false, whoIsMain: 'p', shortName: 't-w' }, //Contact {   text: 'SC', url: '/wiki/Special:Contact/general', isMain: true, whoIsMain: false, shortName: 'c' }, { text: 'S:C/bug', url: '/wiki/Special:Contact/bug', isMain: false, whoIsMain: 'c', shortName: 'c-b' }, {   text: 'S:C/feedback', url: '/wiki/Special:Contact/feedback', isMain: false, whoIsMain: 'c', shortName: 'c-f' }, {   text: 'S:C/close-wiki', url: '/wiki/Special:Contact/close-wiki', isMain: false, whoIsMain: 'c', shortName: 's-w' }, //Logs {   text: 'Logs', url: '/wiki/Special:Log', isMain: true, whoIsMain: false, shortName: 'l' }, { text: 'URL', url: '/wiki/Special:Log/rights', isMain: false, whoIsMain: 'l', shortName: 'url' }, {   text: 'DL', url: '/wiki/Special:Log/delete', isMain: false, whoIsMain: 'l', shortName: 'dl' }, {   text: 'PL', url: '/wiki/Special:Log/protect', isMain: false, whoIsMain: 'l', shortName: 'pl' }, {   text: 'BL', url: '/wiki/Special:Log/block', isMain: false, whoIsMain: 'l', shortName: 'bl' }, {   text: 'ML', url: '/wiki/Special:Log/move', isMain: false, whoIsMain: 'l', shortName: 'ml' }, {   text: 'CC URL', url: '//community.wikia.com/wiki/Special:Log/rights', isMain: false, whoIsMain: 'l', shortName: 'cc-url' }, {   text: 'Admins', url: '/wiki/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' }];//End Configurations */ /***********************************************************************/ /******************************* Imports *******************************/ /***********************************************************************/ /* GeneralImports */ 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:FindAndReplace/code.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:PortableCSSPad/code.js', 'u:dev:QuickDiff/code.js', 'u:dev:RevealAnonIP/usercode.js', 'u:dev:SeeMoreActivityButton/code.js', 'u:dev:ShowUserGroups.js', 'u:dev:Standard Edit Summary/code.js', 'u:dev:StickySummary.js', 'u:dev:UnhideUserMasthead/code.js', 'u:dev:UserAccountAge/code2.js', 'u:dev:VanguardTools.js', 'u:dev:ViewDeleted/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' ] });//End GI */

/* WikiSpecificImports */ if (['193260', '65099'].indexOf(config.wgCityId) !== -1) { importArticles({       type: 'style',        articles: [            'u:dev:MediaWiki:FANSUN.css',            'u:dev:MediaWiki:Nord.css'        ]    }, {        type: 'script',        articles: [            'u:dev:FANSUN.js'        ]    }); }//End WSI */