Run js-beautify and fixjsstyle on code
Found this pointer on stackoverflow:
https://stackoverflow.com/a/31660434/5508494
End goal is to get the code formatted well enough that
clang format will run correctly against it.
Change-Id: I80053e78d253d8eee49233e42d55e5807ae8fdc8
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/app/common/services/apiInterceptor.js b/app/common/services/apiInterceptor.js
index de344cd..b3f2ff4 100644
--- a/app/common/services/apiInterceptor.js
+++ b/app/common/services/apiInterceptor.js
@@ -7,60 +7,61 @@
*/
-window.angular && (function (angular) {
- 'use strict';
+window.angular && (function(angular) {
+ 'use strict';
- angular
- .module('app.common.services')
- .service('apiInterceptor', ['$q', '$rootScope', 'dataService', function($q, $rootScope, dataService){
- return {
- 'request': function(config){
- dataService.loading = true;
- // If caller has not defined a timeout, set to default of 20s
- if (config.timeout == null){
- config.timeout = 20000;
- }
- return config;
- },
- 'response': function(response){
- dataService.loading = false;
+ angular
+ .module('app.common.services')
+ .service('apiInterceptor', ['$q', '$rootScope', 'dataService', function($q, $rootScope, dataService) {
+ return {
+ 'request': function(config) {
+ dataService.loading = true;
+ // If caller has not defined a timeout, set to default of 20s
+ if (config.timeout == null) {
+ config.timeout = 20000;
+ }
+ return config;
+ },
+ 'response': function(response) {
+ dataService.loading = false;
- //not interested in template requests
- if(!/^https?\:/i.test(response.config.url)){
- return response;
- }
+ //not interested in template requests
+ if (!/^https?\:/i.test(response.config.url)) {
+ return response;
+ }
- dataService.last_updated = new Date();
- if(!response){
- dataService.server_unreachable = true;
- }else{
- dataService.server_unreachable = false;
- }
+ dataService.last_updated = new Date();
+ if (!response) {
+ dataService.server_unreachable = true;
+ }
+ else {
+ dataService.server_unreachable = false;
+ }
- if(response && response.status == 'error' &&
- dataService.path != '/login'){
- $rootScope.$emit('timedout-user', {});
- }
+ if (response && response.status == 'error' &&
+ dataService.path != '/login') {
+ $rootScope.$emit('timedout-user', {});
+ }
- return response;
- },
- 'responseError': function(rejection){
- if (dataService.ignoreHttpError === false)
- {
- // If unauthorized, log out
- if (rejection.status == 401){
- if (dataService.path != '/login'){
- $rootScope.$emit('timedout-user', {});
- }
- } else if (rejection.status == -1){
- dataService.server_unreachable = true;
- }
+ return response;
+ },
+ 'responseError': function(rejection) {
+ if (dataService.ignoreHttpError === false) {
+ // If unauthorized, log out
+ if (rejection.status == 401) {
+ if (dataService.path != '/login') {
+ $rootScope.$emit('timedout-user', {});
+ }
+ }
+ else if (rejection.status == -1) {
+ dataService.server_unreachable = true;
+ }
- dataService.loading = false;
- }
- return $q.reject(rejection);
- }
- };
- }]);
+ dataService.loading = false;
+ }
+ return $q.reject(rejection);
+ }
+ };
+ }]);
})(window.angular);