-
-
Save symbiat/94237 to your computer and use it in GitHub Desktop.
Ubiquity symfony command to search symfony API docs
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: "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