Re: Link Numbering



On Sun, 2005-07-31 at 00:06 +0200, Esben Stien wrote:
> Any plans to add support for link numbering?. Probably best suited as
> a plugin;).

I found the following "User JS" + bookmarklet + CSS for Opera:

<http://nontroppo.org/wiki/OperaNumberedLinksScript>

I'm guessing it does the kind of thing you want. Opera's "User JS" is
based on Firefox's Greasemonkey extension, and Epiphany has a
Greasemonkey extension, too, so I think the User JS script would work,
as long as you put in an appropriate header (binding it to include "*"
so it'll apply to every page, for instance -- see any number of
Greasemonkey howtos for appropriate header tags).

The script requires a bookmarklet for full effect, but I think the
author was simply lazy or uncreative. You can make an invisible link and
give it an access key straight in Javascript (add a link with
"style.display: none;" and an "accesskey" attribute, as described at
<http://www.w3.org/TR/html401/interact/forms.html#adef-accesskey>). I
think you can do even better and simply use the document's "onkeypress"
event or something, but I'm no Javascript expert so I'm not 100% sure.
Or you can just cop out and bookmark the bookmarklet, like the author of
the bookmarklet did :).

Oh, and that User JS script doesn't account for the case where an <a>
tag has no "href" attribute. Maybe such tags should be ignored. Again,
an easy hack.

As for the CSS styles, it would make more sense to hard-code them into
the Greasemonkey script than to write a separate stylesheet. That's a
very simple thing to do: instead of setting linkLabel.className, just
set "linkLabel.style.background = 'gray'; linkLabel.style.color =
'black';", etc.

A couple of hours of playing with this and you should have a very good
link numbering user script which would work in both Epiphany and
Firefox. Seems like it'd be useful, though in my 5 minutes of Googling I
found nothing. If anybody attempts this, please let the list know how it
turns out :).

-- 
Adam Hooper <adamh densi com>

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]