Created
November 15, 2008 03:41
-
-
Save mumoshu/25188 to your computer and use it in GitHub Desktop.
{method: "GET"} ver.
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
// 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