Change double quotes into single quotes.

This commit is contained in:
Alexis Lahouze 2016-02-07 23:30:28 +01:00
parent f97a4a7655
commit f5e914510c

View File

@ -16,23 +16,23 @@
*/ */
var accountantApp = angular.module("accountantApp", [ var accountantApp = angular.module("accountantApp", [
'ngResource', 'ngRoute', 'ngResource', 'ngRoute',
"mgcrea.ngStrap", 'mgcrea.ngStrap',
"highcharts-ng", 'highcharts-ng',
"http-auth-interceptor", 'http-auth-interceptor',
'ui-notification', 'ui-notification',
"Storage.Service", 'Storage.Service',
"xeditable" 'xeditable'
]) ])
.factory("sessionInjector", ["$storage", function($storage) { .factory('sessionInjector', ['$storage', function($storage) {
var sessionInjector = { var sessionInjector = {
request : function(config) { request : function(config) {
var token = $storage.get('token'); var token = $storage.get('token');
if(token) { if(token) {
var token_type = $storage.get('token_type'); var token_type = $storage.get('token_type');
var authorization = token_type + " " + token;
config.headers["Authorization"] = authorization; config.headers["Authorization"] = authorization;
var authorization = token_type + ' ' + token;
} }
return config; return config;
} }
@ -98,8 +98,8 @@ var accountantApp = angular.module("accountantApp", [
editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default' editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default'
}) })
.controller("MainController", [ .controller('MainController', [
"$scope", "$rootScope", "$http", "authService", "$storage", '$scope', '$rootScope', '$http', 'authService', '$storage',
function($scope, $rootScope, $http, authService, $storage) { function($scope, $rootScope, $http, authService, $storage) {
$scope.dialogShown = false; $scope.dialogShown = false;
@ -114,36 +114,36 @@ var accountantApp = angular.module("accountantApp", [
$storage.clear(); $storage.clear();
bootbox.dialog({ bootbox.dialog({
title: "Authentification requise", title: 'Authentification requise',
message: '<form class="form-horizontal">' + message: '<form class=\'form-horizontal\'>' +
' <div class="form-group">' + ' <div class=\'form-group\'>' +
' <label for="email" class="col-sm-4 control-label">Adresse email</label>' + ' <label for=\'email\' class=\'col-sm-4 control-label\'>Adresse email</label>' +
' <div class="col-sm-8">' + ' <div class=\'col-sm-8\'>' +
' <input type="text" class="form-control" id="email" ng-model="email" placeholder="Nom d\'utilisateur">' + ' <input type=\'text\' class=\'form-control\' id=\'email\' ng-model=\'email\' placeholder=\'Nom d\\\'utilisateur\'>' +
' </div>' + ' </div>' +
' </div>' + ' </div>' +
' <div class="form-group">' + ' <div class=\'form-group\'>' +
' <label for="password" class="col-sm-4 control-label">Mot de passe</label>' + ' <label for=\'password\' class=\'col-sm-4 control-label\'>Mot de passe</label>' +
' <div class="col-sm-8">' + ' <div class=\'col-sm-8\'>' +
' <input type="password" class="form-control" id="password" ng-model="password" placeholder="Mot de passe">' + ' <input type=\'password\' class=\'form-control\' id=\'password\' ng-model=\'password\' placeholder=\'Mot de passe\'>' +
' </div>' + ' </div>' +
' </div>' + ' </div>' +
' </div>' + ' </div>' +
'</form>', '</form>',
buttons: { buttons: {
login: { login: {
label: "Login", label: 'Login',
className: "btn-primary", className: 'btn-primary',
callback: function(result) { callback: function(result) {
$scope.dialogShown = false; $scope.dialogShown = false;
var email = $('#email').val(); var email = $('#email').val();
var password = $('#password').val(); var password = $('#password').val();
$http.post( $http.post(
"/api/user/login", '/api/user/login',
{ {
"email": email, 'email': email,
"password": password 'password': password
} }
).success(function(result) { ).success(function(result) {
// TODO Alexis Lahouze 2015-08-28 Handle callback. // TODO Alexis Lahouze 2015-08-28 Handle callback.
@ -157,10 +157,10 @@ var accountantApp = angular.module("accountantApp", [
} }
}, },
cancel: { cancel: {
label: "Annuler", label: 'Annuler',
className: "btn-default", className: 'btn-default',
callback: function(result) { callback: function(result) {
authService.loginCancelled(null, "Login cancelled by user action."); authService.loginCancelled(null, 'Login cancelled by user action.');
$scope.dialogShown = false; $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);
}]) }])
; ;