Created
November 26, 2008 12:14
-
-
Save yoshimov/29369 to your computer and use it in GitHub Desktop.
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
CmdUtils.CreateCommand({ | |
name: "java-ja", | |
description: "Search java 1.6 API", | |
help: "Simply type java and the classname and it will doa google search for API documentation on that class", | |
icon:"http://java.com/favicon.ico", | |
takes: {"class name": noun_arb_text}, | |
author: {name: "Yoshimov", email: "yoshimov@pobox.com"}, | |
homepage: "http://yoshimov.com", | |
preview: function(pblock, directObject) { | |
var searchTerm = directObject.text; | |
var pTemplate = "Searches Java for <b>${query}</b>"; | |
var pData = {query: searchTerm}; | |
pblock.innerHTML = CmdUtils.renderTemplate(pTemplate, pData); | |
var url ="http://www.google.com/search"; | |
var params = {v:"1.0", q: "site:http://java.sun.com/javase/ja/6/docs/ja/api/ "+searchTerm }; | |
jQuery.get( url, params, function(data) { | |
pblock.innerHTML = data; | |
}, "html"); | |
}, | |
execute: function( theClass){ | |
var URL ="http://www.google.com/search?q=site:http://java.sun.com/javase/ja/6/docs/ja/api/%20"+theClass.text+"&btnG=Search&btnI=3564"; | |
Utils.openUrlInBrowser(URL); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment