diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index e647ebf6b2..54399c428e 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -42,6 +42,11 @@ "key": "ViewSwitcherController", "implementation": "ViewSwitcherController.js", "depends": [ "$scope" ] + }, + { + "key": "BottomBarController", + "implementation": "BottomBarController.js", + "depends": [ "indicators[]" ] } ], "directives": [ diff --git a/platform/commonUI/general/res/templates/bottombar.html b/platform/commonUI/general/res/templates/bottombar.html index fc62d56f91..67a7e5731d 100644 --- a/platform/commonUI/general/res/templates/bottombar.html +++ b/platform/commonUI/general/res/templates/bottombar.html @@ -1,13 +1,23 @@ -
+
-
- . - Connected +
+ + {{indicator.getGlyph()}} + + + {{indicator.getText()}} + + + G +
-
\ No newline at end of file diff --git a/platform/commonUI/general/src/BottomBarController.js b/platform/commonUI/general/src/BottomBarController.js new file mode 100644 index 0000000000..0c94d94802 --- /dev/null +++ b/platform/commonUI/general/src/BottomBarController.js @@ -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; + } +); \ No newline at end of file