-
-
Save dave1010/55487 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: "search-php", | |
homepage: "http://createopen.com/blog/", | |
author: { name: "David Hulbert", email: "[email protected]"}, | |
icon: "http://static.php.net/www.php.net/favicon.ico", | |
license: "MPL", | |
takes: {"function": noun_arb_text}, | |
description: "Searches PHP for a function.", | |
help: "Searches PHP for a function and previews the description. Example: 'search-php strpos'", | |
preview: function(pblock) { | |
if (pblock.text.length) { | |
"Takes you to the PHP documentation", | |
var url = "http://php.net/{QUERY}" | |
var query = pblock.text; | |
var urlString = url.replace("{QUERY}", query); | |
jQuery.get(urlString, {}, function(d){ | |
if( d.length > 0 ) { | |
var desc = jQuery(".description", d); | |
var title = jQuery(".refpurpose", d); | |
} | |
pblock.innerHTML = desc + title; | |
}); | |
} else { | |
pblock.innerHTML = "Search PHP for a function" | |
} | |
}, | |
execute: function(functionname) { | |
var url = "http://php.net/{QUERY}" | |
var query = functionname.text; | |
var urlString = url.replace("{QUERY}", query); | |
Utils.openUrlInBrowser(urlString); | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment