summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-05-24 16:16:28 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-05-24 16:16:28 -0400
commitc4fa763b5b365012756cc86024982232984904c7 (patch)
tree55b050b46ee5e12f737acf144221d9f12df6354d /www/js/app.js
parent6323ad995bc1e301e437d4cc249a1ee75a0d471f (diff)
added PTZ support (well, P for now, but framework with a cool menu is in place)
Diffstat (limited to 'www/js/app.js')
-rw-r--r--www/js/app.js50
1 files changed, 47 insertions, 3 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 7efea0e1..b541128c 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -6,7 +6,7 @@
// core app start stuff
angular.module('zmApp', [
'ionic',
- 'zmApp.controllers'
+ 'zmApp.controllers',
])
@@ -89,7 +89,7 @@ angular.module('zmApp', [
*/
-.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen) {
+.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen, $http) {
ZMDataModel.init();
var loginData = ZMDataModel.getLogin();
@@ -179,11 +179,55 @@ angular.module('zmApp', [
});
+
+
+ // lets POST so we get a session ID right hre
+ // var loginData = ZMDataModel.getLogin();
+
+ console.log ("*** INIT LOGIN ****");
+ $http({
+ method:'POST',
+ url:loginData.url + '/index.php',
+ headers:{
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'Accept': 'application/json',
+ },
+ transformRequest: function (obj) {
+ var str = [];
+ for (var p in obj)
+ str.push(encodeURIComponent(p) + "=" +
+ encodeURIComponent(obj[p]));
+ var foo = str.join("&");
+ console.log("****RETURNING " + foo);
+ return foo;
+ },
+
+ data: {
+ username:loginData.username,
+ password:loginData.password,
+ action:"login",
+ view:"console"
+ }
+ })
+ .success(function(data)
+ {
+ console.log ("**** INIT LOGIN OK");
+ })
+ .error(function(error)
+ {
+ console.log ("**** INIT LOGIN FAILED");
+ });
+
+
+
+
+
})
// 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 *
+ //$httpProvider.defaults.withCredentials = true;
$httpProvider.interceptors.push('timeoutHttpIntercept');
//$httpProvider.interceptors.push('httpAuthIntercept');