summaryrefslogtreecommitdiff
path: root/www/js/FirstUseCtrl.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/FirstUseCtrl.js')
-rw-r--r--www/js/FirstUseCtrl.js139
1 files changed, 63 insertions, 76 deletions
diff --git a/www/js/FirstUseCtrl.js b/www/js/FirstUseCtrl.js
index 02293f77..89f45e96 100644
--- a/www/js/FirstUseCtrl.js
+++ b/www/js/FirstUseCtrl.js
@@ -2,94 +2,81 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console */
-angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory', '$state', 'NVRDataModel', '$rootScope', '$ionicPopup', '$translate', function($scope, $ionicSideMenuDelegate, zm, $stateParams, $ionicHistory, $state, NVRDataModel, $rootScope, $ionicPopup, $translate)
-{
- $scope.openMenu = function()
- {
- $ionicSideMenuDelegate.toggleLeft();
- };
+angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory', '$state', 'NVRDataModel', '$rootScope', '$ionicPopup', '$translate', function ($scope, $ionicSideMenuDelegate, zm, $stateParams, $ionicHistory, $state, NVRDataModel, $rootScope, $ionicPopup, $translate) {
+ $scope.openMenu = function () {
+ $ionicSideMenuDelegate.toggleLeft();
+ };
- //-------------------------------------------------------------------------
- // Controller Main
- //------------------------------------------------------------------------
- $scope.$on('$ionicView.enter', function()
- {
- //console.log("**VIEW ** FirstUse Ctrl Entered");
- $ionicSideMenuDelegate.canDragContent(true);
- // right up here lets set certs to true, we will disable it later
- // this is for first starts
-
- //
- if (window.cordova)
- {
- cordova.plugins.certificates.trustUnsecureCerts(true);
- NVRDataModel.log (">>>>>Accepting all certificates, since its first use");
- }
+ //-------------------------------------------------------------------------
+ // Controller Main
+ //------------------------------------------------------------------------
+ $scope.$on('$ionicView.enter', function () {
+ //console.log("**VIEW ** FirstUse Ctrl Entered");
+ $ionicSideMenuDelegate.canDragContent(true);
+ // right up here lets set certs to true, we will disable it later
+ // this is for first starts
+ //
+ if (window.cordova) {
+ cordova.plugins.certificates.trustUnsecureCerts(true);
+ NVRDataModel.log(">>>>>Accepting all certificates, since its first use");
+ }
- });
- $scope.switchLang = function()
- {
- $scope.lang = NVRDataModel.getLanguages();
- $scope.myopt = {
- lang: ""
- };
+ });
- $rootScope.zmPopup = $ionicPopup.show(
- {
- scope: $scope,
- template: '<ion-radio-fix ng-repeat="item in lang" ng-value="item.value" ng-model="myopt.lang"> {{item.text}} </ion-radio-fix>',
+ $scope.switchLang = function () {
+ $scope.lang = NVRDataModel.getLanguages();
+ $scope.myopt = {
+ lang: ""
+ };
- title: $translate.instant('kSelectLanguage'),
+ $rootScope.zmPopup = $ionicPopup.show({
+ scope: $scope,
+ template: '<ion-radio-fix ng-repeat="item in lang" ng-value="item.value" ng-model="myopt.lang"> {{item.text}} </ion-radio-fix>',
- buttons: [
- {
- text: $translate.instant('kButtonCancel'),
- onTap: function(e)
- {
- //return "CANCEL";
- }
+ title: $translate.instant('kSelectLanguage'),
- },
- {
- text: $translate.instant('kButtonOk'),
- onTap: function(e)
- {
- NVRDataModel.log("Language selected:" + $scope.myopt.lang);
- NVRDataModel.setDefaultLanguage($scope.myopt.lang, true);
+ buttons: [{
+ text: $translate.instant('kButtonCancel'),
+ onTap: function (e) {
+ //return "CANCEL";
+ }
- //return "OK";
+ },
+ {
+ text: $translate.instant('kButtonOk'),
+ onTap: function (e) {
+ NVRDataModel.log("Language selected:" + $scope.myopt.lang);
+ NVRDataModel.setDefaultLanguage($scope.myopt.lang, true);
- }
- }]
- });
+ //return "OK";
- };
+ }
+ }
+ ]
+ });
- $scope.goToLogin = function()
- {
- $ionicHistory.nextViewOptions(
- {
- disableAnimate: false,
- disableBack: true
- });
- $state.go("app.login",
- {
- "wizard": false
- });
- return;
- };
+ };
- $scope.goToWizard = function()
- {
- $ionicHistory.nextViewOptions(
- {
- disableAnimate: false,
- disableBack: true
- });
- $state.go("app.wizard");
- return;
- };
+ $scope.goToLogin = function () {
+ $ionicHistory.nextViewOptions({
+ disableAnimate: false,
+ disableBack: true
+ });
+ $state.go("app.login", {
+ "wizard": false
+ });
+ return;
+ };
+
+ $scope.goToWizard = function () {
+ $ionicHistory.nextViewOptions({
+ disableAnimate: false,
+ disableBack: true
+ });
+ $state.go("app.wizard");
+ return;
+ };
}]);