if(!initMsg_PR) initMsg_PR = "{{#ifeq:{{{name}}}|" + mw.config.get('wgTitle') + "|~~~~}}" + "The following suggestions were generated by a semi-automatic javascript program, and might not be applicable for the article in question.";
if(!endMsg_PR) endMsg_PR = "\nYou may wish to browse through User:AndyZ/Suggestions for further ideas. Thanks, ~~"+"~~\n\n\n";
$.when( mw.loader.using( ['mediawiki.util'] ), $.ready ).done( function () {
var link = mw.util.addPortletLink('p-'+toolbar_PR, , 'Peer review', 'ca-peerreviewer', 'Semi-automatic peer reviewer by javascript', , '');
$(link).click( function(event) {
event.preventDefault();
toJSpeerreview()
} );
});
}
}
templateData_PR = new Array(
["lead","*Please expand the lead to conform with guidelines at Wikipedia:Manual of Style/Lead section. The article should have an appropriate number of paragraphs as is shown on WP:LEAD, and should adequately summarize the article."],
["leadlong","*The lead of this article may be too long, or may contain too many paragraphs. Please follow guidelines at WP:LEAD; be aware that the lead should adequately summarize the article."],
["leaddetail","*The lead is for summarizing the rest of the article, and should not introduce new topics not discussed in the rest of the article, as per WP:LEAD. Please ensure that the lead adequately summarizes the article."],
["infobox","*You may wish to consider adding an appropriate infobox for this article, if one exists relating to the topic of the article. "],
["dateth","*As per Wikipedia:Manual of Style/Dates and numbers, dates shouldn't use th; for example, instead of (if such appeared in the article) using January 30th was a great day, use January 30 was a great day."],
["nbsp","*Per Wikipedia:Manual of Style/Dates and numbers#Unit names and symbols, there should be a non-breaking space - between a number and the unit symbol. For example, instead of {{{1|18mm}}}, use {{{2|18 mm}}}, which when you are editing the page, should look like: {{{3|18 mm}}}."],
["headingthe","*Per Wikipedia:Manual of Style#Section headings, headings generally do not start with articles ('the', 'a(n)'). For example, if there was a section called ==The Biography==, it should be changed to ==Biography==."],
["headingre","*Per Wikipedia:Manual of Style#Section headings, headings generally should not repeat the title of the article. For example, if the article was Ferdinand Magellan, instead of using the heading ==Magellan's journey==, use ==Journey==."],
["overlink","*Consider removing links that add little to the article or that have been repeated in close proximity to other links to the same article, as per Wikipedia:Manual of Style/Linking#Duplicate and repeat links and WP:CONTEXT. Guides recommend having greater than 3% words in links, but be sure not to overlink words just to add more links."],
["footspace","*As detailed at Help:Footnotes and Wikipedia:Manual of Style#Punctuation and footnotes, footnotes are usually located immediately after a punctuation mark, such that there is no space in between. For example, the sun is larger than the moon [2]. is usually written as the sun is larger than the moon.[2]"],
["ref","*The article will need references. See WP:CITE and WP:V for more information."],
["foot","*This article needs footnotes, preferably in a consistent format recommended by WP:WIAFA. Simply, enclose inline citations, with WP:CITE or WP:CITE/ES information, with THE FOOTNOTE. At the bottom of the article, in a section named “References” or “Footnotes”, add
["expand","*This article is a bit too short, and therefore may not be as comprehensive as Wikipedia:Featured article criterion 1b is looking for. Please see if anything can be expanded upon."],
["SS","*This article may need to undergo summary style, where a series of appropriate subpages are used. For example, if the article is United States, then an appropriate subpage would be History of the United States, such that a summary of the subpage exists on the mother article, while the subpage goes into more detail."],
["list","*This article may be a bit list-weighty; in other words, some of the lists should be converted to prose (paragraph form)."],
["trivia","*Generally, trivia sections are looked down upon; please either remove the trivia section or incorporate any important facts into the rest of the article."],
["how","*Please avoid including instruction manuals, tutorials, etc. or other 'how-to's per WP:NOT."],
["ig","*Generally, avoid including galleries in articles. Common solutions to this problem include moving the gallery to [//commons.wikimedia.org/wiki/Main_Page wikicommons] or integrating images with the text."],
["fact","*Please provide citations for all of the {{fact}}s."]
"\n*A script has been used to generate a semi-automated"
+" review of the article for issues relating to grammar and house style. If you would find such a review helpful, please click [[Wikipedia:Peer review/Automated/"
function JSpeerreview_body(inputText_PR,outputText_PR){
if(outputText_PR.indexOf("Thanks")!=-1){
var existingPR = confirm("There are already suggestions here.\nContinuing will cause the old suggestions to be overwritten.\nDo you wish to proceed?");
if(!existingPR) return;
else{
outputText_PR = initMsg_PR; //reset global variables
outputText_PR+="\n{{subst:User:AndyZ/PR/infobox}} (Note that there might not be an applicable infobox; remember that these suggestions are not generated manually)";
//----------* Checks that units are spelled out in text
var list_SN_PR = /([\d\.]+\s(kms?|mi|yds?|fts?|in\.|cms?|dms?|nms?|oz|lbs?|kgs?|mgs?|dag|dg|ng|(in|ft|yd|mi|m|km|cm|mm|dm|nm)[23]<\/sup>|ha|hl|dl|cl|ml)\s)/gi;
if(list_SN_PR.test(inputText_PR)){
temp_SN = inputText_PR.match(list_SN_PR);
outputText_PR+="\n{{subst:User:AndyZ/PR/spellnum}} " + "Specifically, an example is " + RegExp.$1.substring(0,RegExp.$1.length-1) + ".";
}
//----------* Checks for usage of standard abbreviations in parentheses (without 's') (for conversions) !!!
outputText_PR+="\n*When writing standard abbreviations, the abbreviations should not have a 's' to demark plurality (for example, change kms to km and lbs to lb).";
//----------* Does not work; may fix soon - looks for conversions
var inputText_PR_noquotes = inputText_PR.replace(/"(.+?)"/gi,"").replace(/\[\[.{4,50}?\|/gi,"")
//----------* Weasel words
var ww = new Array("some people sa","it has been","many people have","many scientists believe","allege","many people sa","many people believe","arguably","it is claimed","correctly","apparently","people considered","many considered","is considered","are considered"); var ww2 = new Array();
//----------* American/British English spellings (ize/ise, ization/isation, or/our, er/re, etc)
// ?!!!
var check_amer = 0, check_brit = 0, ab_ex = "";
AmSpell = new Array("flavor","honor","armor","behavior","harbor","neighbor","favorite","aluminum","mustache","tidbit","meter","fiber","saber","defense","offense","pretense","organize","recognize","realize","colonize","criticize","categorize","ization","analyze","catalyze","hydrolyze","paralyze","anemia","anesthesia","cesium","diarrhea","gynecology","hemophilia","leukemia","esophagus","estrogen","orthopedic","pediatric","counterattack","counselor","equaling","modeling","quarreled","signaling","traveled","enrollment","fulfillment","installment","skillful"," aging","routing","anymore","paycheck","cozy"," gray","jewelry","curb","licorice","mold","molt","pajamas","program ","skeptic","sulfur");
BrSpell = new Array("flavour","honour","armour","behaviour","harbour","neighbour","favourite","aluminium","moustache","titbit","metre","fibre","sabre","defence","offence","pretence","organise","recognise","realise","colonise","criticise","categorise","isation","analyse","catalyse","hydrolyse","paralyse","anaemia","anaesthesia","caesium","diarrhoea","gynaecology","haemophilia","leukaemia","oesophagus","oestrogen","orthopaedic","paediatric","counter-attack","counsellor","equalling","modelling","quarrelled","signalling","travelled","enrolment","fulfilment","instalment","skilful"," ageing","routeing"," any more","pay cheque","cosy"," grey","jewellery","kerb","liquorice","mould","moult","pyjamas","programme","sceptic","sulphur");
if(check_amer >= 2 && check_brit >= 2) outputText_PR+="\n*Please make the spelling of English words consistent with either American or British spelling, depending upon the subject of the article. Examples include: " + ab_ex.substring(0,ab_ex.length-2) + ".";
outputText_PR+="\n*Watch for redundancies that make the article too wordy instead of being crisp and concise. (You may wish to try Tony1's redundancy exercises.)";
if(redun_PR[0])
outputText_PR+="\n**While additive terms like “also”, “in addition”, “additionally”, “moreover”, and “furthermore” may sometimes be useful, overusing them when they aren't necessary can instead detract from the brilliancy of the article. This article has "+theaddnum.length+" additive terms, a bit too much.";
if(redun_PR[1])
outputText_PR+="\n**Vague terms of size often are unnecessary and redundant - “some”, “a variety/number/majority of”, “several”, “a few”, “many”, “any”, and “all”. For example, “All pigs are pink, so we thought of a number of ways to turn them green.”";
if(redun_PR[2])
outputText_PR+="\n**Temporal terms like “over the years”, “currently”, “now”, and “from time to time” often are too vague to be useful, but occasionally may be helpful. “I am now using a semi-bot to generate your peer review.”";
if(redun_PR[3])
outputText_PR+="\n**“In the year [of] "+exyear+"”";
outputText_PR+="\n*The script has spotted the following contractions: " + list_contraction + ", if these are outside of quotations, they should be expanded.";
}
//----------* Footnotes
var check_ref = 0;
if (/
else if (/\{\{(ref|fn|harv)/gi.test(inputText_PR)) check_ref=2;
if (!check_ref) // no footnotes
outputText_PR+="\n{{subst:User:AndyZ/PR/foot}}"
else if (check_ref==2) //a method outside of the cite.php
outputText_PR+="\n*You may wish to convert your form of references to the cite.php footnote system that WP:WIAFA 1(c) highly recommends."
//----------* Footnote spacing following a period
var list_sref = new Array(/(<\/ref>|\{\{(fn|ref)(\|.+)?\}\})\s?\./, /\.\s(|{\{(ref|fn))/, /<\/ref>(\s|\n)
spellcheck_output+="\n*Please check through the article for possible misspellings (see WP:SPELL). Examples of possible misspellings include: " + spell_string.substring(0,spell_string.length-1) + ".";
document.getElementById(output_PR).value = document.getElementById(output_PR).value.replace(/\{\{subst:User:AndyZ\/PR\/time.*\}\}/gi,"*Per WP:MOS, avoid using words/phrases that indicate time periods relative to the current day. For example, " + list_paramsStr.replace(/\,\,/g,", ") + " might be terms that should be replaced with specific dates/times.[?]");
if(uTN_PR == "awt")
document.getElementById(output_PR).value = document.getElementById(output_PR).value.replace(/\{\{subst:User:AndyZ\/PR\/awt.*\}\}/gi,"*There are a few occurrences of weasel words in this article- please observe WP:WEASEL. Certain phrases should specify exactly who supports, considers, believes, etc., such a view.\n**" + list_paramsStr.replace(/\,\,/g,"\n**") + "\n**might be weasel words, and should be provided with proper citations (if they already do, or are not weasel terms, please strike this comment).[?]");
if(uTN_PR == "nbsp")
document.getElementById(output_PR).value = document.getElementById(output_PR).value.replace(/\{\{subst:User:AndyZ\/PR\/nbsp.*\}\}/gi,"*Per Wikipedia:Manual of Style/Dates and numbers#Units of measurement, there should be a non-breaking space - between a number and the unit of measurement. For example, instead of "+list_params[1]+", use "+list_params[2]+", which when you are editing the page, should look like: "+list_params[3]+".[?]");