User:Cqm/Scrapbook.js

/** * Test js page */

/** * Admin report * * Reports on various administrative categories and pages * returning number of category members or last edited date * * by User:Cåm */

var reports = [], reportPages = ['RuneScape:Active_discussions', 'User:Cåm/Scrapbook_7'];

if ($.inArray(mw.config.get('wgPageName'), reportPages) > -1) {

$(function {

$('#mw-content-text').prepend('    ');

/**		 * Reports the date the page was last edited * Requires individual page ids in .getJSON request */

// Requests for permissions - 239188 $.getJSON('/api.php?action=query&prop=info&titles=RuneScape:Requests_for_permissions&format=json', function (data) {			var perms = data.query.pages['239188'].touched;			reports.push('Permissions (0) &bull; ');		});

// AutoWikiBrowser requests - 211974 $.getJSON('/api.php?action=query&prop=info&titles=RuneScape:AutoWikiBrowser/Requests&format=json', function (data) {			var awbRequests = data.query.pages['211974'].touched;			reports.push('AWB (0) &bull; ');		});

// Administrator requests - 197645 $.getJSON('/api.php?action=query&prop=info&titles=RuneScape:Administrator_requests&format=json', function (data) {			var adminRequests = data.query.pages['197645'].touched;			reports.push('AR (0) &bull; ');		});

// User help - 92936 $.getJSON('/api.php?action=query&prop=info&titles=RuneScape:User_help&format=json', function (data) {			var userHelp = data.query.pages['92936'].touched;			reports.push('UH (0) &bull; ');		});

// Counter-vandalism unit - 3558 $.getJSON('/api.php?action=query&prop=info&titles=RuneScape:Counter-Vandalism_Unit&format=json', function (data) {			var cvu = data.query.pages['3558'].touched;			reports.push('CVU (0) ');		});

/**		* Reports the number of pages in a category * Adjusted to account for RuneScape:Placholder */

// Speedy move candidates $.getJSON('/api.php?action=query&list=categorymembers&cmtitle=Category:Speedy_move_candidates&format=json', function (data) {			var sMove = data.query.categorymembers.length;			var speedyMove = sMove - 1;			reports.push('Speedy move (' + speedyMove + ') &bull; ');		});

// Speedy deletion candidates $.getJSON('/api.php?action=query&list=categorymembers&cmtitle=Category:Speedy_deletion_candidates&format=json', function (data) {			var sDel = data.query.categorymembers.length;			var speedyDel = sDel - 1;			reports.push('Speedy del (' + speedyDel + ') &bull; ');		});

// Requests for closure $.getJSON('/api.php?action=query&list=categorymembers&cmtitle=Category:Requests_for_closure&format=json', function (data) {			var closure = data.query.categorymembers.length;			var rfClosure = closure - 1;			reports.push('Closure (' + rfClosure + ')</a> ');		});

/**		 * Links to Recent Changes and variants */

var rcLinks = 'RecentChanges</a> &bull; RCH</a> &bull; AbuseLog</a> &bull; RC Patrol</a> '; reports.push(rcLinks);

/**		 * Special page report * Adapted from MediaWiki:Common.js/spreport.js */

// convert w:c:camtest:MediaWiki:Maintenance

var reportList = reports.join('');

$('#reportLoading').remove; $('#reportInner').append(reportList);

});

}

/* */