summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2019-12-17 11:01:53 -0500
committerPliable Pixels <pliablepixels@gmail.com>2019-12-17 11:01:53 -0500
commitfb215ba18d415bb00980530eba0a48c3e5216b7e (patch)
tree02031b4ab6d7fed5e3a8f79d3d9006e266fbeb9e /www/js/app.js
parent0ce2be5cb921c979c79091b773f6c80612779bc2 (diff)
#876 custom header
Diffstat (limited to 'www/js/app.js')
-rwxr-xr-xwww/js/app.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/www/js/app.js b/www/js/app.js
index b5c2c6f4..3eb7210f 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -2,14 +2,7 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console,alert,PushNotification, moment ,ionic, URI,Packery, ConnectSDK, CryptoJS, ContactFindOptions, localforage,$, Connection, MobileAccessibility, hello */
-// For desktop versions, this is replaced
-// with actual app version from config.xml by the
-// ./make_desktop.sh script
-// For mobile versions, I use cordova app version plugin
-// to get it at run time
-
-var appVersion = "0.0.0";
// core app start stuff
angular.module('zmApp', [
@@ -662,12 +655,18 @@ angular.module('zmApp', [
request: function (config) {
if (!config) return config;
if (!config.url) return config;
-
+ nvr = $injector.get('NVR');
if ($rootScope.basicAuthHeader) {
config.headers.Authorization = $rootScope.basicAuthHeader;
}
+ var chdr = nvr.getCustomHeader();
+ if (chdr) {
+ config.headers['X-ZmNinja'] = chdr;
+ }
+
+
return config || $q.when(config);
},
@@ -1131,7 +1130,7 @@ angular.module('zmApp', [
-
+
$rootScope.dpadId = 0;
$rootScope.textScaleFactor = 1.0;
$rootScope.isLoggedIn = false;
@@ -1765,11 +1764,16 @@ angular.module('zmApp', [
// console.log("app version");
cordova.getAppVersion.getVersionNumber().then(function (version) {
- appVersion = version;
- NVR.log("App Version: " + appVersion);
- NVR.setAppVersion(appVersion);
+
+ NVR.log("App Version: " + version);
+ NVR.setAppVersion(version);
});
}
+ else {
+ // custom header
+ $rootScope.appVersion = NVR.getAppVersion();
+ }
+
// At this stage, NVR.init is not called yet