Skip to content

Instantly share code, notes, and snippets.

@symbiat
Created April 13, 2009 03:07
Show Gist options
  • Save symbiat/94237 to your computer and use it in GitHub Desktop.
Save symbiat/94237 to your computer and use it in GitHub Desktop.
Ubiquity symfony command to search symfony API docs
CmdUtils.CreateCommand({
name: "symfony",
icon: "http://www.symfony-project.org/favicon.ico",
author: { name: "Ajai Khattri", email: "[email protected]"},
license: "GPL",
description: "Searches the symfony API docs for words.",
takes: {"search term": noun_arb_text},
preview: function(pblock, directObject, modifiers) {
var query = directObject.text;
var content = "Performs api.symfony-project.org search";
if(query.length > 0)
content += " for <b>" + query + "</b>";
pblock.innerHTML = content;
},
execute: function(directObject, modifiers) {
var query = directObject.text.replace(' ', '+');
var urlString = "http://www.symfony-project.org/api/search/1_2?search="+query;
Utils.openUrlInBrowser(urlString);
CmdUtils.setLastResult( urlString );
},
previewDelay: 10,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment