Mercurial > my-ubiquity-commands
view wowhead/wowhead.js @ 27:305345a0e472 default tip
Modifications to work w/ latest jetpack.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 18 May 2009 22:51:37 -0700 |
parents | e077838df525 |
children |
line wrap: on
line source
/* This is a template command. */ CmdUtils.CreateCommand({ name: "wowhead", icon: "http://www.wowhead.com/favicon.png", homepage: "http://www.wowhead.com/", author: {name: "Your Name", email: "you@example.com"}, license: "GPL", description: "A short description of your command", help: "How to use your command", takes: {"input": /.*/}, previewUrl: "results.html", preview: function(pblock, input) { var url = ("http://www.wowhead.com/?search=" + encodeURI(input.text) + "&opensearch"); CmdUtils.previewAjax(pblock, { url: url, dataType: "text", error: function() { pblock.innerHTML = "Sorry, an error occurred."; }, success: function(data) { var scriptTag = pblock.ownerDocument.createElement("script"); scriptTag.textContent = "showResults(" + data + ");"; pblock.appendChild(scriptTag); } }); }, execute: function(input) { displayMessage("You selected: " + input.text); } });