User:Dibbydib/nofancyquotes.js

/** * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. * @see https://meta.wikimedia.org/wiki/TemplateScript * @update-token * * --- Script forked off Ohconfucius on enwiki ~ kudos! User:Ohconfucius/script/formatgeneral.js --- */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js');

function Ohc_format_Sundry { var   txt=document.editform.wpTextbox1; regex(/“/g, '"'); // L double	regex(/”/g, '"'); // R double regex(/‘/g, "'"); // L single regex(/’/g, "'"); // R single }

/** **/ function Ohc_formats{ Ohc_format_Sundry; }

function Ohc_formatgeneral { // Keeping this bit in here in case I have to fork some more code from the original script Ohc_formats; }

function Ohc_run_formatgeneral { Ohc_formatgeneral; Ohc_formatgen_edit_summary;

}

function Ohc_formatgen_edit_summary{ //Add a tag to the summary box setoptions(minor='true'); setreason('WQ:PUNCTUATION fixes by script', 'append'); doaction('diff'); } // This bit is broken below, must fix or ask someone about it (probably ohc) $(function { if(document.forms.editform) { 	mw.loader.using( ['mediawiki.util'], function { mw.util.addPortletLink('p-tb', 'javascript:Ohc_run_formatgeneral', 'Rem fancy quotes', 't-addmetric', 'description :3', , ); // Why must I always get these stupidly cryptic warning messages? I think this line is where the bug's at, tho }); } }); // The problem (I think) is that something's wrong with the "javascript:Ohc_run_formatgeneral" or that line in general, either I cut something out // from the original script by mistake or it doesn't work on Wikiquote. It's displaying fine but won't run when I click it, so the text displaying // isn't the issue here