Revision as of 19:28, 16 May 2021 view sourceOhconfucius (talk | contribs)Autopatrolled, Extended confirmed users, Pending changes reviewers328,947 edits revert after testingTag: Manual revert← Previous edit |
Latest revision as of 14:07, 25 May 2024 view source Ohconfucius (talk | contribs)Autopatrolled, Extended confirmed users, Pending changes reviewers328,947 edits Revert to revision 1225597808 dated 2024-05-25 13:59:39 by Ohconfucius using popupsTag: Manual revert |
(85 intermediate revisions by the same user not shown) |
Line 5: |
Line 5: |
|
importScript("User:Ohconfucius/test/EngvarB.js"); //Engvar |
|
importScript("User:Ohconfucius/test/EngvarB.js"); //Engvar |
|
importScript("User:Ohconfucius/dashes.js"); |
|
importScript("User:Ohconfucius/dashes.js"); |
|
mw.loader.load('https://meta.wikimedia.org/search/?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript'); |
|
|
importScript("User:Splarka/diffreveal.js"); //reveals unicode characters when viewing diffs |
|
importScript("User:Splarka/diffreveal.js"); //reveals unicode characters when viewing diffs |
|
//importScript("User:Ohconfucius/test/test.js"); |
|
|
importScript("User:Ohconfucius/script/flagcruft.js"); //flagcruft, tablesort |
|
importScript("User:Ohconfucius/script/flagcruft.js"); //flagcruft, tablesort |
|
//importScript("User:Ohconfucius/test/custom.js"); // |
|
|
importScript("User:Ohconfucius/test/formatgeneral.js"); |
|
importScript("User:Ohconfucius/test/formatgeneral.js"); |
|
importScript("User:Ohconfucius/test/MOSNUM dates code.js"); |
|
importScript("User:Ohconfucius/script/tometricunits.js"); |
|
|
importScript("User:Ohconfucius/test/MOSNUM dates.js"); |
|
importScript("User:Ohconfucius/test/Common Terms.js"); |
|
importScript("User:Ohconfucius/test/Common Terms.js"); |
|
importScript("User:Ohconfucius/test/Sources.js"); |
|
importScript("User:Ohconfucius/test/Sources.js"); |
|
importScript("User:Ohconfucius/script/foreigndates.js"); |
|
importScript("User:Ohconfucius/script/foreigndates.js"); |
|
|
mw.loader.load('//en.wikipedia.org/search/?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); |
|
importScript("User:Ohconfucius/test/YMD dot dates.js"); |
|
|
|
|
|
|
importScript('User:Evad37/duplinks-alt.js'); // ] |
|
importScript('User:Evad37/duplinks-alt.js'); // ] |
Line 34: |
Line 32: |
|
/// EDIT SUMMARIES & USE DMY TEMPLATE |
|
/// EDIT SUMMARIES & USE DMY TEMPLATE |
|
|
|
|
|
function Ohc_edit_summary1(){ |
|
function Ohc_edit_summary1() { |
|
//Add a tag to the summary box |
|
//Add a tag to the summary box |
|
// setoptions(minor='true') //removed ",watch='false'" in response to user notification 13 Nov. 2010 |
|
// setoptions(minor='true') //removed ",watch='false'" in response to user notification 13 Nov. 2010 |
|
setreason(']-assisted fixes: per ], ], ]', 'appendonce'); |
|
setreason(']-assisted ] fixes', 'appendonce'); |
|
doaction('diff'); |
|
doaction('diff'); |
|
} |
|
} |
|
|
|
|
|
function Ohc_edit_summary2(){ |
|
function Ohc_edit_summary2(editor) { |
|
|
editor |
|
//Add a tag to the summary box |
|
|
setoptions(minor='false',watch='false'); |
|
.options({ minor: false, watch: false }) |
|
setreason(']-assisted fixes per ], ] and ]', 'appendonce'); |
|
.appendEditSummary(']-assisted ] fixes and per ]') |
|
|
.clickDiff(); |
|
doaction('diff'); |
|
|
} |
|
} |
|
|
|
|
|
function Ohc_edit_summary3(){ |
|
function Ohc_for_AWB(editor) { |
|
|
editor |
|
//Add a tag to the summary box |
|
|
|
.replace(/(+)(?:regex|txt.value=txt.value.replace)\(\//gi, '$1ArticleText=Regex.Replace(ArticleText, @"(?i)') |
|
setoptions(minor='false',watch='false'); |
|
|
|
.replace(/\/gi, /gi, '", "') |
|
setreason('should not be using ] to denote locations', 'appendonce'); |
|
|
|
.replace(/\'(\);*)/gi, '"$1'); |
|
doaction('diff'); |
|
|
} |
|
|
|
|
|
function Ohc_edit_summary4(){ |
|
|
//Add a tag to the summary box |
|
|
// setoptions(minor='true') //removed ",watch='false'" in response to user notification 13 Nov. 2010 |
|
|
setreason(']-assisted fixes: per ], ], ]', 'appendonce'); |
|
|
doaction('diff'); |
|
|
} |
|
} |
|
|
|
|
|
function Ohc_for_AWB(){ |
|
function Ohc_transcripts() { |
|
regex(/(+)(?:regex|txt.value=txt.value.replace)\(\//gi, '$1ArticleText=Regex.Replace(ArticleText, @"(?i)'); |
|
regex(/(\d?:|)\d\d?:\d\d\n/gi, ''); |
|
regex(/\/gi, /gi, '", "'); |
|
regex(/(\w,?)\s?\n/gi, '$1 '); |
|
regex(/\'(\);*)/gi, '"$1'); |
|
|
|
|
|
|
} |
|
} |
|
|
|
|
|
function Ohc_for_Petscan(){ |
|
function Ohc_for_Petscan() { |
|
regex(/\\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+)\|(]*)\]\]/gi, ''); |
|
regex(/\\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+)\|(]*)\]\]/gi, ''); |
|
regex(/\\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+)\|(]*)\]\]/gi, ''); |
|
regex(/\\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+) (\s]+)\|(]*)\]\]/gi, ''); |
Line 80: |
Line 70: |
|
} |
|
} |
|
|
|
|
|
function Baskerville(){ |
|
function Ohc_insert_tag() { |
|
regex(/(\w)\n(\w)/gi, '$1 $2'); |
|
|
regex(/(\w,)\n(\w)/gi, '$1 $2'); |
|
|
regex(/(\n)\n(\")/gi, '$1$2'); |
|
|
|
|
|
} |
|
|
|
|
|
function Ohc_insert_tag(){ |
|
|
var txt=document.editform.wpTextbox1; |
|
var txt=document.editform.wpTextbox1; |
|
// current month-year |
|
// current month-year |
Line 113: |
Line 96: |
|
/// COMPOSITE SCRIPT DRIVERS |
|
/// COMPOSITE SCRIPT DRIVERS |
|
|
|
|
|
function ONETOUCH_DMY(){ |
|
function ONETOUCH_DMY(editor) { |
|
// Add a tag to the summary box |
|
// Add a tag to the summary box |
|
var txt=document.editform.wpTextbox1; |
|
var txt=document.editform.wpTextbox1; |
|
// Ohc_ref_format(); |
|
//Ohc_ref_format(); |
|
Ohc_retrain_links(); |
|
Ohc_retrain_links(); |
|
Ohc_CommonTerms(); |
|
Ohc_CommonTerms(); |
|
//ohc_replaceflag(); |
|
//ohc_replaceflag(); |
|
ohc_delink_dates(); |
|
ohc_delink_dates(editor); |
|
ohc_expand_ref_dates(); |
|
ohc_expand_ref_dates(editor); |
|
ohc_protect_dates(); |
|
ohc_protect_dates(editor); |
|
ohc_fix_unambiguous_dates(); |
|
ohc_fix_unambiguous_dates(editor); |
|
ohc_body_dates_to_dmy(); |
|
ohc_body_dates_to_dmy(editor); |
|
ohc_delink_year_in_X(); |
|
ohc_delink_year_in_X(editor); |
|
ohc_dmy_publication_dates(); |
|
ohc_dmy_publication_dates(editor); |
|
ohc_delink_ISO_to_dmy(); |
|
ohc_delink_ISO_to_dmy(editor); |
|
ohc_unprotect_dates(); |
|
ohc_unprotect_dates(editor); |
|
autoEdFunctions(); //dashes |
|
autoEdFunctions(); //dashes |
|
Ohc_formatgeneral(); |
|
Ohc_formatgeneral(); |
|
ohc_sources_driver(); |
|
ohc_sources_driver(editor); |
|
|
Ohc_edit_summary2(editor); |
|
Ohc_edit_summary4(); |
|
|
} |
|
} |
|
|
|
|
|
function ONETOUCH_MDY(){ |
|
function ONETOUCH_MDY(editor) { |
|
// Add a tag to the summary box |
|
// Add a tag to the summary box |
|
var txt=document.editform.wpTextbox1; |
|
var txt=document.editform.wpTextbox1; |
Line 141: |
Line 124: |
|
Ohc_CommonTerms(); |
|
Ohc_CommonTerms(); |
|
|
|
|
|
ohc_delink_dates(); |
|
ohc_delink_dates(editor); |
|
ohc_expand_ref_dates(); |
|
ohc_expand_ref_dates(editor); |
|
ohc_protect_dates(); |
|
ohc_protect_dates(editor); |
|
ohc_fix_unambiguous_dates(); |
|
ohc_fix_unambiguous_dates(editor); |
|
ohc_body_dates_to_mdy(); |
|
ohc_body_dates_to_mdy(editor); |
|
ohc_delink_year_in_X(); |
|
ohc_delink_year_in_X(editor); |
|
ohc_mdy_publication_dates(); |
|
ohc_mdy_publication_dates(editor); |
|
ohc_delink_ISO_to_mdy(); |
|
ohc_delink_ISO_to_mdy(editor); |
|
ohc_unprotect_dates(); |
|
ohc_unprotect_dates(editor); |
|
autoEdFunctions(); //dashes |
|
autoEdFunctions(); //dashes |
|
Ohc_formatgeneral(); |
|
Ohc_formatgeneral(); |
|
ohc_sources_driver(); |
|
ohc_sources_driver(editor); |
|
|
Ohc_edit_summary2(editor); |
|
Ohc_edit_summary4(); |
|
|
} |
|
} |
|
|
|
|
|
function ohc_sources_driver() |
|
function ohc_sources_driver(editor) { |
|
{ |
|
|
Ohc_remove_urls(); |
|
Ohc_remove_urls(); |
|
ohc_protect_urls(); |
|
ohc_protect_urls(); |
Line 174: |
Line 156: |
|
} |
|
} |
|
|
|
|
|
function ohc_body_to_dmy_driver() |
|
function ONETOUCH_FMT(editor) { |
|
{ |
|
|
Ohc_CommonTerms(); |
|
|
|
|
|
ohc_delink_dates(); |
|
|
ohc_protect_dates(); |
|
|
ohc_body_dates_to_dmy(); |
|
|
ohc_BIGENDIAN_dates(); |
|
|
ohc_unprotect_dates(); |
|
|
autoEdFunctions(); //dashes |
|
|
Ohc_formatgeneral(); |
|
|
ohc_sources_driver(); |
|
|
|
|
|
Ohc_edit_summary1(); |
|
|
} |
|
|
|
|
|
function ohc_body_to_mdy_driver() |
|
|
{ |
|
|
Ohc_CommonTerms(); |
|
|
|
|
|
ohc_delink_dates(); |
|
|
ohc_protect_dates(); |
|
|
ohc_body_dates_to_mdy(); |
|
|
ohc_BIGENDIAN_dates(); |
|
|
ohc_unprotect_dates(); |
|
|
autoEdFunctions(); //dashes |
|
|
Ohc_formatgeneral(); |
|
|
ohc_sources_driver(); |
|
|
|
|
|
Ohc_edit_summary1(); |
|
|
} |
|
|
|
|
|
function ONETOUCH_FMT(){ |
|
|
// Add a tag to the summary box |
|
// Add a tag to the summary box |
|
var txt=document.editform.wpTextbox1; |
|
var txt=document.editform.wpTextbox1; |
|
Ohc_CommonTerms(); |
|
Ohc_CommonTerms(); |
|
autoEdFunctions(); //dashes |
|
autoEdFunctions(); //dashes |
|
ohc_sources_driver(); |
|
ohc_sources_driver(editor); |
|
Ohc_formatgeneral(); |
|
Ohc_formatgeneral(); |
|
Ohc_edit_summary2(); |
|
Ohc_edit_summary2(editor); |
|
} |
|
} |
|
|
|
|
Line 219: |
Line 169: |
|
|
|
|
|
|
|
|
|
|
/** |
|
$(function () { |
|
|
|
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. |
|
if(document.forms.editform) { |
|
|
|
* @see https://meta.wikimedia.org/TemplateScript |
|
mw.util.addPortletLink('p-tb', 'javascript:ohc_delink_dates()', 'delink dates', 't-eng', 'delink dates', '', ''); |
|
|
|
* @update-token ] |
|
mw.util.addPortletLink('p-tb', 'javascript:Ohc_for_Petscan()', 'PetScan', 't-pet', 'Create open PetScan list', '', ''); |
|
|
|
*/ |
|
mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_DMY()', 'One Touch: DMY', 't-dmy', 'day month + CT', '', ''); |
|
|
|
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() { |
|
mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_MDY()', 'One Touch: MDY', 't-mdy', 'month day + CT', '', ''); |
|
|
|
pathoschild.TemplateScript.add( |
|
mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_FMT()', 'One Touch: FMT', 't-fmt', 'general fmt, CT + cites', '', ''); |
|
|
|
[ |
|
// mw.util.addPortletLink('p-tb', 'javascript:Ohc_for_AWB()', 'Make AWB', 'AWB', 'Make AWB code', '', ''); |
|
|
|
//{ name: 'delink dates', script: function(editor) { ohc_delink_dates(editor); }, tooltip: 'delink dates' }, |
|
// mw.util.addPortletLink('p-tb', 'javascript:ohc_refs_to_yyyymmdd()', 'Expand dates', 't-ISO', 'yyyy-mm-dd', '', ''); |
|
|
|
{ name: 'One Touch: DMY', script: function(editor) { ONETOUCH_DMY(editor); }, tooltip: 'day month + CT' }, |
|
mw.util.addPortletLink('p-tb', 'javascript:ohc_US_slash_dates_to_mdy()', 'US-slash dates', 't-US', 'US-slash', '', ''); |
|
|
|
{ name: 'One Touch: MDY', script: function(editor) { ONETOUCH_MDY(editor); }, tooltip: 'month day + CT' }, |
|
mw.util.addPortletLink('p-tb', 'javascript:ohc_UK_slash_dates_to_dmy()', 'UK-slash dates', 't-UK', 'UK-slash', '', ''); |
|
|
|
{ name: 'One Touch: FORMAT', script: function(editor) { ONETOUCH_FMT(editor); }, tooltip: 'general fmt, CT + cites' }, |
|
|
|
|
|
//{ name: 'Make AWB', script: function(editor) { Ohc_for_AWB(editor); }, tooltip: 'Make AWB code' }, |
|
} |
|
|
|
//{ name: 'Expand dates', script: function(editor) { ohc_refs_to_yyyymmdd(editor); }, tooltip: 'yyyy-mm-dd' }, |
|
|
{ name: 'SLASH-US', script: function(editor) { ohc_US_slash_dates_to_mdy(editor); }, tooltip: 'US-slash' }, |
|
|
{ name: 'SLASH-UK', script: function(editor) { ohc_UK_slash_dates_to_dmy(editor); }, tooltip: 'UK-slash' }, |
|
|
], |
|
|
{ category: 'General' } |
|
|
); |
|
}); |
|
}); |
|
// </pre></nowiki> |
|
// </pre></nowiki> |