Board Thread:New Features/@comment-1526346-20160902104505/@comment-452-20160918005357

Since I've already written a script which retrieves various special pages and maintenance categories and displays them on a single page - long before insights - I've repurposed it to create a mix-and-match maintenance list.

I've been using it for several days, and I haven't come across any major issues.

I'm following this thread, so if you find any bugs, or have any suggestions, leave a comment below and I'll look into it.

There are 3 different ways to use it, and 2 options, as explained below.

You can edit the lists of special pages and categories so they are more relevant to you. /* There are two ways to view MaintenanceReport: a div or a modal.

to any page for a button which launches a modal popup.
 * Special:MaintenanceReport to auto-start in a div
 * Add to any page to auto-start in a div
 * Or, add Maintenance Report

Unlike Wikia Staff, I believe in giving users a choice how to use features.

$(function {	if ( (!$('#MaintenanceReport').size && mw.config.get('wgCanonicalNamespace')+":"+mw.config.get('wgTitle') != "Special:MaintenanceReport") || typeof window.maintenanceReport != "undefined" ) return; //skip non-relevant pages and avoid duplicate instances.

window.maintenanceReport = { "options": { removeZero: false, //set to true to remove pages with zero results addButton: false   //set to true to add a button instead of autostarting. } };

maintenanceReport.results = {}; maintenanceReport.specials = new Array("Unusedcategories", "BrokenRedirects", "DoubleRedirects", "Deadendpages", "Lonelypages", "Uncategorizedcategories", "Uncategorizedpages", "Uncategorizedtemplates", "Wantedcategories", "Wantedfiles", "Wantedtemplates", "Unusedtemplates"); maintenanceReport.categories = new Array("Lonelypages", "DPL queries with no results", "DPL queries with errors", "Deletion proposals", "Merge proposals", "Dialogue template with one line", "Broken references", "Broken file links","Template errors","ParserFunction errors", "Template has invalid parameters","References needing descriptions","References needing names","Cleanup","Content requests","Image requests","Infobox needs information","Reference requests","Rating requests","Translation requests","Unconfirmed information");

if (mw.config.get('wgCanonicalNamespace')+":"+mw.config.get('wgTitle') == "Special:MaintenanceReport") { $("title").html("Maintenance Report"); $("#WikiaPageHeader h1").html("Maintenance Report"); $("h1#firstHeading").html("Maintenance Report"); $("#mw-content-text").html($(" ", {id:"MaintenanceReport" }) ); }	if (maintenanceReport.options.addButton) $('#MaintenanceReport').after($(" "), $(" ", { id:"MaintenanceReport", class:"button", html:"Start Maintenance Report" })).remove; if ($('#MaintenanceReport.button').size) $('#MaintenanceReport.button').click(function { MaintenanceReportInit(1) }); else MaintenanceReportInit; });

function showResult(message, result) { if (typeof window.MaintenanceReportNotify != "undefined") window.MaintenanceReportNotify.hide; window.MaintenanceReportNotify = new BannerNotification(message, result).show; }

function MaintenanceReportDisplay(andor) { var temp, output = new Array; $("#MaintenanceReport input[type=checkbox]").each(function{		if($(this).attr("checked")) {			temp = maintenanceReport.results[$(this).attr("id").substring(5)];			if (!output.length) {				output = output.concat(temp);			} else if (andor == "or") {				output = output.filter(function(i) { return temp.indexOf(i) == -1; });									output = output.concat(temp);			} else if (andor == "and") {				output = output.filter(function(i) { return temp.indexOf(i) != -1; });			}		}	});	$("#resultsPane ol").html(""); $(output).each(function(index, value) { 		$("#resultsPane ol").append(''+value+'');	}); }

function MaintenanceReportInit(modal) { var ajaxIndicator = window.ajaxIndicator || 'http://images.wikia.nocookie.net/common/skins/common/images/ajax.gif'; if(modal) { $("#MaintenanceReport").attr("id",""); $.showCustomModal('Maintenance Report', null, {			id: 'MaintenanceReportModal',			width: $(window).width - 254,		}); $(".modalContent").remove; $("#MaintenanceReportModal").css({"top":"100px","min-height":"452px"}); $("#MaintenanceReportModal h1").css({"margin-bottom":0,"text-align":"left"}).append("  "); $("#MaintenanceReportModal").append($(" ", {id:"MaintenanceReport", class:"WikiaArticle"})); $("#MaintenanceReportModal").css({			"text-align":"center",			overflow: "auto",		}); } else { $("#MaintenanceReport").empty; }	$("#MaintenanceReport").append(" "); $("#MaintenanceReport").append(" "); $("#listPane").append(		$(" ", { html:"Show Combined" }).click(function { MaintenanceReportDisplay("or") })	); $("#listPane").append(		$(" ", { html:"Show Intersection", style:"float:right;" }).click(function { MaintenanceReportDisplay("and") })	);

for(var i in maintenanceReport.specials) { $("#listPane").append(" "+maintenanceReport.specials[i]+" (Page) Loading "); $.getJSON('/api.php?action=query&format=json&list=querypage&qplimit=5000&qppage='+maintenanceReport.specials[i], function(result) {		 var formattedresults = new Array;		  var querypage = result.query.querypage;		  $(querypage.results).each(function(index, value) { if (querypage.name == "Unusedcategories") if (maintenanceReport.categories.indexOf("value.title") == -1) return; formattedresults.push(value.title); });		 $("#checkS"+querypage.name +" ~ span").html(" ("+formattedresults.length+")");		  		  $("#checkS"+querypage.name +" ~ span").removeClass("loading");		  if (!$("span.loading").size) $("#ajaxProgress").remove;

maintenanceReport.results["S"+querypage.name] = formattedresults;

if (!formattedresults.length) { $("#checkS"+querypage.name).prop("disabled",true); if (maintenanceReport.options.removeZero) $("#checkS"+querypage.name).parent.remove; }		 if (querypage.cachedtimestamp) { diff = count=Math.floor((new Date(new Date(querypage.cachedtimestamp).getTime+(24*60*60000)).getTime-new Date.getTime)/1000); if ($("#updateCountdown").attr("left") < diff) { $("#updateCountdown").attr("left", diff); var left = (diff%60) + 's';					diff=Math.floor(diff/60); if(diff > 0) left = (diff%60) + 'm ' + left;	diff=Math.floor(diff/60); if(diff > 0) left = (diff%24) + 'h ' + left;	diff=Math.floor(diff/24); if(diff > 0) left = diff + ' days ' + left; $("#updateCountdown").html("Time left until cache update: "+left); }		 }		});	}

for(var i in maintenanceReport.categories) { $("#listPane").append(" "+maintenanceReport.categories[i]+" (Page) Loading ");

$.getJSON('/api.php?action=query&format=json&list=categorymembers&cmlimit=5000&cmtitle=Category:'+maintenanceReport.categories[i]+'&requestid='+maintenanceReport.categories[i].replace(/ /g,""), function(results) {		 formattedresults = new Array;		  $("#checkC"+results.requestid +" ~ span").html("("+Object.keys(results.query.categorymembers).length+")");		  $("#checkC"+results.requestid +" ~ span").removeClass("loading");		  if (!$("span.loading").size) $("#ajaxProgress").remove;		  $(results.query.categorymembers).each(function(index, value) { formattedresults.push(value.title); });		 maintenanceReport.results["C"+results.requestid] = formattedresults;		  if (!formattedresults.length) {		  	$("#checkC"+results.requestid).prop("disabled",true);		  	if (maintenanceReport.options.removeZero) $("#checkC"+results.requestid).parent.remove;		  }		}); } }