Class: Template

Template(view)

Class for dealing with html templates.

Constructor

new Template(view)

Parameters:
Name Type Description
view View View object.
Source:

Methods

alert(text, coloropt)

Returns an alert div.
Parameters:
Name Type Attributes Default Description
text string The text of the alert.
color string <optional>
'red' The color of the alert.
Source:

badge(text, coloropt)

Returns a badge.
Parameters:
Name Type Attributes Default Description
text string The text of the badge.
color string <optional>
'green' The color of the badge.
Source:

fromTemplate(filename) → {string}

Returns the content of a html template file.
Parameters:
Name Type Description
filename string The name of the html template file.
Source:
Returns:
The contents of the html template file.
Type
string

icon(icon, coloropt)

Returns a fontawesome icon.
Parameters:
Name Type Attributes Default Description
icon string The name of the icon.
color string <optional>
'black' The color of the icon.
Source:
Returns a link.
Parameters:
Name Type Description
text string The text of the link.
onclick string The onclick event for the link, in string format.
Source:

progress(percentage, color, textopt) → {object}

Returns a progress bar.
Parameters:
Name Type Attributes Default Description
percentage number Number between 0 and 100 which indicates the progress.
color string The color of the progress bar.
text string <optional>
'' Label which appears on the progress bar.
Source:
Returns:
The progress bar in form of a dom element.
Type
object

table(rows, propsopt) → {object}

Returns a table of given rows.
Parameters:
Name Type Attributes Default Description
rows array An array of strings representing the rows of the table.
props object <optional>
{} Object containing properties of the table.
Source:
Returns:
The table in form of a dom element.
Type
object