Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
/* Close Edit Template requests on talk page */
function ETp() {
	var wpTextbox = document.getElementById("wpTextbox1");
	wpTextbox.value = wpTextbox.value.replace(/{{edit (.*?)(?:\|answered=[^}\|]*(.*?))?}}/g, "{{edit $1|answered=yes$2}}");
	var userMatch = /\[\[User:(.*?)[\|\]]/i.exec(wpTextbox.value)[1]
	wpTextbox.value = wpTextbox.value.replace(/\n$/, "");
	wpTextbox.value = wpTextbox.value.concat("\n:{{Ping|",userMatch,"}} {{subst:","ETp|d}}. --~~","~~\n\n{{-}}");
	document.getElementById("wpSummary").value = document.getElementById("wpSummary").value.concat("Answered [[User:",userMatch,"|",userMatch,"]]'s edit request: Done");
}

if ((mw.config.get('wgNamespaceNumber') == 11 || mw.config.get('wgNamespaceNumber') == 829) && (document.getElementById("wpTextbox1") !== null)){ //Template talk: and Module talk:
	$.when(mw.loader.using('mediawiki.util'), $.ready ).then(
		function() {
	    	mw.util.addPortletLink( 'p-tb', '', 'Close ETp', 'ETpLink', 'Close Edit Template request on talk page.',null,null);
			document.getElementById("ETpLink").getElementsByTagName("a")[0].setAttribute('onclick', 'ETp();return false;');
		}
	);
}
// </nowiki>