MediaWiki:Common.js

/* Clock */ window.DisplayClockJS = '%X %x [%{Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday}w] (UTC)'; /* Last edit header */ window.lastEdited = { avatar: true, size: true, diff: true, comment: true, time: 'timeago', namespaces: { include: [], exclude: [] },   pages: [] }; SpoilerAlert = { pages: ["Spoiler"], };

// Tags window.UserTagsJS = { modules: { autoconfirmed: true, inactive: { days: 60, namespaces: [0], zeroIsInactive: true },       mwGroups: [ 'bannedfromchat', 'bureaucrat', 'chatmoderator', 'sysop', 'rollback', 'patroller', 'bot', 'discord fanoner', 'discord founder', 'imagecontroller' ],       newuser: true } }; // Tabber var Tabs = { switchDuration: 400, selectorDuration: 200, inactiveOpacity: 0.25, hoverOpacity: 0.6, tab1: null, tab2: null, tab3: null, tab4: null, tab5: null, tab6: null, tab1Selector: null, tab2Selector: null, tab3Selector: null, tab4Selector: null, tab5Selector: null, tab6Selector: null, selected: 1, hoverTab: function (tab) { "use strict"; if (tab === Tabs.selected) { return; }       if (tab === 1) { Tabs.tab1Selector.animate({               opacity: Tabs.hoverOpacity            }, Tabs.selectorDuration); }       if (tab === 2) { Tabs.tab2Selector.animate({               opacity: Tabs.hoverOpacity            }, Tabs.selectorDuration); }       if (tab === 3) { Tabs.tab3Selector.animate({               opacity: Tabs.hoverOpacity            }, Tabs.selectorDuration); }       if (tab === 4) { Tabs.tab4Selector.animate({               opacity: Tabs.hoverOpacity            }, Tabs.selectorDuration); }       if (tab === 5) { Tabs.tab5Selector.animate({               opacity: Tabs.hoverOpacity            }, Tabs.selectorDuration); }       if (tab === 6) { Tabs.tab6Selector.animate({               opacity: Tabs.hoverOpacity            }, Tabs.selectorDuration); }   },    unhoverTab: function (tab) { "use strict"; if (tab === Tabs.selected) { return; }       if (tab === 1) { Tabs.tab1Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (tab === 2) { Tabs.tab2Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (tab === 3) { Tabs.tab3Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (tab === 4) { Tabs.tab4Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (tab === 5) { Tabs.tab5Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (tab === 6) { Tabs.tab6Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }   },    changeTab: function (tab) { "use strict"; if (tab === Tabs.selected) { return; }       if (Tabs.selected === 1) { Tabs.tab1.hide(Tabs.switchDuration); Tabs.tab1Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (Tabs.selected === 2) { Tabs.tab2.hide(Tabs.switchDuration); Tabs.tab2Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (Tabs.selected === 3) { Tabs.tab3.hide(Tabs.switchDuration); Tabs.tab3Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (Tabs.selected === 4) { Tabs.tab4.hide(Tabs.switchDuration); Tabs.tab4Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (Tabs.selected === 5) { Tabs.tab5.hide(Tabs.switchDuration); Tabs.tab5Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       if (Tabs.selected === 6) { Tabs.tab6.hide(Tabs.switchDuration); Tabs.tab6Selector.animate({               opacity: Tabs.inactiveOpacity            }, Tabs.selectorDuration); }       Tabs.selected = tab; if (tab === 1) { Tabs.tab1.show(Tabs.switchDuration); Tabs.tab1Selector.animate({               opacity: 1            }, Tabs.selectorDuration); }       if (tab === 2) { Tabs.tab2.show(Tabs.switchDuration); Tabs.tab2Selector.animate({               opacity: 1            }, Tabs.selectorDuration); }       if (tab === 3) { Tabs.tab3.show(Tabs.switchDuration); Tabs.tab3Selector.animate({               opacity: 1            }, Tabs.selectorDuration); }       if (tab === 4) { Tabs.tab4.show(Tabs.switchDuration); Tabs.tab4Selector.animate({               opacity: 1            }, Tabs.selectorDuration); }       if (tab === 5) { Tabs.tab5.show(Tabs.switchDuration); Tabs.tab5Selector.animate({               opacity: 1            }, Tabs.selectorDuration); }       if (tab === 6) { Tabs.tab6.show(Tabs.switchDuration); Tabs.tab6Selector.animate({               opacity: 1            }, Tabs.selectorDuration); }   },    init: function  { "use strict"; Tabs.tab1 = $('#content-1'); Tabs.tab1Selector = $('#selector-1').click(function {            Tabs.changeTab(1);            return false;        }).css('opacity', 1); Tabs.tab1Selector.hover(function {            Tabs.hoverTab(1);        }, function  {            Tabs.unhoverTab(1);        }); Tabs.tab2 = $('#content-2'); Tabs.tab2Selector = $('#selector-2').click(function {            Tabs.changeTab(2);            return false;        }).css('opacity', Tabs.inactiveOpacity); Tabs.tab2Selector.hover(function {            Tabs.hoverTab(2);        }, function  {            Tabs.unhoverTab(2);        }); Tabs.tab3 = $('#content-3'); Tabs.tab3Selector = $('#selector-3').click(function {            Tabs.changeTab(3);            return false;        }).css('opacity', Tabs.inactiveOpacity); Tabs.tab3Selector.hover(function {            Tabs.hoverTab(3);        }, function  {            Tabs.unhoverTab(3);        }); Tabs.tab4 = $('#content-4'); Tabs.tab4Selector = $('#selector-4').click(function {            Tabs.changeTab(4);            return false;        }).css('opacity', Tabs.inactiveOpacity); Tabs.tab4Selector.hover(function {            Tabs.hoverTab(4);        }, function  {            Tabs.unhoverTab(4);        }); Tabs.tab5 = $('#content-5'); Tabs.tab5Selector = $('#selector-5').click(function {            Tabs.changeTab(5);            return false;        }).css('opacity', Tabs.inactiveOpacity); Tabs.tab5Selector.hover(function {            Tabs.hoverTab(5);        }, function  {            Tabs.unhoverTab(5);        }); Tabs.tab6 = $('#content-6'); Tabs.tab6Selector = $('#selector-6').click(function {            Tabs.changeTab(6);            return false;        }).css('opacity', Tabs.inactiveOpacity); Tabs.tab6Selector.hover(function {            Tabs.hoverTab(6);        }, function  {            Tabs.unhoverTab(6);        }); } }; Tabs.init; // Show username function userNameReplace { "use strict"; var disableUsernameReplace; if (typeof (disableUsernameReplace) !== 'undefined' && disableUsernameReplace || mw.config.get('wgUserName') === null) { return; }   $("span.insertusername").html(mw.config.get('wgUserName')); } addOnloadHook(userNameReplace); // Add custom edit buttons if (mw.config.get('mwCustomEditButtons')) mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'http://vignette3.wikia.nocookie.net/sml/images/e/e1/O_Accent_Button.png/revision/latest?cb=20161208115611', 'speedTip': 'Mark for deletion', 'tagOpen': '', 'sampleText': 'your reason here' };      	    mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAWCAMAAAAcqPc3AAAAAXNSR0IArs4c6QAAAk9QTFRFAAAAgAAAAIAAgIAAAACAgACAAICAwMDAwNzApsrwAAAAQ1l4SGB7a3uQdYijhpixkKO9k6bAl6rEmq3HnrHLo7bQqLvVrb/YsMPds8bgus3nvc/owdTuxNjzydz20uT91+f+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////QEBAQUFBQkJCQ0NDRERERUVFRkZGR0dHSEhISUlJSkpKS0tLTExMTU1NTk5OT09PUFBQUVFRUlJSU1NTVFRUVVVVVlZWV1dXWFhYWVlZWlpaW1tbXFxcXV1dXl5eX19fYGBgYWFhYmJiY2NjZGRkZWVlZmZmZ2dnaGhoaWlpampqa2trbGxsbW1tbm5ub29vcHBwcXFxcnJyc3NzdHR0dXV1dnZ2d3d3eHh4eXl5enp6e3t7fHx8fX19fn5+f39/gICAgYGBgoKCg4ODhISEhYWFhoaGh4eHiIiIiYmJioqKi4uLjIyMjY2Njo6Oj4+PkJCQkZGRkpKSk5OTlJSUlZWVlpaWl5eXmJiYmZmZmpqam5ubnJycnZ2dnp6en5+foKCgoaGhoqKio6OjpKSkpaWlpqamp6enqKioqampqqqqq6urrKysra2trq6ur6+vsLCwsbGxsrKys7OztLS0tbW1tra2t7e3uLi4ubm5urq6u7u7vLy8vb29vr6+v7+/wMDAwcHBwsLCw8PDxMTECL3QDwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB90GCQccCQrY7AcAAACHSURBVCjPfchZDsMgEATR+jfOhldsSLj/JdNJjIRHKE+IHhW5qSe/Whz52dKRU4Jk/ekxQrTU9x12S33bYLPUQ4Bgqa8rrJb6ssBiqc8zzJb6NMFUlEt9HGEsyqk+DMBwKKe6954TBa/+kFP/BPV7Tfm76rca/Fb9WuNY9UuLo3ddVz194vo3NB0oZdoKj8sAAAAASUVORK5CYII=", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",		"tagClose": "", "sampleText": "Insert text" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/clubpenguin/images/3/31/HighlightButton.png", "speedTip": "Highlight", "tagOpen": " ", "tagClose": " ", "sampleText": "Highlighted text here." };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/5/56/Button_big.png", "speedTip": "Large Text", "tagOpen": " ", "tagClose": " ", "sampleText": "Insert Text Here" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/5/58/Button_small.png", "speedTip": "Small Text", "tagOpen": " ", "tagClose": " ", "sampleText": "Insert Text Here" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/f/fd/Button_underline.png", "speedTip": " Underline Selected Text ", "tagOpen": " ", "tagClose": " ", "sampleText": "Insert text to underline!" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAWCAYAAAArdgcFAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB90GCBEoGHtVh6UAAAAMaVRYdENvbW1lbnQAAAAAALyuspkAAAIYSURBVDjLtVW7ihRBFD13uvYxa2hmICIo4scIJgqCoOAPmAhGfoEYGGxiIisL/oCIoIEiGGhiZKDsKLg7jbrs4AxOd92HQVXPw77twqKVnOCcunWq7rkUmZnhP6w797YQBvuAmYGIXARwJO7j7jeEKI3xLjwaFytFr65qTKsai3j71k3cuHYFg8GgxTW4/eghrl+9jGdPn7gaM0MwSoct4mDnE0YHBxiPfyYvjmZv9yvK4R7KctihIQRmbXcj31DFIKJuw5oYqPoaMkNgjm6jAECUIcJuw8w0FxdXQ0QIIgwygxHN0LJ1ZYbEeombaVTzDdTXGBBULZ+GGc6dG1iXuQY139AMrgYwhLqOnW9elkMUYcV988lkkgyIIEZ2FIQgIl21sXn/7qGTmBrarkGE9OZd1s+eO4+NjWNu0S+fd7D/43t6c7cGchRzNmeYrV+4eAknT51e5jJubz3Am9cvoWpg0ZZGU/Ho7QUAMDNijC2OAGhOi6j4GjOEyJxanto8RwDCAo6xzRHBNMdV1NeAEIS5wzcgqnn62ndrhk3/oslp+WPjLAmak9DeOM+5uRoiQmARENJUNti4FxGIyBLX4Hz81deYITSNWVxFEVJWewRRcWPW6xVZW3RoCLT5+EXrm2NmqAhW19Y6h8dMUU0rrPf7Lv/81TuE0WjcWeDXNB46oVXt719dLxDevv/wzz/nlX7AmRPH8RuTxxRrcgmtcAAAAABJRU5ErkJggg==", "speedTip": "History table", "tagOpen": "{|class=\"wikitable sortable\"\n! scope=\"col\"| Catalog\n! scope=\"col\"| Available from\n! scope=\"col\"| Available until\n|-\n|catalog goes here\n|starting date\n|ending date\n|}", };   mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'http://images2.wikia.nocookie.net/__cb20100821183407/bleach/en/images/e/e1/O_Accent_Button.png', 'speedTip': 'Add the ō character', 'tagOpen': 'ō', 'tagClose': '', 'sampleText': '' };   mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'http://images4.wikia.nocookie.net/__cb20100821183407/bleach/en/images/d/db/U_Accent_Button.png', 'speedTip': 'Add the ū character', 'tagOpen': 'ū', 'tagClose': '', 'sampleText': '' };   mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'http://images1.wikia.nocookie.net/naruto/images/7/79/Button_reflink.png', 'speedTip': 'Add a reference', 'tagOpen': ' ', 'sampleText': '' };       mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'https://facebookbrand.com/wp-content/themes/fb-branding/prj-fb-branding/assets/images/fb-art.png', 'speedTip': 'Add a Facebook like button', 'tagOpen': '', 'tagClose': '', 'sampleText': '' };       mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'https://facebookbrand.com/wp-content/themes/fb-branding/prj-fb-branding/assets/images/fb-art.png', 'speedTip': 'Add a Facebook share button', 'tagOpen': '', 'tagClose': '', 'sampleText': '' };       mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'http://vignette4.wikia.nocookie.net/sml/images/f/f7/Twitter.png/revision/latest?cb=20170122231631', 'speedTip': 'Add a Twitter follow button', 'tagOpen': 'Follow @username', 'tagClose': ' ', 'sampleText': '' };       mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'http://vignette4.wikia.nocookie.net/sml/images/f/f7/Twitter.png/revision/latest?cb=20170122231631', 'speedTip': 'Add a Twitter tweet button', 'tagOpen': ' ', 'tagClose': ' ', 'sampleText': '' };       mw.config.get('mwCustomEditButtons')[mw.config.get('mwCustomEditButtons').length] = { 'imageFile': 'https://blog.agilebits.com/wp-content/uploads/2015/01/Tumblr-icon.png', 'speedTip': 'Add a Tumblr share button', 'tagOpen': ' ', 'tagClose': ' ', 'sampleText': '' }; $(function {    "use strict";    // Change title    var newTitle = $('#title-meta').html,        edits = $('#user_masthead_since').text;    if (!newTitle) {        return;    }    $('.firstHeading, #WikiaUserPagesHeader h1, #WikiaPageHeader h1').html(newTitle);    $('.#user_masthead_head h2').html(newTitle + '' + edits + ' '); }); // SocialIcons config var SocialMediaButtons = { position: "top", colorScheme: "color" }; AjaxRCRefreshText = 'Auto-Refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; ajaxPages = ["Special:RecentChanges","Special:WikiActivity","Special:UncategorizedPages","Special:AllPages"]; importScriptPage('AjaxRC/code.js', 'dev');

/* .username is the same class for the 'Edited by' section of Wall/Blog/Forum posts This should be changed to something more specific to not conflict $('.username').text(mw.config.get('wgUserName'));

/* The SML Quiz, hopefully works! */

var quizName = "The SuperMarioLogan Quiz"; var quizLang = "en"; var resultsTextArray = [ "Don't be such a Jeffy!", "Not bad and not perfect, right in the middle!", "You have a great SML memory!" ]; var questions = [ ["How old is Jeffy?", "12",      "3",       "7",       "4"],       ["Who is Bowser's ex-wife", "Sheila Perkins", "Flandre Scarlet", "Mary Poppins", "Miss Finch"], ["What channel was Schizophrenia Case Study uploaded on", "SuperLuigiLogan", "SuperMarioLogan", "SuperPeachLogan", "SuperBowserLogan"], ["Who created the term 'Chef Pee Pee's Torture Porn'", "Dabhdude", "Yoshi Player", "SML Reviewer", "Draco Lumina"], ["How many times have the SML Crew moved?", "2",      "1",       "4",       "3"],       ["What date does Jeffy's Parents take place?", "January 24, 2017", "April 12, 2016", "January 24, 2016", "December 26, 2007"], ];

function addTwitterFollowButton { $('#twitter-follow-button').append('Follow @SuperMarioLoga3 '); } $(addTwitterFollowButton);

function addTwitterTweetButton { $('#twitter-tweet-button').append('Tweet '); } $(addTwitterTweetButton);

function addLinkedInButton { $('#linkedin-button').append('lang: + mw.config.get("wgUserLanguage") + mw.config.get("wgUserLanguage").toUpperCase +  '); } $(addLinkedInButton);

//

function addSinaWeiboButton { $('#sinaweibo-button').append(' '); } $(addSinaWeiboButton);

function addTwitterMessageButton { $('#twitter-message-button').append('<a href="https://twitter.com/messages/compose?recipient_id=3805104374" class="twitter-dm-button" data-screen-name="@FlandrTakane333">Message</a><script src="http://platform.twitter.com/widgets.js" type="text/javascript"> '); } $(addTwitterMessageButton);

function addFlipboardFlipButton { $('#flipboard-flip-button').append('<a data-flip-widget="flipit" href="https://flipboard.com">Add to Flipboard Magazine.</a><script src="https://cdn.flipboard.com/web/buttons/js/flbuttons.min.js" type="text/javascript"> '); } $(addFlipboardFlipButton);

// Add Twitter timeline to sidebar by King Dragonhoff from boombeach.wikia.com $(window).load(function {    $('.ChatModule').after('<section class="module" id="twittermodule"><a class="twitter-timeline" data-height="380" href="https://twitter.com/SMLWiki">Tweets by SMLWiki</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"> ');    !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); });

function addThisButton { $('#addthis-button').append('<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-58caffe0baa142cb"> '); } $(addThisButton);
 * Any JavaScript here will be loaded for all users on every page load. */