User:Info-farmer/tamilProverbs.js

/*

This scipt helps to replace/remove input data in the opened page and helps to edit quikly, regex editor and welcome inserter. source:https://en.wikisource.org/wiki/User:Bodhisattwa/cleanup.js

* global $, mw, importScript, pathoschild * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. * @see https://meta.wikimedia.org/wiki/TemplateScript * @update-token

//set some global parameters for selection var isPageNS = mw.config.get('wgNamespaceNumber') == 104;

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function

{	// page NS	pathoschild.TemplateScript.add(		[

{				name: '', position: 'cursor', script: function(editor) { var header = editor.forField('#wpHeaderTextbox'); var footer = editor.forField('#wpFooterTextbox'); var isPageNS = mw.config.get('wgNamespaceNumber') == 104; var isDictionary = isPageNS && mw.config.get('Dictionary of National');

// various cleanup editor // Tamil missing template to none as per request .replace(/;\s\{\{Tamil missing\}\}/g, '; '); }			}		],		{ category:'↓🔻↓ நீக்குக ↓🔻↓', forNamespaces:'page' } // common fields );

}); // end of TemplateScript

if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1) { mw.loader.using('user.options', function {		if (mw.user.options.get( 'showtoolbar' ) == 1) {			$.when( mw.loader.using('mediawiki.toolbar'), $.ready ).then(addExtraButtons);		}	}); }