diff --git a/client/js/app.js b/client/js/app.js index 96997eb..451df66 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -1,8 +1,13 @@ -// Declare main app +/** + * The main app module instance + * @type angular.module.angular-1_3_6_L1749.moduleInstance + */ var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize']); - +/** + * Configure the router + */ mainApp.config(['$routeProvider', function($routeProvider){ $routeProvider. when('/home',{ diff --git a/client/js/controllers/home/main.js b/client/js/controllers/home/main.js index 2898de2..e629779 100644 --- a/client/js/controllers/home/main.js +++ b/client/js/controllers/home/main.js @@ -1,9 +1,8 @@ -/* - * home Controller +/** + * The home controller + * + * @param {$scope} $scope The $scope service from angular */ - - - mainApp.controller('homeCtrl', function ($scope) { diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js index 3447ab1..751bd09 100644 --- a/client/js/controllers/login.js +++ b/client/js/controllers/login.js @@ -1,7 +1,11 @@ /** - * Represents a book. - * @constructor + * The login controler + * @param {$scope} $scope The $scope angular service + * @param {$sce} $sce The $sce angular service + * @param {$http} $http The $http angular service + * @param {sharedProfile} sharedProfile The sharedProfile service + */ mainApp.controller('loginCtrl', ['$scope','$sce','$http', 'sharedProfile', function ($scope,$sce, $http, sharedProfile) { diff --git a/client/js/controllers/network/main.js b/client/js/controllers/network/main.js index 6c916ae..7264aec 100644 --- a/client/js/controllers/network/main.js +++ b/client/js/controllers/network/main.js @@ -1,9 +1,8 @@ -/* - * network Controller +/** + * The network controller + * + * @param {$scope} $scope The $scope service from angular */ - - - mainApp.controller('networkCtrl', function ($scope) { }); \ No newline at end of file diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index 4ffdb6b..ce6882e 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -1,11 +1,11 @@ -/* - * mainApp Controller + + +/** + * The status controller + * + * @param {$scope} $scope The $scope service from angular + * @param {sharedProfile} sharedProfile The sharedProfile build by ourself */ - - - - - mainApp.controller('statusCtrl', ['$scope','sharedProfile', function ($scope, sharedProfile) { $scope.profile=sharedProfile; diff --git a/client/js/requests/identity.js b/client/js/requests/identity.js index d34af53..b2c7273 100644 --- a/client/js/requests/identity.js +++ b/client/js/requests/identity.js @@ -1,21 +1,43 @@ -// Make Namespace +/** + * Client Identity Module + * @namespace identity + */ var identity = {}; -identity.request = {}; // Request part -identity.requestParser = {}; // Parser part + +/** + * Contain all request who can be send with http request + * @namespace request + */ +identity.request = {}; + +/** + * Contain parser for result of request made by {@link identity.request} + * @namespace request + */ +identity.requestParser = {}; - -identity.request.login=function($http,username, password,projectname){ - var requestResultObject={}; - +/** + * + * @param {object} $http Angular $http service + * @param {string} username The user name + * @param {string} password The user password + * @param {string} projectname The user project name + * @returns {promise} The result of the request + */ +identity.request.login=function($http,username, password,projectname){ return $http.post('../server/index.php', $.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}), {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}); }; - +/** + * + * @param {string} response The response to parse + * @returns {requestParserResult} Formated data + */ identity.requestParser.parseLoginAnswer=function(response){ var requestParserResult={}; diff --git a/client/js/services/sharedProfile.js b/client/js/services/sharedProfile.js index 2a5ab83..6e78cf6 100644 --- a/client/js/services/sharedProfile.js +++ b/client/js/services/sharedProfile.js @@ -1,6 +1,8 @@ - - +/** + * The sharedProfile service + * It's used to shared the profile between controller + */ mainApp.factory('sharedProfile',[function(){ var profile={};