Hi Kim,
> I see your point, but I'm not sure... DQSD has to do
> *something* by default, and keeping that something to
> gg.xml seems reasonable to me.
> By that line of reasoning, just making gg.xml a required
> search would make everything sooo much cleaner
> development-wise.
>
> I don't know, I can't come up with any great arguments
> at the moment, but I still think gg.xml is the #1 DQSD
> search, and that it's reasonable to require it...
I have no objection to requiring it, but I do object to it being a
'core search.' It's just another search as far as the rest of the
DQSD implementation is concerned. Sure, it's the most popular, but
DQSD was written specifically so it wasn't absolutely necessary to
use it. Myself, with as many ARIN searches I have to do each day,
I've been tempted for the last couple months to switch my default
search to arin.xml. I use "gg" for my google searches anyway since
many of my 'google' searches use funky characters.
Hmmm, there's an idea. Maybe I should just add a handler for IP
addresses in the def() parser. That'd enable me to avoid typing
"arin " 24/7. Golly, I guess I can do that now. :)
I'll make a special handler for it for now, but looking at this
code, I'm thinking we should have a way for a search to load and add
itself to this stack on it's own. This could be implemented by that
sweet onload feature Brent added to the mix a few weeks ago.
Anyway...
Here's the autodetect handler for ip's:
In arin.xml:
ip_regex = new
RegExp("^((\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d{1,2}|1\\d\
\d|2[0-4]\\d|25[0-5])$", "");
// autodetection for ip addresses
function autodetect_ip(q){
res = ip_regex.exec(q);
if (res){
arin(q);
return true;
}
}
In search.htm, within the 'detect special commands' section of
def():
// detect strings that look like ip addresses
if ((typeof autodetect_ip) == 'function' && autodetect_ip(t))
return false;
We _should_ be handling the autodetection stack with an array and
let individual searches add themselves to the stack by adding
themselves to the stack (probably with a simple addAutodetect()
function), and that way newer searches that wanted to support
autodetect. The stack would look and function like the aliases
stack.
Regards,
Shawn K. Hall
http://12PointDesign.com/
http://ReliableAnswers.com/
'// ========================================================
In films murders are always very clean. I show how difficult
it is and what a messy thing it is to kill a man.
-- Alfred Hitchcock (1899 - 1980)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Archive: https://lists.sourceforge.net/lists/listinfo/dqsd-devel