MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/* This code is loaded on all skins. importScriptPage('ShowHide/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: User:LeftyTheSketch $(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; } } }); /* Opens chat in a new window for homepage */ $(".openchat a").click(function {  window.open('/wiki/Special:Chat', 'wikiachat', 'width=600,height=600,menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=yes');   return false; }); /* $(function{	if ( wgNamespaceNumber === 112 || wgNamespaceNumber === 113 ||wgNamespaceNumber === 114 || wgNamespaceNumber === 115 ) {		var FEurl = wgScript + '?title=Admin_Central:Main_Page';		$('h1.wordmark.medium.graphic > a').attr('href', FEurl);	} });

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/funnye/images/c/c5/Boxbutton.PNG", "speedTip": "Box (to put text in)", "tagOpen": "", "sampleText": "	};