User:Proteins/summarizeFAC.js: Difference between revisions

Content deleted Content added
Proteins (talk | contribs)
turn on more reporting
m Maintenance: Fixing deprecated call to addPortletLink (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(3 intermediate revisions by 2 users not shown)
Line 346:
}
boldface_text = boldface_text.replace(/(<([^>]+)>)/ig,""); // remove HTML tags
// window.alert("List item " + list_item_index + " has boldface text: " + boldface_text + "\n");
Line 352:
num_support_votes++;
reported_string = num_support_votes + ". " + boldface_text + " — " + user_name + "\n";
// window.alert(reported_string);
support_votes[num_support_votes-1] = reported_string;
} else if (boldface_text.match(/neutral/ig)) {
Line 382:
num_votes = num_support_votes + num_oppose_votes + num_neutral_votes + num_ambiguous_votes;
 
// window.alert("There were " + num_votes + " !votes.\n\n");
 
 
Line 397 ⟶ 399:
alert_string += "\t one Oppose !vote\n";
oppose_vote_summary = "There was one Oppose !vote:\n\n";
} else if (num_delete_votesnum_oppose_votes>1) {
alert_string += "\t " + num_oppose_votes + " Oppose !votes\n";
oppose_vote_summary = "There were " + num_oppose_votes + " Oppose !votes:\n\n";
Line 404 ⟶ 406:
alert_string += "\t one Support !vote\n";
support_vote_summary = "There was one Support !vote:\n\n";
} else if (num_support_votes>1) {
alert_string += "\t " + num_support_votes + " Support !votes\n";
keep_vote_summarysupport_vote_summary = "There were " + num_support_votes + " Support !votes:\n\n";
}
if (num_neutral_votes == 1) {
alert_string += "\t one Neutral !vote\n";
merge_vote_summaryneutral_vote_summary = "There was one Neutral !vote:\n\n";
} else if (num_neutral_votes>1) {
alert_string += "\t " + num_neutral_votes + " Neutral !votes\n";
merge_vote_summaryneutral_vote_summary = "There were " + num_neutral_votes + " Neutral !votes:\n\n";
}
if (num_ambiguous_votes == 1) {
alert_string += "\t one ambiguous !vote\n";
ambiguous_vote_summary = "There was one ambiguous !vote:\n\n";
} else if (num_ambiguous_votes>1) {
alert_string += "\t " + num_ambiguous_votes + " ambiguous !votes\n";
ambiguous_vote_summary = "There were " + num_ambiguous_votes + " ambiguous !votes:\n\n";
Line 424 ⟶ 426:
if ((num_notes + num_comments + num_questions) == 1) {
alert_string += "\nIn addition, there was:\n";
} else if ((num_notes + num_comments + num_questions)>1) {
alert_string += "\nIn addition, there were:\n";
}
Line 430 ⟶ 432:
alert_string += "\t one Note\n";
note_summary = "There was one Note:\n\n";
} else if (num_notes>1) {
alert_string += "\t " + num_notes + " Notes\n";
note_summary = "There were " + num_notes + " Notes:\n\n";
Line 437 ⟶ 439:
alert_string += "\t one Comment\n";
comment_summary = "There was one Comment:\n\n";
} else if (num_comments>1) {
alert_string += "\t " + num_comments + " Comments\n";
comment_summary = "There were " + num_comments + " comments:\n\n";
Line 443 ⟶ 445:
if (num_questions == 1) {
alert_string += "\t one Question\n";
comment_summaryquestion_summary = "There was one Question:\n\n";
} else if (num_questions>1) {
alert_string += "\t " + num_questions + " Questions\n";
comment_summaryquestion_summary = "There were " + num_questions + " Questions:\n\n";
}
window.alert(alert_string);
Line 541 ⟶ 543:
} // closes function summarizeFAC()
addOnloadHook$(function () {
mw.util.addPortletLink('p-cactions', 'javascript:summarizeFAC()', 'FAC', 'ca-fac', 'Summarize FAC votes', '!', '');
});