Created
November 18, 2008 00:44
-
-
Save dsample/26007 to your computer and use it in GitHub Desktop.
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
CmdUtils.CreateCommand({ | |
name: "mobilecode", | |
homepage: "http://mobib.org/", | |
author: { name: "Duncan Sample" }, | |
description: "Shows a mobile code for the current page.", | |
license: "MPL", | |
preview: function( pblock ) { | |
var document = context.focusedWindow.document; | |
var style = Application.prefs.getValue("mobilebarcode.style", "QR"); | |
var size = Application.prefs.getValue("mobilebarcode.size", "M"); | |
var msg = '<div style="background-color:white;padding:20px;text-align:center;"><img src="http://mobilecodes.nokia.com/qr?DATA=${url}&MODULE_SIZE=6&name=&MARGIN=2&ENCODING=BYTE&NDEF_DATA=&MODE=TEXT&a=view" /></div>'; | |
pblock.innerHTML = CmdUtils.renderTemplate( msg, {url: document.location} ); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment