Actually, there's also a 'direct()' method in search.htm. I'm not sure whether
it makes more sense to call 'direct()' or openDocument in the broader context
(broader than the bookmarks). A function more like 'def()' is probably what
should be called, except with an argument. Check out 'def' and see what you
think about checking for an optional argument. If an argument was supplied, it
could be used instead of the value of the input field. This would allow menu
items to work with anything that could also be typed into the search field. Not
sure though. Take a look and see what you think.
----- Original Message -----
From: "Brent Beardsley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 22, 2002 4:32 PM
Subject: Re: [DQSD-Devel] ignoreSearchInHistory needs some more thought
> Hi Glenn,
>
> I think I found the function you were referring to:
> openDocument. I changed performsearch to not add
> parenthesis if it already has them before calling eval
> and this is already in CVS. I've tested it out on my
> desktop, configure, and bookmarks addons and it is
> working well.
>
> For the bookmarks now I give the function as
> openDocument('http://www.myurl.com/') instead of
> http://www.myurl.com and it works great.
>
> I would like some testing on the changes I made on
> when to add history to make sure it is working as it
> should. I made the non-searches (so javascript
> functions) not get added to the history by checking
> searches[func] to see if it exists. Is this the right
> way to do it?
>
> Thanks,
>
> Brent
>
> --- Glenn Carr <[EMAIL PROTECTED]> wrote:
> > Ah. I think I understand now. So, I think what you
> > need to do is call
> > 'direct(term)' if 'fname' isn't a function... maybe
> > something like this:
> >
> >
> > // ...
> > if (searches[fname])
> > searches[fname].fun(term);
> > else
> > {
> > try
> > {
> > if ( typeof fname == 'function' )
> > eval(fname + "()");
> > else
> > direct(term);
> > }
> > catch(e)
> > {
> > // ...
> > }
> > }
> >
> > // ...
> >
> > I'm shooting from hip here, so this might not work.
> > But, I'm pretty sure
> > there's a 'direct' function that will try to
> > determine what to do with the
> > string, which should result in launching the
> > bookmark URL.
> >
> > ----- Original Message -----
> > From: "Brent Beardsley" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, October 21, 2002 11:38 PM
> > Subject: RE: [DQSD-Devel] ignoreSearchInHistory
> > needs some more thought
> >
> >
> > > Hi Glenn,
> > >
> > > >> Also while trying to hook bookmarks into the
> > menu I
> > > >> realized that the performSearch should be
> > changed to
> > > >> check to see if it's a search otherwise do a
> > shellexec
> > > >> on it.
> > >
> > > > I don't understand.
> > >
> > > Here's the function:
> > >
> > > function performsearch(fname, term)
> > > {
> > > // if the specified search does not exist (ie.
> > no default search), set to
> > > defaultsearch
> > > if (!fname)
> > > {
> > > if (!defaultsearch ||
> > !searches[defaultsearch]) // bad defaultsearch
> > > variable (e.g., old localprefs.js) -> use gg
> > instead of failing
> > > fname = "gg";
> > > else
> > > fname = defaultsearch;
> > > }
> > >
> > > term = term.replace(/^\s+/g,
> > '').replace(/\s+$/g, '') // strip out
> > > leading and trailing spaces
> > > if (searches[fname])
> > > searches[fname].fun(term);
> > > else
> > > {
> > > try
> > > {
> > > eval(fname + "()");
> > > }
> > > catch(e)
> > > {
> > > alert('An error (' + e + '/' +
> > e.description + ') occurred while
> > > trying to run the search "'+fname+'()'+'"');
> > > }
> > > }
> > > }
> > >
> > > Now it tries to do an eval on fname + "()" and if
> > that fails displays an
> > > alert. Now my bookmarks addon passes in a URL for
> > fname and it fails
> > > because the URL + "()" does not map to a function.
> > I also cannot specify a
> > > function name with a parameter either.
> > >
> > > Hope this is clearer,
> > >
> > > Brent
> > >
> > >
> > >
> > >
> >
> -------------------------------------------------------
> > > This sf.net emial is sponsored by: Influence the
> > future
> > > of Java(TM) technology. Join the Java Community
> > > Process(SM) (JCP(SM)) program now.
> > >
> >
> http://ad.doubleclick.net/clk;4699841;7576298;k?http://www.sun.com/javavote
> > > _______________________________________________
> > > DQSD-Devel mailing list
> > > [EMAIL PROTECTED]
> > >
> >
> https://lists.sourceforge.net/lists/listinfo/dqsd-devel
> >
> >
> >
> >
> -------------------------------------------------------
> > This sf.net emial is sponsored by: Influence the
> > future
> > of Java(TM) technology. Join the Java Community
> > Process(SM) (JCP(SM)) program now.
> >
> http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
> > _______________________________________________
> > DQSD-Devel mailing list
> > [EMAIL PROTECTED]
> >
> https://lists.sourceforge.net/lists/listinfo/dqsd-devel
>
>
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
>
>
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future
> of Java(TM) technology. Join the Java Community
> Process(SM) (JCP(SM)) program now.
> http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
> _______________________________________________
> DQSD-Devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dqsd-devel
-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
_______________________________________________
DQSD-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-devel