-
Notifications
You must be signed in to change notification settings - Fork 71.9k
Client: ui utils.js
I created ui-utils.js
as a catch-all for the toolbar and settings drawer. It makes a lot of sense to merge dropdown.js with this file, so I just did that.
Some reusable functions are also included, such as showNotification() and lots of querystring parameters.
Usage:
http://localhost:1337/?drawer=true
http://localhost:1337/?toolbar=false
-
?drawer=true
opens the drawer -
?mute=true
use this carefully and this will mute all alarms!!! -
?toolbar=false
hides the toolbar
-
?experiments=true
hamburger? -
?notify=Hello,_world!
underscores will become spaces ?notify=Something_went_wrong!¬ifytype=urgent
This is a basic, home grown notification system. Notifications messages should be short and to the point. This is both for the sake of the users, and because the notification bar only has a single line for text and phone screens are narrow.
Displays a notification message at the top center of the screen. On narrow phone screens it displays below the BG number. By default the background color is red, but is can be customized. See the notifytype explination below.
Only one notification can be displayed at a time, so no parameters are needed. showNotification() calls this to clear the previous notification before adding a new one.
Valid notifytype values are info, success, warn, urgent. Info has a blue background, success is green, warn is yellow, and urgent is red. When a notifytype is not specified, urgent is assumed.