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
1 changed files with 28 additions and 28 deletions

View File

@ -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: '<form class="form-horizontal">' +
' <div class="form-group">' +
' <label for="email" class="col-sm-4 control-label">Adresse email</label>' +
' <div class="col-sm-8">' +
' <input type="text" class="form-control" id="email" ng-model="email" placeholder="Nom d\'utilisateur">' +
title: 'Authentification requise',
message: '<form class=\'form-horizontal\'>' +
' <div class=\'form-group\'>' +
' <label for=\'email\' class=\'col-sm-4 control-label\'>Adresse email</label>' +
' <div class=\'col-sm-8\'>' +
' <input type=\'text\' class=\'form-control\' id=\'email\' ng-model=\'email\' placeholder=\'Nom d\\\'utilisateur\'>' +
' </div>' +
' </div>' +
' <div class="form-group">' +
' <label for="password" class="col-sm-4 control-label">Mot de passe</label>' +
' <div class="col-sm-8">' +
' <input type="password" class="form-control" id="password" ng-model="password" placeholder="Mot de passe">' +
' <div class=\'form-group\'>' +
' <label for=\'password\' class=\'col-sm-4 control-label\'>Mot de passe</label>' +
' <div class=\'col-sm-8\'>' +
' <input type=\'password\' class=\'form-control\' id=\'password\' ng-model=\'password\' placeholder=\'Mot de passe\'>' +
' </div>' +
' </div>' +
' </div>' +
'</form>',
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);
}])
;