summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-06-24 18:47:42 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-06-24 18:47:42 -0400
commit855a0e8ddc273b58066530a1b55a946021dfc56e (patch)
tree26550033e855a31a265fc2da4da3df0cc2733dc1 /www/js/app.js
parentd442629aa825aab6bc55ab6be19e3aba060867fe (diff)
Cleaned up code, commented, preparing for HTTPS via CordovaHTTP
Diffstat (limited to 'www/js/app.js')
-rw-r--r--www/js/app.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 463e15d4..76b14c66 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -7,13 +7,15 @@
angular.module('zmApp', [
'ionic',
'zmApp.controllers',
+ //'cordovaHTTP'
])
-
+//------------------------------------------------------------------
// this directive will be load any time an image completes loading
// via img tags where this directive is added (I am using this in
// events and mionitor view to show a loader while the image is
// downloading from ZM
+//------------------------------------------------------------------
.directive('imageonload', function () {
return {
@@ -29,14 +31,14 @@ angular.module('zmApp', [
};
})
-
+//------------------------------------------------------------------
// In Android, HTTP requests seem to get stuck once in a while
// It may be a crosswalk issue.
// To tackle this gracefully, I've set up a global interceptor
// If the HTTP request does not complete in 15 seconds, it cancels
// That way the user can try again, and won't get stuck
// Also remember you need to add it to .config
-
+//------------------------------------------------------------------
.factory('timeoutHttpIntercept', function ($rootScope, $q) {
//console.log("*** HTTP INTERCEPTOR CALLED ***");
return {
@@ -60,7 +62,10 @@ angular.module('zmApp', [
};
})
+//-----------------------------------------------------------------
// This service automatically logs into ZM at periodic intervals
+//------------------------------------------------------------------
+
.factory('zmAutoLogin', function($interval, ZMDataModel, $http) {
var zmAutoLoginHandle;
function doLogin()
@@ -151,7 +156,9 @@ angular.module('zmApp', [
})
*/
-
+//------------------------------------------------------------------
+// First run in ionic
+//------------------------------------------------------------------
.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin)
{
@@ -260,6 +267,10 @@ angular.module('zmApp', [
}) //run
+//------------------------------------------------------------------
+// Route configuration
+//------------------------------------------------------------------
+
// My route map connecting menu options to their respective templates and controllers
.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
// If you do this, Allow Origin can't be *