browserout

by Keeth
Using a browser control and the new functionality for javascript function execution, creates a fast loading, easily customizable pseudo-output control.
Version 4 · Date Added: 8/14/09

If you wish to download this demo for your Linux/Mac installation, enter the following on your command line:

DreamDownload byond://Keeth.browserout##version=4

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Keeth.browserout##version=4

With the new ability to call javascript functions within a browser control, we can create a really cool pseudo-output control that can be easily customized for personal use.

This demo shows how we can do that in the simplest way possible.

I've included 2 javascript "output" functions that add the messages to the browser. The default is a top-to-bottom method that adds new messages to the top of the browser. The alternative is a bottom-to-top method that, you guessed it, adds new messages to the bottom of the browser.

v1.1 changes:
I changed some of the styles.

The output now uses divs instead of spans, saving some unnecessary work.

I have the body itself handling its own overflow, and [html] no longer handles any overflowing.

The bottom to top method is now the "default" method.

v2 changes:
I've changed how it handles the unique IDs of messages. Now, the world itself handles "unique IDs". Messages that are sent to everyone will be supplied with a "unique ID", so all of them match up. Messages that aren't "global" are supplied a "personal ID" by the script itself.

This way we can modify global messages that everyone SHOULD have without interfering with people that might have conflicting message IDs.

v3 changes
Turns out the method I was using to manipulate the window's scrolling only worked in old versions of IE.

This method should work properly in more recent browsers.

Please report and bugs.

v4 changes
It now only scrolls to the bottom if text has been displayed and you were viewing the bottom.

Yay.