1,007
edits
| Line 414: | Line 414: | ||
== Insert Email: Commands with Specific Argument Types == | == Insert Email: Commands with Specific Argument Types == | ||
Let's take a look at one of | Let's take a look at one of these noun-types: <code>noun_type_contact</code>. This lets Ubiquity know to expect a person (either by name or email address). By using the noun-type, Ubiquity will also autocomplete to known people while the user is entering the command. This is what the built-in Ubiquity command "email" uses. | ||
At the moment, Ubiquity figures out what people you know through reading your Gmail contacts. In this prototyped version, you'll need to use Gmail and be logged in for for Ubiquity to know who you know. Eventually, we'd like to be able to interface with all major web-mail sites, as well as desktop software like Thunderbird. | At the moment, Ubiquity figures out what people you know through reading your Gmail contacts. In this prototyped version, you'll need to use Gmail and be logged in for for Ubiquity to know who you know. Eventually, we'd like to be able to interface with all major web-mail sites, as well as desktop software like Thunderbird. | ||
| Line 422: | Line 422: | ||
<pre> | <pre> | ||
CmdUtils.CreateCommand({ | CmdUtils.CreateCommand({ | ||
names: ["insert email"], | |||
arguments: {modifier: noun_type_contact}, | |||
preview: "Inserts someone's email address by name.", | preview: "Inserts someone's email address by name.", | ||
execute: function( | execute: function( arguments ) { | ||
CmdUtils.setSelection( | CmdUtils.setSelection( arguments.modifier.text ); | ||
} | } | ||
}) | }); | ||
</pre> | </pre> | ||
To try this out, Ubiq "insert email for " and then the first few letters of someone you email often. | |||
This one command sums up what I love about Ubiquity. In 8 lines of code, I can fundamentally enhance the browser's functionality. Doing the same thing using a normal Firefox extension methodology takes pages and pages of code—and the interface would take more thought still. Doing the same thing using a bookmarklet would require a server-side component (to get around cross-site Ajax request ban) as well as forcing the user to give up their email password. | This one command sums up what I love about Ubiquity. In 8 lines of code, I can fundamentally enhance the browser's functionality. Doing the same thing using a normal Firefox extension methodology takes pages and pages of code—and the interface would take more thought still. Doing the same thing using a bookmarklet would require a server-side component (to get around cross-site Ajax request ban) as well as forcing the user to give up their email password. | ||
edits