User:TheGoldenPatrik1/global.js

/** * @Name           Global.js * @Author          TheGoldenPatrik1 * @Description    Scripts imported for global use. * @Protect */

/***********************************************************************/ /******************************* Functions *****************************/ /***********************************************************************/ // Config var config = mw.config.get([   'wgCityId' ]); // Custom Edit Buttons if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { 'speedTip': 'Signature', 'tagOpen': '' }; } // KillFeaturedVideos $('#WikiaMainContentContainer > div[itemprop="video"]').remove;

/** * @class Functions * @classdesc Central function class */ var Functions = { /**    * @method randomButton * @description Adds ?useskin=oasis to the URL of the Random button * @scope Mobile */   randomButton: function  { $('.wds-list a[data-tracking="explore-random"]').attr(           {                href: mw.util.getUrl('Special:Random', {usekin: 'oasis'})            }        ); } };

/***********************************************************************/ /**************************** 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.unsafeScriptsConfig = { 'usesitejs': false, 'usesitecss': false, 'useusercss': false }; 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: '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: 'CC S:C', url: 'https://c.wikia.com/wiki/Special:Contact/general', isMain: false, whoIsMain: 'c', shortName: 's-c' }, //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 *******************************/ /***********************************************************************/ // 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' ]       });        Functions.randomButton;    } 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:thegoldenpatrik1:BlankUndo.js', 'u:thegoldenpatrik1:Rollback.js', 'u:thegoldenpatrik1:SignatureCreator.js' ] }); // Wiki Specific Imports if (['193260', '65099'].indexOf(config.wgCityId) !== -1) {   importArticles({ type: 'style', articles: [ 'u:dev:MediaWiki:FANSUN.css' ]   }, {        type: 'script', articles: [ 'u:dev:FANSUN.js' ]   }); }