Created
January 27, 2010 23:01
-
-
Save ErikDeBruijn/288250 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
CmdUtils.makeSearchCommand({ | |
name: "qrcode", | |
description: "Generates a QR Code from the current document URL or what you've tpyed after the command. Useful to quickly get something onto your phone.", | |
homepage: "http://www.erikdebruijn.nl/", | |
author: {name: "Erik de Bruijn", email: "ubiquity@erikdebruijn.nl"}, | |
license: "GPLv2", | |
takes: {"input": /.*/}, | |
preview: function(pblock, input) { | |
var atext; | |
atext = input.object.html.toString(); | |
if(!atext) | |
atext = context.focusedWindow.document.location; | |
pblock.innerHTML = "<div style='width:100%;height:100%;background:white;'><img src=\"http://chart.apis.google.com/chart?cht=qr&chld=M|4&chs=150x150&chl="+ atext + "\"><br><br>URL: "+ atext + "<br><br><br></div>"; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment