Userscripts.org TOC

By jerone Last update Jan 12, 2009 — Installed 210 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0
Script Summary:
Add a TOC for Userscripts.org metadata. Updated 12-01-2009 14:30 [v1.7 Beta].
Version: v1.7 Beta
Copyright: 2008 Jerone
Recently Updated TopicsPosts
Archived Comments8

this script has 1 topic, 8 posts

This script has no reviews.


Userscripts.org TOC

$1 News:

This script adds a simple TOC to the metadata. All headers (from 1 to 6) are listed in this TOC. Clicking on one of the links scrolls you down to that header.

It's now possible to exclude headers from the TOC by adding cite="noTOC" to the header in your metadata.

NOTE:This script is still a Beta release, so I'm not sure if all works for everybody. Please leave a message if you get any errors or bugs!

This script does NOT work without US Framework[Install][Homepage]. Please install that script first and read the instructions!

Have fun using it, gr Jerone

$2 Changelog:

[+] = added; [-] = removed; [/] = fixed; [*] = updated;
  • 03-09-2008 14:00 [v1 Alpha]:
    [+] initial release;
  • 05-09-2008 12:00 [v1.1 Beta]:
    [+] option to choose position;
  • 07-09-2008 15:15 [v1.2 Beta]:
    [/] problem with padding/margin for the list;
  • 08-09-2008 10:30 [v1.3 Beta]:
    [+] option to hide when no headers;
  • 11-09-2008 11:45 [v1.4 Beta]:
    [*] improved element finding;
    [+] multiple levels indent;
    [+] support for levels 5 and 6;
    [+] TOC removed on print;
  • 24-09-2008 13:00 [v1.5 Beta]:
    [+] added numbering + custom numbering;
    [/] use only headers with text;
    [*] links are trimmed;
    [*] updated layout;
  • 21-11-2008 21:00 [v1.5.1 Beta]:
    [/] fixed small bug in framework check;
  • 10-01-2009 19:30 [v1.6 Beta]:
    [*] updated framework;
  • 12-01-2009 14:30 [v1.7 Beta]:
    [+] added exclution of "noTOC" in cite;
    [/] fixed bug with headers in a node;
    [*] cleaned up code;

$3 Feature's:

  • Add a TOC for Userscripts.org metadata.

$4 Screenshot:

Userscripts.org TOC screenshot

$5 Options:

tocPosition
[Integer] float position: 0=whole screen, 1=left, 2=right;
hideNone
[Boolean] hide when there are no headers;
showNumbering
[Boolean] add numbering;
customNrs
[Function] use custom numbering (parameter "n" is an Array with all numbering, starting with 1);
This function can be used if you prefer for example Roman numbering or just symbols;

$6 Todo:

  • Internet Explorer (IE7Pro) and Opera (UserJS) compatible.

$7 Test:

These are all supported headers:


Test header 1 <h1>

Test header 2 <h2>

Test header 3 <h3>

Test header 4 <h4>

Test header 5 <h5>
Test header 6 <h6>

$8 Notes:

I made this userscript in Dreamweaver 8.
It's tested in Firefox 2 (partly) and Firefox 3.0.5 (continuous) with GreaseMonkey 0.8.
This script is copyrighted and I prefer if you ask if you can 'borrow' parts of this script.
Installing is at own risk and I can't be held responsible if anything goes wrong.
Want to reward me for putting time and sweat into making this free userscript; (thank you).