Skip to content

Commit

Permalink
#724 more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Oct 21, 2018
1 parent 5af4141 commit b2933c0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 31 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zmninjapro",
"description": "Home security mobile app for ZoneMinder",
"version":"1.3.026",
"version": "1.3.026",
"displayName": "zmNinja",
"author": "Pliable Pixels",
"license": "custom see LICENSE.md",
Expand Down Expand Up @@ -175,4 +175,4 @@
]
}
}
}
}
8 changes: 1 addition & 7 deletions www/js/DataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,7 @@ angular.module('zmApp.controllers')
// the ZM authors fix this and streamline the access of images
// from APIs, I don't have an option

zmStateGo: function (state, p1, p2) {
if ($rootScope.platformOS == 'desktop')
$state.go(state, p1, p2);
else
$state.go(state, p1, p2);
// $ionicNativeTransitions.stateGo(state, p1, p2);
},


// used when an empty server profile is created
getDefaultLoginObject: function () {
Expand Down
8 changes: 4 additions & 4 deletions www/js/EventCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ angular.module('zmApp.controllers')
$http.get(apiurl)
.then(function (data) {
data = data.data;
NVRDataModel.debug(JSON.stringify(data));
// NVRDataModel.debug(JSON.stringify(data));
$scope.hours = [];
var p = data.results;
for (var key in data.results) {
Expand Down Expand Up @@ -1849,7 +1849,7 @@ angular.module('zmApp.controllers')
$http.get(apiurl)
.then(function (data) {
data = data.data;
NVRDataModel.debug(JSON.stringify(data));
//NVRDataModel.debug(JSON.stringify(data));
$scope.days = [];
var p = data.results;
for (var key in data.results) {
Expand Down Expand Up @@ -1882,7 +1882,7 @@ angular.module('zmApp.controllers')
$http.get(apiurl)
.then(function (data) {
data = data.data;
NVRDataModel.debug(JSON.stringify(data));
// NVRDataModel.debug(JSON.stringify(data));
$scope.weeks = [];
var p = data.results;
for (var key in data.results) {
Expand Down Expand Up @@ -1916,7 +1916,7 @@ angular.module('zmApp.controllers')
$http.get(apiurl)
.then(function (data) {
data = data.data;
NVRDataModel.debug(JSON.stringify(data));
//NVRDataModel.debug(JSON.stringify(data));
$scope.months = [];
var p = data.results;
for (var key in data.results) {
Expand Down
19 changes: 12 additions & 7 deletions www/js/EventModalCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,14 +1064,14 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
if (currentStreamState == streamState.STOPPED || !$scope.eventId) {
stream = "";
} else if (currentStreamState == streamState.SNAPSHOT) {
stream = $scope.loginData.url +
stream = currentEvent.Event.recordingURL +
"/index.php?view=image" +
"&fid=" + $scope.snapshotFrameId +
(!isGlobalFid ? "&eid=" + $scope.eventId : "") +
"&scale=" + $scope.singleImageQuality +
$rootScope.authSession;
} else if (currentStreamState == streamState.ACTIVE) {
stream = $scope.loginData.streamingurl +
stream = currentEvent.Event.streamingURL +
"/nph-zms?source=event&mode=jpeg" +
"&event=" + $scope.eventId + "&frame=1" +
"&replay=" + $scope.currentStreamMode +
Expand All @@ -1082,9 +1082,11 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
}

//console.log ($scope.connKey );
//console.log ("STREAM="+stream);

//console.log ("EID="+$scope.eventId);
if ($rootScope.basicAuthToken && stream) stream += "&basicauth=" + $rootScope.basicAuthToken;

//console.log ("STREAM="+stream);
return stream;

};
Expand Down Expand Up @@ -1131,6 +1133,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
isSnapShotEnabled = true;
currentStreamState = streamState.SNAPSHOT;
if (m.snapshotId) {

$scope.snapshotFrameId = m.snapshotId;

$scope.snapshotFrameId = m.snapshotId;
isGlobalFid = true;
} else {
Expand Down Expand Up @@ -1913,7 +1918,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
tempAlarms = [];
$scope.FrameArray = [];

console.log ("FRAME ARRAY: "+JSON.stringify(data));
//console.log ("FRAME ARRAY: "+JSON.stringify(data));
if (data.event && data.event.Frame) $scope.FrameArray = data.event.Frame;
var ts = 0;

Expand Down Expand Up @@ -1950,7 +1955,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro

if ($rootScope.authSession != 'undefined') frame += $rootScope.authSession;
frame += NVRDataModel.insertBasicAuthToken();
// console.log (frame);
//console.log ("alarm:"+frame);
return frame;
};

Expand Down Expand Up @@ -1982,7 +1987,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
currentEvent = event;
$scope.event = event;

console.log ("prepareModal DATA:"+JSON.stringify(success.data));
// console.log ("prepareModal DATA:"+JSON.stringify(success.data));
computeAlarmFrames(success.data);
$scope.eventWarning = '';

Expand All @@ -1998,7 +2003,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro

event.Event.streamingURL = NVRDataModel.getStreamingURL(event.Event.MonitorId);

event.Event.recordingURL = loginData.url;
event.Event.recordingURL = NVRDataModel.getRecordingURL(event.Event.MonitorId);
event.Event.imageMode = NVRDataModel.getImageMode(event.Event.MonitorId);

//console.log (JSON.stringify( success));
Expand Down
7 changes: 0 additions & 7 deletions www/js/MontageCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,6 @@ angular.module('zmApp.controllers')
"view": 'app.montage'
});


/* $state.transitionTo($state.current, $stateParams, {
reload: true,
inherit: false,
notify: true
});*/

});


Expand Down
1 change: 1 addition & 0 deletions www/js/PortalLoginCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
broadcastHandles.push(pp);

function evaluateTappedNotification() {
NVRDataModel.debug (">>>Inside evaluateNotifications");
var ld = NVRDataModel.getLogin();


Expand Down
4 changes: 2 additions & 2 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ angular.module('zmApp', [
//console.log ("HTTP response");


if (response.data && typeof(response.data) == 'string' && response.data.indexOf("<pre class=\"cake-error\">") != -1) {
if (response.data && typeof(response.data) == 'string' && response.data.startsWith("<pre class=\"cake-error\">")) {
console.log ("cake error detected, attempting fix...");
response.data = JSON.parse(response.data.replace(/<pre class=\"cake-error\">[\s\S]*<\/pre>/,''));
//console.log ("FIXED="+response.data);
Expand Down Expand Up @@ -2350,7 +2350,7 @@ angular.module('zmApp', [
} else {

// work around for cake-error leak
if (succ.data.indexOf("<pre class=\"cake-error\">") != -1) {
if (succ.data.startsWith("<pre class=\"cake-error\">") ) {
logger.debug ("**** Native: cake-error in message, trying fix...");
succ.data = JSON.parse(succ.data.replace(/<pre class=\"cake-error\">[\s\S]*<\/pre>/,''));
}
Expand Down
4 changes: 2 additions & 2 deletions www/templates/events-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
</div>



<img ng-if="!liveFeedMid" image-spinner-src="{{constructStream()}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"
on-double-tap="closeModal();" img-spinner-w="1024" img-spinner-h="768" image-spinner-loader="lines"
imageonload="modalImageLoaded()" on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" />


<div ng-if="liveFeedMid">
<img image-spinner-src="{{loginData.streamingurl}}/nph-zms?mode=jpeg&monitor={{liveFeedMid}}&connkey={{connKey}}{{$root.authSession}}"
<img image-spinner-src="{{currentEvent.Event.streamingURL}}/nph-zms?mode=jpeg&monitor={{liveFeedMid}}&connkey={{connKey}}{{$root.authSession}}"
ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}" on-double-tap="closeModal();"
img-spinner-w="1024" img-spinner-h="768" image-spinner-loader="lines" imageonload="modalImageLoaded()"
on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" />
Expand Down

0 comments on commit b2933c0

Please sign in to comment.