User:Graeme Bartlett/vector.js

window.charinsertCustom = { "Dic": ' – — ° ′ ″ ≈ ≠ ≤ ≥ ± − × ÷ ← → ∠ · • ≡ § α β γ δ η θ λ+ σ ω μm π Γ Δ Π Σ Å cm−1     +  +  [\[+]]  +  +  +   +   +   ', "Talks": ' {\{WP.Astronomy|object=yes|infobox=no|class=stub|importance=low}} {\{WP.Chemicals|class=start|importance=low}} {\{WP.Geology|class=start|importance=low}} {\{WP.Physics|class=start|importance=low}} ' }; $.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then (function { pathoschild.TemplateScript.add({ name:'P-phrasefmt', script: function(editor) { editor.replaceSelection(function(selected) {		return selected.replace(/, P/g,"|").replace(/, and P/,"|").replace(/P/g,"");   	}); } }); pathoschild.TemplateScript.add({ name:'H-phrasefmt', script: function(editor) { editor.replaceSelection(function(selected) {		return selected.replace(/H([0-9][0-9][0-9]).*/g,"|$1E").replace(/E\n\|/g,"|").replace(/\|/,"").replace(/E/,"");   	}); } });

pathoschild.TemplateScript.add({	name:'chemboxformat',	script: function(editor) {		editor.replaceSelection(function(selected) { return selected.replace(/UNII\n/,"| UNII = ").replace(/EC Number\n/,"| EC_number = ").replace(/InChI=/,"| StdInChI=").replace(/InChI Key\n/,"| StdInChIKey = ").replace(/CAS\n/,"| CASNo = ").replace(/CHEMBL([1-9][0-9]*)/,"| ChEMBL = $1").replace(/CHEBI:([1-9][0-9]*)/,"| ChEBI = $1").replace(/Canonical SMILES\n/,"| SMILES = ").replace(/ChemSpider\t/,"| ChemSpiderID = ").replace(/ChemSpider ID/,"| ChemSpiderID = ").replace(/RTECS Number\n/,"| RTECS = ").replace(/UN Number\n/,"| UNNumber = "); });	} }); pathoschild.TemplateScript.add({	name:'addbullets',	script: function(editor) {		editor.replaceSelection(function(selected) { return selected.replace(/^/gm,"*").replace(/^\*/gm,"* ").replace(/^\* */gm,"* "); });	} }

); });