Created
December 6, 2009 17:58
-
-
Save yura/250315 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({ | |
names: ["github"], | |
icon: "http://github.com/favicon.ico", | |
description: "GitHub search", | |
author: {name: "Yury Kotlyarov", email: "[email protected]"}, | |
license: "Ruby", | |
homepage: "http://www.brainhouse.ru/", | |
arguments: [{role: 'object', nountype: noun_arb_text, label: 'search query'}], | |
_getSearchUrl: function(query) { | |
return "http://github.com/search?" + jQuery.param( {q: query} ); | |
}, | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = _("GitHub search in progress..."); | |
CmdUtils.previewGet(pblock, this._getSearchUrl(args.object.text), function (htm) { | |
pblock.innerHTML = htm; | |
}); | |
}, | |
execute: function execute(args) { | |
Utils.openUrlInBrowser(this._getSearchUrl(args.object.text)); | |
} | |
}); |
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
<link rel="commands" href="github.js" name="Ubiquity GitHub Search Command" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment