From bd81674a85677378b8a6a167439cac92c807dc23 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sat, 6 Feb 2016 12:10:04 +0100 Subject: Add doc --- client/js/requests/identity.js | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'client/js/requests/identity.js') 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 - - -identity.request.login=function($http,username, password,projectname){ - var requestResultObject={}; - +/** + * 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 = {}; + + +/** + * + * @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={}; -- cgit v1.2.3