Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

TBui function class

creesch edited this page Dec 18, 2014 · 9 revisions

TBui contains all UI elements (who would have guessed) starting with all the images we insert on reddit encoded in base

TBui.standardColors

Colors as used by usernotes.

HTML generation

TBui.popup

Generates the html for a toolbox popup window.

Example of a popup in toolbox:

popup

Usage example:

        $popup = TB.ui.popup(
            'Popup title',
            [
                {
                    title: 'Tab1',
                    tooltip: 'Tooltip shown when hovering tab.',
                    content: 'Content here',
                    footer: 'Footer content here.'
                },
                {
                    title: 'Tab2',
                    tooltip: 'Tooltip shown when hovering tab.',
                    content: 'Content here',
                    footer: 'Footer content here.'
                }
            ],
            '', // possible meta data to be added to the popup. 
            'class-for-popup' // class
        ).appendTo('body');
TBui.overlay

Generates the html for a toolbox big overlay window.

Example of an overlay window in toolbox:

overlay window

Usage example:

        $overlay = TB.ui.overlay (
            'Overlay title',
            [
                {
                    title: 'Tab1',
                    tooltip: 'Tooltip shown when hovering tab.',
                    content: 'Content here',
                    footer: 'Footer content here.'
                },
                {
                    title: 'Tab2',
                    tooltip: 'Tooltip shown when hovering tab.',
                    content: 'Content here',
                    footer: 'Footer content here.'
                }
            ],
            '', // possible meta data to be added to the popup. 
            'class-for-overlay' // class
        ).appendTo('body');

Selection UI

TBui.selectSingular
TBui.selectMultiple

Generates a generic multiple selection UI with two dropdown menus, like the one in Mod Button.

Feedback methods

TBui.textFeedback

Feed this a bit of text and the type of feedback and it will show it to the user for a few seconds.

TBui.longLoadSpinner

Our awesome long load spinner that ended up not being a spinner at all. It will attend the user to ongoing background operations with a warning when leaving the page.