Hi tlob,
Ubiquity is meant and designed to be a (currently somewhat simple) language
parser - thus, for it to do your work for you, you'll need to feed it a
proper sentence...
That being said, you can freely parse an incomplete sentence yourself, if
you lose the modifier, you'll get the departure "chicago toronto", and you
can use normal javascript to split these by the space
On Wed, Nov 26, 2008 at 11:09 AM, tlob <[EMAIL PROTECTED]> wrote:
>
> That works, thanx
> But I dont want to type "sbb chicago to toronto" I want type "sbb
> chicago toronto"
>
>
> CmdUtils.CreateCommand({
> name: "sbb",
> license: "CC",
> icon: "http://www.sbb.ch/favicon.ico",
> description: "Time table for Swiss Railways",
> license: "CC",
>
> takes: { "departure":noun_arb_text },
> modifiers: {"to": noun_arb_text},
>
> execute: function( departure, modifiers ) {
>
> var strDeparture = departure.text;
> /* How to set default when not giving snd input? */
> var strDestination = modifiers.to.text;
>
> /* How to set local vars? if DE(german) then localVar=d, if FR
> (french) then localVar=f */
> var strUrl = "http://fahrplan.sbb.ch/bin/query.exe/d?S=" +
> strDeparture + "!&Z=" + strDestination + "!&start=1";
>
> Utils.openUrlInBrowser( strUrl );
> },
> });
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---