Chrome Extension that translates highlighted text to Gematria

// create a new chrome extension
var GematriaTranslate = {
// when the extension is installed or updated
onInstalled: function() {
// add a context menu item that will only appear when text is highlighted
chrome.contextMenus.create({
id: "gematria-translate",
title: "Translate to Gematria",
contexts: ["selection"]
});
},

// when a context menu item is clicked
onClicked: function(info, tab) {
// get the highlighted text
var text = info.selectionText;

// perform the Gematria translation
var gematria = this.translateToGematria(text);

// display the translated text to the user
alert(gematria);
},

..... continued ....

// perform the Gematria translation
translateToGematria: function(text) {
// the Gematria translation is a simple substitution cipher, where each letter
// is replaced by its corresponding numerical value
var gematria = "";
for (var i = 0; i < text.length; i++) {
var c = text.charCodeAt(i);
// only translate letters, ignore numbers and special characters
if (c >= 97 && c = 65 && c

Only people mentioned by @4dBender in this post can reply

No replys yet!

It seems that this publication does not yet have any comments. In order to respond to this publication from ••• Bender •••, click on at the bottom under it