summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/external/angular-carousel.js2
-rw-r--r--www/js/EventCtrl.js4
-rw-r--r--www/js/TimelineCtrl.js2
-rw-r--r--www/js/app.js109
-rw-r--r--www/templates/login.html4
-rw-r--r--www/templates/zm-portal-login.html1
6 files changed, 47 insertions, 75 deletions
diff --git a/www/external/angular-carousel.js b/www/external/angular-carousel.js
index 04b91455..9dcdf491 100644
--- a/www/external/angular-carousel.js
+++ b/www/external/angular-carousel.js
@@ -67,7 +67,7 @@ angular.module('angular-carousel')
if (attrs.hasOwnProperty('rnCarouselPauseOnHover') && attrs.rnCarouselPauseOnHover !== 'false'){
// PP - added touchend to make it react to touch devices
- if (attrs.hasOwnProperty('rnPlatform') && attrs.rnPlatform == 'unknown')
+ if (attrs.hasOwnProperty('rnPlatform') && attrs.rnPlatform == 'desktop')
{
console.log ("ranPlatform is " + attrs.rnPlatform);
console.log ("Desktop, de-registering any old click");
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index 001e98ea..cc0abf1c 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -90,7 +90,7 @@ angular.module('zmApp.controllers')
$scope.eventCommands = eventCommands;
$scope.loginData = ZMDataModel.getLogin();
$scope.playbackURL = $scope.loginData.url;
- if ($rootScope.platformOS == "unknown") {
+ if ($rootScope.platformOS == "desktop") {
$scope.playbackURL = zm.desktopUrl;
}
@@ -1151,7 +1151,7 @@ angular.module('zmApp.controllers')
$scope.videoObject = event.Event.video;
$scope.playbackURL = $scope.loginData.url;
- if ($rootScope.platformOS == "unknown") {
+ if ($rootScope.platformOS == "desktop") {
$scope.playbackURL = zm.desktopUrl;
}
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js
index 75779aff..7319f671 100644
--- a/www/js/TimelineCtrl.js
+++ b/www/js/TimelineCtrl.js
@@ -126,7 +126,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla
console.log ("**** defaultVideo is " + evideo);
$scope.playbackURL = $scope.loginData.url;
- if ($rootScope.platformOS == "unknown") {
+ if ($rootScope.platformOS == "desktop") {
$scope.playbackURL = zm.desktopUrl;
}
diff --git a/www/js/app.js b/www/js/app.js
index baeaa51f..eda3db27 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -207,15 +207,15 @@ angular.module('zmApp', [
'request': function (config) {
- if ($rootScope.platformOS == "unknown")
+ if ($rootScope.platformOS == "desktop")
{
var zmD = $injector.get('ZMDataModel');
var ld = zmD.getLogin();
-
// This takes care of url and apiurl as they have
// the same base
- if (config.url.indexOf(ld.url) > -1)
+ if (ld.url !="" && config.url.indexOf(ld.url) > -1)
{
+
zmD.zmDebug("Running in desktop, removing URLs for proxy");
zmD.zmDebug ("OLD URL " + config.url);
config.url = config.url.replace(ld.url,zm.desktopUrl);
@@ -507,7 +507,7 @@ angular.module('zmApp', [
.run(function ($ionicPlatform, $ionicPopup, $rootScope, zm, $state, $stateParams, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, $fileLogger, $timeout, $ionicHistory, $window, $ionicSideMenuDelegate, EventServer,$ionicContentBanner) {
- //$cordovaPush
+
$rootScope.zmGlobalCookie = "";
$rootScope.isEventFilterOn = false;
@@ -522,33 +522,16 @@ angular.module('zmApp', [
$rootScope.tappedNotification = 0;
//var eventsToDisplay=[];
$rootScope.alarmCount="0";
- $rootScope.platformOS="unknown";
+ $rootScope.platformOS="desktop";
- //console.log ("HERE");
-
- if ($ionicPlatform.is('ios'))
- $rootScope.platformOS = "ios";
-
-
- if ($ionicPlatform.is('android'))
- $rootScope.platformOS = "android";
-
- ZMDataModel.init();
- EventServer.init();
- // for making sure we canuse $state.go with ng-click
- // needed for views that use popovers
- $rootScope.$state = $state;
- $rootScope.$stateParams = $stateParams;
-
- var loginData = ZMDataModel.getLogin();
- //$rootScope.exceptionMessage({reason:exception, cause:cause});
$rootScope.exceptionMessage = function(error)
{
ZMDataModel.zmDebug("**EXCEPTION**"+error.reason+" caused by " + error.cause);
};
+
// This code takes care of trapping the Android back button
// and takes it to the menu.
$ionicPlatform.registerBackButtonAction(function (e) {
@@ -575,6 +558,10 @@ angular.module('zmApp', [
};
window.addEventListener("resize", checkOrientation, false);
+
+ //---------------------------------------------------------------------------
+ // authorize state transitions
+ //----------------------------------------------------------------------------
$rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
var requireLogin = toState.data.requireLogin;
@@ -609,28 +596,35 @@ angular.module('zmApp', [
});
- /*
- function successHandler(result) {
- console.log("************** Token: " + result.gcm);
-}
- function errorHandler(error) {
- console.log("************** Error: " + error);
-}
-
-
- window.onNotification = function(notification)
- {
- console.log ("******** HOLY GOT MESSAGE " + JSON.stringify(notification));
- };
-*/
+ //---------------------------------------------------------------------
+ // called when device is ready
+ //---------------------------------------------------------------------
$ionicPlatform.ready(function () {
-
+ $rootScope.platformOS = "desktop";
ZMDataModel.zmLog("Device is ready");
var ld = ZMDataModel.getLogin();
+ if ($ionicPlatform.is('ios'))
+ $rootScope.platformOS = "ios";
+
+
+ if ($ionicPlatform.is('android'))
+ $rootScope.platformOS = "android";
+
+ console.log ("**** You are running on " + $rootScope.platformOS);
+
+ ZMDataModel.init();
+ EventServer.init();
+ // for making sure we canuse $state.go with ng-click
+ // needed for views that use popovers
+ $rootScope.$state = $state;
+ $rootScope.$stateParams = $stateParams;
+
+ // var loginData = ZMDataModel.getLogin();
+
$fileLogger.checkFile().then(function (resp) {
@@ -643,31 +637,7 @@ angular.module('zmApp', [
console.log("Log file size is " + resp.size + " bytes");
}
- // ZMDataModel.zmLog ("Setting up zmNinja for push notifications");
-
- /* $ionicPush.init({
- "debug": true,
- "onNotification": function(notification) {
- var payload = notification.payload;
- console.log("************PUSH PAYLOAD************" + notification, payload);
- },
- "onRegister": function(data) {
- console.log("********** PUSH REGISTER *************" + data.token);
- },
- "pluginConfig": {
- "ios": {
- "badge": true,
- "sound": true
- },
- "android": {
- "iconColor": "#343434"
- }
- }
-
- });
-
- $ionicPush.register();*/
-
+
});
@@ -710,7 +680,8 @@ angular.module('zmApp', [
$rootScope.devWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width);
$rootScope.devHeight = ((window.innerHeight > 0) ? window.innerHeight : screen.height);
- console.log("********Computed Dev Width & Height as" + $rootScope.devWidth + "*" + $rootScope.devHeight);
+ console.log("********Computed Dev Width & Height as" + $rootScope.devWidth + "*" +
+ $rootScope.devHeight);
// What I noticed is when I moved the app to the device
// the montage screens were not redrawn after resuming from background mode
@@ -784,16 +755,16 @@ angular.module('zmApp', [
StatusBar.styleDefault();
}
-
-
- }); //platformReady
-
-
// lets POST so we get a session ID right hre
console.log("Setting up POST LOGIN timer");
zmAutoLogin.start();
+
+ }); //platformReady
+
+
+
}) //run
diff --git a/www/templates/login.html b/www/templates/login.html
index 64c1bca6..99f06b8c 100644
--- a/www/templates/login.html
+++ b/www/templates/login.html
@@ -71,7 +71,7 @@
- <div ng-if="$root.platformOS != 'unknown'">
+ <div ng-if="$root.platformOS != 'desktop'">
<label>
<ion-toggle ng-model="loginData.usePin" ng-change="pinPrompt();"
@@ -86,7 +86,7 @@
toggle-class="toggle-calm">Use SSL</ion-toggle>
</label>
- <div ng-if="$root.platformOS != 'unknown'">
+ <div ng-if="$root.platformOS != 'desktop'">
<label>
<ion-toggle ng-model="loginData.keepAwake"
diff --git a/www/templates/zm-portal-login.html b/www/templates/zm-portal-login.html
index 2ee7d2e5..67927269 100644
--- a/www/templates/zm-portal-login.html
+++ b/www/templates/zm-portal-login.html
@@ -1,3 +1,4 @@
+
<ion-view view-title="zmNinja" hide-nav-bar="true" hide-back-button="true" cache-view="false">
<!--<ion-view view-title="zmNinja" hide-nav-bar="false" hide-back-button="true" cache-view="false">-->
<ion-content class="pin-background" scroll="false">