Tuesday, September 23, 2008

Ubiquity Command: urlencode

I just hacked up this quick Ubiquity command because I was cuttin' and pastin' URLs all over the place, and I needed some of them url encoded...

Ubiquity, by the way, is totally sweet.

Run "command editor" and paste the block of Javascript below somewhere in the text field.

That's all you need to do. It auto-saves.


CmdUtils.CreateCommand({
name: "urlencode",
takes: {"what": noun_arb_text},
preview: function(pblock, what) { pblock.innerHTML = CmdUtils.renderTemplate(escape(what.text)) },
execute: function(what) { CmdUtils.setSelection(escape(what.text)); }

No comments: