Created
April 8, 2009 12:22
-
-
Save eversonl/91747 to your computer and use it in GitHub Desktop.
This file contains 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
//Read an article | |
CmdUtils.CreateCommand({ | |
name: "read an article", | |
icon: "http://media.ineedtoreadthis.com/images/favicon.ico", | |
homepage: "http://www.0-21.co.uk/index.php/200902173422/Blog/Lee-s-Blog/My-Ubiquity-commands.html", | |
author: { name: "Lee Everson", email: "lee@0-21.co.uk"}, | |
license: "GPL", | |
description: "Takes you to your list of stored articles at ineedtoreadthis.com", | |
preview: function(pblock) { | |
pblock.innerHTML = "Takes you to your list of stored articles at ineedtoreadthis.com"; | |
}, | |
execute: function() { | |
var bookmarkletCode = "javascript:%28function%28%29%20%7Bvar%20div%20%3D%20document.createElement%28%22div%22%29%3Bdocument.body.appendChild%28div%29%3Bdiv.innerHTML%20%3D%20%22%3Cform%20method%3D%27post%27%3E%3C/form%3E%22%3Bvar%20form%20%3D%20div.childNodes%5B0%5D%3Bform.action%20%3D%20%22http%3A//ineedtoreadthis.com/pop/%3Fguid%3Da2e6bc1d-5a31-42d3-9594-4693c02f9d79%22%3Bform.submit%28%29%3B%7D%29%28%29%3B"; | |
var urlBar = context.chromeWindow.document.getElementById("urlbar"); | |
var oldURL = urlBar.value; | |
urlBar.value = bookmarkletCode; | |
context.chromeWindow.handleURLBarCommand(); | |
urlBar.value = oldURL; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment