Skip to content

Instantly share code, notes, and snippets.

@saratpediredla
Created November 18, 2008 21:55
Show Gist options
  • Save saratpediredla/26295 to your computer and use it in GitHub Desktop.
Save saratpediredla/26295 to your computer and use it in GitHub Desktop.
// Based on apidock.org Ubiquity Search: http://gist.github.com/8132
CmdUtils.CreateCommand(
{
name: "fixx-search",
takes: {"function": noun_arb_text},
icon: "http://hedgehoglab-images.s3.amazonaws.com/fluid/fixx.png",
homepage: "http://hedgehoglab.com/products/fixx/",
author: {name: "Sarat Pediredla", email: "info@hedgehoglab.com"},
license: "MPL,GPL",
description: "Search fixx issues",
help: "Search fixx issues",
execute: function(directObject)
{
/** REMEMBER TO CHANGE LOCALHOST TO YOUR FIXX URL **/
var url = "http://localhost:9000/issues/?query={QUERY}"
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject)
{
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0)
{
pblock.innerHTML = "Search fixx issues";
return;
}
var previewTemplate = "Search fixx issues for keyword: ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment