diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 11 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 84 | ||||
| -rw-r--r-- | www/js/app.js | 17 |
4 files changed, 107 insertions, 7 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 5efede89..b68b478e 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -71,7 +71,8 @@ angular.module('zmApp.controllers') 'defaultPushSound': false, 'enableBlog':true, 'use24hr':false, - 'packeryPositions':'' + 'packeryPositions':'', + 'packerySizes':'', }; @@ -293,6 +294,14 @@ angular.module('zmApp.controllers') } + + if (typeof loginData.packerySizes == 'undefined') + { + zmDebug ("packerySizes does not exist. Setting to empty"); + loginData.packerySizes = ""; + + } + if (typeof loginData.use24hr == 'undefined') { zmDebug ("use24hr does not exist. Setting to false"); diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index 7a3841eb..6b4d7b42 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -1641,7 +1641,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ console.log ("************* GENERATED CONNKEY " + $scope.connKey); $scope.currentFrame = 1; console.log ("CURRENT EVENT " + JSON.stringify($scope.currentEvent)); - $scope.currentEventDuration = parseFloat($scope.currentEvent.Event.Length); + //$scope.currentEventDuration = parseFloat($scope.currentEvent.Event.Length); //console.log ($scope.event.Event.Frames); if (currentEvent && currentEvent.Event) prepareModalEvent(currentEvent.Event.Id); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 43a96e2d..ab9a73e3 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -31,6 +31,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.slider.monsize = ZMDataModel.getMontageSize(); + + var oldSliderVal = $scope.slider.monsize; $scope.revMonSize = 11 - parseInt($scope.slider.monsize); // The difference between old and original is this: @@ -108,6 +110,13 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.MontageMonitors = ZMDataModel.applyMontageMonitorPrefs (message, 1)[0]; + for (i=0; i < $scope.MontageMonitors.length; i++) + { + $scope.MontageMonitors[i].Monitor.gridScale="20"; + $scope.MontageMonitors[i].Monitor.selectStyle=""; + + } + var loginData = ZMDataModel.getLogin(); $scope.packMontage = loginData.packMontage; @@ -160,7 +169,7 @@ function initPackery() imagesLoaded(elem).on('progress', function() { console.log ("******** SOME IMAGE LOADED"); progressCalled = true; - if (layouttype) $timeout (function(){pckry.shiftLayout();},50); + if (layouttype) $timeout (function(){pckry.layout();},50); }); imagesLoaded(elem).on('always', function() { @@ -514,7 +523,7 @@ function initPackery() " and hidden order as " + hiddenOrder.toString()); $scope.modal.remove(); ZMDataModel.zmLog ("Reloading packery"); - $timeout (function(){pckry.reloadItems(); pckry.shiftLayout();},50); + $timeout (function(){pckry.reloadItems(); pckry.layout();},50); }; $scope.cancelReorder = function () { @@ -694,6 +703,24 @@ function initPackery() // console.log("dragging"); }; + $scope.noop = function() + { + console.log ("Ignoring tap, drag on"); + }; + + $scope.toggleSelectItem = function(ndx) + { + + if ($scope.MontageMonitors[ndx].Monitor.selectStyle !== "undefined" && $scope.MontageMonitors[ndx].Monitor.selectStyle=="dragborder-selected") + { + $scope.MontageMonitors[ndx].Monitor.selectStyle=""; + } + else + { + $scope.MontageMonitors[ndx].Monitor.selectStyle="dragborder-selected"; + } + console.log ("Switched value to " + $scope.MontageMonitors[ndx].Monitor.selectStyle); + }; $scope.onDropComplete = function (index, obj, event) { // console.log("dragged"); @@ -717,6 +744,7 @@ function initPackery() { draggies[i].enable(); } + } else @@ -727,6 +755,10 @@ function initPackery() { draggies[i].disable(); } + for (i=0; i < $scope.MontageMonitors.length; i++) + { + $scope.MontageMonitors[i].Monitor.selectStyle=""; + } } }; @@ -1109,6 +1141,18 @@ function initPackery() processSliderChanged($scope.slider.monsize); }; + + $scope.resetSizes = function() + { + for (var i=0; i< $scope.MontageMonitors.length; i++) + { + $scope.MontageMonitors[i].Monitor.gridScale="20"; + } + $timeout (function(){pckry.layout();},50); + $scope.slider.monsize = 2; + + }; + //--------------------------------------------------------- // slider is tied to the view slider for montage @@ -1119,13 +1163,43 @@ function initPackery() $scope.sliderChanged = function () { + if (oldSliderVal == $scope.slider.monsize) return; - + var dirn = (oldSliderVal > $scope.slider.monsize) ? -1:1; //pckry.destroy(); - $scope.gridScale = "grid-item-" + ($scope.slider.monsize * 10).toString(); + //$scope.gridScale = "grid-item-" + ($scope.slider.monsize * 10).toString(); + + + + for (var i=0; i< $scope.MontageMonitors.length; i++) + { + var curVal = parseInt($scope.MontageMonitors[i].Monitor.gridScale); + curVal = curVal + (10 * dirn); + if (curVal < 20) curVal=20; + if (curVal >100) curVal = 100; + console.log ("For Index: " + i + " From: " + $scope.MontageMonitors[i].Monitor.gridScale + " To: " + curVal); + + if ($scope.isDragabillyOn) + { + // only do this for selected monitors + if ($scope.MontageMonitors[i].Monitor.selectStyle=="dragborder-selected") + { + + $scope.MontageMonitors[i].Monitor.gridScale= curVal; + } + } + else + { + $scope.MontageMonitors[i].Monitor.gridScale= curVal; + + } + oldSliderVal = $scope.slider.monsize; + } + + //console.log("**** CSS IS " + $scope.gridScale); $timeout(function () { - pckry.shiftLayout(); + pckry.layout(); pckry.getItemElements().forEach(function (itemElem) { console.log (itemElem.attributes['data-item-id'].value+" size "+itemElem.attributes['data-item-size'].value ); diff --git a/www/js/app.js b/www/js/app.js index 51922d6a..f7bf544b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -151,6 +151,23 @@ angular.module('zmApp', [ }) +.directive('detectGestures', function($ionicGesture) { + return { + restrict : 'A', + + link : function(scope, elem, attrs) { + var gestureType = attrs.gestureType; + + switch(gestureType) { + case 'pinchin': + $ionicGesture.on('pinchin', scope.reportEvent, elem); + break; + } + + } + }; +}) + .directive('tooltip', function () { return { restrict: 'C', |
