User:Okhjon/traduction-référence.js

// !function { /**	 * Add a link in the toolbox to a copy/paste-ready * model to be used on WP:fr for the translation credits. **/	var permalinkEl = document.querySelector("#t-permalink>a"), titleEl = document.querySelector("#firstHeading"), toolId = "t-okj-tradref", title, oldid, code; if (permalinkEl && titleEl) { title = titleEl.textContent; oldid = /oldid=(\d+)/.exec(permalinkEl.href)[1]; if (oldid) { // let's assume 'title' is wikicode-safe™ code = ""; mw.util.addPortletLink(				"p-tb", // toolbox				"#",				"Traduction/Référence",				toolId); document.getElementById(toolId).onclick = function(e) { e.preventDefault; prompt("", code); };		} 	} }; //