MediaWiki:CopyCodeButton.js

$(function {   "use strict";    $("div.mw-geshi.mw-content-ltr.pi-data-value").prepend($(" ", {        id: "dev-copy-code",        text: "Copy"    }));    $("#dev-copy-code").prepend($(" ", {        id: "dev-copy-code-hover"    }));    document.querySelector("#dev-copy-code").addEventListener("click", function { $("#dev-copy-code").click; var range = document.createRange; range.selectNode(document.querySelector("div.javascript.source-javascript")); window.getSelection.addRange(range); try { document.execCommand("copy"); } catch(err) { console.log("Whoops, unable to copy"); }       window.getSelection.removeAllRanges; });   importArticle({ type: "script", article: "MediaWiki:CopyCodeButton.css" }); });