MediaWiki:Gadget-quickFileMove.js

// Adds a way to quickly move a file // Authored by http://cod.wikia.com/wiki/User:Sactage  2012

function quickMoveFile { $("#filetoc").append(" Move "); $("#qm-button").click( function {		newname = $("#qm-name").val;		if (newname == "File:" || newname == "") {			alert("You must choose a new filename.");			return;		} else if (newname.indexOf("File:") != 0) { 			alert("The new name must start with 'File:'");			return;		} else {			$.post("/api.php", {action: "move", from: wgPageName, to: newname, token: mw.user.tokens.values.editToken, noredirect: , movetalk: , reason: "Moving " + wgPageName + " to " + newname}, function  { window.location.href = wgServer + "/wiki/" + newname; });		}	}); } if (wgCanonicalNamespace == "File") { addOnloadHook(quickMoveFile); }