User:Pointillist/vectorwork.js

<syntaxhighlight lang="javascript">

importScript("User:PleaseStand/segregate-refs.js");
importScript("User:Ohconfucius/test/EngvarB.js");	//Engvar
//importScript("User:Symplectic_Map/spell.js");
//importScript("User:GregU/dashes.js");
mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript');

importScript("User:Ohconfucius/test/formatgeneral.js"); 
importScript("User:Ohconfucius/test/MOSNUM dates code.js");
importScript("User:Ohconfucius/test/Common Terms.js");
importScript("User:Ohconfucius/test/Sources.js");
//importScript("User:Ohconfucius/test/Football_links.js");
importScript("User:Ohconfucius/script/foreigndates.js");

//importScript("User:Ohconfucius/script/protect.js");
//importScript("User:Ohconfucius/test/historyxtraction.js");
/**** navpop ****/
// [[User:Lupin/popups.js]]

importScript('User:Lupin/popups.js');

/**** dyk ****/
// [[User:Dr pda/prosesize.js]]
importScript('User:Dr pda/prosesize.js'); //[[User:Dr pda/prosesize.js]]


/**** afd helper ****/
document.write('<script type="text/javascript"' +
'src="http://en.wikipedia.org/w/index.php?title=User:Jnothman/afd_helper/' +
'script.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/* This is to keep track of who is using this extension: [[User:Jnothman/afd_helper/script.js]] */

/** ------------------------------------------------------------------------ **/
/// EDIT SUMMARIES & USE DMY TEMPLATE

function Ohc_edit_summary1(){
	//Add a tag to the summary box
//	setoptions(minor='true'); 		//removed ",watch='false'" in response to user notification 13 Nov. 2010
	setreason('[[WP:MOS|style]] fixes: mainly [[WP:MOSNUM|date formats]]', 'appendonce');
	doaction('diff');
}

function Ohc_edit_summary2(){
  // Add a tag to the summary box
  setoptions(minor='false',watch='false); 		
  setreason('[[WP:MOS|style]] fixes per [[WP:TIES]] and [[WP:MOSNUM|date formats]]', 'appendonce');
  doaction('diff');
}
 

function Ohc_insert_tag(){
 var txt=document.editform.wpTextbox1;
// current month-year
    var currentDate = new Date();
    var currmonth = currentDate.getMonth();
    var curryear  = currentDate.getFullYear();
    var myMonths = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    var curryyyymm = myMonths[currmonth] + ' ' + curryear;
 
// insert 'use British English' template
    txt.value=txt.value.replace(/\{\{(?:use British (?:\(Oxford\) |)English|Engvar[ABC])(\|[^}]*)?\}\}/gi, '{{Use British English|date='+curryyyymm+'}}');
    txt.value=txt.value.replace(/\{\{(Use (Australian|Indian|Irish|Pakistani|South African) English)(\|[^}]*)?\}\}/gi, '{{Use British English|date='+curryyyymm+'}}');
 
    var rxpdd = new RegExp("{{Use British English\\|date="+curryyyymm+"}}", "gi");
    var dflagfound = txt.value.search(rxpdd);
    if (dflagfound == -1)
    {
        txt.value='{{Use British English|date='+curryyyymm+'}}\r\n'+txt.value;
    }
}

/** ------------------------------------------------------------------------ **/
/// COMPOSITE SCRIPT DRIVERS

function ONETOUCH_ENG() {
 var txt=document.editform.wpTextbox1;
//	autoEdFunctions(); //dashes
	Ohc_formatgeneral();
//	Ohc_ref_format();
//	Ohc_CommonTerms();

	ohc_protect_dates();
	ohc_fix_unambiguous_dates();
	ohc_body_dates_to_dmy();
	ohc_delink_year_in_X();
	ohc_expand_ref_dates(); 
	ohc_unprotect_dates();
	ohc_dmy_publication_dates();
//	ohc_delink_ISO_to_dmy();

	ohc_protect_ENGVAR();
	Ohc_ENGVARSimple();
	zwords();
	ohc_unprotect_ENGVAR();
	Ohc_insert_tag();

	Ohc_edit_summary2();
}
 
function ONETOUCH_DMY(){
// Add a tag to the summary box
 var txt=document.editform.wpTextbox1;
//	autoEdFunctions(); //dashes
	Ohc_formatgeneral();
//	Ohc_ref_format();
//	Ohc_CommonTerms();
 
	ohc_protect_dates();
	ohc_fix_unambiguous_dates();
	ohc_body_dates_to_dmy();
	ohc_delink_year_in_X();
	ohc_expand_ref_dates(); 
	ohc_unprotect_dates();
	ohc_dmy_publication_dates();
	Ohc_edit_summary1();
}
 
function ONETOUCH_MDY(){
// Add a tag to the summary box
 var txt=document.editform.wpTextbox1;
//	autoEdFunctions(); //dashes
	Ohc_formatgeneral();
//	Ohc_ref_format();
//	Ohc_CommonTerms();
 
	ohc_protect_dates();
	ohc_fix_unambiguous_dates();
	ohc_body_dates_to_mdy();
	ohc_delink_year_in_X();
	ohc_expand_ref_dates(); 
	ohc_unprotect_dates();
	ohc_mdy_publication_dates();
	Ohc_edit_summary1();
}

function ohc_body_to_dmy_driver()
{
    ohc_protect_dates();
    ohc_body_dates_to_dmy();
    ohc_unprotect_dates();
 
    Ohc_edit_summary1();
}
 
function ohc_body_to_mdy_driver()
{
    ohc_protect_dates();
    ohc_body_dates_to_mdy();
    ohc_unprotect_dates();
 
    Ohc_edit_summary1();
}
 
function ONETOUCH_FMT(){
// Add a tag to the summary box
 var txt=document.editform.wpTextbox1;
//	autoEdFunctions(); //dashes
	Ohc_formatgeneral();
	Ohc_ref_format();
	Ohc_CommonTerms();
//	Ohc_edit_summary1();
}

function Ohc_ref_format_new() {
 var txt=document.editform.wpTextbox1;
 
      ohc_protect_urls();
      Ohc_sources_prep();
      Ohc_sourcename();
      Ohc_sourcetype();
//      Ohc_sourceunlink();
      Ohc_sources_cleanup();
      ohc_unprotect_urls();
 
      doaction('diff');
}
 
/** ------------------------------------------------------------------------ **/
/// SIDEBAR BUTTONS

// Add [[WP:Reflinks]] launcher in the toolbox on left
addOnloadHook(function () {
 mw.util.addPortletLink(
  "p-tb",     // toolbox portlet
  "http://toolserver.org/~dispenser/cgi-bin/webreflinks.py/" + wgPageName 
   + "?client=script&citeweb=on&overwrite=simple&limit=200&lang=" + wgContentLanguage,
  "Reflinks Citeweb"  // link label
)});
addOnloadHook(function () {
 mw.util.addPortletLink(
  "p-tb",     // toolbox portlet
  "http://toolserver.org/~dispenser/cgi-bin/webreflinks.py/" + wgPageName 
   + "?client=script&overwrite=simple&limit=200&lang=" + wgContentLanguage,
  "Reflinks plain"  // link label
)});

addOnloadHook(function () {
 if(document.forms.editform) {
    mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_ENG()', 'One Touch: ENGVAR', 't-eng', 'Engvar + all', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_DMY()', 'One Touch: DMY', 't-dmy', 'day month + CT', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_MDY()', 'One Touch: MDY', 't-mdy', 'month day + CT', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ohc_body_to_dmy_driver()', 'Body dates to dmy', 't-dmy', 'day month', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ohc_body_to_mdy_driver()', 'Body dates to mdy', 't-mdy', 'month day', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ONETOUCH_FMT()', 'One Touch: FMT', 't-fmt', 'general fmt, CT + cites', '', '');
//    mw.util.addPortletLink('p-tb', 'javascript:ohc_ISO_to_dmy_anywhere()', 'ALL ISO DMY', 't-dmy', 'day month', '', '');
//    mw.util.addPortletLink('p-tb', 'javascript:ohc_ISO_to_mdy_anywhere()', 'ALL ISO MDY', 't-mdy', 'month day', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ohc_protect_dates()', 'protect strings', 't-dmy', 'day month', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ohc_US_slash_dates_to_mdy()', 'US-slash dates', 't-US', 'US-slash', '', '');
    mw.util.addPortletLink('p-tb', 'javascript:ohc_UK_slash_dates_to_dmy()', 'UK-slash dates', 't-UK', 'UK-slash', '', '');
  }
});
</syntaxhighlight>

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.