summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-04-17 08:37:07 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-04-17 08:37:07 -0400
commit9b96991f06a11513b524e45d06dab0ebbbd26ea7 (patch)
tree9bd9085d522c37021970c39d786bc2e24af16fa3
parenta1bae88bb0b7f75d28e300c5f4935aa1ab88a0b6 (diff)
allow for forcedresumeDelay to wait for network stack, switch to native scrolling (should improve android perf)
Former-commit-id: 4bcb4fa02be69677fd75a2acf84357d8dbfe201c
-rw-r--r--config.xml3
-rw-r--r--www/js/DataModel.js9
-rw-r--r--www/js/app.js65
-rw-r--r--www/templates/devoptions.html9
-rw-r--r--www/templates/events.html18
5 files changed, 64 insertions, 40 deletions
diff --git a/config.xml b/config.xml
index 23780d06..83e46695 100644
--- a/config.xml
+++ b/config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget id="com.pliablepixels.zmninjapro" android-packageName="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.1.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.pliablepixels.zmninjapro" android-packageName="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.1.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>zmNinja</name>
<description>
High performance ZoneMinder client
@@ -11,6 +11,7 @@
<access origin="*" subdomains="true" />
<allow-navigation href="*" />
<allow-intent href="*" />
+ <preference name="CrosswalkAnimatable" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 3633d384..ec2686b4 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -75,6 +75,7 @@ angular.module('zmApp.controllers')
'packeryPositions':'',
'packerySizes':'',
'timelineModalGraphType':'all',
+ 'resumeDelay':300,
};
@@ -451,6 +452,14 @@ angular.module('zmApp.controllers')
loginData.timelineModalGraphType = 'all';
}
+ if (typeof loginData.resumeDelay == 'undefined')
+ {
+ zmDebug ("resumeDelay does not exist. Setting to 0");
+ loginData.resumeDelay = "0";
+
+ }
+
+
if (typeof loginData.montageHistoryQuality == 'undefined')
{
diff --git a/www/js/app.js b/www/js/app.js
index 603c4867..6f2bf72b 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1248,38 +1248,42 @@ angular.module('zmApp', [
// from foreground to background and back
document.addEventListener("resume", function () {
ZMDataModel.zmLog("App is resuming from background");
- var ld = ZMDataModel.getLogin();
+ var forceDelay = ZMDataModel.getLogin().resumeDelay;
+ ZMDataModel.zmLog (">>> Resume delayed for " + forceDelay + " ms, to wait for network stack...");
+ $timeout (function () {
+ var ld = ZMDataModel.getLogin();
- ZMDataModel.setBackground(false);
- // don't animate
- $ionicHistory.nextViewOptions({
- disableAnimate: true,
- disableBack: true
- });
- // remember the last state so we can
- // go back there after auth
- if ($ionicHistory.currentView) {
- $rootScope.lastState = $ionicHistory.currentView().stateName;
- $rootScope.lastStateParam =
- $ionicHistory.currentView().stateParams;
- ZMDataModel.zmDebug("Last State recorded:" +
- JSON.stringify($ionicHistory.currentView()));
-
- if ($rootScope.lastState == "zm-portal-login") {
- ZMDataModel.zmDebug("Last state was portal-login, so forcing montage");
- $rootScope.lastState = "montage";
+ ZMDataModel.setBackground(false);
+ // don't animate
+ $ionicHistory.nextViewOptions({
+ disableAnimate: true,
+ disableBack: true
+ });
+
+ // remember the last state so we can
+ // go back there after auth
+ if ($ionicHistory.currentView) {
+ $rootScope.lastState = $ionicHistory.currentView().stateName;
+ $rootScope.lastStateParam =
+ $ionicHistory.currentView().stateParams;
+ ZMDataModel.zmDebug("Last State recorded:" +
+ JSON.stringify($ionicHistory.currentView()));
+
+ if ($rootScope.lastState == "zm-portal-login") {
+ ZMDataModel.zmDebug("Last state was portal-login, so forcing montage");
+ $rootScope.lastState = "montage";
+ }
+
+ ZMDataModel.zmDebug ("going to portal login");
+ $state.go("zm-portal-login");
+ } else {
+ $rootScope.lastState = "";
+ $rootScope.lastStateParam = "";
+ ZMDataModel.zmDebug ("reset lastState to null");
}
-
- ZMDataModel.zmDebug ("going to portal login");
- $state.go("zm-portal-login");
- } else {
- $rootScope.lastState = "";
- $rootScope.lastStateParam = "";
- ZMDataModel.zmDebug ("reset lastState to null");
- }
-
+ }, forceDelay);
//$ionicSideMenuDelegate.toggleLeft(false);
@@ -1357,7 +1361,7 @@ angular.module('zmApp', [
//------------------------------------------------------------------
// My route map connecting menu options to their respective templates and controllers
-.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide) {
+.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide,$compileProvider) {
// This is an exception interceptor so it can show up in app logs
@@ -1383,7 +1387,8 @@ angular.module('zmApp', [
//$httpProvider.defaults.withCredentials = true;
$httpProvider.interceptors.push('timeoutHttpIntercept');
$ionicConfigProvider.navBar.alignTitle('center');
- //$ionicConfigProvider.scrolling.jsScrolling(false);
+ $ionicConfigProvider.scrolling.jsScrolling(false);
+ $compileProvider.debugInfoEnabled(false);
$stateProvider
.state('app', {
diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html
index 0996b6d3..f592f268 100644
--- a/www/templates/devoptions.html
+++ b/www/templates/devoptions.html
@@ -82,6 +82,15 @@
</div>
<div class="item item-input-inset">
+ resume delay(ms)&nbsp;
+ <label class="item-input-wrapper">
+ <input type="tel" placeholder="" ng-model="loginData.resumeDelay">
+
+ </label>
+
+ </div>
+
+ <div class="item item-input-inset">
Event Montage image scale(%)&nbsp;
<label class="item-input-wrapper">
<input type="tel" placeholder="" ng-model="loginData.montageHistoryQuality">
diff --git a/www/templates/events.html b/www/templates/events.html
index bd1ee03a..a0170112 100644
--- a/www/templates/events.html
+++ b/www/templates/events.html
@@ -41,9 +41,9 @@
<ion-item collection-repeat="event in events| filter:search.text" item-height="event.Event.height" id="item-{{$index}}" >
- <span style="float:right;margin-top:-18px;background-color:#6d0909;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-clock"></i>&nbsp;&nbsp;{{prettifyTime(event.Event.StartTime)}}</span>
+ <span style="float:right;margin-top:-18px;background-color:#6d0909;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-clock"></i>&nbsp;&nbsp;{{::prettifyTime(event.Event.StartTime)}}</span>
- <span style="float:left;margin-top:-18px;background-color:#444444;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-calendar"></i>&nbsp;&nbsp;{{prettifyDate(event.Event.StartTime)}}</span>
+ <span style="float:left;margin-top:-18px;background-color:#444444;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-calendar"></i>&nbsp;&nbsp;{{::prettifyDate(event.Event.StartTime)}}</span>
<div class="row">
@@ -80,27 +80,27 @@
<br/>
<span style="font-size:80%; color:rgb(110,110,110)">
- {{event.Event.Length}}s
+ {{::event.Event.Length}}s
</span>
</div>
<!-- col col left-->
<div class="col col-80">
<div class="item-text-wrap">
<i class="ion-monitor"></i>
- <b>{{event.Event.MonitorName}}</b> ({{event.Event.Name}})
+ <b>{{::event.Event.MonitorName}}</b> ({{::event.Event.Name}})
</div>
- <i class="ion-images"></i> {{event.Event.Frames}} &nbsp;
- <i class="ion-ios-bell-outline"></i> {{event.Event.AlarmFrames}} &nbsp;
- <i class="ion-arrow-graph-up-right"></i> {{event.Event.TotScore}}
+ <i class="ion-images"></i> {{::event.Event.Frames}} &nbsp;
+ <i class="ion-ios-bell-outline"></i> {{::event.Event.AlarmFrames}} &nbsp;
+ <i class="ion-arrow-graph-up-right"></i> {{::event.Event.TotScore}}
</div>
</div>
<!--row-->
<div class="row" style="font-size:80%; color:rgb(110,110,110)">
- <div class="item-text-wrap"><i class="ion-calendar"></i>&nbsp; {{prettify(event.Event.StartTime)}}
+ <div class="item-text-wrap"><i class="ion-calendar"></i>&nbsp; {{::prettify(event.Event.StartTime)}}
<br/>
- <i class="ion-clipboard"></i>&nbsp; {{event.Event.Notes}}
+ <i class="ion-clipboard"></i>&nbsp; {{::event.Event.Notes}}
<!-- <br/> Default video:{{event.Event.relativePath}}{{event.Event.DefaultVideo}}-->
</div>
</div>