User:Ohconfucius/script/Sources.js: Difference between revisions

Content deleted Content added
No edit summary
line spacing
 
Line 16:
// importScript("User:Ohconfucius/script/foreigndates.js"); //link-fixing, dabbing etc
}
 
function Ohc_add_ref_tags() {
var txt=document.editform.wpTextbox1;
Line 37 ⟶ 38:
 
}
 
 
function Ohc_remove_urls() {
Line 88:
regex(/(\|\s*url\s*\=\s*)(https?:[^|{}#\s]+\.html?)\?[^|}]{1,5}(?=[\s\[\]|{}<>])/gi, '$1$2'); //rem link tracking
regex(/(\|\s*url\s*\=\s*|\[)(https?:\/\/books\.google\.[^\/]+\/books\?id=\w{12}&pg=PA\d{1,3})&dq[^\s|}]+(?=\s?[|}])/gi, '$1$2'); //rem browser optimisation
 
 
}
Line 548 ⟶ 547:
// regex(/(<ref name=[^/>"]*)>([\s\S]*)\1>/gi, '$1A>$2$1B>');
// regex(/(<ref name="[^/>]*)">([\s\S]*)\1>/gi, '$1A>$2$1B">');
 
}
 
Line 588:
 
}
 
 
function ohc_unprotect_urls()
Line 638 ⟶ 637:
Ohc_sources_cleanup();
ohc_unprotect_urls();
 
 
Ohc_Source_edit_summary();
Line 651 ⟶ 649:
regex(/<ref>\[https?:\/\/(?:en\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|findagrave|instagram|mailonline|myspace|twitter|x)\.com)\/[^\s\]]*[ ]+[\w\d][^\]]*\]<\/ref>/gi, '');
regex(/\|[ ]*url[ ]*=[ ]*https?:\/\/(?:\w{2}\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|findagrave|instagram|mailonline|myspace|twitter|x)\.com)[^\s\|\{\}<]*(?=[ ]*[|}])/gi, '');
 
 
regex(/[ ]\[https?:\/\/en\.wikipedia\.org\/wiki\/[^\s\]]*[ ]+([\w][^\]]*)\]/gi, ' [[$1]]');
Line 674 ⟶ 671:
 
}
 
function prevDef ( e ) {
e.preventDefault();
}
 
function addLinks() {