Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
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.
functionclosePeerReview(){mw.loader.using("mediawiki.api").done(function(){$("#ca-closepeer>a").text("Closing...");$("#ca-closepeer").off("click");vartalkPage=$("a:contains('Article talk')").attr("href");vartalkPageName="";if(talkPage!=null){talkPage=talkPage.match(/\/wiki\/(\w+:.+)/);if(talkPage!=null){talkPageName=talkPage[1];}}varapi=newmw.Api();api.edit(mw.config.get("wgPageName"),function(revision){varregexResult=revision.content.match(/\{\{ *[pP]eer review page *\| *topic *= *\w+ *\}\}/);if(regexResult!=null){return{text:revision.content.replace(regexResult[0],"{{Closed peer review page}}"),summary:"Closing peer review due to inactivity (via [[User:Writ Keeper/Scripts/peerReviewCloser|peerReviewCloser.js]])"};}else{mw.notify('Error updating the Peer Review page; article talk page might also require cleanup.',{title:'Peer review closing error'});$("#ca-closepeer>a").text("error!");returnnull;}}).done(function(){api.edit(talkPageName,function(revision){varregexResult=revision.content.match(/\{\{ *[pP]eer review *(\| *archive *= *\d+) *\}\}/);if(regexResult!=null&&typeofregexResult[1]!="undefined"){return{text:revision.content.replace(regexResult[0],"{{subst:Close peer review"+regexResult[1]+"}}"),summary:"Closing peer review due to inactivity (via [[User:Writ Keeper/Scripts/peerReviewCloser|peerReviewCloser.js]])"};}else{if(typeofwindow.sessionStorage!="undefined"){window.sessionStorage.setItem("peerReviewCloserError","talkPageError");___location.reload();returnnull;}else{mw.notify('Peer review page updated, but error updating the article talk page; it may require manual intervention.',{title:'Peer review closing error'});$("#ca-closepeer>a").text("error!");returnnull;}}}).done(function(){___location.reload();});});});}$(document).ready(function(){if(typeofwindow.sessionStorage!="undefined"){if(window.sessionStorage.getItem("peerReviewCloserError")=="talkPageError"){mw.notify('Peer review page updated, but error updating the article talk page; it may require manual intervention.',{title:'Peer review closing error'});window.sessionStorage.removeItem("peerReviewCloserError");}}if(mw.config.get("wgCategories",[]).indexOf("Current peer reviews")>=0){mw.loader.using("mediawiki.util").done(function(){mw.util.addPortletLink('p-cactions','#',"Close peer review","ca-closepeer","close this peer review");$("#ca-closepeer").click(function(event){event.preventDefault();mw.loader.load(['mediawiki.api.edit']);//start loading, while the user is in the promptreturnclosePeerReview();});});}});