[Indicators] Add notion of indicators

Add indicators as a category-of-extension, utilized
from the bottom bar to populate its contents.
WTD-608.
This commit is contained in:
Victor Woeltjen
2014-12-15 10:17:00 -08:00
parent 03179284f4
commit 48bcb662c6
3 changed files with 59 additions and 8 deletions

View File

@@ -0,0 +1,36 @@
/*global define*/
define(
[],
function () {
"use strict";
/**
* Controller for the bottombar template. Exposes
* available indicators (of extension category "indicators")
* @constructor
*/
function BottomBarController(indicators) {
// Utility function used to instantiate indicators
// from their injected constructors.
function instantiate(Indicator) {
return new Indicator();
}
indicators = indicators.map(instantiate);
return {
/**
* Get all indicators to display.
* @returns {Indicator[]} all indicators
* to display in the bottom bar.
*/
getIndicators: function () {
return indicators;
}
};
}
return BottomBarController;
}
);