[plt-dev] Re: doc searches

From: Henk Boom (henk at henk.ca)
Date: Sun Jun 7 13:29:16 EDT 2009

(Sorry Eli, I forgot to reply to list)

2009/6/7 Eli Barzilay <eli at barzilay.org>:
> Loading on a click is worse that what I thought you suggested. =C2=A0It
> means that the link cannot point to the right manual which means that
> you can't see in your browser's status line where it will take you
> (that's something that I consider pretty rude...). =C2=A0But ignoring tha=
t,
> it means that at the moment when the link is clicked, the code should
> retrieve the file to know where to jump to -- which will delay the
> action, and in some cases it will just appear that the page is not
> working at all.
>
> In addition to that you run into a bunch of problems at the low-level
> that the browser should really take care of. =C2=A0For example, you can
> just make the browser jump to a page -- you need to check the ctrl and
> shift status to know if the user wanted a new window or tab, taking
> into consideration the different interfaces in different browsers, and
> ignoring browsers that might be user-customized (which will just have
> to face the fact that the plt pages behave like we want them to,
> ignoring what you like), and assuming that there *is* a way to open a
> new tab or a new window reliable (probably not, since it's rare to see
> a browser without some popup blocker these days).
>
> You also need to deal gracefully with failures -- a second click
> before the index is retrieved should be ignored *unless* enough time
> has passed which means that we should give up on getting it. =C2=A0(And
> this is much more of a problem than it seems -- the first thing anyone
> will do when a link doesn't respond is to immediately click it
> repeatedly a few times.)
>
>
>> If you include the module name and the manual name (perhaps by index)
>> in the main .js file then M: and T: should work fine as far as I can
>> tell.

I can see now that this probably isn't going to work as a solution.

Just FYI though, there's a common trick for handling this kind of
on-click event which is to have the url point to #goto-car or
something similar and handle it as a response to that instead, this
way it "just works" when the user opens the link in a new window/tab.
AFAIK Facebook/twitter/Google Reader do something like this, though
they use it for triggering ajax page reloads rather than for
redirects.

    Henk


Posted on the dev mailing list.