Content deleted Content added
Writ Keeper (talk | contribs) test |
Writ Keeper (talk | contribs) apparently this is bad now |
||
(20 intermediate revisions by 2 users not shown) | |||
Line 1:
function closePeerReview()
{
mw.loader.using("mediawiki.api
{
$("#ca-closepeer>a").text("
$("#ca-closepeer").off("click");
var talkPage = $("a:contains('Article talk')").attr("href");
var talkPageName = "";
if(talkPage != null)
{
talkPage = talkPage.match(/\/wiki\/(\w+:
if(talkPage != null)
{
Line 16 ⟶ 17:
var api = new mw.Api();
api.edit(
{
var regexResult = revision.content.match(/\{\
if(regexResult != null
{
return {
text: revision.content.replace(
summary: "Closing peer review due to inactivity (via [[User:Writ Keeper/Scripts/peerReviewCloser|peerReviewCloser.js]])"
};
}
else
{
$("#ca-closepeer>a").text("error!");
return null;
}
}).done(function()
{
api.edit(
{
var regexResult = revision.content.match(/\{\{
if(regexResult != null && typeof regexResult[1] != "undefined")
{
return {
text: revision.content.replace(
summary: "Closing peer review due to inactivity (via [[User:Writ Keeper/Scripts/peerReviewCloser|peerReviewCloser.js]])"
};
}
else
{
if(typeof window.sessionStorage != "undefined")
window.sessionStorage.setItem("peerReviewCloserError","talkPageError");
___location.reload();
return null;
}
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!");
return null;
}
}
})
.done(function() {
___location.reload();
});
});
});
}
$(document).ready(function()
{
if(typeof window.sessionStorage != "undefined")
if(mw.config.get("wgCategories").indexOf("Current peer reviews") >= 0)▼
{
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', '#', "
$("#ca-closepeer").click( function(event)
{
|