User:Bawolff/vector.js

importScript('User:Bawolff/DYKVerified.js'); importScript('User:Bawolff/test-mode.js');

$(function {    var changeDevelopToReviewButton = document.getElementById('develop_to_review_link');    if (changeDevelopToReviewButton) {        try {            //in a try since this makes some assumptions about the format of            //the develop template, which could change.            mw.loader.load('https://secure.wikimedia.org/wikinews/en/w/index.php?title=user:Bawolff/mwapilib2.js&action=raw&ctype=text/javascript');            var button = document.createElement('button');            button.type = 'button';            button.appendChild(changeDevelopToReviewButton.firstChild.firstChild);            changeDevelopToReviewButton.replaceChild(button, changeDevelopToReviewButton.firstChild);            button.onclick = function  {                if (this && this.firstChild && this.firstChild.data) this.firstChild.data = "Loading...";                api(mw.config.get('wgPageName')).getPage. setDefaultSummary("Edit summary"). replace(/^/, "\{\{template to add}}\n"). savePage. lift(function {                        alert("The article is now listed as needing review.");                        location.reload;                    }). exec; }       }        catch (e) {} } });