User:Ilmari Karonen/watchlisteditdoublesubmit.js

// Add a second submit button to the top of Special:Watchlist/edit

if (mw.config.get('wgCanonicalNamespace') === "Special" && mw.config.get('wgCanonicalSpecialPageName') === "Watchlist") { $(function {        var form = document.getElementsByTagName("form")[0];        if (!form || !/[?&]action=edit(&|$)/.test(form.getAttribute("action")))            return;  // not the edit page        var heading = document.getElementsByTagName("h2")[0];        if (!heading) return;        var buttonP = document.createElement("p");        var inputs = form.getElementsByTagName("input");        for (var i = 0; i < inputs.length; i++) {            if (inputs[i].type == "submit") {                buttonP.appendChild(inputs[i].cloneNode(true));                heading.parentNode.insertBefore(buttonP, heading);                return;            }        }    }); }