1,007
edits
| Line 118: | Line 118: | ||
<pre> | <pre> | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["insert date"], | |||
execute: function() { | execute: function() { | ||
var date = new Date(); | var date = new Date(); | ||
| Line 136: | Line 136: | ||
<pre> | <pre> | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["insert date"], | |||
_date: function(){ | _date: function(){ | ||
| Line 178: | Line 178: | ||
<pre> | <pre> | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["insert date"], | |||
homepage: "http://azarask.in/", | homepage: "http://azarask.in/", | ||
author: { name: "Aza Raskin", email: "aza@mozilla.com"}, | author: { name: "Aza Raskin", email: "aza@mozilla.com"}, | ||
| Line 192: | Line 192: | ||
<pre> | <pre> | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["insert date"], | |||
homepage: "http://azarask.in/", | homepage: "http://azarask.in/", | ||
author: { name: "Aza Raskin", email: "aza@mozilla.com"}, | author: { name: "Aza Raskin", email: "aza@mozilla.com"}, | ||
| Line 204: | Line 204: | ||
</pre> | </pre> | ||
The <code>.description</code> and <code>.help</code> attributes are both automatically displayed alongside your command's name on the command-list page. (The user can get to this page at any time by issuing the " | The <code>.description</code> and <code>.help</code> attributes are both automatically displayed alongside your command's name on the command-list page. (The user can get to this page at any time by issuing the "list ubiquity commands" command.) HTML tags can be used in both of these strings. | ||
Description is a one-line summary of what the command does, while Help is a longer description that can include examples, caveats, and so on. If your command is simple enough that all you have to say about it fits in one line, it's OK to use a description alone and leave out the help. | Description is a one-line summary of what the command does, while Help is a longer description that can include examples, caveats, and so on. If your command is simple enough that all you have to say about it fits in one line, it's OK to use a description alone and leave out the help. | ||
| Line 237: | Line 237: | ||
In this command, we use the Google [http://code.google.com/apis/maps/documentation/staticmaps/ static map API] and the Ubiquity function <code>CmdUtils.getGeoLocation()</code> to insert a map of your current location. Ubiquity currently uses the [http://www.maxmind.com/app/api MaxMind] API for trying to guess your location from your IP. That will probably change in the future. | In this command, we use the Google [http://code.google.com/apis/maps/documentation/staticmaps/ static map API] and the Ubiquity function <code>CmdUtils.getGeoLocation()</code> to insert a map of your current location. Ubiquity currently uses the [http://www.maxmind.com/app/api MaxMind] API for trying to guess your location from your IP. That will probably change in the future. | ||
We'll call this command <code>"map me"</code> so that it won't be confused with the standard <code>"map"</code> command. | |||
<pre> | <pre> | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["map me"], | |||
_getMapUrl: function() { | _getMapUrl: function() { | ||
edits