MediaWiki:Common.js

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

/* Archive */ importScriptPage('ArchiveTool/code.js', 'dev');

/**Batch del**/ importScriptPage('AjaxBatchDelete/code.js', 'dev');

/** Purge Button **/ importScriptPage('PurgeButton/code.js', 'dev'); /** Test if an element has a certain class ************************************** * * Description: Uses regular expressions and caching for better performance. * Maintainers: User:Mike Dillon, User:R. Koot, User: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 );       }; });

/* 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; } } });

/** Auto refresh on RecentChanges ******************************************* */

AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refreshes the current page every 30 seconds.'; importScriptPage('AjaxRC/code.js', 'dev');

/** Inactive users *************** */

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

/** Duplicate images *************** */ importScriptPage('DupImageList/code.js', 'dev'); // 11:52, February 19, 2012 (UTC) //