MediaWiki:Common.js

// 03:54, May 18, 2019 (UTC)

// AUTO-REFRESH RECENT CHANGES AND WIKI-ACTIVITY window.AjaxRCRefreshText = 'Auto-refresh'; window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; window.ajaxPages = ["Special:RecentChanges", "Special:WikiActivity"]; // END AUTO-REFRESH

// Create the "dev" namespace if it doesn't exist already: window.dev = window.dev || {}; // Create the sub-namespace for this addon and set some options: window.dev.editSummaries = { select: 'Template:Stdsummaries' };

window.UserTagsJS = { modules: {}, tags: { assistant: 'Assistant', threadmoderator: 'Discussion Moderator', 'content-moderator': 'Content Moderator' } };

UserTagsJS.modules.inactive = 62; UserTagsJS.modules.newuser = true; UserTagsJS.modules.autoconfirmed = true; UserTagsJS.modules.mwGroups = [ 'bureaucrat', 'sysop', 'assistant', 'rollback', 'chatmoderator', 'threadmoderator', 'content-moderator', 'bannedfromchat', 'global-discussions-moderator' ];

// ************************************************* // Pagetitle rewrite // // Rewrites the page's title, used by Template:Title // ************************************************* $(function {   if ($('#title-meta').length) {        var newTitle = mw.html.escape($("#title-meta").html);        // Allow italics        newTitle = newTitle.replace(/&lt;(\/?i)&gt;/g, '<$1>');        var edits = $("#user_masthead_since").text;        $(".firstHeading,#WikiaUserPagesHeader h1,#WikiaPageHeader h1").text(newTitle);        $("#user_masthead_head h2").text(newTitle + "" + edits + " ");    } });

$(function changeTitle{   if (!$('span.newPageTitle').html) {        return;    }    var title = mw.html.escape($('span.newPageTitle').html);    $('h1.page-header__title').text(title); });

/* Custom edit buttons See https://c.wikia.com/wiki/Help:Custom_edit_buttons */ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.com/extensions/wikia/WikiaPhotoGallery/images/gallery_add.png", "speedTip": "", "tagOpen": "<" + "gallery>", "tagClose": " ", "sampleText": "", "imageId": "mw-editbutton-wpg" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/1/11/Btn_toolbar_liste.png", "speedTip": "List", "tagOpen": "\n* ", "tagClose": "\n* Element B\n* Element C", "sampleText": "Element A"   };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/8/88/Btn_toolbar_enum.png", "speedTip": "Numbering", "tagOpen": "\n# ", "tagClose": "\n# Element 2\n# Element 3", "sampleText": "Element 1" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/f/fd/Button_blockquote.png", "speedTip": "Blockquote", "tagOpen": " ", "tagClose": " ", "sampleText": "Insert text" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/7/74/Button_comment.png", "speedTip": "Note", "tagOpen": "", "sampleText": "Insert text" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/b/b4/Button_category03.png", "speedTip": "Category", "tagOpen": "[[Category:",       "tagClose": "]]", "sampleText": "Category name" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",       "tagClose": "", "sampleText": "Insert text" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/1/12/Button_gallery.png", "speedTip": "Picture gallery", "tagOpen": "\n\nImage:", "tagClose": "|C.Syde's Wiki Logo\nImage:Wiki.png|C.Syde's Wiki Logo\nImage:Wiki.png|Eine C.Syde's Wiki Logo\n<\/gallery>", "sampleText": "Wiki.png" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/3/3b/Button_template_alt.png", "speedTip": "Template", "tagOpen": "", "sampleText": "Template" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": "" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://images.wikia.nocookie.net/central/images/7/74/Button_comment.png", "speedTip": "Comment visible only for editors", "tagOpen": "", "sampleText": "Insert comment here" }; }

$(function {   if ($.getUrlVar('action') !== 'edit') {        return;    }    var interval = setInterval(function { var $button = $('#mw-editbutton-wpg'); if ($button.exists) { clearInterval(interval); $button.off.click(function {               WikiaPhotoGallery.showEditor({ from: 'source' });           });        }    }, 100); });

if (['assistant','bot','content-moderator','sysop'].indexOf(mw.config.get('wgUserGroups')) >= 0) { massRenameDelay = 1000; massRenameSummary = 'automatic'; importScriptPage('MediaWiki:MassRename/code.js', 'dev');

massProtectDelay = 500; massProtectSummary = 'automatic'; importScriptPage('MediaWiki:MassProtect/code.js', 'dev'); }

importArticle({   type: 'style',    article: 'MediaWiki:Import.css' });

(window.dev = window.dev || {}).profileTags = { noHideTags: true };