MediaWiki:Common.js

//************************************************ // Imported Scripts //************************************************ importScriptPage('MediaWiki:Common.js/stdsummaries.js'); importScriptPage('MediaWiki:Common.js/userRightsIcons.js'); importScriptPage('Countdown/code.js', 'dev'); importScriptPage('BackToTopButton/code.js', 'dev'); importScriptPage('PurgeButton/code.js', 'dev' ); importScriptPage('DisableArchiveEdit/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c');

//************************************************ // //************************************************ if (wgUserName != 'null') { $('.insertusername').html(wgUserName); }

//************************************************ // Wanted Files Tweak //************************************************ $(function {   if ("Special" == wgCanonicalNamespace && "WantedFiles" == wgCanonicalSpecialPageName) {        $('ol.special a.new').each(function { var m = $(this).attr('href').match(/title=File:([^&]+)/); if (m) { $(this).attr({                   href: '/wiki/Special:Upload?wpDestFile=' + m[1],                    title: 'Upload ' + m[1]                }); }       });    } });

//************************************************ // Adds Button to Edit Message Wall Greeting //************************************************ function EditGreeting { if (wgCanonicalNamespace == 'Message_Wall' && wgAction != 'history') { if (wgTitle == wgUserName) { $('.WikiaMainContent').prepend('  Edit greeting	 '); }	} }

addOnloadHook(EditGreeting);

//************************************************ // Test if an element has a certain class // Maintainers: Mike Dillon, R. Koot, SG //************************************************ var hasClass = (function {   var reCache = {};   return function (element, className) {      return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);  }; });

//************************************************ // Disable Archive Edit Config //************************************************ var DisableArchiveEditConfig = { archiveSubpage: 'Archive', disableCompletely: false, textColor: '#D9D9D9', userLang: true };