Name: Anonymous 2007-01-28 13:53
Hay guys!
First off, I suck at javascript.
I was trying to write a Greasemonkey script that would take the text in the textbox and replace certain characters with unicode equivalents.
My problem lies in intercepting the submittal of the form. How do I do it?
I managed to find the tag with a xpath search, but I can't add a "onClick" action properly.
As fron payment, I offer a javascript array of possible replacements:
First off, I suck at javascript.
I was trying to write a Greasemonkey script that would take the text in the textbox and replace certain characters with unicode equivalents.
My problem lies in intercepting the submittal of the form. How do I do it?
I managed to find the tag with a xpath search, but I can't add a "onClick" action properly.
As fron payment, I offer a javascript array of possible replacements:
var replacements, regex, key;
replacements = {
"A": "\u0410",
"B": "\u0412",
"C": "\u0421",
"H": "\u041D",
"I": "\u0406",
"J": "\u0408",
"M": "\u041C",
"O": "\u041E",
"P": "\u0420",
"S": "\u0405",
"T": "\u0422",
"V": "\u0474",
"Y": "\u04AE",
"a": "\u0430",
"c": "\u0441",
"e": "\u0435",
"h": "\u04BB",
"i": "\u0456",
"j": "\u0458",
"l": "\u04C0",
"o": "\u043E",
"p": "\u0440",
"s": "\u0455",
"y": "\u0443",
"v": "\u0475";
}
regex = {};
for (key in replacements) {
regex[key] = new RegExp(key, 'g');
}