Statusbar messages and tip popovers
Methods
banner(bannerText, bannerClassopt)
Display text in the popup banner
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
bannerText |
string | The text to display |
|
bannerClass |
string |
<optional> |
The banner class ('footnote' creates a black banner, default 'clear') |
Example
Marked.message.banner('Just some text to pop in at the bottom');
clear()
Clear both status bar and HTML popups
Example
Marked.message.clearAll();
clearBanner()
Clear the banner and hide
Example
Marked.message.clearBanner();
clearHTML()
Clear all HTML popups
Example
Marked.message.clearAll();
clearStatus(nameopt)
Clear statusbar message
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
Specific named timer to clear, clear all timers if blank |
Example
Marked.message.clearStatus();
clearTip()
Clear an HTML popup
Example
Marked.message.clearTip();
colorStatusBar(color)
Colorize current status bar message
Parameters:
Name | Type | Description |
---|---|---|
color |
string | Colorize message (red, blue, green, black, white, grey) default color if empty |
Examples
Marked.message.colorStatusBar('green');
Marked.message.colorStatusBar('red');
dialog(options)
Display a dismissable dialog
Parameters:
Name | Type | Description |
---|---|---|
options |
object | Dictionary of options (type, message) |
statusBar(msgopt, timeoutopt, nameopt, coloropt)
Updates statusbar message using object
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
msg |
String |
<optional> |
String to display in status bar (clears last status if empty) |
timeout |
Integer |
<optional> |
Seconds to display message |
name |
String |
<optional> |
Named timer for later reference |
color |
string |
<optional> |
Colorize message (red, blue, green, black, white, grey) |
Example
Marked.message.statusBar('Hey there!', 2500, 'heyThere', 'red');
tip(tiptext, coloropt, timeoutopt, idopt, onClickopt) → {String}
Display an HTML popup
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tiptext |
String | Text to display |
|
color |
String |
<optional> |
Background color for tip (green, blue, black, red, clear) |
timeout |
Integer |
<optional> |
Remove tip after X seconds |
id |
string |
<optional> |
tip ID |
onClick |
function |
<optional> |
onClick callback |
Returns:
tip ID
- Type
- String
Example
// A tip that disappears in 1.5 seconds
Marked.message.tip('A notification string', 'red', 1500);
// A tip that remains fixed with an onClick callback
Marked.message.tip('Sticky notification', 'clear', 0, 'stickyID', function(){...});