MediaWiki:Gadget-oldfilepages.js

// // BEGIN MW GADGET // *********

$(function restoreFilePages {	if (mw.config.get("wgNamespaceNumber") != 6 || !$("ul.tabs").length)		return;	if (skin === "oasis") {		var api = new mw.Api;		$("ul.tabs").remove;		$(".tabBody").css({display: "block"});		var newListing = $(" Pages that use this file  ");		$("section.page-listings").remove;		$("div[data-tab-body='history']").after(newListing);		api.get({ action: "query", list: "imageusage", iutitle: mw.config.get("wgPageName"), format: "json", iulimit: 100 }).done(function (data) { var pages = data.query.imageusage; for (var i = 0; i < pages.length; i++) { var page = pages[i]; $("#file-listing-list").append("" + page.title + ""); }			if (data.hasOwnProperty("query-continue")) { $("#file-listing-list").prepend("More than 100 pages use this file. See all pages that use this file."); }		});		return;	} else {		return;	} });

//END MW GADGET //