Labs/Ubiquity/Ubiquity Source Tip Author Tutorial: Difference between revisions

Jump to navigation Jump to search
no edit summary
(→‎Just a Message: As Simple as it Gets: changed screenshot to match command name)
No edit summary
Line 440: Line 440:
* noun_type_geolocation
* noun_type_geolocation


 
Once you are familiar with writing commands, you should check out the [http://ubiquity.mozilla.com/hg/ubiquity-firefox/file/tip/ubiquity/modules/nountypes.js nountypes.js], which has the implementation for most of the noun-types.  You can see what noun types are already available for your commands to use, what still needs to be written, and where the existing implementations could use improvement — and then come [[Labs/Ubiquity#Participation|get involved]] to help us improve them.
Once you are familiar with writing commands, you should check out the [http://hg.toolness.com/ubiquity-firefox/file/6caa9d66b3bb/ubiquity/chrome/content/nlparser/en/nountypes.js nountypes.js], which has the implementation for most of the noun-types.  You can see what noun types are already available for your commands to use, what still needs to be written, and where the existing implementations could use improvement — and then come [[Labs/Ubiquity#Participation|get involved]] to help us improve them.


=== Regexps as Noun Types ===
=== Regexps as Noun Types ===
Line 483: Line 482:


Of course, not every type of noun you'd be interested in can be represented
Of course, not every type of noun you'd be interested in can be represented
as a finite list or as a regexp.  If you want to be able to accept or reject input based on some algorithmic test, you can do so by writing a custom JavaScript object that implements a <code>suggest()</code> method (and, optionally, a <code>default()</code> method.)
as a finite list or as a regexp.  If you want to be able to accept or reject input based on some algorithmic test, you can do so by writing a custom JavaScript object that implements a <code>suggest()</code> method (and, optionally, a <code>default()</code> method).


There is an example of how to do this in the section on the tab commands, below.
There is an example of how to do this in the section on the tab commands, below. More information on writing your own noun types can be found in our guide, [[Labs/Ubiquity/Writing_Noun_Types|Writing Noun Types]].


== Insert Email: the Contact noun type ==
== Insert Email: the Contact noun type ==
308

edits

Navigation menu