7 link : function(scope, ele, attr, ctrl) {
8 ctrl.$parsers.unshift(function(viewValue) {
9 if (viewValue === '' || viewValue === null
10 || typeof viewValue === 'undefined') {
13 return parseInt(viewValue, 10);
21 function($scope, $interval, $http, $modal, $log, ManifestService) {
23 $scope.testMsg = "Welcome Page1";
24 $scope.gridsterOpts = {
25 columns : 6, // the width of the grid, in columns
26 pushing : true, // whether to push other items out of
27 // the way on move or resize
28 floating : true, // whether to automatically float
29 // items up so they stack (you can
30 // temporarily disable if you are
31 // adding unsorted items with
33 width : 'auto', // can be an integer or 'auto'. 'auto'
34 // scales gridster to be the full width
35 // of its containing element
36 colWidth : 'auto', // can be an integer or 'auto'.
37 // 'auto' uses the pixel width of
38 // the element divided by 'columns'
39 rowHeight : 60, // can be an integer or 'match'. Match
40 // uses the colWidth, giving you square
42 margins : [ 10, 10 ], // the pixel distance between
44 outerMargin : true, // whether margins apply to outer
48 enabled : true, // whether dragging items is
50 stop : function(event, uiWidget, $element) {
52 } // optional callback fired when item is finished
59 * $scope.gridsterOpts = { columns: 6, width: 'auto',
60 * colWidth: '230', rowHeight: '120', margins: [10, 10],
61 * outerMargin: true, pushing: true, floating: true,
65 $scope.toggleMinMax = function(index, tileName) {
67 $scope.standardItems[index].max = !$scope.standardItems[index].max;
68 if ($scope.standardItems[index].max)
69 $scope.standardItems[index].sizeY = $scope.standardItems[index].maxHeight;
71 $scope.standardItems[index].sizeY = 0;
73 $scope.tileTemp = $scope.$eval(tileName);
74 var tileMax = $parse(tileName + '.max');
75 tileMax.assign($scope, !$scope.$eval(tileName).max);
76 var tileSizeY = $parse(tileName + '.sizeY');
77 if ($scope.tileTemp.max)
78 tileSizeY.assign($scope,
79 $scope.tileTemp.maxHeight);
81 tileSizeY.assign($scope, 0);
85 // These map directly to gridsterItem options
86 // IMPORTANT: Items should be placed in the grid in the
88 // they should appear.
89 // In most cases the sorting should be by row ASC, col ASC
90 $scope.standardItems = [
97 headerText : 'Dashboard',
107 headerText : 'Donut Chart',
111 * { sizeX : 1, sizeY : 5, maxHeight : 5, row :
112 * 0, col : 2, headerText : 'Area Chart', max :
121 headerText : 'Pie Chart',
125 * { sizeX : 1, sizeY : 5, maxHeight : 5, row : 8,
126 * col : 1, headerText : 'Line Chart', max : false },
134 headerText : 'Gauges',
143 headerText : 'Traffic distribution by day of week',
152 headerText : 'Busy hour traffic analysis by day of week',
160 headerText : 'Additional Samples',
168 headerText : 'Sticky Notes',
176 headerText : 'Service Configuration',
181 * $.each($scope.standardItems, function(i, a) {
182 * $scope.toggleMinMax(i, ''); });
185 angular.forEach($scope.standardItems, function(i, a) {
186 $scope.toggleMinMax(counter, '');
187 counter = counter + 1;
190 $scope.activeTabId = 'Monday';
193 $scope.selectedTrafficDay = [ {
216 $scope.currentSelectedDayTab = '#Monday';
218 $scope.onClickTab1 = function(Daytab) {
219 $scope.currentSelectedDayTab = Daytab.url;
222 $scope.isActiveTab1 = function(tabUrl) {
223 return tabUrl == $scope.currentSelectedDayTab;
257 $scope.BusyHourTraffic = [ {
258 title : 'BH SNRC DLSTX - Incoming',
261 title : 'BH SNRC DLSTX - Outgoing',
264 title : 'BH National - Default',
267 title : 'BH National - Priority',
270 title : 'BH National',
276 $scope.currentSelectedBusyHourTraffic = '#Incoming';
278 $scope.onClickTab2 = function(TrafficTab) {
279 $scope.currentSelectedBusyHourTraffic = TrafficTab.url;
282 $scope.isActiveTab2 = function(tabUrl) {
283 return tabUrl == $scope.currentSelectedBusyHourTraffic;
286 $scope.activeTabId2 = 'Incoming';
289 title : 'BH SNRC DLSTX - Incoming',
294 title : 'BH SNRC DLSTX - Outgoing',
298 title : 'BH National - Default',
302 title : 'BH National - Priority',
306 title : 'BH National',
311 $scope.activeTabId3 = 'Incoming';
314 title : 'BH SNRC DLSTX - Incoming',
319 title : 'BH SNRC DLSTX - Outgoing',
323 title : 'BH National - Default',
327 title : 'BH National - Priority',
331 title : 'BH National',
337 * $scope.$watch('activeTabId', function(newVal) {
338 * alert(newval); $('#'+newval).show(); }, true);
341 $scope.toggleEastToWest = function() {
342 $("#toggle").toggle('slide');
343 if ($("#leftIcon").is(":visible")) {
344 $("#rightIcon").show();
345 $("#leftIcon").hide();
346 } else if ($("#rightIcon").is(":visible")) {
347 $("#rightIcon").hide();
348 $("#leftIcon").show();
392 // Fetch manifest info
393 $scope.manifest = {};
394 ManifestService.getManifest()
395 .then(function(jsonObj) {
396 // $log.debug("welcome-controller: getManifest returned " + JSON.stringify(jsonObj));
398 $log.error('welcome-controller: failed to get manifest: ' + JSON.stringify(jsonObj));
401 $scope.manifest=jsonObj;
404 $log.error("welcome-controller: getManifest failed: " + error);