Skip to content

Instantly share code, notes, and snippets.

@mumoshu
Created November 15, 2008 03:41
Show Gist options
  • Save mumoshu/25188 to your computer and use it in GitHub Desktop.
Save mumoshu/25188 to your computer and use it in GitHub Desktop.
{method: "GET"} ver.
// urlをプロパティ化した
// URLパラメータ文字列をUtils.paramsToString()で作るようにした
// executeをつけた
CmdUtils.CreateCommand({
name: "search-template-with-createcommand",
takes: {query: noun_arb_text},
url: "http://www.google.co.jp/search",
preview: function(pBlock, directObject) {
var query = directObject.text;
Utils.parseRemoteDocument(
this.url + Utils.paramsToString({q: query}),
null,
function(doc) {
jQuery('li.g',doc).each(function() {
pBlock.innerHTML += this.innerHTML;
});
}
);
},
execute: function(directObject) {
var query = directObject.text;
Utils.openUrlInBrowser(this.url + Utils.paramsToString({q: query}));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment