User:Chris the speller/script/ScriptA.js
Appearance
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. |
Documentation for this user script can be added at User:Chris the speller/script/ScriptA. |
/* mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript'); commented out 10/16/2020 - no longer exists */
function Ctsp_nix_hyph_edit_summary() {
//Add a tag to the summary box
setoptions(minor='true');
setreason('hyphen(s) per [[WP:HYPHEN]], sub-subsection 3, points 3,4,6, by [[User:Chris the speller/script/ScriptA.js|script]]', 'append');
doaction('diff');
}
function Ctsp_the_works_edit_summary() {
//Add a tag to the summary box
setoptions(minor='true');
setreason('number fmt, and/or hyphen(s) per [[WP:HYPHEN]], sub-subsection 3, points 3,4,6, by [[User:Chris the speller/script/ScriptA.js|script]]', 'append');
doaction('diff');
}
function Ctsp_overlink() {
Ctsp_overlink_main();
doaction('diff');
}
function Ctsp_past() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/ are /g, ' were ');
regex(/ is /g, ' was ');
regex(/ have /g, ' had ');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('past tense');
doaction('diff');
}
function Ctsp_ddea() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/qqqq?0(?:born|b\.)\s?(\d\d\d\d)/g, '$1–2020');
regex(/qqqq?1(?:born|b\.)\s?(\d\d\d\d)/g, '$1–2021');
setreason('add year of death');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
// setoptions(minor='true');
setreason('add year of death');
doaction('diff');
}
function Ctsp_uss() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\[\[([UC]SS) ([A-Za-z\. ]+)\]\]/g, '[[$1 $2|$1 \x27\x27$2\x27\x27]]');
regex(/\[\[USS +([A-Za-z\. ]+[a-z]) \(([-A-Z0-9]+)\)\]\]/g, '[[USS $1 ($2)|USS \x27\x27$1\x27\x27 ($2)]]');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('italics for ship names');
doaction('diff');
}
function Ctsp_jobt() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/ - /g, ' – ');
regex(/([A-Za-z,–].)A(ssistant|ssoci|dmin|nalys|nalytic|dvi|dvan|ffairs)/g, '$1a$2');
regex(/([A-Za-z,–].)A(ssistant|ssoci|dmin|nalys|nalytic|dvi|dvan|ffairs)/g, '$1a$2');
regex(/([A-Za-z,–].)B(acks|usiness)/g, '$1b$2');
regex(/([A-Za-z,–].)C(hair|oach|ollege|oordi|ontrol|onditi|onsult|ap|ontract|orner|ommittee|hief|ounsel)/g, '$1c$2');
regex(/([A-Za-z,–].)C(hair|oach|ollege|oordi|ontrol|onditi|onsult|ap|ontract|orner|ommittee|hief|ounsel)/g, '$1c$2');
regex(/([A-Za-z,–].)D(efensive|irector|efense|evelopm|raft)/g, '$1d$2');
regex(/([A-Za-z,–].)E(nds|xecutive)/g, '$1e$2');
regex(/([A-Za-z,–].)F(ootball|inanc)/g, '$1f$2');
regex(/([A-Za-z,–].)G(ame|eneral)/g, '$1g$2');
regex(/([A-Za-z,–].)H(ead|igh)/g, '$1h$2');
regex(/([A-Za-z,–].)I(ntern|nterim|nitiat|nside|nvest)/g, '$1i$2');
regex(/([A-Za-z,–].)L(ine|ogistics)/g, '$1l$2');
regex(/([A-Za-z,–].)M(anager|anagement|anaging|arketing)/g, '$1m$2');
regex(/([A-Za-z,–].)N(ickel|utrition)/g, '$1n$2');
regex(/([A-Za-z,–].)O(peration|perating|ffens|ffice|pponent)/g, '$1o$2');
regex(/([A-Za-z,–].)O(ffice|wner)/g, '$1o$2');
regex(/([A-Za-z,–].)P(ersonnel|resident|ro|ass|erformance|layer|ro|artner|ublic|lanning)/g, '$1p$2');
regex(/([A-Za-z,–].)P(ersonnel|resident|ro|ass|erformance|layer|ro|artner|ublic|lanning)/g, '$1p$2');
regex(/([A-Za-z,–].)Q(uarterb|uality)/g, '$1q$2');
regex(/([A-Za-z,–].)R(eceivers|un|ush|esearch)/g, '$1r$2');
regex(/([A-Za-z,–].)S(pecial|cout|trength|cience|upport|taff|trateg|afeties|alary|econdary}enior)/g, '$1s$2');
regex(/([A-Za-z,–].)S(pecial|cout|trength|cience|upport|taff|trateg|afeties|alary|econdary|enior)/g, '$1s$2');
regex(/([A-Za-z,–].)T(eam|ight|ackle|ravel)/g, '$1t$2');
regex(/([A-Za-z,–].)T(eam|ight|ackle|ravel)/g, '$1t$2');
regex(/([A-Za-z,–].)V(ice|ideo)/g, '$1v$2');
regex(/([A-Za-z,–].)W(ide)/g, '$1w$2');
regex(/([A-Za-z,–].)Y(outh)/g, '$1y$2');
regex(/& Analy/g, '& analy');
regex(/& Legal/g, '& legal');
regex(/& Gener/g, '& gener');
regex(/& Footb/g, '& footb');
regex(/& Strat/g, '& strat');
regex(/\(Cor/g, '(cor');
regex(/\(Saf/g, '(saf');
regex(/\(Off/g, '(off');
regex(/\(Nic/g, '(nic');
regex(/National football/g, 'National Football');
regex(/php coach/g, 'php Coach');
regex(/php management/g, 'php Management');
regex(/html coach/g, 'html Coach');
regex(/html manage/g, 'html Manage');
regex(/\|staff/g, '|Staff');
regex(/NFLsecondary/g, 'NFLSecondary');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('cap per [[MOS:JOBTITLES]]');
doaction('diff');
}
function Ctsp_x_powered() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(olar|attery|uman|asoline|electric|edal|cell|ydrogen|iesel)\s+powered\s+(aircr|cars?\b|vehic|satel|electr|water|unmanned|devic|desal|refrig)/g, '$1-powered $2');
regex(/`°♫/g, ''); // unprotect
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_keyp() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
// clean up key_people
regex(/q<small>/g, '');
regex(/q<.small>/g, '');
regex(/q\{\{small\|([- ,A-Za-z\&,\(\)\[\]]+)\}\}/g, '$1');
regex(/`q /g, '{{wbr}} ');
regex(/ql/g, '{{ubl|');
regex(/qe/g, '}}');
regex(/`q, ?/g, '|');
regex(/q ?<.?br ?.?> ?/g, '|');
regex(/qr ?<.?br ?.?> ?/g, ' ');
regex(/\(Chairman\)/g, '(chairman)');
regex(/\(President\)/g, '(president)');
regex(/\(Chairman [Ee]meritus\)/g, '(chairman emeritus)');
regex(/\(Chairman (\&|and) ([A-Z][A-Z][A-Z])\)/g, '(chairman $1 $2)');
regex(/\(President (\&|and) ([A-Z][A-Z][A-Z])\)/g, '(president $1 $2)');
regex(/\(Managing [Dd]irector\)/g, '(managing director)');
regex(/\(Chief [Ee]xecutive [Oo]fficer\)/g, '(chief executive officer)');
regex(/\(Chief [Ee]xecutive\)/g, '(chief executive)');
regex(/\(Group [Cc]hief [Ee]xecutive\)/g, '(group chief executive)');
regex(/\(Deputy Chairman\)/g, '(deputy chairman)');
regex(/\(Vice([- ])[Cc]hairman\)/g, '(vice$1chairman)');
regex(/\(Executive Vice([- ])[Cc]hairman\)/g, '(executive vice$1chairman)');
regex(/\(President \(corporate title\)\|President\)/g, '(President (corporate title)|president)');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_space_punct() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\.(com|net|jpg|JPG|png|PNG|svg|SVG)/g, '.`°♫$1'); // protect .com etc.
regex(/([A-Za-z\]])\(([A-Za-z])\)/g, '$1`°♫($2)'); // protect xxxx(x) [one letter]
regex(/([A-Za-z\],\.])\(/g, '$1 ('); // xxx(
regex(/\)([A-Za-z\[])/g, ') $1'); // )xxx
regex(/\( +/g, '('); // ( xxx
regex(/ +\)/g, ')'); // xxx )
regex(/([a-z]) \.([A-Z])/g, '$1. $2'); // xxx .Xxx
regex(/( [A-Za-z]+\]?\]?)\.([A-Za-z]+(?: |\n))/g, '$1. $2'); // xxxx.xxxx
regex(/( [A-Za-z]+\]?\]?),([A-Za-z]+ )/g, '$1, $2'); // xxxx,xxxx
regex(/…/g, '...'); // ellipsis character
regex(/([a-z\]]{2})\.\.\.\.([A-Za-z][a-z])/g, '$1. ... $2'); // ellipsis plus full stop
regex(/([a-z\]]{2})\.\.\.([A-Za-z][a-z])/g, '$1 ... $2'); // ellipsis
regex(/([a-z\]]{2})\.\.\.\.([^A-Za-z0-9\/,\-])/g, '$1. ...$2'); // ellipsis plus full stop
regex(/([a-z\]]{2})\.\.\.([^A-Za-z0-9\/,\-])/g, '$1 ...$2'); // ellipsis
// regex(//g, '');
regex(/`°♫/g, ''); // unprotect
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_overlink_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\[\[([- A-Za-z0-9\.,\u002F]+)\]\]([- A-Za-z0-9\.,;:’'"—–\u002F\[\]\|\(\)ó]{0,9000})\[\[\1\]\]/g, '[[$1]]$2$1');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_Anchor() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/xxya(.+)xxyb/g, '{{anchor|$1}}$1'); // ==xxyaEarly Lifexxyb == to =={{anchor|Early Life}}Early Life ==
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_nix_ly_hyph_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/([Ff]ami|el|[Kk]ind|\b[Ee]ar|\bon|[Ff]|[th]er|[Ff]|riend|gain|Ju|Ita|el|Eder|mber|supp|ssemb|wil|ral)ly-/g, '$1l`°♫y-');
regex(/([Pp]ol|o|hur|jing|hilate|heaven|\bho|bul|rick|[Mm]an|li|il|Mol|au|Da|ir|dai|th|ur|[Ss]ca)ly-/g, '$1l`°♫y-');
regex(/\b([Ff])ully-(fledged|accum|grown)/g, '$1ul`°♫ly-$2');
regex(/\b([A-Za-z]+ly)xx[- ]/g, '{{Sic|?|hide=y|$1|-}}');
regex(/\b([A-Za-z]+ly)x[- ]/g, '{{Sic|hide=y|$1|-}}');
regex(/([ \n\|\[\(]\w+)ly-(?!-)/g, '$1ly ');
regex(/l`°♫y-/g, 'ly-');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_gen_hyph_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\s[a-z]+\s+\d{1,4})-(\d{1,4}\s+[a-z]+)\b/g, '$1–$2'); // abcd 34-56 vwxy (hyphen to en dash)
regex(/\b([Ll])ife-long\b/g, '$1ifelong');
regex(/on a large scale/g, 'on a large sc`°♫ale');
regex(/on a small scale/g, 'on a small sc`°♫ale');
regex(/\b([Ll])arge scale\b/g, '$1arge-scale');
regex(/\b([Ss])mall scale\b/g, '$1mall-scale');
// regex(/\b([Tt])he (best|well)-known/g, '$1he $2-kn`°♫own');
regex(/\bWell known\b(?! for\b| as\b| in\b| by\b| to\b)/g, 'Well-known');
regex(/\b([Oo])ther well known\b/g, '$1ther well-known');
regex(/\b([Mm])any well known\b/g, '$1any well-known');
regex(/\b([Tt])he well known\b/g, '$1he well-known');
regex(/\b([Aa]) well known\b/g, '$1 well-known');
regex(/(Most|most|very|less) well known/g, '$1 well kn`°♫own');
regex(/\b([Ww])ell known (artist|music|actor|name|brand|song|writer|people|film|person|telev|figure|band)/g, '$1ell-known $2');
regex(/\b([Bb]est|[Ww]ell)-known(?= for\b| as\b| by\b| in\b| to\b)/g, '$1 known');
regex(/([Bb])lack and white p/g, '$1lack-and-white p');
regex(/(\d+)(?: to |-|–)(\d+)[- ]year[- ]old/g, '$1- to $2-year-old');
regex(/(\d\d|2|3|4|5|6|7|8|9|0) year old(s?)\b/g, '$1-year-old$2');
regex(/-year old/g, '-year-old');
regex(/([0-9\.]{2,99}) (liter|litre)\b/g, '$1-$2');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_nonbspace_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\[\[.{0,15}\d)(mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)(.{0,15}\]\])/g, '$1`°♫$2$3'); // protect wikilinks
regex(/(\[\[.{0,15}\d)(mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)(.{0,15}\|)/g, '$1`°♫$2$3'); // protect wikilinks
regex(/(mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)\|/g, '`°♫$1|'); // protect convert templates
regex(/(\d)(mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)\b/g, '$1 $2');
regex(/(\d)°([CF])\b/g, '$1 °$2');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_nonbspace_hard_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\[\[.{0,15}\d) (mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)(.{0,15}\]\])/g, '$1`°♫$2$3'); // protect wikilinks
regex(/(\[\[.{0,15}\d) (mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)(.{0,15}\|)/g, '$1`°♫$2$3'); // protect wikilinks
regex(/(mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)\|/g, '`°♫$1|'); // protect convert templates
regex(/km mpg/g, 'k`°♫m mpg'); // protect convert templates
regex(/(\d) (mm|cc|hp|HP|kg|km|rpm|RPM|kW|mph)\b/g, '$1 $2');
regex(/(\d) °([CF])\b/g, '$1 °$2');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_mech_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/ylinder (bank|angle)/g, 'yli`°♫nder $1'); // protect 2 cylinder banks
regex(/\b(\d\d|2|3|4|5|6|7|8|9|[Tt]wo|[Tt]hree|[Ff]our|[Ff]ive|[Ss]ix|[Ss]even|[Ee]ight|[Nn]ine|[Tt]win) (door|wheel|wheeled|wheeler|stroke|cylinder|valve|cycle|seat|seater|speed|barrel|barrelled|blade|bladed|row|degree)\b/g, '$1-$2');
regex(/\u00B3/g, '<sup>3</sup>');
regex(/(\u00BD) ?(Litre|litre|Liter|liter)\b/g, '$1-$2'); // 1/2 litre
regex(/\b(\d+) ?\u00BD/g, '{{frac|$1|1|2}}'); // nnn 1/2
regex(/ inch\b/g, '-inch');
regex(/\ball metal\b/g, 'all-metal');
regex(/([\n ][Gg])eneral purpose\b/g, '$1eneral-purpose');
regex(/\b([Mm])ass produced\b/g, '$1ass-produced');
regex(/\b([Hh])igh performance\b/g, '$1igh-performance');
regex(/\b(High|high|Low|low) pressure\b/g, '$1-pressure');
regex(/otor-cycle/g, 'otorcycle');
regex(/\b(Long|long|Short|short) stroke (V8|engine)/g, '$1-stroke $2');
regex(/\b([Ff])uel injected\b/g, '$1uel-injected');
regex(/\b([Rr])ecoil operated\b/g, '$1ecoil-operated');
regex(/\b([Ss])o called\b/g, '$1o-called');
regex(/\b(Air|air|Water|water|Liquid|liquid|metal|Metal|Gas|gas|Oil|oil) cooled\b/g, '$1-cooled');
regex(/\b([A-Za-z0-9]+) engined\b/g, '$1-engined');
regex(/\b([A-Za-z0-9é]+) bodied\b/g, '$1-bodied');
regex(/\b(floor|rear|front|column|bottom|top|side) mounted\b/g, '$1-mounted');
regex(/([0-9\.]{2,99})(?: | )(\[?\[?liter|\[?\[?litre)\b/g, '$1-$2');
regex(/\b(2|3|4|5|6|7|8|9|two|three|four|five|six|seven|eight|Two|Three|Four)(?: | )(liter|litre)\b/g, '$1-$2');
// regex(/\b(2|4|two|four|Two|Four) Stroke\b/g, '$1-stroke');
// regex(/\b(2|4|two|four|Two|Four)-Stroke\b/g, '$1-stroke');
// regex(/\b(2|4|two|four|Two|Four)[- ]Stoke\b/g, '$1-stroke');
// regex(/\b(2|4|two|four|Two|Four)[- ]stoke\b/g, '$1-stroke');
// regex(/\b(2|4|two|four|Two|Four)[ ]stroke\b/g, '$1-stroke');
// regex(/\b(2|3|4|Single|Two|Twin|Three|Four)[- ]Cylinder\b/g, '$1-cylinder');
// regex(/\b(2|3|4|Single|Two|Twin|Three|Four)[ ]cylinder\b/g, '$1-cylinder');
regex(/\b(Long|long|Short|short) wheelbase (model|vehicle|variant|version|model|car|chassis|sedan|saloon)/g, '$1-wheelbase $2');
regex(/m\u00B2/g, 'm<sup>2</sup>'); // superscript 2
regex(/ft\u00B2/g, 'ft<sup>2</sup>'); // superscript 2
regex(/\bsq m\b/g, 'm<sup>2</sup>'); // superscript 2
regex(/\b(Large|large|Medium|medium|Small|small) sized/g, '$1-sized');
regex(/generation of/g, 'generat`°♫ion of'); // protect first generation (noun)
regex(/(File.{0,25})generation(.{0,30}jpg)/g, '$1generat`°♫ion$2'); // protect first generation (in file name)
regex(/\b(First|Second|Third|Fourth|Fifth|Sixth|first|second|third|fourth|fifth|sixth|1st|2nd|3rd|4th|5th|6th) generation\b/g, '$1-generation');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_from_range_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\b(F|f)rom\x20(\d{4})(?:-|–|—| - | – |–)(\d{4})\b/g, '$1rom $2 to $3');
regex(/\b(F|f)rom\x20(\d{2})(\d{2})(?:-|–|—|–)(\d{2})\b/g, '$1rom $2$3 to $2$4');
regex(/\bto\x20(\d{4})(,?)\x20and\x20(\d{4})(?:-|–|—|–)(\d{4})\b/g, 'to $1$2 and $3 to $4');
regex(/\bto\x20(\d{4})(,?)\x20and\x20(\d{2})(\d{2})(?:-|–|—|–)(\d{2})\b/g, 'to $1$2 and $3$4 to $3$5');
regex(/\b(B|b)etween\x20(\d{4})(?:-|–|—|–)(\d{4})\b/g, '$1etween $2 and $3');
regex(/\b(B|b)etween\x20(\d{2})(\d{2})(?:-|–|—|–)(\d{2})\b/g, '$1etween $2$3 and $2$4');
regex(/\((\d{4})-(\d{4})\)(?![\]|#])/g, '($1–$2)');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_state_abbr() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/ID=/g, 'I`°♫D='); // protect ID= (often appears in URLs)
regex(/([a-z][,\ ]+)AL\b/g, '$1Alabama');
regex(/([a-z][,\ ]+)AK\b/g, '$1Alaska');
regex(/([a-z][,\ ]+)AS\b/g, '$1American Samoa');
regex(/([a-z][,\ ]+)AZ\b/g, '$1Arizona');
regex(/([a-z][,\ ]+)AR\b/g, '$1Arkansas');
regex(/([a-z][,\ ]+)CA\b/g, '$1California');
regex(/([a-z][,\ ]+)CO\b/g, '$1Colorado');
regex(/([a-z][,\ ]+)CT\b/g, '$1Connecticut');
regex(/([a-z][,\ ]+)DE\b/g, '$1Delaware');
regex(/([a-z][,\ ]+)DC\b/g, '$1D.C.');
// regex(/([a-z][,\ ]+)FM\b/g, '$1Federated States of Micronesia');
regex(/([a-z][,\ ]+)FL\b/g, '$1Florida');
regex(/([a-z][,\ ]+)GA\b/g, '$1Georgia');
regex(/([a-z][,\ ]+)GU\b/g, '$1Guam');
regex(/([a-z][,\ ]+)HI\b/g, '$1Hawaii');
regex(/([a-z][,\ ]+)ID\b/g, '$1Idaho');
regex(/([a-z][,\ ]+)IL\b/g, '$1Illinois');
regex(/([a-z][,\ ]+)IN\b/g, '$1Indiana');
regex(/([a-z][,\ ]+)IA\b/g, '$1Iowa');
regex(/([a-z][,\ ]+)KS\b/g, '$1Kansas');
regex(/([a-z][,\ ]+)KY\b/g, '$1Kentucky');
regex(/([a-z][,\ ]+)LA\b/g, '$1Louisiana');
regex(/([a-z][,\ ]+)ME\b/g, '$1Maine');
regex(/([a-z][,\ ]+)MH\b/g, '$1Marshall Islands');
regex(/([a-z][,\ ]+)MD\b/g, '$1Maryland');
regex(/([a-z][,\ ]+)MA\b/g, '$1Massachusetts');
regex(/([a-z][,\ ]+)MI\b/g, '$1Michigan');
regex(/([a-z][,\ ]+)MN\b/g, '$1Minnesota');
regex(/([a-z][,\ ]+)MS\b/g, '$1Mississippi');
regex(/([a-z][,\ ]+)MO\b/g, '$1Missouri');
regex(/([a-z][,\ ]+)MT\b/g, '$1Montana');
regex(/([a-z][,\ ]+)NE\b/g, '$1Nebraska');
regex(/([a-z][,\ ]+)NV\b/g, '$1Nevada');
regex(/([a-z][,\ ]+)NH\b/g, '$1New Hampshire');
regex(/([a-z][,\ ]+)NJ\b/g, '$1New Jersey');
regex(/([a-z][,\ ]+)NM\b/g, '$1New Mexico');
regex(/([a-z][,\ ]+)NY\b/g, '$1New York');
regex(/([a-z][,\ ]+)NC\b/g, '$1North Carolina');
regex(/([a-z][,\ ]+)ND\b/g, '$1North Dakota');
regex(/([a-z][,\ ]+)MP\b/g, '$1Northern Mariana Islands');
regex(/([a-z][,\ ]+)OH\b/g, '$1Ohio');
regex(/([a-z][,\ ]+)OK\b/g, '$1Oklahoma');
regex(/([a-z][,\ ]+)OR\b/g, '$1Oregon');
regex(/([a-z][,\ ]+)PW\b/g, '$1Palau');
regex(/([a-z][,\ ]+)PA\b/g, '$1Pennsylvania');
regex(/([a-z][,\ ]+)PR\b/g, '$1Puerto Rico');
regex(/([a-z][,\ ]+)RI\b/g, '$1Rhode Island');
regex(/([a-z][,\ ]+)SC\b/g, '$1South Carolina');
regex(/([a-z][,\ ]+)SD\b/g, '$1South Dakota');
regex(/([a-z][,\ ]+)TN\b/g, '$1Tennessee');
regex(/([a-z][,\ ]+)TX\b/g, '$1Texas');
regex(/([a-z][,\ ]+)UT\b/g, '$1Utah');
regex(/([a-z][,\ ]+)VT\b/g, '$1Vermont');
regex(/([a-z][,\ ]+)VI\b/g, '$1Virgin Islands');
regex(/([a-z][,\ ]+)VA\b/g, '$1Virginia');
regex(/([a-z][,\ ]+)WA\b/g, '$1Washington');
regex(/([a-z][,\ ]+)WV\b/g, '$1West Virginia');
regex(/([a-z][,\ ]+)WI\b/g, '$1Wisconsin');
regex(/([a-z][,\ ]+)WY\b/g, '$1Wyoming');
regex(/`°♫/g, ''); // unprotect
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_provi_abbr() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\bAB\b/g, 'Alberta');
regex(/\bBC\b/g, 'British Columbia');
regex(/\bMB\b/g, 'Manitoba');
regex(/\bNB\b/g, 'New Brunswick');
regex(/\bNL\b/g, 'Newfoundland and Labrador');
regex(/\bNT\b/g, 'Northwest Territories');
regex(/\bNS\b/g, 'Nova Scotia');
regex(/\bNU\b/g, 'Nunavut');
regex(/\bON\b/g, 'Ontario');
regex(/\bPE\b/g, 'Prince Edward Island');
regex(/\bQC\b/g, 'Quebec');
regex(/\bSK\b/g, 'Saskatchewan');
regex(/\bYT\b/g, 'Yukon');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_nonbspace() {
Ctsp_nonbspace_main();
doaction('diff');
}
function Ctsp_nonbspace_hard() {
Ctsp_nonbspace_hard_main();
doaction('diff');
}
function Ctsp_mech() {
Ctsp_mech_main();
doaction('diff');
}
function Ctsp_time_fmt_A() {
Ctsp_time_fmt_A_main();
doaction('diff');
}
function Ctsp_time_fmt_B() {
Ctsp_time_fmt_B_main();
doaction('diff');
}
function Ctsp_time_fmt_C() {
Ctsp_time_fmt_C_main();
doaction('diff');
}
function Ctsp_page_number() {
Ctsp_page_number_main();
doaction('diff');
}
function Ctsp_gen_hyph_nosumm() {
Ctsp_gen_hyph_main();
doaction('diff');
}
function Ctsp_nix_ly_hyph_nosumm() {
Ctsp_nix_ly_hyph_main();
doaction('diff');
}
function Ctsp_day_names() {
Ctsp_day_names_main();
doaction('diff');
}
function Ctsp_from_range() {
Ctsp_from_range_main();
doaction('diff');
}
function Ctsp_nix_ly_hyph() {
Ctsp_nix_ly_hyph_main();
Ctsp_nix_hyph_edit_summary();
}
function Ctsp_year_range() {
Ctsp_year_range_main()
setoptions(minor='true');
setreason('date fmt', 'append');
doaction('diff');
}
function Ctsp_year_born() {
Ctsp_year_born_main()
setoptions(minor='true');
setreason('date fmt', 'append');
doaction('diff');
}
function Ctsp_day_names_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\bSun\b/g, 'Sunday');
regex(/\b[Mm]on\b/g, 'Monday');
regex(/\b[Tt]ues?\b/g, 'Tuesday');
regex(/\b[Ww]ed\b/g, 'Wednesday');
regex(/\b[Tt]hur?s?\b/g, 'Thursday');
regex(/\b[Ff]ri\b/g, 'Friday');
regex(/\bSat\b/g, 'Saturday');
regex(/(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)(s)?-(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/g, '$1$2–$3');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_tempCF() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/([ \(])([0-9\.\-\u2212]+)(?: || )(?:°|º|\x3Csup\x3Eo\x3C\x2fsup\x3E)([CF])/g, '$1$2 °$3');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('number fmt', 'append');
doaction('diff');
}
function Ctsp_custom() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
// regex(/All The Worldsx Fighting Ships/g, 'All The World\'sx Fighting Ships');
regex(/(\w)\x20It\b/g, '$1 it'); // Title case - nix caps for short prepositions, etc.
regex(/(\w)\x20Of\b/g, '$1 of');
regex(/(\w)\x20A\b/g, '$1 a');
regex(/(\w)\x20An\b/g, '$1 an');
regex(/(\w)\x20At\b/g, '$1 at');
regex(/(\w)\x20To\b/g, '$1 to');
regex(/(\w)\x20On\b/g, '$1 on');
regex(/(\w)\x20In\b/g, '$1 in');
regex(/(\w)\x20If\b/g, '$1 if');
regex(/(\w)\x20The\b/g, '$1 the');
regex(/(\w)\x20For\b/g, '$1 for');
regex(/(\w)\x20With\b/g, '$1 with');
regex(/(\w)\x20By\b/g, '$1 by');
// regex(/([ \(])([0-9\.\-\u2212]+)\x20?[°º]C \(([0-9\.\-\u2212]+)\x20?[°º]F\)([ \.\)])/g, '$1{{convert|$2|C|F}}$4'); // degrees
// regex(/([ \(])([0-9\.\-\u2212]+)\x20?\x3Csup\x3Eo\x3C\x2fsup\x3EC \(([0-9\.\-\u2212]+)\x20?\x3Csup\x3Eo\x3C\x2fsup\x3EF\)([ \.\)])/g, '$1{{convert|$2|C|F}}$4');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('caps', 'append');
doaction('diff');
}
function Ctsp_ord_suff() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/11º/g, '11th');
regex(/12º/g, '12th');
regex(/13º/g, '13th');
regex(/1º/g, '1st');
regex(/2º/g, '2nd');
regex(/3º/g, '3rd');
regex(/(\d)º/g, '$1th');
regex(/11ª/g, '11th');
regex(/12ª/g, '12th');
regex(/13ª/g, '13th');
regex(/1ª/g, '1st');
regex(/2ª/g, '2nd');
regex(/3ª/g, '3rd');
regex(/(\d)ª/g, '$1th');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('ordinal indicators to suffixes', 'append');
doaction('diff');
}
function Ctsp_years_only() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\(.{0,18}([12]\d\d\d)\D.{0,18}([12]\d\d\d).{0,18}\)/g, '($1–$2)'); // ( May 19, 1988 - June 23, 1999)
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
// setoptions(minor='true');
// setreason('ordinal indicators to suffixes', 'append');
doaction('diff');
}
function Ctsp_year_range_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\[[Ff]ile.{1,40}[12]\d)(\d\d.{0,25}(svg|jpg)\|)/g, '$1`°♫$2'); // protect image files
regex(/(\b to \d\d)(\d\d)/g, '$1`°♫$2'); // protect " to 1987"
regex(/(\b and \d\d)(\d\d)/g, '$1`°♫$2'); // protect " and 1987"
regex(/\(c1/g, '(c. 1'); // fix (c1987
regex(/\(''circa''/g, '(c.'); // fix (''circa''
regex(/\( ?([12]\d\d\d) – ?([12]\d\d\d) ?\)/g, '($1–$2)'); // (1977 – 1998)
regex(/\b([12]\d\d\d){{ndash}} ?([12]\d\d\d)\b/g, '$1–$2'); // 1977{{ndash}} 1998
regex(/\b([12]\d\d\d)\?/g, 'c. $1'); // fix 1587?
regex(/\bca?\.([12]\d\d\d)\b/g, 'c. $1'); // put space after c. (c.1955)
regex(/\( ?circa ([12]\d\d\d)\b/g, '(c. $1'); // (circa 1989 -> (c. 1989
regex(/\bborn ca\./g, 'born c.'); // born ca. -> born c.
regex(/\(b\. ?ca\./g, '(born c.'); // (b. ca. -> (born c.
regex(/(\d\d)(\d\d)-(\d\d)(\d\d)\)\]\]/g, '$1`°♫$2-$3`°♫$4)]]'); // double protect year range in link
regex(/(\d\d)(\d\d)-(\d\d)(\d\d)\)\|/g, '$1`°♫$2-$3`°♫$4)|'); // double protect year range in piped link
regex(/(\d\d)(\d\d)\)\]\]/g, '$1`°♫$2)]]'); // protect year range in link
regex(/(\d\d)(\d\d)\)\|/g, '$1`°♫$2)|'); // protect year range in piped link
regex(/\[\[(\d\d)(\d\d)\b/g, '[[$1`°♫$2'); // protect year at beginning of link
regex(/(\d\d)(\d\d)(}}|''| \()/g, '$1`°♫$2$3'); // protect year in template name, etc.
regex(/rom (\d\d)(\d\d)/g, 'rom $1`°♫$2'); // protect 'from 1988'
regex(/, (\d\d)(\d\d)/g, ', $1`°♫$2'); // protect ', 1988'
regex(/c\. (\d\d)(\d\d)/g, 'c. $1`°♫$2'); // protect 'c. 1988'
regex(/(\|\| ?)(\d\d)(\d\d)( ?\|\||)/g, '$1$2`°♫$3$4'); // protect single year in table def
regex(/(\| ?\d\d)(\d\d ?\n)/g, '$1`°♫$2'); // protect single year in table at end of line
regex(/\[\[([12]\d\d\d)\]\]/g, '$1'); // delink years [[1988]]
regex(/\b([12]\d\d\d)\D.{0,4}([12]\d\d\d)(?!.{3,999})/g, '$1–$2'); // fix 1998 x 1999 (at end of line)
regex(/\( ?([12]?\d\d\d)[- –—\u2011]{1,4}([12]?\d\d\d) ?\)/g, '($1–$2)'); // fix (1998 - 1999)
regex(/\( ?([12]\d)(\d\d)[- –—\u2011]{1,4}(\d\d) ?\)/g, '($1$2–$1$3)'); // fix (1998 - 99)
regex(/\b(17\d\d)-(\d\d)\b(?!-)(?!\)\|)(?!\)\]\])/g, '$1–$2'); // fix 1750-55
regex(/\b(18\d\d)-(\d\d)\b(?!-)(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(19\d\d)-(\d\d)\b(?!-)(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(20\d\d)-(\d\d)\b(?!-)(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(17\d\d)-(17\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); // 1750-1755
regex(/\b(17\d\d)-(18\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(18\d\d)-(18\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(18\d\d)-(19\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(19\d\d)-(19\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(19\d\d)-(20\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\b(20\d\d)-(20\d\d)\b(?!\)\|)(?!\)\]\])/g, '$1–$2'); //
regex(/\( ?b\. ?([12]\d\d\d) ?\)/g, '(born $1)'); // (b. 1998) or (b.1998)
regex(/\( ?d\. ?([12]\d\d\d) ?\)/g, '(died $1)'); // (d. 1998) or (d.1998)
regex(/\( ?\* ?([12]\d\d\d) ?\)/g, '(born $1)'); // (* 1998) or (*1998)
regex(/\( ?b\. ([12]\d\d\d) ?\)/g, '(born $1)'); // (b. 1998)
regex(/\( ?d\. ([12]\d\d\d) ?\)/g, '(died $1)'); // (d. 1998)
regex(/\( ?[Bb]orn ?([12]\d\d\d) ?\)/g, '(born $1)'); // ( Born1998)
regex(/\( ?[Bb]orn in ?([12]\d\d\d) ?\)/g, '(born $1)'); // ( Born in1998)
regex(/\( ?([12]\d\d\d) ?[-–—\u2011] {0,4}\)/g, '(born $1)'); // (1998- )
regex(/\( ?([12]\d\d\d) ?– ?\)/g, '(born $1)'); // (1998– )
regex(/\( ?\??[- –—\u2011]{1,2}([12]\d\d\d) ?\)/g, '(died $1)'); // (-1998) or (?-1998)
regex(/\( *(\d{1,2}) +([A-Z][a-z]{2,8}) +([12]\d\d\d)[- –—\u2011]{1,3}(\d{1,2}) +([A-Z][a-z]{2,8}) +([12]\d\d\d) *\)/g, '($1 $2 $3 – $4 $5 $6)'); // (15 January 1865-28 August 1877)
regex(/`°♫/g, ''); // unprotect
regex(/(\d\d)(\d\d)\)\]\]/g, '$1`°♫$2)]]'); // protect year range in link again
regex(/(\d\d)(\d\d)\)\|/g, '$1`°♫$2)|'); // protect year range in piped link again
regex(/\( *([A-Z][a-z]{2,8}) +(\d{1,2}),? +([12]\d\d\d)[- –—\u2011]{1,3}([A-Z][a-z]{2,8}) +(\d{1,2}),? +([12]\d\d\d) *\)/g, '($1 $2, $3 – $4 $5, $6)'); // (January 15, 1865-August 28, 1877)
regex(/\( ?b\. c\. ?([12]\d\d\d) ?\)/g, '(born c. $1)'); // (b. c. 1998)
regex(/\( ?d\. ?c\. ?([12]\d\d\d) ?\)/g, '(died c. $1)'); // (d. c. 1998)
regex(/\( ?c\. ?([12]\d\d\d) ?[-–—\u2011] ?\)/g, '(born c. $1)'); // (c. 1998-)
regex(/\( ?ca?\. ([12]\d\d\d)[- –—\u2011]{1,3}([12]\d\d\d) ?\)/g, '(c. $1 – $2)'); // (c. 1958-1999)
regex(/\( ?([12]\d\d\d)[- –—\u2011]{1,3}ca?\. ?([12]\d\d\d) ?\)/g, '($1 – c. $2)'); // (1958-c. 1999)
regex(/\( ?ca?\. ([12]\d\d\d)– ?([12]\d\d\d) ?\)/g, '(c. $1 – $2)'); // (c. 1958–1999)
regex(/\bca?\. ([12]\d\d\d)[- –—\u2011]{1,3}ca?\. ?([12]\d\d\d)\b/g, 'c. $1 – c. $2'); // c. 1958-c.1999
regex(/\b(\d{1,2}) Jan\.? ([12]\d{3})\b/g, '$1 January $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Feb\.? ([12]\d{3})\b/g, '$1 February $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Mar\.? ([12]\d{3})\b/g, '$1 March $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Apr\.? ([12]\d{3})\b/g, '$1 April $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Jun\.? ([12]\d{3})\b/g, '$1 June $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Jul\.? ([12]\d{3})\b/g, '$1 July $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Aug\.? ([12]\d{3})\b/g, '$1 August $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Sept?\.? ([12]\d{3})\b/g, '$1 September $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Oct\.? ([12]\d{3})\b/g, '$1 October $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Nov\.? ([12]\d{3})\b/g, '$1 November $2'); // 21 Jan 1919
regex(/\b(\d{1,2}) Dec\.? ([12]\d{3})\b/g, '$1 December $2'); // 21 Jan 1919
regex(/\bJan\.? (\d{1,2}),? ([12]\d{3})\b/g, 'January $1, $2'); // Jan 21, 1919
regex(/\bFeb\.? (\d{1,2}),? ([12]\d{3})\b/g, 'February $1, $2'); // Jan 21, 1919
regex(/\bMar\.? (\d{1,2}),? ([12]\d{3})\b/g, 'March $1, $2'); // Jan 21, 1919
regex(/\bApr\.? (\d{1,2}),? ([12]\d{3})\b/g, 'April $1, $2'); // Jan 21, 1919
regex(/\bJun\.? (\d{1,2}),? ([12]\d{3})\b/g, 'June $1, $2'); // Jan 21, 1919
regex(/\bJul\.? (\d{1,2}),? ([12]\d{3})\b/g, 'July $1, $2'); // Jan 21, 1919
regex(/\bAug\.? (\d{1,2}),? ([12]\d{3})\b/g, 'August $1, $2'); // Jan 21, 1919
regex(/\bSept?\.? (\d{1,2}),? ([12]\d{3})\b/g, 'September $1, $2'); // Jan 21, 1919
regex(/\bOct\.? (\d{1,2}),? ([12]\d{3})\b/g, 'October $1, $2'); // Jan 21, 1919
regex(/\bNov\.? (\d{1,2}),? ([12]\d{3})\b/g, 'November $1, $2'); // Jan 21, 1919
regex(/\bDec\.? (\d{1,2}),? ([12]\d{3})\b/g, 'December $1, $2'); // Jan 21, 1919
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
} // unprotect
}
function Ctsp_hard_number_range() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\d\d)(\d\d)\)\]\]/g, '$1`°♫$2)]]'); // protect year range in link
regex(/(\d\d)(\d\d)\)\|/g, '$1`°♫$2)|'); // protect year range in piped link
regex(/([ \(;:]\d+ ?)[-–—\u2011]( ?\d+[,\. \)'"])/g, '$1–$2'); // two numbers separated by a hyphen, within certain delimiters
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
} // unprotect
doaction('diff');
}
function Ctsp_hard_year_range() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\d\d)(\d\d)\)\]\]/g, '$1`°♫$2)]]'); // protect year range in link
regex(/(\d\d)(\d\d)\)\|/g, '$1`°♫$2)|'); // protect year range in piped link
regex(/((?:[Ff]ile|[Ii]mage)\:[- A-Za-z0-9,\.;\(\)']*)(\d\d-\d\d[ A-Za-z0-9,\.;]*[|\]\(\)'])/g, '$1`°♫$2'); // protect year range in files
regex(/((?:[Ff]ile|[Ii]mage)\:[- A-Za-z0-9,\.;\(\)']*)(\d\d-\d\d[ A-Za-z0-9,\.;]*[|\]\(\)'])/g, '$1`°♫$2'); // once more to be more sure
regex(/(\b[12]\d)(\d\d-\d\d-)/g, '$1`°♫$2'); // protect yyyy-mm-dd dates
regex(/\b(17\d\d)-(17\d\d)\b/g, '$1–$2'); // 1750-1755
regex(/\b(17\d\d)-(18\d\d)\b/g, '$1–$2'); //
regex(/\b(18\d\d)-(18\d\d)\b/g, '$1–$2'); //
regex(/\b(18\d\d)-(19\d\d)\b/g, '$1–$2'); //
regex(/\b(19\d\d)-(19\d\d)\b/g, '$1–$2'); //
regex(/\b(19\d\d)-(20\d\d)\b/g, '$1–$2'); //
regex(/\b(20\d\d)-(20\d\d)\b/g, '$1–$2'); //
regex(/\((\d\d)(\d)(\d)[-–](\d)\)/g, '($1$2$3–$2$4)'); // (1874-6)
regex(/ (\d\d)(\d)(\d)[-–](\d)([ ,\.\)<;])/g, ' $1$2$3–$2$4$5'); // 1874-6,
regex(/\((\d\d\d\d)[-](\d\d)\)/g, '($1–$2)'); // (1874-76)
regex(/ (\d\d\d\d)[-](\d\d)([ ,\.\)<;])/g, ' $1–$2$3'); // 1874-76,
regex(/`°♫/g, ''); // unprotect
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_year_born_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(dash;)([12]\d)(\d\d)([- –—]{1,3})(?!.{3,999})/g, '$1`°♫$2$3'); // protect 1998–1999 range
regex(/\b([12]\d\d\d)[- –—\u2011]{1,3}(?!.{3,999})/g, 'born $1');
regex(/(\]\][\x20]*)\(([12]\d\d\d)\)/g, '$1(born $2)');
regex(/\(.{0,3}([12][90]\d\d).{0,3}(?:-|–|–).{0,3}\)/g, '(born $1)'); // fix (1932-)
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_page_number_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\x2Fpage/g, '/pa`°♫ge'); // Protect /page (as in URL)
regex(/\x2Fpg/g, '/p`°♫g'); // Protect /pg (as in URL)
regex(/\bPp\b/g, 'pp'); // Pp -> pp
regex(/\bPg\b/g, 'p'); // Pg -> p
regex(/\b[Pp]gs\b/g, 'pp'); // Pgs -> pp
regex(/\b[Pp]g\.?(\d)/g, 'p. $1'); // Pg2 -> p. 2
regex(/\b[Pp]gs\.?(\d)/g, 'pp. $1'); // Pgs2 -> pp. 2
regex(/\b[Pp]age ?(\d)/g, 'p. $1'); // Page -> p.
regex(/\b[Pp]ages ?(\d)/g, 'pp. $1'); // Pages -> pp.
regex(/[Pp]age ?([-–0-9, ]+[,\.])/g, 'p. $1'); // Page -> p.
regex(/[Pp]ages ?([-–0-9, ]+[,\.])/g, 'pp. $1'); // Pages -> pp.
regex(/([= \(])p[pg]?[\. ]{0,3}(\d+) ?(?:-|–|–|\u2212) ?(\d+)\b/g, '$1pp. $2–$3'); // page number range
regex(/([= \(])p[pg]?[\. ]{0,3}(\d+) ?(?:&|&) ?(\d+)\b/g, '$1pp. $2 & $3'); // page number range w/ampersand
regex(/([= \(])p[pg]?[\. ]{0,3}(\d+)(?: ?,)/g, '$1p. $2,'); // single page number p. 27,
regex(/([= \(])p[pg]?[\. ]{0,3}(\d+)(?:, ?)(\d+)\b/g, '$1pp. $2, $3'); // page number range
regex(/([= \(])pg?[\. ]{0,3}(\d+)\b/g, '$1p. $2'); // single page number
regex(/([= \(])p[pg]?[\. ]{0,3}(\d+)( )?(?=\.|<|\|)/g, '$1p. $2$3'); // single page number
// regex(/(\w) (pp?\.) (\d)/g, '$1, $2 $3'); // comma preceding page number(s) (No! URLs!)
regex(/\|pp=(\d+)\}\}/g, '|p=$1}}'); // |pp=123}} in sfn template
regex(/\|pp?=(\d+)[-–](\d+)\}\}/g, '|pp=$1–$2}}'); // |p=123-456}} in sfn template
regex(/\bpp (\d)/g, 'pp. $1'); // pp 123 -> pp. 123
regex(/ ([A-Za-z0-9'"]+) (pp?\.) /g, ' $1, $2 '); // comma preceding page number(s)
regex(/\bNo\.(\d+) (pp?\.) /g, 'No.$1, $2 '); // comma preceding page number(s)
regex(/,(pp?\.)/g, ', $1'); // space between comma and pp. (or p.)
regex(/\| ?pages ?= ?(\d+) ?\}\}/g, '|page=$1}}'); // |pages=25}} -> |page=25}}
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_page_number_add_pp() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(?:[:,]) ?(\d+)(?:[-–])(\d+)[ \.]{0,2}(?:<.ref)/g, ' pp. $1–$2'); // add pp. if "Vol 5, 108-110</ref>"
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_move_dates() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/`(.{0,500})`(\(.{0,25}\))`/g, ' $2$1');
regex(/`(.{0,500})`(.{0,25})`/g, ' ($2)$1');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_yyyymmdd() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\b([12]\d\d\d)\-01\-(\d\d)\b/g, '$2 January $1');
regex(/\b([12]\d\d\d)\-02\-(\d\d)\b/g, '$2 February $1');
regex(/\b([12]\d\d\d)\-03\-(\d\d)\b/g, '$2 March $1');
regex(/\b([12]\d\d\d)\-04\-(\d\d)\b/g, '$2 April $1');
regex(/\b([12]\d\d\d)\-05\-(\d\d)\b/g, '$2 May $1');
regex(/\b([12]\d\d\d)\-06\-(\d\d)\b/g, '$2 June $1');
regex(/\b([12]\d\d\d)\-07\-(\d\d)\b/g, '$2 July $1');
regex(/\b([12]\d\d\d)\-08\-(\d\d)\b/g, '$2 August $1');
regex(/\b([12]\d\d\d)\-09\-(\d\d)\b/g, '$2 September $1');
regex(/\b([12]\d\d\d)\-10\-(\d\d)\b/g, '$2 October $1');
regex(/\b([12]\d\d\d)\-11\-(\d\d)\b/g, '$2 November $1');
regex(/\b([12]\d\d\d)\-12\-(\d\d)\b/g, '$2 December $1');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_bare_bones_born() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\(([12]\d\d\d)\)/g, '(born $1)');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_school_year() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\bthe (\d\d\d\d)-(\d\d\d\d|\d\d) (season|school year|year)\b/g, 'the $1/$2 $3');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_initials() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/College/g, 'C`°♫ollege'); // exempt college names
regex(/\b([MD])[Rr][\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, '$1r. $2. $3'); // Mr. A. Doyle (or Dr.)
regex(/\b([MD])[Rr][\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, '$1r. $2. $3. $4'); // Mr. A. C. Doyle
regex(/\b([MD])[Rr][\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, '$1r. $2. $3. $4. $5'); // Mr. A. Doyle
regex(/\bSri[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, 'Sri $1. $2'); // Sri M. Unwurthy
regex(/\bSri[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, 'Sri $1. $2. $3'); // Sri I. M. Unwurthy
regex(/\bSri[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z])[\x20\.]([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, 'Sri $1. $2. $3. $4'); // Sri I. M. N. Unwurthy
regex(/\b([A-Z])[\x20\.]([A-Z])[\x20\.]{1,2}([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, '$1. $2. $3. $4'); // C. P. E. Bach
regex(/\b([A-Z])[\x20\.]([A-Z])[\x20\.]{1,2}([A-Z][a-z]+)\b/g, '$1. $2. $3'); // E. E. Cummings
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_century() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\b(\w+)th century (?=house|country house|mansion|engraving|Engraving|\[\[engraving|image|paint|panel|art|writ|drama|author|moralit|copy|writing|portrait|illustra|additi|town)/g, '$1th-century ');
regex(/\b(a|A|an|An|this|This|These|these|Its|its|Some|some|Most|most|All|all|Any|any|Its|its|with|With|of) (\w+)(th|st) [Cc]entury\b/g, '$1 $2$3-century');
regex(/\b([Ee])arly (\w+th-)/g, '$1arly-$2');
regex(/\b([Ll])ate (\w+th-)/g, '$1ate-$2');
regex(/ mid /g, ' mid-');
regex(/\bthe (\w+)th-[cC]entury([,\.])/g, 'the $1th century$2');
regex(/-century period\b/g, '-century-period');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_time_fmt_A_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\b(\d{1,2})[\.:](\d\d) ?(AM|am)\b/g, '$1:$2 am');
regex(/\b(\d{1,2})[\.:](\d\d) ?(PM|pm)\b/g, '$1:$2 pm');
regex(/\b(\d{1,2})[\.:](\d\d) ?(A\.M\.|a\.m\.)/g, '$1:$2 a.m.');
regex(/\b(\d{1,2})[\.:](\d\d) ?(P\.M\.|p\.m\.)/g, '$1:$2 p.m.');
regex(/ (\d{1,2}) ?(AM|am)\b/g, ' $1 am');
regex(/ (\d{1,2}) ?(PM|pm)\b/g, ' $1 pm');
regex(/ (\d{1,2}) ?(A\.M\.)/g, ' $1 a.m.');
regex(/ (\d{1,2}) ?(P\.M\.)/g, ' $1 p.m.');
regex(/\( ?(\d{1,2})[\.:](\d{1,2}) ?(AM|am) ?[-–]/g, '($1:$2 am –'); // (2:30 am -
regex(/\( ?(\d{1,2})[\.:](\d{1,2}) ?(PM|pm) ?[-–]/g, '($1:$2 pm –');
regex(/\( ?(\d{1,2})[\.:](\d{1,2}) ?(A\.M\.|a\.m\.) ?[-–]/g, '($1:$2 a.m. –');
regex(/\( ?(\d{1,2})[\.:](\d{1,2}) ?(P\.M\.|p\.m\.) ?[-–]/g, '($1:$2 p.m. –');
regex(/[-–] ?(\d{1,2})[\.:](\d{1,2}) ?(AM|am) ?\)/g, '– $1:$2 am)'); // - 2:30 am)
regex(/[-–] ?(\d{1,2})[\.:](\d{1,2}) ?(PM|pm) ?\)/g, '– $1:$2 pm)');
regex(/[-–] ?(\d{1,2})[\.:](\d{1,2}) ?(A\.M\.|a\.m\.) ?\)/g, '– $1:$2 a.m.)');
regex(/[-–] ?(\d{1,2})[\.:](\d{1,2}) ?(P\.M\.|p\.m\.) ?\)/g, '– $1:$2 p.m.)');
regex(/\( ?(\d{1,2}) ?(AM|am) ?[-–]/g, '($1 am –'); // (2 am -
regex(/\( ?(\d{1,2}) ?(PM|pm) ?[-–]/g, '($1 pm –');
regex(/\( ?(\d{1,2}) ?(A\.M\.|a\.m\.) ?[-–]/g, '($1 a.m. –');
regex(/\( ?(\d{1,2}) ?(P\.M\.|p\.m\.) ?[-–]/g, '($1 p.m. –');
regex(/[-–] ?(\d{1,2}) ?(AM|am) ?\)/g, '– $1 am)'); // - 2 am
regex(/[-–] ?(\d{1,2}) ?(PM|pm) ?\)/g, '– $1 pm)');
regex(/[-–] ?(\d{1,2}) ?(A\.M\.|a\.m\.) ?\)/g, '– $1 a.m.)');
regex(/[-–] ?(\d{1,2}) ?(P\.M.\|p\.m\.) ?\)/g, '– $1 p.m.)');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_time_fmt_B_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/<small>(AM|PM)<.{1}small>/g, '$1');
regex(/\b(\d{1,2})[\.:](\d\d)(?: | )?(AM|am)\b/g, '$1:$2 am');
regex(/\b(\d{1,2})[\.:](\d\d)(?: | )?(PM|pm)\b/g, '$1:$2 pm');
regex(/\b(\d{1,2})(?: | )?(AM|am)\b/g, '$1 am');
regex(/\b(\d{1,2})(?: | )?(PM|pm)\b/g, '$1 pm');
regex(/\b(\d{1,2})[\.:](\d\d)(?: | )?(A\.M\.|a\.m\.)/g, '$1:$2 a.m.');
regex(/\b(\d{1,2})[\.:](\d\d)(?: | )?(P\.M\.|p\.m\.)/g, '$1:$2 p.m.');
regex(/\b(\d{1,2})(?: | )?(A\.M\.|a\.m\.)/g, '$1 a.m.');
regex(/\b(\d{1,2})(?: | )?(P\.M\.|p\.m\.)/g, '$1 p.m.');
regex(/ ?[-–] ?(\d{1,2})[\.:](\d\d)(?: | )?(AM|am)\b/g, ' – $1:$2 am');
regex(/ ?[-–] ?(\d{1,2})[\.:](\d\d)(?: | )?(PM|pm)\b/g, ' – $1:$2 pm');
regex(/ ?[-–] ?(\d{1,2})(?: | )?(AM|am)\b/g, ' – $1 am');
regex(/ ?[-–] ?(\d{1,2})(?: | )?(PM|pm)\b/g, ' – $1 pm');
regex(/ ?[-–] ?(\d{1,2})[\.:](\d\d)(?: | )?(A\.M\.|a\.m\.)\b/g, ' – $1:$2 am');
regex(/ ?[-–] ?(\d{1,2})[\.:](\d\d)(?: | )?(P\.M\.|p\.m\.)\b/g, ' – $1:$2 pm');
regex(/ ?[-–] ?(\d{1,2})(?: | )?(A\.M\.|a\.m\.)\b/g, ' – $1 a.m.');
regex(/ ?[-–] ?(\d{1,2})(?: | )?(P\.M\.|p\.m\.)\b/g, ' – $1 p.m.');
regex(/(\d) ?[-–] ?(\d{1,2})[\.:](\d\d)(?: | )?(p\.m\.|a\.m\.|pm|am)\b/g, '$1–$2:$3 $4');
regex(/(\d) ?[-–] ?(\d{1,2})(?: | )?(p\.m\.|a\.m\.|pm|am)\b/g, '$1–$2 $3');
regex(/\b([Ff])rom (\d{1,2})(:\d\d)? (p\.m\.|a\.m\.|pm|am) –/g, '$1rom $2$3 $4 to');
regex(/\b([Bb])etween (\d{1,2})(:\d\d)? (p\.m\.|a\.m\.|pm|am) –/g, '$1etween $2$3 $4 and');
regex(/:12\b/g, ':1`°♫2');
regex(/\b12(?::00)?(?: | )?(?:a\.m\.|A\.M\.)/g, 'midnight');
regex(/\b12(?::00)?(?: | )?(?:p\.m\.|P\.M\.)/g, 'noon');
regex(/\b12(?::00)?(?: | )?(?:am|AM)\b/g, 'midnight');
regex(/\b12(?::00)?(?: | )?(?:pm|PM)\b/g, 'noon');
regex(/`°♫/g, '');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_decaps() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/\b([A-Z][a-z]+|,) At [Tt]he +([A-Z][a-z]+)\b/g, '$1 at the $2');
regex(/\b([A-Z][a-z]+|,) Of [Tt]he +([A-Z][a-z]+)\b/g, '$1 of the $2');
regex(/\b([A-Z][a-z]+|,) On [Tt]he +([A-Z][a-z]+)\b/g, '$1 on the $2');
regex(/\b([A-Z][a-z]+|,) In [Tt]he +([A-Z][a-z]+)\b/g, '$1 in the $2');
regex(/\b([A-Z][a-z]+|,) Of [Aa] +([A-Z][a-z]+)\b/g, '$1 of a $2');
regex(/\b([A-Z][a-z]+|,) Of [Aa]n +([A-Z][a-z]+)\b/g, '$1 of an $2');
regex(/\b([A-Z][a-z]+|,) On [Aa] +([A-Z][a-z]+)\b/g, '$1 on a $2');
regex(/\b([A-Z][a-z]+|,) On [Aa]n +([A-Z][a-z]+)\b/g, '$1 on an $2');
regex(/\b([A-Z][a-z]+|,) And [Aa] +([A-Z][a-z]+)\b/g, '$1 and a $2');
regex(/\b([A-Z][a-z]+|,) And [Aa]n +([A-Z][a-z]+)\b/g, '$1 and an $2');
regex(/\b([A-Z][a-z]+|,) In ([A-Z][a-z]+)\b/g, '$1 in $2');
regex(/\b([A-Z][a-z]+|,) And ([A-Z][a-z]+)\b/g, '$1 and $2');
regex(/\b([A-Z][a-z]+|,) Off ([A-Z][a-z]+)\b/g, '$1 off $2');
regex(/\b([A-Z][a-z]+|,) Of ([A-Z][a-z]+)\b/g, '$1 of $2');
regex(/\b([A-Z][a-z]+|,) On ([A-Z][a-z]+)\b/g, '$1 on $2');
regex(/\b([A-Z][a-z]+|,) For ([A-Z][a-z]+)\b/g, '$1 for $2');
regex(/\b([A-Z][a-z]+|,) From ([A-Z][a-z]+)\b/g, '$1 from $2');
regex(/\b([A-Z][a-z]+|,) With ([A-Z][a-z]+)\b/g, '$1 with $2');
regex(/\b([A-Z][a-z]+|,) Near ([A-Z][a-z]+)\b/g, '$1 near $2');
regex(/\b([A-Z][a-z]+|,) The ([A-Z][a-z]+)\b/g, '$1 the $2');
regex(/\b([A-Z][a-z]+) A ([A-Z][a-z]+)\b/g, '$1 a $2');
regex(/\b([A-Z][a-z]+|,) An ([A-Z][a-z]+)\b/g, '$1 an $2');
regex(/\b([A-Z][a-z]+|,) By ([A-Z][a-z]+)\b/g, '$1 by $2');
regex(/\b([A-Z][a-z]+|,) At ([A-Z][a-z]+)\b/g, '$1 at $2');
regex(/\b([A-Z][a-z]+|,) To ([A-Z][a-z]+)\b/g, '$1 to $2');
regex(/\b(\d\d\d\d) To (\d\d\d\d)\b/g, '$1 to $2');
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_time_fmt_C_main() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\n.{1,50}) (am|pm|a\.m\.|p\.m\.)(.{0,40}\n)/g, '$1 $2$3'); // change nbsp to normal space in short lines
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
}
function Ctsp_bullet() {
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/(\n\*+)/g, '$1 '); // ensure blank follows asterisk in bulleted lists
regex(/(\n\:+)/g, '$1 '); // ensure blank follows colon in unbulleted lists
regex(/(\n\#+)/g, '$1 '); // ensure blank follows pound sign in ordered lists
regex(/(\n\*+)\s\s+/g, '$1 '); // remove double blanks
regex(/(\n\:+)\s\s+/g, '$1 '); // remove double blanks
regex(/(\n\#+)\s\s+/g, '$1 '); // remove double blanks
regex(/(\n)\n\*/g, '$1*'); // change double-spaced bulleted lists to single-spaced
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
doaction('diff');
}
function Ctsp_the_works() {
Ctsp_nix_ly_hyph_main();
Ctsp_gen_hyph_main();
Ctsp_mech_main();
Ctsp_nonbspace_main();
Ctsp_from_range_main();
Ctsp_page_number_main();
Ctsp_time_fmt_A_main();
Ctsp_the_works_edit_summary();
}
function Ctsp_special() {
Ctsp_nix_ly_hyph_main();
Ctsp_gen_hyph_main();
Ctsp_mech_main();
Ctsp_nonbspace_main();
Ctsp_from_range_main();
Ctsp_page_number_main();
Ctsp_time_fmt_A_main();
Ctsp_time_fmt_B_main();
Ctsp_time_fmt_C_main();
Ctsp_time_fmt_C_main();
// copy wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) frame to wpTextbox1 textarea
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateTextarea();
}
}
regex(/Monday-Friday/g, 'Monday–Friday'); // temp, for 1982–1983 United States network television schedule etc.
regex(/highlited/g, 'highlighted'); // temp, for 1982–1983 United States network television schedule etc.
regex(/('')('NEW YORK TIMES')('')/g, '$1New York Times$3'); // temp, for 1982–1983 United States network television schedule etc.
regex(/September (\d\d\d\d)-September (\d\d\d\d)/g, 'September $1 – September $2'); // temp, for 1982–1983 United States network television schedule etc.
// copy wpTextbox1 textarea back to wikEd frame
if (typeof(window.wikEd.useWikEd) != 'undefined') {
if (window.wikEd.useWikEd == true) {
WikEdUpdateFrame();
}
}
setoptions(minor='true');
setreason('date and time fmt', 'append');
doaction('diff');
}
addOnloadHook(function () {
if(document.forms.editform) {
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_ddea()', '· · Ddea', 't-Ddea', 'Ddea', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_keyp()', '· · Keyp', 't-Keyp', 'Keyp', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_past()', '· · Past', 't-Past', 'Past', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_overlink()', '· · Overlink', 't-OvLi', 'Overlink', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_Anchor()', '· Anchor xxya', 't-Anchor', 'Anchor xxya', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_century()', '· xxth-century', 't-Cen', 'xxth-century', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_jobt()', '· JOBT', 't-Jobt', 'JOBT', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_uss()', '· USS', 't-USS', 'USS', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_nix_ly_hyph()', '· Nix ly hyphen', 't-NHe', 'Nix hyphen', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_nix_ly_hyph_nosumm()', '· Nix ly nosumm', 't-NHn', 'Nix hyphen nosumm', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_gen_hyph_nosumm()', '· General hyphens', 't-NHa', 'General hyphens', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_mech()', '· Mech', 't-Mec', 'Mech', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_nonbspace()', '· Nonbspace', 't-Nonbsp', 'Nonbspace', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_from_range()', '· Fromrange', 't-Fromrg', 'Fromrange', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_the_works()', '· · The OOOO works', 't-Thewks', 'The works', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_special()', '· · Special', 't-Spec', 'Special', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_bullet()', '· · Bullet', 't-Bull', 'Bullet', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_nonbspace_hard()', '· Hard nbsp', 't-HNbsp', 'Hard nbspace', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_year_range()', '· Year range', 't-Yrange', 'Year range', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_hard_year_range()', '· · Hard year range', 't-Hyrange', 'Hard year range', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_hard_number_range()', '· · Hard num range', 't-Hnrange', 'Hard num range', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_move_dates()', '· Move dates', 't-Mvdate', 'Move dates', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_school_year()', '· School year', 't-SchYr', 'School year', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_bare_bones_born()', '· Bare bones born', 't-Bbborn', 'Bare bones born', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_years_only()', '· Years only', 't-Yrsonly', 'Years only', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_year_born()', '· Year born', 't-Yborn', 'Year born', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_state_abbr()', '· St abbr', 't-StAbbr', 'St abbr', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_provi_abbr()', '· Prov abbr', 't-ProvAbbr', 'Prov abbr', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_ord_suff()', '· Ord suff', 't-Ordsuf', 'Ord suff', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_tempCF()', '· TempCF', 't-Tempcf', 'TempCF', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_custom()', '· · Custom', 't-Custom', 'Custom', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_initials()', '· Initials', 't-Initls', 'Initials', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_time_fmt_A()', '· Time fmt A', 't-TimeFA', 'Time fmt A', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_time_fmt_B()', '· Time fmt B', 't-TimeFB', 'Time fmt B', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_time_fmt_C()', '· Time fmt C', 't-TimeFC', 'Time fmt C', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_page_number()', '· Page num', 't-PageNu', 'Page num', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_page_number_add_pp()', '· Page add pp', 't-PagAdPp', 'Page add pp', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_day_names()', '· Day names', 't-DayNm', 'Day names', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_yyyymmdd()', '· yyyy-mm-dd', 't-YyyyMm', 'yyyy-mm-dd', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_decaps()', '· Decaps', 't-Decaps', 'Decaps', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_space_punct()', '· Space punct', 't-SpPunct', 'Space punct', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ctsp_x_powered()', '· X powered', 't-XPower', 'X powered', '', '');
}
});