The "nothingthree" script is Nihiltres' very own collection of little JavaScript tweaks to Wikipedia's user interface (UI). This page outlines what features it has, and how to make use of them yourself.

The script is visible at User:Nihiltres/nothingthree.js.

Compatibility

This script is tested primarily in Safari on Mac OS X. It should probably also work in Google Chrome, Firefox, and Opera (among other standards-compliant browsers). It should usually work in Internet Explorer, as well, but support for that browser should generally be considered dubious; use a better browser if possible!

Many, if not most of the functions use the jQuery library which is available through the Vector skin. While jQuery is designed to broadly support most browsers, some older browsers may have issues. See the jQuery browser compatibility page for more details.

There is no debugging on mobile platforms other than Nihiltres' iPhone, and the routine that checks if the user is on a mobile platform currently only checks for the iPhone and iPod touch. Other mobile user-agents can be added on request, and bug reports are always welcome!

How to use the script

These instructions constitute a very rough draft; please feel free to improve them.

  1. Make sure that you are using the Vector skin. Use of the Vector skin is assumed for the script.
  2. Go to Special:MyPage/vector.js and add the following line:
    importScript("User:Nihiltres/nothingthree.js"); //change settings at [[Special:MyPage/nothingthree-config.js]]
    
  3. Follow this link and edit the list of selected routines to include only the ones that you want, using the list of routines below. If you do not use Wikipedia from a mobile platform, feel free to omit that section. Once you're done, save your edit. (This step is the hard step.)
  4. Enjoy the new features!

If you need any help, feel free to ask on Nihiltres' talk page:

How to report bugs

Please report any bugs you find. Unknown bugs can't be fixed! :)

Functional overview

The nothingthree library is divided into sections, despite the relative lack of organization. Some parts refer to others, particularly ones in nothingthree.settings or nothingthree.util. That said, there's still some attempt to keep code together in its own section. Each section will include an idea of what its functions do, examples if the function is at all ambiguous, and the canonical way to use it through nothingthree-config.js.

nothingthree.settings

This section is just a holding pen for settings that other sections might use, so that those settings can be globally available while still being corralled within the nothingthree object. There are no functions here, so this section largely omits example code. Most non-technical users will not need to tweak values in this section, with the possible exception of nothingthree.settings.specificAutoWatchNamespaces.

nothingthree.util

This section holds functions that are of broad general use, especially if they're expected to be used in multiple other scripts. Most aren't of use to non-technical users, and some are included purely speculatively as support for future scripts.

nothingthree.tabAdd

This section includes routines that add new tabs and userlinks to the interface. Although there are other functions in the library that add tabs and userlinks, this section focuses on those bits of code whose primary purpose is the addition of a tab, rather than those that add a tab simply as an easy way to activate some other functionality.

nothingthree.specificAutoWatch

This isolated function does something very specific, but very useful: it automatically checks the "watch this page" box when editing in particular namespaces. The function takes no parameters, but the list of namespaces in which it is activated can be changed in nothingthree.settings.specificAutoWatchNamespaces. Here's an example:

nothingthree.specificAutoWatch();

nothingthree.tabMove

These functions work primarily to move tabs, particularly in and out of Vector's drop-down menu. That being said, almost all of them offer secondary functions: the deletion function, for example, moves the tab out of the menu only if it detects a reason that the page is likely to be deleted.

nothingthree.sidebar

This collection of functions allows the left-hand sidebar, which advanced users often don't need, to be collapsed off-screen, on demand. It comes in three parts: a function that toggles the sidebar, a function that adds a tab for said toggling, and a function that re-collapses the sidebar on new pages or tabs if its most recent state was collapsed. This function should work on most browsers, but modern browsers will benefit from CSS3 animations, supplied from nothingthree.css, to slide the sidebar in and out. If the re-collapsing feature is desirable, this is how to activate the feature:

nothingthree.sidebar.toggleTab();
nothingthree.sidebar.remember();

If the re-collapsing isn't wanted, this will suffice:

nothingthree.sidebar.toggleTab();

Here are details on each of the three functions:

nothingthree.tops

This section adds a tab to contributions pages which, when clicked, applies CSS that fades out edits that are "(top)", or the most recent contributions to the page. This makes it easy to see which pages have been modified since that user last edited them. There are four functions: one that fades those edits, one that restores them, one that gathers the hide and show functions into a toggle function, and one that adds a tab so that the user can access the function. Only the last function needs to be activated by end-users:

nothingthree.tops.toggleTab();

Descriptions of the individual functions follow:

nothingthree.monoedit

This section adds a button to the WikiEditor interface that allows the editing field to be toggled to a monospace font. It assumes that the user, like Nihiltres, has changed their vector.css to cause edit fields to use a proportional font instead. This functionality is accomplished by adding a CSS class, meaning end-users could reverse the functionality by overriding the default "monoedit" class from nothingthree.css so that for them, it displays in their choice of font(s). The button-adding functionality is somewhat experimental, so the button may move if and when the code's refined. Additionally, the functions don't account for custom editing interfaces like the code editors for CSS and JavaScript pages, but shouldn't affect them. End-users need only call the function that adds the button:

nothingthree.monoedit.toggleButton();

Descriptions of the individual functions follow:

Activator

At the end of the library, two main things happen: