You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by gi...@apache.org on 2016/01/21 16:20:03 UTC
syncope git commit: [SYNCOPE-719] Added loading spinner
Repository: syncope
Updated Branches:
refs/heads/master 0f8dbd498 -> f27187cff
[SYNCOPE-719] Added loading spinner
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/f27187cf
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/f27187cf
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/f27187cf
Branch: refs/heads/master
Commit: f27187cff6ad569d8df623e83bd3a2fc1cc08d60
Parents: 0f8dbd4
Author: giacomolm <gi...@hotmail.it>
Authored: Thu Jan 21 16:17:04 2016 +0100
Committer: giacomolm <gi...@hotmail.it>
Committed: Thu Jan 21 16:17:15 2016 +0100
----------------------------------------------------------------------
client/enduser/pom.xml | 4 +++
.../resources/META-INF/resources/app/index.html | 9 ++++--
.../resources/META-INF/resources/app/js/app.js | 32 +++++++++++---------
pom.xml | 12 ++++++--
4 files changed, 37 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/f27187cf/client/enduser/pom.xml
----------------------------------------------------------------------
diff --git a/client/enduser/pom.xml b/client/enduser/pom.xml
index eea3e87..9f02390 100644
--- a/client/enduser/pom.xml
+++ b/client/enduser/pom.xml
@@ -95,6 +95,10 @@ under the License.
<artifactId>angular-cookies</artifactId>
</dependency>
<dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-treasure-overlay-spinner</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.webjars</groupId>
<artifactId>kendo-ui-core</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/f27187cf/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 6ab3b31..f1beecd 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
@@ -43,9 +43,10 @@ under the License.
<span id="notifications" kendo-notification="notifications"></span>
<!--<div ng-view ng-cloak ng-controller="ApplicationController"></div>-->
- <div ui-view ng-cloak ng-controller="ApplicationController" ng-init="initApplication()">
- </div>
-
+ <treasure-overlay-spinner active='spinner.active'>
+ <div ui-view ng-cloak ng-controller="ApplicationController" ng-init="initApplication()">
+ </div>
+ </treasure-overlay-spinner>
<!-- <footer id="footer" class="hidden-print">
<ul class="nav pull-right">
<li>
@@ -73,6 +74,7 @@ under the License.
<script src="../webjars/kendo-ui-core/${kendo-ui-core.version}/js/kendo.ui.core.min.js"></script>
<script src="../webjars/kendo-ui-core/${kendo-ui-core.version}/js/kendo.notification.min.js"></script>
<script src="../webjars/kendo-ui-core/${kendo-ui-core.version}/js/kendo.angular.js"></script>
+ <script src="../webjars/angular-treasure-overlay-spinner/${angular-treasure-overlay-spinner}/dist/treasure-overlay-spinner.min.js"></script>
<script type="text/javascript" src="../webjars/bootstrap-select/${bootstrap-select.version}/js/bootstrap-select.min.js"></script>
<script src="../webjars/FileSaver.js/${FileSaver.version}/FileSaver.js" type="text/javascript"></script>
<!--main angular application-->
@@ -121,6 +123,7 @@ under the License.
<link href="../webjars/angular-ui-select/${angular-ui-select.version}/select.css" rel="stylesheet" type="text/css"/>
<link href="../webjars//kendo-ui-core/${kendo-ui-core.version}/styles/web/kendo.common.core.min.css" rel="stylesheet" type="text/css"/>
<link href="../webjars//kendo-ui-core/${kendo-ui-core.version}/styles/web/kendo.default.min.css" rel="stylesheet" type="text/css"/>
+ <link href="../webjars/angular-treasure-overlay-spinner/${angular-treasure-overlay-spinner}/dist/treasure-overlay-spinner.min.css" rel="stylesheet" type="text/css"/>
<link href="../webjars/select2/${select2.version}/select2.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" type="text/css" />
<link href="css/login.css" rel="stylesheet" type="text/css" />
http://git-wip-us.apache.org/repos/asf/syncope/blob/f27187cf/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 25c16df..b42e015 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
@@ -34,6 +34,7 @@ var app = angular.module('SyncopeEnduserApp', [
'ngAnimate',
'ngResource',
'ngCookies',
+ 'treasure-overlay-spinner',
'kendo.directives',
'home',
'login',
@@ -196,21 +197,15 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
if (config.url.indexOf('.html', config.url.length - 5) == -1) {
$rootScope.$broadcast("xhrStarted");
}
- /*numLoadings++;
- // Show loader
- if (config.url.indexOf("skipLoader=true") == -1) {
- $rootScope.$broadcast("loader_show");
- }*/
+ $rootScope.spinner.on();
return config || $q.when(config);
},
-// 'response': function (response) {
-// if ((--numLoadings) === 0) {
-// // Hide loader
-// $rootScope.$broadcast("loader_hide");
-// }
-// return response || $q.when(response);
-// },
+ 'response': function (response) {
+ $rootScope.spinner.off();
+ return response || $q.when(response);
+ },
'responseError': function (response) {
+ $rootScope.spinner.off();
if (response.config.url.indexOf("acceptError=true") == -1) {
var status = response.status;
if (status == 401) {
@@ -270,6 +265,15 @@ app.run(['$rootScope', '$location', '$cookies', '$state',
// $location.path('/self');
// }
// });
+ $rootScope.spinner = {
+ active: false,
+ on: function () {
+ this.active = true;
+ },
+ off: function () {
+ this.active = false;
+ }
+ };
}]);
app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService', function ($scope, $rootScope,
@@ -317,7 +321,7 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService',
component.show(message, "success");
}
}
- $scope.showError = function (message, component) {
+ $scope.showError = function (message, component) {
if (!$scope.notificationExists(message)) {
component.options.autoHideAfter = 0;
component.show(message, "error");
@@ -370,7 +374,7 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService',
});
//Intercepting xhr start event
$scope.$on('xhrStarted', function (event, next, current) {
- $scope.hideNotifications(0);
+ $scope.hideNotifications(0);
});
}
}]);
http://git-wip-us.apache.org/repos/asf/syncope/blob/f27187cf/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b5aec89..b784b6a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -332,9 +332,9 @@ under the License.
<camel.version>2.16.1</camel.version>
<!-- Cannot upgrade to 2.7.0 because current swagger-jaxrs relies on
- com.fasterxml.jackson.databind.type.TypeFactory.constructType(Type, Class<?>)
- which was removed in 2.7.0
- See https://github.com/swagger-api/swagger-core/issues/1601 -->
+ com.fasterxml.jackson.databind.type.TypeFactory.constructType(Type, Class<?>)
+ which was removed in 2.7.0
+ See https://github.com/swagger-api/swagger-core/issues/1601 -->
<jackson.version>2.6.5</jackson.version>
<spring.version>4.2.4.RELEASE</spring.version>
@@ -404,6 +404,7 @@ under the License.
<angular-ui-bootstrap.version>1.0.3</angular-ui-bootstrap.version>
<angular-ui-select.version>0.13.1</angular-ui-select.version>
<angular-sanitize.version>1.4.8</angular-sanitize.version>
+ <angular-treasure-overlay-spinner>1.1.0</angular-treasure-overlay-spinner>
<kendo-ui-core.version>2014.2.716</kendo-ui-core.version>
<select2.version>3.4.8</select2.version>
<FileSaver.version>0.0.2</FileSaver.version>
@@ -1077,6 +1078,11 @@ under the License.
<version>${angular-sanitize.version}</version>
</dependency>
<dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-treasure-overlay-spinner</artifactId>
+ <version>${angular-treasure-overlay-spinner}</version>
+ </dependency>
+ <dependency>
<groupId>org.webjars</groupId>
<artifactId>kendo-ui-core</artifactId>
<version>${kendo-ui-core.version}</version>