User:Mazro/global.js

window.customUserTemplatesPlacement = "globalNav"; window.wgWikiaChatWindowFeatures = ""; window.pageCreatorTimestamp = true; window.pageCreatorUTC = true; window.ajaxPages = [ "Special:WikiActivity", "Special:RecentChanges", "Special:Log" ]; window.lastEdited = { avatar: false, size: false, comment: false, timezone: "UTC", namespaces: { include: [0, 4, 8, 10, 14], exclude: [1, 2, 3, 5, 6, 7, 9, 11, 12, 15, 110, 111, 828, 829, 1202] } };

// General imports

importArticles({   type: "script",    articles: [        "u:dev:AjaxRC/code.js",        "u:dev:GlobalChatJS.js",        "u:dev:Rollback/code.2.js",        "u:dev:PortableCSSPad/code.js",        "u:dev:CodeQuickLinks/code.js",        "u:dev:NullEditButton/code.js",        "u:dev:SkinSwitchButton/code.js",        "u:dev:UnhideUserMasthead/code.js",        "u:mazro:MediaWiki:EditcountLink.js",        "u:mazro:MediaWiki:UserTemplates.js"    ] });

// Toolbar item pseudoconstructor

/** * Pseudoconstructor function * @param {string} $linkAddress - The address to which the link points * @param {string} $linkText - The text to display on the toolbar * @returns {void} */ function createToolbarLink($linkAddress, $linkText) { var $toolbarLink = mw.html.element("li", {       "class": "overflow"    }, new mw.html.Raw( mw.html.element("a", {           title: $linkText,            href: mw.config.get("wgArticlePath").replace("$1", $linkAddress)        }, $linkText) ));

$($toolbarLink).prependTo(".toolbar .tools"); }

// Wiki-specific imports

switch (mw.config.get("wgCityId")) { case "1585084": console.log("Global.js - Loading UTCClock & Feed"); importScriptPage("UTCClock/code.js", "dev"); createToolbarLink("Mazro:Feed#Activity_Feed", "Feed"); break; case "644": console.log("Global.js - Loading LastEdited, PageCreator, & categories"); importScriptPage("LastEdited/code.js", "dev"); importScriptPage("PageCreator/code2.js", "dev"); createToolbarLink("Category:Images by Mazro", "My Images"); createToolbarLink("Category:Articles by Mazro", "My Articles"); break; case "177": console.log("Global.js - Loading EditBio, UserAccountAge, & code links"); importScriptPage("EditBio/code.js", "dev"); importScriptPage("UserAccountAge/code.js", "dev"); createToolbarLink("User:Mazro/chat.js", "My Chat.js"); createToolbarLink("User:Mazro/global.js", "My Global.js"); break; }

if (mw.config.get("wgCityId") !== "177") { $(".UserProfileMasthead .masthead-info .details").css("display", "none"); }

// Counter UnhideUserMasthead on own userpage

if ($(".UserProfileMasthead .masthead-info h1").text === mw.config.get("wgUserName")) { var $interval = setInterval(function {        if ($(".UserProfileMasthead .wikis").exists) {            clearInterval($interval);            $(".UserProfileMasthead .wikis").css("display", "none");        }    }, 100); }