24 lines
570 B
JavaScript
24 lines
570 B
JavaScript
#include utility.js
|
|
|
|
var AmiStatusIndicator = function(parent) {
|
|
var icon = $e({ attrs: { id: 'statusIconContainer' } });
|
|
parent.appendChild(icon);
|
|
|
|
var setState = function(colour, text) {
|
|
icon.className = 'status-' + colour;
|
|
icon.title = (text || '').toString();
|
|
};
|
|
|
|
return {
|
|
setRed: function(text) {
|
|
setState('red', text);
|
|
},
|
|
setYellow: function(text) {
|
|
setState('yellow', text);
|
|
},
|
|
setGreen: function(text) {
|
|
setState('green', text);
|
|
},
|
|
};
|
|
};
|