reddit top bar

By ohkine Last update Aug 4, 2012 — Installed 1,905 times.

Script Summary: Fixes reddit's stupid top bar.



Version: 1.2.3

License: Modified (3-clause) BSD

screenshots:

  1. http://i.imgur.com/IycBm.png — Customised 'my reddits' menu and short-cuts bar (OS X) [version 1.1.1]
  2. http://i.imgur.com/4HUNG.png — In-page preferences panel (OS X) [version 1.1.1]
  3. http://i.imgur.com/GxcP8.png — In-page preferences panel + Web-based settings file (Vista/Classic) [version 1.2.1]

This script is designed to fix what i think is the very irritating and useless default implementation of the top bar (including 'my reddits' menu) on reddit.com. It does the following things, specifically:

  1. Provides an option to rename the 'my reddits' menu.
  2. Populates the 'my reddits' menu with sub-reddits of your own choosing. These can be given in any order, may be assigned custom display names, and will be arranged into columns.
  3. Provides an option to show/hide the all/random/friends/mod links in the 'my reddits' menu.
  4. Populates the short-cuts bar (the horizontal menu across the top) with sub-reddits of your own choosing. As with the 'my reddits' menu, these can be in any order and may have custom display names applied.
  5. Provides an in-page preferences panel to modify all of the above options.
  6. Provides the ability to pull data from a Web-based settings file for easy synchronisation of settings across multiple machines. [1.2+]


There are a few known limitations and/or bugs:

  1. I did not take into account situations where the 'my reddits' menu is not displayed. (This typically occurs with new accounts; the menu is not shown until you have subscribed to a few additional sub-reddits.) — FIXED in 1.1
  2. The sub-reddits must be added manually. This is not as immediately gratifying as the way Reddit Enhancement Suite does it, but i think my way looks nicer, and functionally it has several advantages: (1) sub-reddits can be put into any order; (2) sub-reddits can be renamed; (3) sub-reddits can be added to the menu even if you are not subscribed to them; (4) sub-reddits can be excluded from the menu even if you are subscribed to them. Also, from a development stand-point this was an easy way of doing things.
  3. Column creation in the menu is not configurable. Having more than 64 sub-reddits forces it to 4 columns (4 being the max number of columns).
  4. Probably (?) works only in Firefox.


Things i do eventually hope to implement:

  1. Better handling of case mentioned in bug # 1 above. — FIXED in 1.1
  2. Ability to pull at least the currently subscribed sub-reddits into the list when the script is first run (similar to RES). (Sort of addresses bug # 2)
  3. Option to have the script automatically insert new sub-reddits into the list upon subscribing to them. (Sort of addresses bug # 2)
  4. Ability to configure column creation (bug # 3).
  5. Ability to run in Chrome (bug # 4).
  6. Ability to change short-cuts separator character. (⌘F '183' for now)
  7. Ability to change 'more' link name. (⌘F 'raquo' for now)


As far as usage: The script will add a 'top bar' link to the user bar at the top right of the page; clicking this will display the preferences panel. Everything from there should be fairly straight-forward.

Note to Reddit Enhancement Suite users: These two scripts are compatible, but you will need to make one change to your RES configuration first. Access the RES console via the '[RES]' link at the top right, then click on 'Configure Modules'. Select 'betteReddit' from the list, then untick the 'manageSubreddits' option. Lastly, click 'save' and close the RES console; you may also need to reload the page.


One final thing i ought to mention: I am a very amateur programmer, and extending this script so that it would be worth releasing was mainly a learning exercise for me. I'm sure i've taken the long/slow way of doing several things. Please keep my inexperience in mind if you happen to look through the code. :x

♥ kine


change log:

  • 1.2.3 (2012-08-04) — Very minor CSS changes (no more -moz- prefix).
  • 1.2.2 (2012-02-03) — Fixed a 'critical' error which prevented the script from loading; this was apparently caused by a small change in reddit's HTML. Also changed max menu columns to 5 instead of 4, and moved the preference pane up by 40 px (should be much better for small screens).
  • 1.2.1 (2011-05-02) — Wording, &c.
  • 1.2 (2011-05-02) — Added ability to pull info from a settings file hosted on an external server. This file should be in plain-text format and should contain four values, each separated by any number of new lines: (1) name of menu, (2) contents of menu, (3) show last four?, (4) contents of short-cut bar.
  • 1.1.1 (2011-03-20) — Tested on Mac, looks OK; preferences panel now hides on Escape.
  • 1.1 (2011-03-20) — Disabled spell-check in textareas. Fixed tick-box alignment in FF for Windows (will test Mac later). Code changes (clean-up, renamed vars, changed from DOM to innerHTML). Script now functions as expected when not logged in to reddit! (Bug #1 ✓) More consistent insertion of preferences link.
  • 1.0.8 (2011-03-04) — Added word-wrap: break-word to textareas to fix scroll bars.
  • 1.0.7 (2011-03-04) — Fixed bug that prevented the script from running on new installations...
  • 1.0.6 (2011-03-04) — Initial public release (2 years later to the day!); documentation.

(more in source)