User:Terasail/COI Request Tool.js: Difference between revisions

Content deleted Content added
Fixed problems with Template:Request edit caused by Special:Diff/965374418/1005728991 & added reply option to all template variants
Fixed error with reopening requests
Line 233:
removeB.on("click", function() {
executeCOI(currentBox, "REMOVE", "", answerB.value)
});
}
 
function addReplyButton(currentBox, boxType) {
var replyB = new OO.ui.ButtonWidget( {
icon: "edit",
flags: "progressive",
invisibleLabel: true
});
replyB.$element[0].style = "margin:5px 0px";
$(currentBox.children[0].children[0]).append(replyB.$element);
replyB.on("click", function() {
currentBox.parentElement.setAttribute("class", "plainlinks tmbox tmbox-notice editrequest");
var img = currentBox.children[0].children[0].children[0]
img.width = 53;
img.height = 53;
img.src = "//upload.wikimedia.org/wikipedia/commons/f/f4/Info_talk.png"
img.scrset = "";
currentBox.children[0].children[1].innerHTML = '<div style="text-align:center; font-size:125%">Please read the instructions for the parameters used by this template for accepting and declining them, and review the request below and make the edit if it is well sourced, neutral, and follows other Wikipedia guidelines and policies.</div>'
replyB.$element.remove();
loadButtons(currentBox);
});
}
Line 247 ⟶ 268:
loadButtons(currentBox);
} else { //For answered boxes
addReplyButton(currentBox);
var replyB = new OO.ui.ButtonWidget( {
icon: "edit",
flags: "progressive",
invisibleLabel: true
});
replyB.$element[0].style = "margin:5px 0px";
$(currentBox.children[0].children[0]).append(replyB.$element);
replyB.on("click", function() {
currentBox.parentElement.setAttribute("class", "plainlinks tmbox tmbox-notice editrequest");
var img = currentBox.children[0].children[0].children[0]
img.width = 53;
img.height = 53;
img.src = "//upload.wikimedia.org/wikipedia/commons/f/f4/Info_talk.png"
img.scrset = "";
currentBox.children[0].children[1].innerHTML = '<div style="text-align:center; font-size:125%">Please read the instructions for the parameters used by this template for accepting and declining them, and review the request below and make the edit if it is well sourced, neutral, and follows other Wikipedia guidelines and policies.</div>'
replyB.$element.remove();
loadButtons(currentBox);
});
}
} else {
a = edReqCheck.innerText;
}
}