Skip to main content
29 of 43
1.11 and also updated all screenshots
Jason C
  • 591
  • 2
  • 11

Top Bar for Chat Rooms

This currently only works on Chrome. I could use some help making it Firefox-compatible!

Description:

Provides a fully functional top bar, including realtime notifications, easy chat server switching, and fast room list searching, at the top of all chat rooms. Keep tabs on your inbox and site activity while chatting.

enter image description here

enter image description here

Can also match the chat room's theme:

enter image description here

And now contains a fancy new room finder dropdown:

enter image description here


Download:

Features:

  • Fully functional with dropdowns and realtime notifications.

  • Topbar background can match chat room theme.

  • Adds a dropdown that lets you search for rooms directly (with optional search-as-you-type support and the ability to open rooms in the same tab or a new one).

  • Adds chat server links to SE dropdown (click server name to open in new window, click "switch" to open in same window), with optional auto-rejoin favorite rooms. Makes using multiple chat servers convenient:

    enter image description here

  • Does not require additional authentication or access tokens.

  • To configure settings, click the "topbar" link in the footer:

    enter image description here

Console Usage:

Some options are settable through the console via the ChatTopBar object. All options set will be saved. The following console commands are available:

  • ChatTopBar.setWiden(boolean): True to use wide layout, false to use default width.
  • ChatTopBar.setThemed(boolean): True to make the topbar match the current chat room's theme, false to use the default dark background.
  • ChatTopBar.setBrightness(float): Set brightness of icons and text in topbar (1.0 is default). This setting is saved per theme, and is only applied when themes are enabled. Can help deal with themes that don't contrast well with the icons.
  • ChatTopBar.setQuiet(boolean): True to suppress console output.
  • ChatTopBar.setShowSwitcher(boolean): True to show chat server links in SE dropdown.
  • ChatTopBar.setRejoinOnSwitch(boolean): True to make "switch" links in SE dropdown auto-rejoin favorite rooms.
  • ChatTopBar.setOpenRoomsHere(boolean): True to open rooms from the room search dropdown in this tab, false to open them in a new tab.
  • ChatTopBar.setAutoSearch(boolean): True to search for rooms in the room finder as you type, false to require you to press a search button.
  • ChatTopBar.setSearchByActivity(boolean): True to sort room search by activity, false to sort by number of people in room.
  • ChatTopBar.setRunInFrame(boolean): True to allow the topbar to load when chat is in an iframe, false not to. For compatibility with other scripts.
  • ChatTopBar.showChangeLog(): Show the change log dialog.
  • ChatTopBar.forgetAccount(): Forget cached network account ID, useful for testing.
  • ChatTopBar.forgetEverything(): Erase all persistent settings, useful for testing.
  • ChatTopBar.dumpSettings(): Print all persistent settings, useful for testing.
  • ChatTopBar.fakeUnreadCounts(inbox,rep): Fake unread item messages to show indicators, useful for testing and photo ops.

All of the set* functions can be run with no parameters to return the current setting.

Notes:

  • Uses one API query to get account ID. However, this value is cached, so usage should be extremely minimal. This is the only thing it uses the API for, so your quota should be safe.
  • Mad props to Gerry and Shog9 for helping me figure stuff out.

Issues:

  • Currently does not work on Firefox. I'm running into all kinds of problems with GreaseMonkey, and event handlers not being called, and sandboxing, scope, jQuery, etc. There's a branch at https://github.com/JC3/SEUserScripts/blob/firefox-greasemonkey/ChatTopBar.user.js that I'm doing Firefox work on, if anybody has any insight, it'd be greatly appreciated.
  • Initial state of notification / reputation unread counts may be inaccurate due to fundamental issues with the topbar on chat. See also the source comments.
  • Hovering over other topbar dropdown icons when room finder is currently open won't automatically open them like it should. Can't fix until I figure out how to open topbar dropdowns programmatically.
  • You may post bugs and requests here or on Github (or ping me in The Tavern)!

Change Log:

  • 1.11

    • Chat room search contains selector for room tab (all, mine, favorites).
    • Default search sort order is now by people, with option to use activity instead. Improves search results greatly.
    • ChatTopBar.setSearchByActivity to change sort order option.
  • 1.10

    • Search for chat rooms from new dropdown in topbar.
    • Styling tweaks to change log dialog.
  • 1.09, +, +, +, +

    • Clicking site search box in SE dropdown no longer closes dropdown.
    • Also the site search didn't work, now it does.
    • Prevent overscrolling in dropdowns from scrolling chat when using mouse wheel.
  • 1.08, +, +

    • Chat server links placed in SE dropdown (click name to open in new tab, "switch" to open in current tab).
    • Clicking "switch" on chat server link automatically rejoins favorite rooms (can be disabled in settings).
    • Brightness setting is now associated with the current room's theme rather than the room itself (so it applies to all rooms with the same theme). Apologies for any reset settings (it does make a good attempt to copy them, though).
    • Change log now displayed after update (when flashing "topbar" link clicked).
    • ChatTopBar.showChangeLog() will always show the change log, too.
    • ChatTopBar functions for additional settings added.
    • Don't load jQuery UI if it's already loaded.
    • Don't run in iframes (by default), for compatibility with some other scripts. ChatTopBar.setRunInFrame() can control this.
  • 1.07

    • Settings dialog (accessible from 'topbar' link in footer).
    • Wide mode now matches right side padding instead of fixed at 95%.
    • More descriptive search box placeholders.
    • ChatTopBar.forgetEverything, for testing.
  • 1.06, +

    • Brightness now only applied if theme enabled.
    • Sidebar resized so it doesn't hide behind the bottom panel.
    • ChatTopBar.fakeUnreadCounts(inbox,rep) for debugging.
    • Explicit unsafeWindow grant.
    • Sort output of dumpSettings().
  • 1.04, 1.05

    • Per-room icon/text brightness option.
    • Option to suppress console output.
    • Ability to dump settings to console for testing.
    • Fixed a style bug where things were happening before CSS was loaded, was sometimes causing non-themed topbar to have a white background instead of black.
  • 1.03

    • ChatTopBar console interface for setting options.
    • Widen / theme options now user-settable.
    • Ability to forget cached account ID for testing.
  • 1.02

    • WebSocket reconnect when connection lost.
    • Beta code for themed topbar.
    • Better console logging.
  • 1.01

    • Realtime event handling via websocket.
  • 1.00

    • Initial version.

Check out my other scripts.

Jason C
  • 591
  • 2
  • 11