User:Beleg Tâl/Behistun.js

/** * This tool simplifies the entry of the characters 'â' and 'š' which are * frequently used in The Sculptures and Inscription of Darius the Great on the Rock of Behistûn in Persia. * * To use: * - Use a^ and s^ to represent these characters in the text * - Select the text that contains these characters * - Press the "Behistun" link in the sidebar to change a^ to â, and s^ to š */ $.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function {	pathoschild.TemplateScript.add({ name: 'Behistun', category: 'Page tools', script: function(editor) { editor.replaceSelection(function(text) {   		    return text.replace(/a\^/g, 'â').replace(/s\^/g, 'š');            }); }	}); });