Skip to content

Commit

Permalink
#91 - initial support - needs formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Dec 7, 2017
1 parent 3d33072 commit da18905
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 7 deletions.
6 changes: 3 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninjapro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.2.507" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninjapro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.2.510" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>zmNinja</name>
<description>
High performance ZoneMinder client
Expand Down Expand Up @@ -101,7 +101,7 @@
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<engine name="ios" spec="4.5.4" />
<engine name="android" spec="6.4.0" />
<engine name="android" spec="^6.3.0" />
<plugin name="com.telerik.plugins.nativepagetransitions" spec="^0.6.5" />
<plugin name="cordova-library-helper" spec="^1.0.4">
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="Save media to your Camera Roll" />
Expand Down Expand Up @@ -144,9 +144,9 @@
<plugin name="cordova-plugin-email" spec="git+https://github.com/pliablepixels/cordova-email-plugin.git" />
<plugin name="cordova-plugin-touch-id" spec="^3.2.0" />
<plugin name="cordova-plugin-android-fingerprint-auth" spec="^1.4.0" />
<plugin name="cordova-plugin-certificates" spec="git+https://github.com/hypery2k/cordova-certificate-plugin.git" />
<plugin name="phonegap-plugin-push" spec="^2.1.1">
<variable name="FCM_VERSION" value="11.0.1" />
</plugin>
<plugin name="cordova-plugin-statusbar" spec="git+https://github.com/apache/cordova-plugin-statusbar.git" />
<plugin name="cordova-plugin-certificates" spec="git+https://github.com/hypery2k/cordova-certificate-plugin.git" />
</widget>
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@
"cordova-plugin-email": {},
"cordova-plugin-touch-id": {},
"cordova-plugin-android-fingerprint-auth": {},
"cordova-plugin-certificates": {},
"phonegap-plugin-push": {
"FCM_VERSION": "11.0.1"
},
"cordova-plugin-statusbar": {}
"cordova-plugin-statusbar": {},
"cordova-plugin-certificates": {}
}
},
"dependencies": {
"EmailComposer": "git+https://github.com/pliablepixels/email-composer.git",
"com.telerik.plugins.nativepagetransitions": "^0.6.5",
"cordova-android": "6.4.0",
"cordova-android": "^6.3.0",
"cordova-custom-config": "^4.0.2",
"cordova-ios": "4.5.4",
"cordova-library-helper": "^1.0.4",
Expand Down
9 changes: 8 additions & 1 deletion www/js/DataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ angular.module('zmApp.controllers')
'hideArchived': false,
'videoPlaybackSpeed': 2,
'enableGIFMP4': false,
'enableThumbs': true,
'enableStrictSSL': false,
'enableSlowLoading': false,
'isFullScreen': false,
Expand Down Expand Up @@ -994,10 +995,16 @@ angular.module('zmApp.controllers')

if (typeof loginData.enableGIFMP4 == 'undefined') {

loginData.enableGIFMP4 = true;
loginData.enableGIFMP4 = false;

}

if (typeof loginData.enableThumbs == 'undefined') {

loginData.enableThumbs = true;

}

if (typeof loginData.enableSlowLoading == 'undefined') {

loginData.enableSlowLoading = false;
Expand Down
37 changes: 37 additions & 0 deletions www/js/EventCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ angular.module('zmApp.controllers')
$scope.typeOfFrames = $translate.instant('kShowTimeDiffFrames');
$scope.outlineMotion = false;
$scope.outlineMotionParam = "";


var eventsListScrubHeight = eventsListScrubHeight;
var eventsListDetailsHeight = eventsListDetailsHeight;


//---------------------------------------------------
// initial code
//---------------------------------------------------
Expand Down Expand Up @@ -148,6 +151,14 @@ angular.module('zmApp.controllers')
eventsListDetailsHeight = parseInt(zm.eventsListDetailsHeight * $rootScope.textScaleFactor);
eventsListScrubHeight = parseInt(zm.eventsListScrubHeight * $rootScope.textScaleFactor);


if (NVRDataModel.getLogin().enableThumbs) {
NVRDataModel.debug ("--> thumbnail means increasing row size");
eventsListScrubHeight=370;
eventsListDetailsHeight=300;

}

NVRDataModel.debug(">>>height of list/scrub set to " + eventsListDetailsHeight + " and " + eventsListScrubHeight);

pageLoaded = false;
Expand Down Expand Up @@ -2682,6 +2693,32 @@ angular.module('zmApp.controllers')

});



$scope.showThumbnail = function (b,f) {


$scope.thumbnailLarge=b+'/index.php?view=image&fid='+f;
$ionicModal.fromTemplateUrl('templates/image-modal.html',
{
scope: $scope,
animation: 'slide-in-up',
id: 'thumbnail',
})
.then(function(modal)
{
$scope.modal = modal;


$scope.modal.show();

var ld = NVRDataModel.getLogin();

});

};


//--------------------------------------------------------
//This is called when we first tap on an event to see
// the feed. It's important to instantiate ionicModal here
Expand Down
1 change: 1 addition & 0 deletions www/lang/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"kEnableNewsUpdates" :"enable news updates",
"kEnableSlowLoading" :"Use large HTTP timeouts",
"kEnableStrictSSL" :"Enable strict SSL check",
"kEnableThumbs" :"Enable thumbnails in events list",
"kEnterPin" :"Enter PIN",
"kError" :"Error",
"kErrorChangingMonitors" :"Error changing monitors. Please check logs",
Expand Down
7 changes: 7 additions & 0 deletions www/templates/devoptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@
</ion-toggle>
</label>


<label>
<ion-toggle ng-model="loginData.enableThumbs" ng-checked="loginData.enableThumbs" toggle-class="toggle-calm"><span class="item-text-wrap">{{'kEnableThumbs' | translate}}
</span>
</ion-toggle>
</label>

<label>
<ion-toggle ng-model="loginData.enableSlowLoading" ng-checked="loginData.enableSlowLoading" toggle-class="toggle-calm"><span class="item-text-wrap">{{'kEnableSlowLoading' | translate}}
</span>
Expand Down
4 changes: 4 additions & 0 deletions www/templates/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
<button ng-if="event.Event.DefaultVideo!='' && event.Event.DefaultVideo!=undefined && $root.platformOS!='desktop' && loginData.enableGIFMP4 " class="button button-small button-clear icon mp4-icon" ng-click="downloadFileToDevice(event.Event.videoPath, event.Event.Id)">
</button>

<!-- thumbnail -->

<img ng-if="loginData.enableThumbs" style="float:right;max-width:150px; max-height:200px;" ng-src="{{event.Event.baseURL}}/index.php?view=image&fid={{event.Event.MaxScoreFrameId}}" on-tap="showThumbnail(event.Event.baseURL,event.Event.MaxScoreFrameId)" />


</div>

Expand Down
5 changes: 5 additions & 0 deletions www/templates/image-modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ion-modal-view cache-view="false" style="background-color:#444444">
<ion-content>
<img on-double-tap="closeModal();" src="{{thumbnailLarge}}" style="display:block; width:100%"/>
</ion-content>
</ion-modal-view>

0 comments on commit da18905

Please sign in to comment.