MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ /* If you don not know what you are doing, do not edit this page */

// Hide edit button on Exchange pages for wcs function AnonMessage { if(wgUserGroups == null) { $('.anonmessage').css('display', 'inline'); } }

// Fill the block expiry time with a default value var wgDefaultExpiryBlock = '1 week'; if ( wgNamespaceNumber == -1 && wgCanonicalSpecialPageName == 'Blockip' ) { $(function {		if ( ($('#wpBlockExpiry').val ==  || $('#wpBlockExpiry').val == 'other') && $('#mw-bi-other').val ==  ) {			$('#wpBlockExpiry').val('1 week').trigger('change');		}	}); } // Credit to Beyblade wiki. // Adding "My Contributions" to user menu. // Function: Adds "My Contributions" to the UserDropdownMenu. function UserContribsMenuItem { $('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('My contributions'); } addOnloadHook(UserContribsMenuItem); function onloadhookcustom { var replace = document.getElementById("OnlineChat"); if (null != replace) { var getvalue = replace.getAttribute("class"); replace.innerHTML=' [ Copy this | Start New | Full Size</a> ]'; } } if (window.addEventListener) {window.addEventListener("load",onloadhookcustom,false);} else if (window.attachEvent) {window.attachEvent("onload",onloadhookcustom);}

/* some imports*/ importScriptPage('BackToTopButton/code.js', 'dev'); importScriptPage('SearchGoButton/code.js', 'dev');

/** Archive edit tab disabling ************************************* * Disables the edit tab on old forum topic pages to stop new people bumping old topics. * Page can still be edited by going via the edit tab on the history etc, or by * typing the edit address manually. * By Spang * Monaco support by Uberfuzzy * Oasis support by Uberfuzzy */ if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) { function disableOldForumEdit { if( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) { return; }	if( !document.getElementById('old-forum-warning') ) { return; } if(skin == 'oasis') { $('#WikiaPageHeader .wikia-menu-button > a').html('Archived').removeAttr('href'); return; }	if( !document.getElementById('ca-edit') ) { return; }	var editLink = null; if( skin == 'monaco' ) {		editLink = document.getElementById('ca-edit'); }	else if( skin == 'monobook' ) {		editLink = document.getElementById('ca-edit').firstChild; }	else {		return; }	editLink.removeAttribute('href', 0); editLink.removeAttribute('title', 0); editLink.style.color = 'gray'; editLink.innerHTML = 'Archived'; $('span.editsection-upper').remove; } addOnloadHook( disableOldForumEdit ); }

/* lock blog comments for blogs that haven't been commented on for more than 30 days. by: Joey Ahmadi $(function { if (wgNamespaceNumber == 500 && $('#article-comments-ul li').size > 1) { var then = $('#article-comments-ul > .SpeechBubble:first .permalink').attr('href'); then = new String(then.match(/\d{8}/)); var monthnames = ['January','February','March','April','May','June','July', 'August','September','October','November','December']; var year = then.match(/^\d{4}/); var month = then.substring(4,6); var now = new Date; month--; month= monthnames[month]; var day = then.match(/\d{2}$/); then = new Date(month+''+day+', '+year); var old = parseInt(now - then); old = Math.floor(old/(1000*60*60*24)); if (old > 30) { $('#article-comm').attr('disabled','disabled').text('This blog post hasn\'t been commented on for over 30 days. There is no need to comment.'); $('#article-comm-submit').attr('disabled','disabled'); $('.article-comm-reply').remove; } } });

importScriptPage('ShowHide/code.js', 'dev');

function fBox { $('#fbox').append('<iframe marginheight="0" marginwidth="0" src="http://www.facebook.com/connect/connect.php?id=202082182029&amp;connections=10&amp;stream=1" align="top" frameborder="0" width="300" height="250" scrolling="no" />'); }

$(fBox);

function fBox2 { $('#fbox2').append('<iframe marginheight="0" marginwidth="0" src="http://www.facebook.com/connect/connect.php?id=202082182029&amp;connections=0&amp;stream=0" align="top" frameborder="0" width="300" height="250" scrolling="no" />'); }

$(fBox2); function onloadhookcustom { var replace = document.getElementById("JRChatReplace"); if (null != replace) { replace.innerHTML='<iframe src="http://webchat.freenode.net/?channels=#wikia-halfblood" width="450" height="400"> '; if (window.attachEvent) window.attachEvent("onbeforeunload",confirmexitjrchat); else window.onbeforeunload = confirmexitjrchat;

} //alert(document.getElementById("JRChatReplace").innerHTML);

}

if (window.addEventListener) window.addEventListener("load",onloadhookcustom,false); else if (window.attachEvent) window.attachEvent("onload",onloadhookcustom); /* 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 */

var ShowHideConfig = { brackets: '' }; importScriptPage('ShowHide/code.js', 'dev'); importScriptPage('CollapsibleInfobox/code.js', 'dev'); //for examples on CollapsibleInfobox

//main importScript('MediaWiki:Common.js/main.js'); //main//

// Cookie accessor functions importScript('MediaWiki:Common.js/cookieAccessor.js'); // END Cookie accessor functions

// Collapsibles var autoCollapse = 2; var collapseCaption = "hide"; var expandCaption = "show"; var maxHeight = 300; // Collapsible Tables importScriptPage('ShowHide/code.js', 'dev'); // END of Collapsible Tables // Standard Edit Summaries importScript('MediaWiki:Common.js/standardeditsummaries.js'); // END of Standard Edit Summaries

//AjaxBatchDelete importScriptPage('AjaxBatchDelete/code.js', 'dev'); //END AjaxBatchDelete // Ajax auto-refresh var ajaxPages = ['Special:RecentChanges','Special:WikiActivity','Special:Contributions']; var AjaxRCRefreshText = 'Auto-refresh'; importScriptPage('AjaxRC/code.js', 'dev'); var ajaxRefresh = 30000; // END of ajax auto-refresh

// Extra Rollback Buttons importScript('MediaWiki:Common.js/extraRollbacks.js'); // END Extra Rollback Buttons // AjaxRollback - works with Extra Rollback Buttons importScript('MediaWiki:Common.js/ajaxRollback.js'); // END AjaxRollback // Countdown code importScriptPage('Countdown/code.js', 'dev'); // END Countdown code // JS for Template:CSS importScript('MediaWiki:Common.js/userCSS.js'); // END JS for Template:CSS // Adds PURGE button for both skins var PurgeButtonText = 'Purge'; importScriptPage('PurgeButton/code.js', 'dev'); // END Adds PURGE button for both skins // For UserGroup-only messages importScript('MediaWiki:Common.js/UserGroupMessages.js'); // END For UserGroup-only messages

// Inactive users importScriptPage('InactiveUsers/code.js', 'dev'); // END Inactive users // Add "Edit Intro" Button/Tab importScriptPage('EditIntroButton/code.js', 'dev'); // END Add "Edit Intro" Button/Tab // Adds PopupsNavigation importScript('MediaWiki:Common.js/popupsNav.js'); // END Adds PopupsNavigation // Add Enhanced DIFF View importScript('MediaWiki:Common.js/wikEdDiff.js'); // END Add Enhanced DIFF View // Add Template:Information to Special:Upload importScript('MediaWiki:Common.js/uploadTemp.js'); // END Add Template:Information to Special:Upload // Backwards compatibility CSS importScript('MediaWiki:Common.js/backupCSS.js'); // END Backwards compatibility CSS // Locate Main Page "Buttons" into Headers importScript('MediaWiki:Common.js/mainPageButtons.js'); // END Locate Main Page "Buttons" into Headers // IE-specific fixes importScript('MediaWiki:Common.js/IE.js'); // END IE-specific fixes // Display Comments w/ Local Times // importScript('MediaWiki:Common.js/localTimeComments.js'); // END Display Comments w/ Local Times

// 06:49, November 1, 2011 (UTC) //

//