MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ // var PurgeButtonText = 'Refresh', ajaxPages = ["Special:RecentChanges", "Special:Watchlist", "Special:Log", "Special:Contributions", "Special:WikiActivity", "Blog:Recent_posts"], AjaxRCRefreshText = 'Auto-refresh'; //preload line to add user category for special:upload and special:multipleupload function preloadUploadDesc { // check wgCanonicalSpecialPageName for upload page if ( [ 'MultipleUpload', 'Upload' ].indexOf( mw.config.get( 'wgCanonicalSpecialPageName' ) ) > -1 ) { // append Category:USERNAME to upload desc textarea $( '#wpUploadDescription').val( $( '#wpUploadDescription').val + '' ); } } $( preloadUploadDesc ); //edit buttons if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",           "tagClose": "", "sampleText": "Insert page" };   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": "http://images.wikia.com/central/images/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": "" };   mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/7/74/Button_comment.png", "speedTip": "Comment visible only for editors", "tagOpen": "", "sampleText": "Insert comment here" }; } /* Replaces with the name of the user browsing the page. Requires copying Template:USERNAME. */ function UserNameReplace { if (typeof (disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName === null) return; $("span.insertusername").html(wgUserName); } addOnloadHook(UserNameReplace); /* End of the replacement */ // window.UserTagsJS = { modules: {}, tags: { // group: { associated tag data }, // Titles that have to do with departmentallization CD: { u:'Claiming Department', m:'Claiming Department', f:'Claiming Department' }, HR: { u:'Human Resources', m:'Human Resources', f:'Human Resources' }, RD: { u:'Recreational Department', m:'Recreational Department', f:'Recreational Department' }, RDev: { u:'Research and Development', m:'Research and Development', f:'Research and Development' }, AS: { u:'Aid and Support', m:'Aid and Support', f:'Aid and Support' }, // Titles that have to do with User Rights H: { u:'Camp Helper', m:'Camp Helper', f:'Camp Helper' }, R: { u:'Rollback', m:'Rollback', f:'Rollback' }, C: { u:'Bureaucrat', m:'Bureaucrat', f:'Bureaucrat' } } }; UserTagsJS.modules.custom = { //CLAIMING DEPT //CRAT

//ADMIN 'Kevin Mo': ['CD'], '~The Musician~': ['CD'], 'Meloney': ['CD'], //RB 'YorkieWolf': ['CD', 'R'], 'Omnia Lesvos': ['CD', 'R'],

//HUMAN RESOURCES //CRAT 'Demi-hunter13': ['HR', 'C'], //ADMIN

//RB 'Mr.Suit ': ['HR', 'R'],

//RECREATIONAL DEPT //CRAT

//ADMIN

//RB

//RESEARCH AND DEVELOPMENT //CRAT 'Brocky292': ['RDev', 'C'], //ADMIN 'EvilhariboMadness': ['RDev'], 'Windsword7': ['RDev'], //RB 'A Son of Hades': ['RDev', 'R'],

//AID AND SUPPORT //ADMIN

//RB 'Eternal Sterek': ['AS', 'R'], 'ScalesofFate': ['AS', 'R'],

// Camp Helpers tag 'Nata Roebot': ['H'], 'Summer June': ['H'], 'WickedHuntressOfCookies': ['H'],

}; // Imports EditIntroButtonText = 'Intro'; importArticles({   type: 'script',    articles: [        'u:dev:Countdown/code.js',        'u:dev:UserTags/code.js',        'u:dev:EditIntroButton/code.js',        'u:dev:FixWantedFiles/code.js',        'u:dev:MiniComplete/code.js',        'u:dev:DupImageList/code.js',        'u:deadisland:User:Jgjake2/js/DISPLAYTITLE.js',        'u:dev:PurgeButton/code.js',        'u:dev:AjaxRC/code.js'         ] }, {    type: "style",    articles: [        "MediaWiki:KevinWordBubble.css",        "MediaWiki:KevinWordBubble2.css",        "MediaWiki:StaffHighlight.css"        ] });

/* IRClogin div */ $(function {   if ($('#IRClogin').length) {        if (typeof wgUserName == 'undefined') {            var nick = 'wgusername' + Math.floor(Math.random * 100);        } else {            var nick = wgUserName.replace(/ /g, "_");        }        $('#IRClogin').html(' ');    } });

/* Portable Infobox JS */ /* Adds parameter brackets ("") prepend and append to the Portable Infobox placeholders */

$('.pi-placeholder').each(function {   $(this).prepend(""); });

/* Adds an image placeholder ("File:|250px]]") if an image is not present in the Portable Infobox */ if($('.pi-image').length === 0){ $('.pi-header:first-of-type').after(" "); $('.pi-image-placeholder').css({           "font-size": "12px",            "text-align": "center",            "color": "#000000",    }); }

/* jQuery for Kevin's Word Bubble */ /* Shows the biography for the word bubble when "kevin-wb-hover" either the elements with that class are hovered or if the "kevin-wb-biography" class element is hovered */ $("#kevin-wb").ready(function {   $("#kevin-wb-image").show;    $("#kevin-wb-biography").hide; });

$(".kevin-wb-hover").hover(function {   $("#kevin-wb-image").hide;    $("#kevin-wb-biography").show; }, function{    $("#kevin-wb-image").show;    $("#kevin-wb-biography").hide; });

/* Detects the user agent of the browser that the user is using; displaying modified parts of the word bubble specifically for Internet Explorer browsers and Mozilla Firefox browsers due to CSS incompatibility */

$("#kevin-wb").ready(function {   var DetectIE = IEVersion;    var DetectIEEdge = IEEdgeVersion;    var DetectFirefox = FirefoxVersion;    if (DetectIE === false && DetectIEEdge === false && DetectFirefox === false) {        $("#kevin-wb-other-header").show;        $("#kevin-wb-firefox-ie-header").hide;        $("#kevin-wb-ie-biography").hide;        $("#kevin-wb-other-biography").show;    }    if (DetectIE === true) {        $("#kevin-wb-ie-biography").show;        $("#kevin-wb-other-biography").hide;        $("#kevin-wb-other-header").hide;        $("#kevin-wb-firefox-ie-header").show;    }    if (DetectIEEdge === true) {        $("#kevin-wb-ie-biography").show;        $("#kevin-wb-other-biography").hide;    }    if (DetectFirefox === true) {        $("#kevin-wb-other-header").hide;        $("#kevin-wb-firefox-ie-header").show;    }    function IEVersion { var userAgent = window.navigator.userAgent; var MSIE = userAgent.indexOf('MSIE'); var Trident = userAgent.indexOf('Trident/'); if (MSIE > -1 || Trident > -1) { return true; }           return false; }   function IEEdgeVersion { var userAgent = window.navigator.userAgent; var Edge = userAgent.indexOf('Edge/'); if (Edge > -1) { return true; }           return false; }   function FirefoxVersion { var userAgent = window.navigator.userAgent; var Firefox = userAgent.indexOf('Firefox/'); if (Firefox > -1) { return true; }       return false; } });