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