Looks good, but I'm curious if this will work for my application...
does the context that is passed in to the execute function
automatically overwrite the external commands context or does the
command author have to write that in?  Also, is an alias just a
wrapper around references to the external command functions or is it a
local copy of those functions?

It seems that if the latter is the case then having a bunch of
commands which are separately making aliases of other commands would
bloat the command namespace... I'm wondering if it wouldn't be better
to allow command authors to expose mini-command-apis for use by other
commands which could then be accessed via a CmdUtils method?

On Feb 26, 3:34 am, lrbabe <[email protected]> wrote:
> You should have a look at my proposed additions to the API related to
> alias creation, you're likely to find some answers and I'm interested
> in the results you get when using it:http://gist.github.com/61752
>
> On Feb 26, 4:46 am, GooseusTheGreen <[email protected]> wrote:
>
> > Alright, looks like this could work so long as the command doesn't
> > reference any variables in the local sandbox.
>
> > for instance, I'm trying to execute the "email" command, but
> > unfortunately it requires the context variable to get the document of
> > the focused window.  Are there any plans to allow the email command to
> > have the document passed in (along with any other needed parameters)?
> > I suppose I shall just snag the necessary code for a local email
> > function.  Any other interest in this sort of thing?  What are the
> > feelings on command chaining?
>
> > On Feb 25, 6:48 pm, GooseusTheGreen <[email protected]> wrote:
>
> > > Alright, looks like these (pulled from mouse.js, suggested by atul in
> > > another post of the same sort) is the functions I need.  Am I
> > > correct?  Any plans to develop this functionality in to CmdUtils or
> > > another library?
>
> > > function getUbiquity(){
> > >   var mainWindow = window.QueryInterface
> > > (Components.interfaces.nsIInterfaceRequestor)
> > >                      .getInterface
> > > (Components.interfaces.nsIWebNavigation)
> > >                      .QueryInterface
> > > (Components.interfaces.nsIDocShellTreeItem)
> > >                      .rootTreeItem
> > >                      .QueryInterface
> > > (Components.interfaces.nsIInterfaceRequestor)
> > >                      .getInterface
> > > (Components.interfaces.nsIDOMWindow);
>
> > >   return mainWindow.gUbiquity;
>
> > > }
>
> > > function getCommandByName( name ) {
> > >   var ubiq = getUbiquity();
> > >   return ubiq.__cmdManager.__cmdSource.getCommand( name );
>
> > > }
>
> > > function executeCommand( commandName, mods ) {
> > >   var cmd = getCommandByName( commandName );
> > >   var selText = CmdUtils.getWindow().getSelection().toString();
> > >   selText = selText || LAST_SEL_TEXT;
> > >   LAST_SEL_TEXT = selText;
>
> > >   cmd.execute( {}, {text:selText}, mods || {} );
>
> > > }
>
> > > On Feb 25, 6:33 pm, GooseusTheGreen <[email protected]> wrote:
>
> > > > Alright, maybe I'm having trouble with my wording here.  What I'm
> > > > looking to do is make a command that grabs information from a web
> > > > service and then puts it in a new email to my contact.  For
> > > > instance...
>
> > > > get-asset-to-email (assetID) (email)
>
> > > > Everything is fine, but I am not sure how to access the other commands
> > > > (ie email) from within my command... is this not possible yet?  I
> > > > can't imagine being forced to rewrite the "email" command in to my
> > > > command function just to do this.
>
> > > > Can I maybe send a command to the ubiquity command line from within my
> > > > function?
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to