Created
July 6, 2009 17:01
-
-
Save satyr/141536 to your computer and use it in GitHub Desktop.
(en|de)codeURIComponent()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function cmd_codeURIComponent(_){ | |
var name = _ + 'codeURIComponent', fn = this[name]; | |
CmdUtils.CreateCommand({ | |
name: name, | |
icon: 'chrome://ubiquity/skin/icons/convert.png', | |
argument: noun_arb_text, | |
execute: function({object: {text}}){ | |
if (!text) return; | |
try { var r = fn(text) } | |
catch(e){ displayMessage(_ +'code error', this); return } | |
CmdUtils.setSelection(Utils.escapeHtml(Utils.clipboard.text = r), | |
{text: r}); | |
}, | |
}); | |
return arguments.callee; | |
})('en')('de'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment