summaryrefslogtreecommitdiff
path: root/www/js/BookmarkCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-05-31 08:22:26 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-05-31 08:22:26 -0400
commit5214cdac945bc95cc18f449e91188f6f3c53d3e2 (patch)
treeb40baf3db7a893a68d5c0aaf4286324cb7457bec /www/js/BookmarkCtrl.js
parent49263c5ddd92c4374b23cff4273c1e6460823f80 (diff)
placeholder code for bookmarks - not enabled
Diffstat (limited to 'www/js/BookmarkCtrl.js')
-rw-r--r--www/js/BookmarkCtrl.js105
1 files changed, 105 insertions, 0 deletions
diff --git a/www/js/BookmarkCtrl.js b/www/js/BookmarkCtrl.js
new file mode 100644
index 00000000..9472f8d3
--- /dev/null
+++ b/www/js/BookmarkCtrl.js
@@ -0,0 +1,105 @@
+/* jshint -W041 */
+/* jslint browser: true*/
+/* global cordova,StatusBar,angular,console, Masonry */
+
+angular.module('zmApp.controllers').controller('zmApp.BookmarkCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$translate', '$q', '$templateRequest', '$sce', '$compile', function ($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $translate, $q, $templateRequest, $sce, $compile) {
+ $scope.openMenu = function () {
+ $ionicSideMenuDelegate.toggleLeft();
+ };
+
+ //----------------------------------------------------------------
+ // Alarm notification handling
+ //----------------------------------------------------------------
+ $scope.handleAlarms = function () {
+ $rootScope.isAlarm = !$rootScope.isAlarm;
+ if (!$rootScope.isAlarm) {
+ $rootScope.alarmCount = "0";
+ $ionicHistory.nextViewOptions({
+ disableBack: true
+ });
+ $state.go("app.events", {
+ "id": 0,
+ "playEvent": false
+ }, {
+ reload: true
+ });
+ return;
+ }
+ };
+
+
+ //-------------------------------------------------------------------------
+ // Lets make sure we set screen dim properly as we enter
+ // The problem is we enter other states before we leave previous states
+ // from a callback perspective in ionic, so we really can't predictably
+ // reset power state on exit as if it is called after we enter another
+ // state, that effectively overwrites current view power management needs
+ //------------------------------------------------------------------------
+ $scope.$on('$ionicView.beforeEnter', function () {
+ //console.log("**VIEW ** Help Ctrl Entered");
+ NVRDataModel.setAwake(false);
+
+ $scope.bookmarks = [];
+
+
+
+ $scope.bookmarks.push(
+ {
+ text:"Change State",
+ state:"app.state",
+ params: {
+ shortcut: {
+ fn:"selectCustomState",
+ fnargs:null,
+ }
+ }
+ },
+ {
+ text:"Stop ZM",
+ state:"app.state",
+ params: {
+ shortcut: {
+ fn:"controlZM",
+ fnargs:'stop',
+ }
+ },
+ },
+ {
+ text:"Start ZM",
+ state:"app.state",
+ params: {
+ shortcut: {
+ fn:"controlZM",
+ fnargs:'start',
+ }
+ },
+ },
+ {
+ text:"Restart ZM",
+ state:"app.state",
+ params: {
+ shortcut: {
+ fn:"controlZM",
+ fnargs:'restart',
+ }
+ },
+ }
+ );
+
+ $scope.bookmarks.push({text:""});
+
+
+ });
+
+ $scope.action = function (item) {
+
+ $ionicHistory.nextViewOptions({
+ historyRoot: true,
+ disableAnimate: true,
+ expire: 300
+ });
+ console.log ("GOIN WITH "+ JSON.stringify(item.params));
+ $state.go(item.state, item.params);
+ };
+
+}]);