Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Table of Contents

2 views
Skip to first unread message

Avindra Goolcharan

unread,
Apr 10, 2009, 11:07:58 PM4/10/09
to dev...@lists.mozilla.org
The anchor links in the Table of Contents include the *href* for the actual
page itself, and clicking on it will reload the page, then scroll to the
specified section.

If a server-side fix isn't issued, this simple script (with greasemonkey
metadata) should take care of the problem. If added, just remove all the
comments.

*// ==UserScript==
// @name Anchorify MDC
// @namespace #aVg
// @description *
// @include http*://developer.mozilla.org/*
// ==/UserScript==*
*function fix(a) {
if(a.rel=="internal")
a.href=a.href.substring(a.href.indexOf("#"));
}
var l=document.getElementById("article-nav").getElementsByTagName("a"), i;
for(i=l.length-1;i>=0;i--)
fix(l[i]);*

vb.dude

unread,
Apr 11, 2009, 2:34:50 PM4/11/09
to
Sorry for some reason, it didn't show up right. Here it is again:

// ==UserScript==
// @name Anchorify MDC
// @namespace #aVg
// @description *
// @include http*://developer.mozilla.org/

// ==/UserScript==*

Sheppy

unread,
Apr 13, 2009, 11:39:49 AM4/13/09
to
I'm talking to MindTouch to find out if there's a way to make it just
insert the #anchor part instead of the full URI. The way the TOC is
done right now doesn't make sense to me.

Eric Shepherd
Developer Documentation Lead
Mozilla Corporation
http://www.bitstampede.com/

0 new messages