Jump to content

User:Ohconfucius/script/formatgeneral.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/**
 * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
 * @see https://meta.wikimedia.org/wiki/TemplateScript
 * @update-token [[File:pathoschild/templatescript.js]]
 */
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js');
importScript("User:Ohconfucius/test/formatgeneral.js/core.js");

function Ohc_formatgeneral() {
	ohc_change_type();
	ohc_protect_fmt();
	Ohc_formats();
	ohc_unprotect_fmt();
	ohc_downcase_CEO();
	ohc_linkspam();
	Ohc_final_cleanup();
	Ohc_formatgen_edit_summary();
}

function Ohc_formatgen_edit_summary(){
	//Add a tag to the summary box
	setoptions(minor='true'); 		
	setreason('General [[WP:MOS|formatting]]', 'append');
	doaction('diff');
}

$(function () {
 if(document.forms.editform) {
    mw.util.addPortletLink('p-tb', 'javascript:Ohc_formatgeneral()', 'FORMAT general', 't-fmt', 'general fmt, CT   cites', '', '');

  }
});