User:Hypercane/global.js

/****** All of the code I have in this page go to their respective owners, I own none of them. ******/

/* Talk Page Notifications */ window.talkWikis = ['hypotheticalweather','hypotheticalhurricanes','hypothetical-events']; window.talkName = 'talk'; window.topLevelCat = 'Browse'; batchDeleteDelay = massCategorizationDelay = massProtectDelay = nullEditDelay = 10; window.AjaxCommentDeleteConfig = { fastDelete: 'Deleting comment' }; window.ImageNotificationConfig = { refreshInterval: 1000000, enableOn: ['Special:BlankPage/Images'] }; window.YoutubePlayerDisableAutoplay = true; window.AjaxBlock = { blockReasons: { 'Vandalism': 'Vandalism', 'Spam': 'Spam', 'Terms of Use violation': 'ToU', 'Abusing multiple accounts': 'Sock', 'Intimidating behaviour/harassment': 'Harassment', 'Unacceptable username': 'Username', 'Creating unnecessary pages': 'Pages', 'Flooding comments/threads': 'Flood', 'Uploading unnecessary images': 'Images' } }; window.AjaxDelete = { deleteReasons: { 'Help:Vandalism': 'Vandalism', 'Help:Spam': 'Spam', 'Marked for deletion': '{' + '{delete}}', 'Copyright violation': 'Copyright violation', 'Author request': 'Author request', 'Unused': 'Unused', },   imageDeleteReasons: { 'Unused photo/video': 'Unused', 'Help:Vandalism': 'Vandalism', 'Help:Spam': 'Spam', 'Marked for deletion': '{' + '{delete}}', 'Bad quality': 'Quality', 'Duplicated/superseded file': 'Duplicate', 'Unrelated to the wiki topic': 'Not HHW', },   autoCheckWatch: false };

var regularList = [ 'u:admintools:MediaWiki:Common.js/Maintenance.js', 'u:dev:MediaWiki:AjaxUndo/code.js', 'u:dev:MediaWiki:AnchoredRollback/code.js', 'u:dev:MediaWiki:AntiSoundcloud/code.js', 'u:dev:MediaWiki:CacheCheck/code.js', 'u:dev:MediaWiki:DiscussionsFeed.js', 'u:dev:MediaWiki:GlobalEditcount/code.js', 'u:dev:MediaWiki:ListFiles/code.js', 'u:dev:MediaWiki:MassNullEdit/code.js', 'u:dev:MediaWiki:MastheadGender/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:OldFilePages/code.js', 'u:dev:MediaWiki:QuickDiff/code.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:QuickLogs/code.js', 'u:dev:MediaWiki:PortableCSSPad/code.js', 'u:dev:MediaWiki:ToggleSideBar/code.js', 'u:dev:MediaWiki:UserAccountAge/code.js', 'u:dev:Mediawiki:UserTalkNotifications/code.js', 'u:dev:MediaWiki:WallGreetingButton/code.js', 'u:dev:MediaWiki:WorkingMoreUsersCount.js' ], cmList = [ 'u:dev:MediaWiki:AjaxBatchDelete/code.2.js', 'u:dev:MediaWiki:AjaxDelete/code.js', 'u:dev:MediaWiki:AjaxPatrol/code.js', 'u:dev:MediaWiki:AjaxThreadDelete/code.js', 'u:dev:MediaWiki:FastOldImageDelete/code.js', 'u:dev:MediaWiki:MassCategorization/code.js', 'u:dev:MediaWiki:MassRedirect/code.1.js', 'u:dev:MediaWiki:MassRename/code.js', 'u:dev:MediaWiki:MassRenameRevert/code.js', 'u:dev:MediaWiki:MassProtect/code.js', 'u:dev:MediaWiki:WHAM/code.2.js' ], adminList = [ 'u:dev:MediaWiki:AjaxBlock/code.js' ]; $(function {   // Move the toggle button on CC    if(mw.config.get('wgCityId') === 177) {        var togglemove = setInterval(function { if($('#ToggleSideBarButton').length > 0) { clearInterval(togglemove); $('#ToggleSideBarButton').insertAfter('.header-tally .tally'); }       }, 100);    }    // Clean up my title    document.title = document.title.split(' | ')[0];    // Show user registration date in masthead    mw.loader.using('mediawiki.api').then(function { if($('#UserProfileMasthead').length === 0) { return; }       var reg, load; new mw.Api.get({           action: 'query',            list: 'users',            ususers: $("#UserProfileMasthead h1").text,            usprop: 'registration'        }).done(function(d) {            if(d.query.users) {                reg = new Date(d.query.users[0].registration).toLocaleString;                if(load) {                    cb;                }            }        }); var regInt = setInterval(function {           if($('.globaledit-label').length > 0) {                clearInterval(regInt);                load = true;                if(reg) {                    cb;                }            }        }, 100); function cb { $('.globaledit-label').html($('.globaledit-label').html + ' ' + reg); }   });    // Automatically remove "favorite wikis" (Thanks KockaAdmiralac)    $.nirvana.getJson('UserProfilePage', 'renderUserIdentityBox', function(d) { var user = d.user; user.topWikis.forEach(function(el) {           $.nirvana.postJson('UserProfilePage', 'onHideWiki', { userId: user.id, wikiId: el.id           });        }, this); }); }); importArticles({   type: 'script',    articles: regularList        .concat((wgUserGroups.includes('sysop') ? adminList.concat(cmList) : []))        .concat((wgUserGroups.includes('content-moderator') ? cmList : [])) });

/* Global Chat JS */ importArticles({   type: 'script',    articles: [        'u:dev:GlobalChatJS.js',    ] });