Created
July 10, 2009 04:07
-
-
Save bellbind/144237 to your computer and use it in GitHub Desktop.
[Ubiquity] show coloring pane
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
/* | |
* Ubiquity 0.5 example | |
* changes from 0.1.8: | |
* - name:String -> names:[String] | |
* - takes:{String:RegExp} -> arguments:[{role:String, nountype:RegExp}] | |
* - preview&execute:function(Element, arg) | |
* -> preview&execute:function(Element, {argname:arg,...}) | |
*/ | |
CmdUtils.CreateCommand({ | |
names: ["color"], | |
icon: "chrome://ubiquity/skin/icons/favicon.ico", | |
homepage: "http://d.hatena.ne.jp/bellbind/", | |
author: {name: "bellbind", email: "bellbind@gmail.com"}, | |
license: "GPL", | |
description: "display colors", | |
help: "display colors", | |
arguments: [{role: "input", nountype: noun_arb_text}], | |
preview: function (pblock, args) { | |
var pnode = jQuery(pblock); | |
var color = args.input.text; | |
pnode.empty(); | |
try { | |
pnode.html( | |
["<div style='", | |
"width: 450px; height: 450px;", | |
"background-color: ", | |
color, | |
";'></div>"].join("")); | |
} catch (ex) {;} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment