diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/external/AppDelegate.m | 124 | ||||
| -rw-r--r-- | www/index.html | 2 | ||||
| -rw-r--r-- | www/js/LoginCtrl.js | 3 | ||||
| -rwxr-xr-x | www/js/app.js | 5 |
4 files changed, 14 insertions, 120 deletions
diff --git a/www/external/AppDelegate.m b/www/external/AppDelegate.m index 0b13600a..3b5c47fa 100644 --- a/www/external/AppDelegate.m +++ b/www/external/AppDelegate.m @@ -28,133 +28,19 @@ #import "AppDelegate.h" #import "MainViewController.h" -#import <Cordova/CDVPlugin.h> - @implementation AppDelegate -@synthesize window, viewController; - -- (id)init -{ - /** If you need to do any extra app-specific initialization, you can do it here - * -jm - **/ - NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - - [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; - - int cacheSizeMemory = 8 * 1024 * 1024; // 8MB - int cacheSizeDisk = 32 * 1024 * 1024; // 32MB -#if __has_feature(objc_arc) - NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"]; -#else - NSURLCache* sharedCache = [[[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"] autorelease]; -#endif - [NSURLCache setSharedURLCache:sharedCache]; - - self = [super init]; - return self; -} - -#pragma mark UIApplicationDelegate implementation - -/** - * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up) - */ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - CGRect screenBounds = [[UIScreen mainScreen] bounds]; - -#if __has_feature(objc_arc) - self.window = [[UIWindow alloc] initWithFrame:screenBounds]; -#else - self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease]; -#endif - self.window.autoresizesSubviews = YES; - -#if __has_feature(objc_arc) - self.viewController = [[MainViewController alloc] init]; -#else - self.viewController = [[[MainViewController alloc] init] autorelease]; -#endif - - // Set your app's start page by setting the <content src='foo.html' /> tag in config.xml. - // If necessary, uncomment the line below to override it. - // self.viewController.startPage = @"index.html"; - - // NOTE: To customize the view's frame size (which defaults to full screen), override - // [self.viewController viewWillAppear:] in your view controller. - - self.window.rootViewController = self.viewController; - [self.window makeKeyAndVisible]; - - return YES; -} - -// this happens while we are running ( in the background, or from within our own app ) -// only valid if zmNinja-Info.plist specifies a protocol to handle -- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation -{ - if (!url) { - return NO; - } - - // all plugins will get the notification, and their handlers will be called - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; - - return YES; -} - -// repost all remote and local notification using the default NSNotificationCenter so multiple plugins may respond -- (void) application:(UIApplication*)application - didReceiveLocalNotification:(UILocalNotification*)notification -{ - // re-post ( broadcast ) - [[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification]; -} - -#ifndef DISABLE_PUSH_NOTIFICATIONS - - - (void) application:(UIApplication*)application - didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken - { - // re-post ( broadcast ) - NSString* token = [[[[deviceToken description] - stringByReplacingOccurrencesOfString:@"<" withString:@""] - stringByReplacingOccurrencesOfString:@">" withString:@""] - stringByReplacingOccurrencesOfString:@" " withString:@""]; - - [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token]; - } - - - (void) application:(UIApplication*)application - didFailToRegisterForRemoteNotificationsWithError:(NSError*)error - { - // re-post ( broadcast ) - [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error]; - } -#endif - -- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window -{ - // iPhone doesn't support upside down by default, while the iPad does. Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected). - NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown); - - return supportedInterfaceOrientations; -} - -- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application -{ - [[NSURLCache sharedURLCache] removeAllCachedResponses]; + self.viewController = [[MainViewController alloc] init]; + return [super application:application didFinishLaunchingWithOptions:launchOptions]; } @end -// credit: http://ivancevich.me/articles/ignoring-invalid-ssl-certificates-on-cordova-android-ios/ - @implementation NSURLRequest(DataController) -+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host + + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host { - return YES; + return YES; } -@end +@end diff --git a/www/index.html b/www/index.html index 7da97e38..3ba46aa2 100644 --- a/www/index.html +++ b/www/index.html @@ -4,7 +4,7 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> - <meta http-equiv="Content-Security-Policy" content="img-src * blob: android-webview-video-poster: cdvphotolibrary: 'self' data:; default-src * blob: 'self' gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"> + <meta http-equiv="Content-Security-Policy" content="img-src * blob: android-webview-video-poster: cdvphotolibrary: 'self' data:; default-src * blob: 'self' gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src * http: https: ws: wss:;"> <title></title> <meta name="format-detection" content="telephone=no"> <link rel="stylesheet" href="css/animate.min.css"> diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 5424dbd4..300e4fbf 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -638,9 +638,12 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r // lets logout NVRDataModel.debug("Logging out of current session..."); $rootScope.authSession = "undefined"; + + $http( { method: 'POST', + timeout:10000, //withCredentials: true, url: $scope.loginData.url + '/index.php', headers: diff --git a/www/js/app.js b/www/js/app.js index f7bc5e69..9d8e4994 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -623,6 +623,7 @@ angular.module('zmApp', [ .factory('timeoutHttpIntercept', ['$rootScope', '$q', 'zm', '$injector', function($rootScope, $q, zm, $injector) { $rootScope.zmCookie = ""; + //console.log ("HHHHHHHHHHHHHH**************************"); return { @@ -1514,6 +1515,8 @@ angular.module('zmApp', [ $rootScope.platformOS = "desktop"; NVRDataModel.log("Device is ready"); + + // var ld = NVRDataModel.getLogin(); if ($ionicPlatform.is('ios')) $rootScope.platformOS = "ios"; @@ -1821,6 +1824,8 @@ angular.module('zmApp', [ NVRDataModel.log("Setting up POST LOGIN timer"); zmAutoLogin.start(); setupPauseAndResume(); + + } } |
