summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/css/style.css27
-rw-r--r--www/index.html1
-rw-r--r--www/js/BookmarkCtrl.js105
-rw-r--r--www/js/StateCtrl.js20
-rw-r--r--www/lang/locale-en.json1
-rw-r--r--www/templates/bookmark.html51
-rw-r--r--www/templates/menu.html7
-rw-r--r--www/templates/state.html24
8 files changed, 212 insertions, 24 deletions
diff --git a/www/css/style.css b/www/css/style.css
index 2847d2be..39cf95b7 100644
--- a/www/css/style.css
+++ b/www/css/style.css
@@ -1435,6 +1435,33 @@ fill-opacity: 0.8;
}
+.bookmarkButton {
+ width:100%;
+ height:100px;
+ background-color:#6e7375;
+ color: white;
+
+}
+
+.bookmarkButton i{
+ position: relative;
+ float: left;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ color: white;
+ font-size:2em;
+ text-align:center;
+
+}
+
+.bookmark_text {
+ font-variant:small-caps;
+ font-size:0.6em;
+ color:white;
+ text-align:center;
+
+}
@media (min-width:600px) {
diff --git a/www/index.html b/www/index.html
index 01a87cc5..4d8d2332 100644
--- a/www/index.html
+++ b/www/index.html
@@ -134,6 +134,7 @@
<script src="js/InvalidApiCtrl.js"></script>
<script src="js/MomentCtrl.js"></script>
<script src="js/RefreshCtrl.js"></script>
+ <script src="js/BookmarkCtrl.js"></script>
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);
+ };
+
+}]);
diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js
index a278c55d..d845d02a 100644
--- a/www/js/StateCtrl.js
+++ b/www/js/StateCtrl.js
@@ -4,8 +4,8 @@
// controller for State View
-angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup', '$scope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope', '$timeout', '$ionicHistory', '$translate', function (
- $ionicPopup, $scope, zm, NVRDataModel, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout, $ionicHistory, $translate) {
+angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup', '$scope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope', '$timeout', '$ionicHistory', '$translate', '$stateParams', function (
+ $ionicPopup, $scope, zm, NVRDataModel, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout, $ionicHistory, $translate, $stateParams) {
//----------------------------------------------------------------------
// Controller main
@@ -63,6 +63,16 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
$scope.$on('$ionicView.enter', function () {
// console.log("**VIEW ** Montage Ctrl Entered");
NVRDataModel.setAwake(false);
+
+ });
+
+ $scope.$on('$ionicView.afterEnter', function () {
+ // console.log("**VIEW ** Montage Ctrl Entered");
+
+ console.log ("STATE SHORTCUT: " + JSON.stringify($stateParams));
+ $stateParams.shortcut && $stateParams.shortcut.fn &&
+ $scope[$stateParams.shortcut.fn]($stateParams.shortcut.fnargs); // jshint ignore:line
+
});
//---------------------------------------------------------
@@ -121,6 +131,10 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
// Allows the user to select a custom run state
//---------------------------------------------------------
$scope.selectCustomState = function () {
+ selectCustomState();
+ };
+
+ function selectCustomState() {
$scope.myopt = {
selectedState: ""
};
@@ -158,7 +172,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
controlZM($scope.myopt.selectedState);
}
});
- };
+ }
//----------------------------------------------------------------------
// returns disk space in gigs taken up by events
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index da35e82c..e3711040 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -26,6 +26,7 @@
"kBannerPleaseCheck" :"Please check settings",
"kBeCareful" :"be careful",
"kBodyPortalNotConfigured" :"Please fill in your login details as well as portal URL and save it before you try to detect the cgi-path",
+ "kBookmark" : "Bookmark",
"kButtonCancel" :"Cancel",
"kButtonClear" :"Clear",
"kButtonNo" :"No",
diff --git a/www/templates/bookmark.html b/www/templates/bookmark.html
new file mode 100644
index 00000000..3538dbfd
--- /dev/null
+++ b/www/templates/bookmark.html
@@ -0,0 +1,51 @@
+<ion-view cache-view="false" view-title="{{'kBookmark' | translate}}">
+ <ion-nav-buttons side="left">
+ <button class="button button-icon button-clear ion-navicon" ng-click="openMenu()"></button>
+ <button data-badge="{{$root.alarmCount}}" class="animated infinite tada button button-icon button-clear ion-ios-bell notification-badge"
+ ng-click="handleAlarms();" ng-if="$root.isAlarm"></button>
+ </ion-nav-buttons>
+ <ion-content class="padding" delegate-handle="none" overflow-scroll="false" mouse-wheel-scroll>
+
+ <div class="row" ng-repeat="bookmark in bookmarks" ng-if="$index % 4 === 0">
+
+ <div class="col col-25" ng-if="$index < bookmarks.length" ng-click="action(bookmarks[$index])">
+ <div class="bookmarkButton">
+ <i ng-class="(bookmarks[$index].text=='') ? 'ion-plus-circled':'ion-share'">
+ <br/>
+ <span class="bookmark_text"> {{bookmarks[$index].text}}</span>
+ </i>
+ </div>
+ </div>
+
+
+ <div class="col col-25" ng-if="$index + 1 < bookmarks.length" ng-click="action(bookmarks[$index+1])">
+ <div class="bookmarkButton">
+ <i ng-class="(bookmarks[$index+1].text=='') ? 'ion-plus-circled':'ion-share'">
+ <br/>
+ <span class="bookmark_text"> {{bookmarks[$index+1].text}}</span>
+ </i>
+ </div>
+ </div>
+
+ <div class="col col-25" ng-if="$index + 2 < bookmarks.length" ng-click="action(bookmarks[$index+2])">
+ <div class="bookmarkButton">
+ <i ng-class="(bookmarks[$index+2].text=='') ? 'ion-plus-circled':'ion-share'">
+ <br/>
+ <span class="bookmark_text"> {{bookmarks[$index+2].text}}</span>
+ </i>
+ </div>
+ </div>
+
+ <div class="col col-25" ng-if="$index + 3 < bookmarks.length" ng-click="action(bookmarks[$index+3])">
+ <div class="bookmarkButton">
+ <i ng-class="(bookmarks[$index+3].text=='') ? 'ion-plus-circled':'ion-share'">
+ <br/>
+ <span class="bookmark_text"> {{bookmarks[$index+3].text}}</span>
+ </i>
+
+ </div>
+ </div>
+ </div>
+
+ </ion-content>
+</ion-view>
diff --git a/www/templates/menu.html b/www/templates/menu.html
index 43833490..0c1d06a3 100644
--- a/www/templates/menu.html
+++ b/www/templates/menu.html
@@ -16,6 +16,13 @@
<!-- <ion-scroll scrollbar-y="false" style="height:100%" >-->
<ion-list>
<!--<ion-item ng-click="navigateView('app.montage')" menu-close>-->
+
+ <ion-item ng-if="0" href="#/app/bookmark" ng-click="go('/app/bookmark)')">
+ <span class=" item-icon-left">
+ <i class="icon ion-bookmark"></i>
+ </span>{{'kBookmark'| translate}}
+ </ion-item>
+
<ion-item id="menu-move-1" href="#/app/montage" ng-click="go('/app/montage')" >
<!--<span ng-if="$root.runMode=='lowbw'" style="float:right;margin-top:-18px;background-color:#f1c40f;color:#000;font-size:11px;opacity:0.7;width:20px;border-radius: 0px 0px 5px 5px;display:inline-block;text-align:center;">&nbsp;<i class="icon ion-arrow-graph-down-left"></i>&nbsp;</span>-->
diff --git a/www/templates/state.html b/www/templates/state.html
index d227bb5b..dd672e7a 100644
--- a/www/templates/state.html
+++ b/www/templates/state.html
@@ -35,28 +35,10 @@
</div>
</div>
</ion-item>
- <!--
- <ion-item>
- <div class="row">
- <div class="col col-10">
- <i class="ion-social-buffer" style="font-size:150%;"></i>
- </div>
-
- <div class="col">
-
- Disk Usage:
- </div>
- <div class="col" style="text-align:right;">
- {{zmDisk}}
- </div>
- </div>
- </ion-item>
- -->
+
<ion-item>
- <button class="button button-full {{dangerButtonColor[showDanger?1:0]}}" ng-click="showDanger=!showDanger">
- <i class="ion-alert-circled" "style:font-size:300%;"></i> {{dangerText[showDanger?1:0]}}
- </button>
- <div ng-show="showDanger">
+
+ <div>
<div class="row">
<div class="col text-center">
<a class="button button-small button-outline button-dark " ng-click="selectCustomState();" href="">{{'kChangeState'|translate}}</a>