1,007
edits
| Line 773: | Line 773: | ||
http://img363.imageshack.us/img363/1906/picture7cm5.png | http://img363.imageshack.us/img363/1906/picture7cm5.png | ||
There isn't much to say here besides that it's easy. For example, here's a command (thanks to [http://foyrek.com/lyrics.html Abimanyu Raja] for writing this code) that finds the lyrics for a song. You can simply Ubiq something like "get | There isn't much to say here besides that it's easy. For example, here's a command (thanks to [http://foyrek.com/lyrics.html Abimanyu Raja] for writing this code) that finds the lyrics for a song. You can simply Ubiq something like "get lyrics for wild international" but the command will also interface with the FoxyTunes extension (if it is installed) and add the currently playing song to the suggestion list. Interfacing with other extensions, too, is easy because you can view the source code for every Firefox extension. | ||
<pre> | <pre> | ||
| Line 789: | Line 789: | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["get lyrics"], | |||
arguments: {modifier: noun_type_song}, | |||
preview: function(pblock, | preview: function(pblock, arguments) { | ||
searchText = jQuery.trim( | searchText = jQuery.trim(arguments.modifier.text); | ||
if(searchText.length < 1) { | if(searchText.length < 1) { | ||
pblock.innerHTML = "Searches for lyrics of the song"; | pblock.innerHTML = "Searches for lyrics of the song"; | ||
| Line 804: | Line 804: | ||
}, | }, | ||
execute: function( | execute: function(arguments) { | ||
var url = "http://www.google.com/search?q={QUERY}" | var url = "http://www.google.com/search?q={QUERY}" | ||
var query = | var query = arguments.object.text + " lyrics"; | ||
var urlString = url.replace("{QUERY}", query); | var urlString = url.replace("{QUERY}", query); | ||
Utils.openUrlInBrowser(urlString); | Utils.openUrlInBrowser(urlString); | ||
| Line 812: | Line 812: | ||
}); | }); | ||
</pre> | </pre> | ||
== Implementing Asynchronous Noun Suggestions == | == Implementing Asynchronous Noun Suggestions == | ||
edits