diff --git a/accountant/frontend/static/js/app.js b/accountant/frontend/static/js/app.js index 632a59d..f4e69b2 100644 --- a/accountant/frontend/static/js/app.js +++ b/accountant/frontend/static/js/app.js @@ -16,23 +16,23 @@ */ var accountantApp = angular.module("accountantApp", [ 'ngResource', 'ngRoute', - "mgcrea.ngStrap", - "highcharts-ng", - "http-auth-interceptor", + 'mgcrea.ngStrap', + 'highcharts-ng', + 'http-auth-interceptor', 'ui-notification', - "Storage.Service", - "xeditable" + 'Storage.Service', + 'xeditable' ]) -.factory("sessionInjector", ["$storage", function($storage) { +.factory('sessionInjector', ['$storage', function($storage) { var sessionInjector = { request : function(config) { var token = $storage.get('token'); if(token) { var token_type = $storage.get('token_type'); - var authorization = token_type + " " + token; config.headers["Authorization"] = authorization; + var authorization = token_type + ' ' + token; } return config; } @@ -98,8 +98,8 @@ var accountantApp = angular.module("accountantApp", [ editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default' }) -.controller("MainController", [ - "$scope", "$rootScope", "$http", "authService", "$storage", +.controller('MainController', [ + '$scope', '$rootScope', '$http', 'authService', '$storage', function($scope, $rootScope, $http, authService, $storage) { $scope.dialogShown = false; @@ -114,36 +114,36 @@ var accountantApp = angular.module("accountantApp", [ $storage.clear(); bootbox.dialog({ - title: "Authentification requise", - message: '
' + - '
' + - ' ' + - '
' + - ' ' + + title: 'Authentification requise', + message: '' + + '
' + + ' ' + + '
' + + ' ' + '
' + '
' + - '
' + - ' ' + - '
' + - ' ' + + '
' + + ' ' + + '
' + + ' ' + '
' + '
' + '
' + '', buttons: { login: { - label: "Login", - className: "btn-primary", + label: 'Login', + className: 'btn-primary', callback: function(result) { $scope.dialogShown = false; var email = $('#email').val(); var password = $('#password').val(); $http.post( - "/api/user/login", + '/api/user/login', { - "email": email, - "password": password + 'email': email, + 'password': password } ).success(function(result) { // TODO Alexis Lahouze 2015-08-28 Handle callback. @@ -157,10 +157,10 @@ var accountantApp = angular.module("accountantApp", [ } }, cancel: { - label: "Annuler", - className: "btn-default", + label: 'Annuler', + className: 'btn-default', callback: function(result) { - authService.loginCancelled(null, "Login cancelled by user action."); + authService.loginCancelled(null, 'Login cancelled by user action.'); $scope.dialogShown = false; } } @@ -168,7 +168,7 @@ var accountantApp = angular.module("accountantApp", [ }); }; - $rootScope.$on("event:auth-loginRequired", $scope.showLoginForm); + $rootScope.$on('event:auth-loginRequired', $scope.showLoginForm); }]) ;