User:Slayingthehalcyon/global.js

importScriptPage('User:Callofduty4/ChatHacks.js', 'c');

importArticles({   type: 'script',    articles: [        'w:coreychambers:MediaWiki:VectorSkin.js',        'u:redisc0very:MediaWiki:Slash_Commands/code.js',        'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',        'u:dev:MediaWiki:MessageBlocker/code.js',        'u:halcyonictests:MediaWiki:TabComplete.js',        'u:halyconictests:MediaWiki:EasyPublish.js',        'u:halcyonictests:MediaWiki:Toraload.js',        'u:halcyonictests:MediaWiki:PseudVector.js',        'u:halcyonictests:MediaWiki:SnowPlow.js',        'u:halcyonictests:MediaWiki:Spells.js',        'u:halcyonictests:MediaWiki:SlashCommands.js',        'u:halcyonictests:MediaWiki:Carrots.js',        'u:halcyonictests:MediaWiki:HouseCleaning.js',        'u:halcyonictests:MediaWiki:MBload.js',       'u:halcyonictests:MediaWiki:Collapse.js'   ]  });

// Miscellaneous $(function {   var buttons = {        monobook: {            href: 'useskin=monobook'        },        wikiamobile: {            href: 'useskin=wikiamobile'        },        vector: {            href: 'useskin=monobook&usevector=1&usesitecss=0'        },        qqx: {            href: 'uselang=qqx'        },        debug: {            href: 'debug=true'        },        test: {            id: 'test-mode',            text: (mw.config.get('wgContentReviewTestModeEnabled') ? 'exit' : 'enter') + ' test mode',           handler: function {                if (mw.config.get('wgContentReviewTestModeEnabled')) {                    $.nirvana.sendRequest({ controller: 'ContentReviewApiController', method: 'disableTestMode', callback: function(e) { if (e.status) { window.location.reload; }                       }                    });                } else {                    $.nirvana.sendRequest({ controller: 'ContentReviewApiController', method: 'enableTestMode', data: { pageId: mw.config.get('wgArticleId'), wikiId: mw.config.get('wgCityId'), editToken: mw.user.tokens.get('editToken') },                       callback: function(e) { if (e.status) { window.location.reload; }                       }                    });                }            }        }    };        $('.global-navigation .hubs-links').html('');        for (var i in buttons) {            $('.global-navigation .hubs-links').append( $('') .attr({                       href: (buttons[i].href ? mw.config.get('wgArticlePath').replace(/\$1/g, (mw.config.get('wgPageName') + (!!window.location.search ? window.location.search + '&' : '?') + buttons[i].href + (!!window.location.hash ? window.location.hash : ))) : ),                       class: 'globalnav-button',                        id: (buttons[i].id ? buttons[i].id : '')                   }) .text(buttons[i].text || i)           );            if (buttons[i].id && buttons[i].handler && typeof buttons[i].handler == 'function') {                $('#' + buttons[i].id).bind('click', buttons[i].handler);            }        }    // load pseudo-vector on usevector=1    if (mw.config.get('skin') == 'monobook' && $.getUrlVar('usevector')) {        importStylesheetPage('Pseudo-Vector/code.css', 'dev');    } });

// /** * Name:       Global edit count script * Author:     Noreplyz *             KockaAdmiralac <1405223@gmail.com> (smaller modifications) * Description: Adds a global edit count to user's masthead. */ $(function {   var mwApiCounter1291238 = setInterval(function { if(typeof mw.Api !== 'undefined') { if ($("#UserProfileMasthead").length === 0) { return; } else { var username = $("h1").text; new mw.Api.get({                   action: "query",                    list: "users",                    ususers: username,                    usprop: "editcount"                }).done(function(data) {                    if(data.error) {                        new BannerNotification("Error while fetching user edit count: " + data.error.code, 'error').show;                    } else if(typeof data.query.users[0].editcount !== 'undefined') {                        $(".tally").first.after(' ' + mw.html.element("em", { id: "globaleditcount" }, data.query.users[0].editcount.toString.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")) + mw.html.element("span", null, "global edits") + ' ');                   }                    $("#globaleditcount").click(function { window.location.href = "/wiki/Special:Editcount/" + username; });               }).fail(function {                    new BannerNotification("Error while fetching user edit count", 'error').show;                }); }           clearInterval(mwApiCounter1291238); }   }, 100); }); //