You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/06/13 09:49:44 UTC

[2/2] syncope git commit: More fixes to enduser

More fixes to enduser


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/339f9d5d
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/339f9d5d
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/339f9d5d

Branch: refs/heads/master
Commit: 339f9d5d3f996d38c08df57c5ec28135f75dda9f
Parents: 9d15e6f
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Mon Jun 13 11:49:35 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Mon Jun 13 11:49:35 2016 +0200

----------------------------------------------------------------------
 .../main/resources/META-INF/resources/app/index.html   |  1 -
 .../main/resources/META-INF/resources/app/js/app.js    | 11 +++++------
 .../resources/app/js/controllers/UserController.js     | 13 +++++--------
 .../META-INF/resources/app/js/directives/captcha.js    | 12 +++++++-----
 4 files changed, 17 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/339f9d5d/client/enduser/src/main/resources/META-INF/resources/app/index.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/index.html b/client/enduser/src/main/resources/META-INF/resources/app/index.html
index d191570..ebba78a 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/index.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/index.html
@@ -89,7 +89,6 @@ under the License.
     <script src="js/services/resourceService.js"></script>
     <script src="js/services/groupService.js"></script>
     <script src="js/services/anyService.js"></script>
-    <script src="js/services/captchaService.js"></script>
     <!--controllers-->
     <script src="js/controllers/HomeController.js"></script>
     <script src="js/controllers/LoginController.js"></script>

http://git-wip-us.apache.org/repos/asf/syncope/blob/339f9d5d/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
index 780d738..3f356c9 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
@@ -211,11 +211,10 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
     $httpProvider.defaults.headers.common["If-Modified-Since"] = "0";
 
     $httpProvider.interceptors.push(function ($q, $rootScope, $location) {
-      var numLoadings = 0;
       return {
         'request': function (config, a, b) {
           //if the url is an html, we're changing page
-          if (config.url.indexOf('.html', config.url.length - 5) == -1) {
+          if (config.url.indexOf('.html', config.url.length - 5) === -1) {
             $rootScope.$broadcast("xhrStarted");
             var separator = config.url.indexOf('?') === -1 ? '?' : '&';
             config.url = config.url + separator + 'noCache=' + new Date().getTime();
@@ -231,15 +230,15 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
         },
         'responseError': function (response) {
           $rootScope.spinner.off();
-          if (response.config.url.indexOf("acceptError=true") == -1) {
+          if (response.config.url.indexOf("acceptError=true") === -1) {
             var status = response.status;
-            if (status == 401) {
+            if (status === 401) {
               console.error("ERROR ", status);
             }
-            if (status == 403) {
+            if (status === 403) {
               console.error("UNAUTHORIZED ", status);
             }
-            if (status == 400 || status == 404 || status == 412 || status == 500) {
+            if (status === 400 || status === 404 || status === 412 || status === 500) {
               console.error("GENERIC ERROR ", status);
             }
           }

http://git-wip-us.apache.org/repos/asf/syncope/blob/339f9d5d/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
index ad6ea3c..3aa009a 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
@@ -20,11 +20,10 @@
 'use strict';
 
 angular.module("self").controller("UserController", ['$scope', '$rootScope', '$location', '$compile', 'AuthService',
-  'UserSelfService', 'SchemaService', 'RealmService', 'ResourceService', 'SecurityQuestionService', 'CaptchaService',
-  'GroupService', 'AnyService', 'UserUtil', 'GenericUtil', "ValidationExecutor",
+  'UserSelfService', 'SchemaService', 'RealmService', 'ResourceService', 'SecurityQuestionService', 'GroupService',
+  'AnyService', 'UserUtil', 'GenericUtil', "ValidationExecutor",
   function ($scope, $rootScope, $location, $compile, AuthService, UserSelfService, SchemaService, RealmService,
-          ResourceService, SecurityQuestionService, CaptchaService, GroupService, AnyService, UserUtil, GenericUtil,
-          ValidationExecutor) {
+          ResourceService, SecurityQuestionService, GroupService, AnyService, UserUtil, GenericUtil, ValidationExecutor) {
 
     $scope.user = {};
     $scope.confirmPassword = {
@@ -255,8 +254,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l
           }
           if ($scope.user.mustChangePassword) {
             $location.path('/mustchangepassword')
-          }
-          else {
+          } else {
             initProperties();
           }
         }, function (e) {
@@ -395,8 +393,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l
             }
             $scope.showError("Error retrieving user security question: " + errorMessage, $scope.notification);
           });
-        }
-        else {
+        } else {
           $scope.userSecurityQuestion = "";
         }
       }

http://git-wip-us.apache.org/repos/asf/syncope/blob/339f9d5d/client/enduser/src/main/resources/META-INF/resources/app/js/directives/captcha.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/captcha.js b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/captcha.js
index dc52bd8..a2d5938 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/captcha.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/captcha.js
@@ -19,17 +19,17 @@
 'use strict';
 
 angular.module('self')
-        .directive('captcha', function (CaptchaService) {
+        .directive('captcha', function () {
           return {
             restrict: 'E',
             templateUrl: 'views/captcha.html',
             scope: {
               input: "=",
-              captchaEnabled : '=enabled'
+              captchaEnabled: '=enabled'
             },
             controller: function ($scope) {
               $scope.captchaUrl = '';
-                            
+
               //initialize captcha
               $scope.refreshCaptcha = function () {
                 console.debug("REFRESH CAPTCHA")
@@ -38,8 +38,10 @@ angular.module('self')
 
               // initialize captcha
               $scope.refreshCaptcha();
-              
-              $scope.$on("refreshCaptcha", function(){$scope.refreshCaptcha()});
+
+              $scope.$on("refreshCaptcha", function () {
+                $scope.refreshCaptcha()
+              });
             }
           };
         });