From f127db0cd5d8efe585027cabed5614bee962fcbc Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 17 Dec 2012 04:42:15 -0500 Subject: [PATCH] from now api url on client readed from config.json --- ChangeLog | 4 +++- lib/client/storage/_github.js | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ac274c0..9c6b8fe6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,9 @@ and Util.setTimeout(pFunction [, pCallBack, pTime]) * Added function getCurrentDir to DOM module. -* Fixed bug with terminal load +* Fixed bug with terminal load. + +* From now api url on client readed from config.json. 2012.12.12, Version 0.1.8 diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index 18f48277..b6cece81 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -3,11 +3,11 @@ var CloudCommander, Util, DOM, $, Github, cb; (function(){ "use strict"; - + var cloudcmd = CloudCommander, Cache = DOM.Cache, - APIURL = '/api/v1', + APIURL, AuthURL = APIURL + '/auth', GitHub_ID, @@ -36,14 +36,15 @@ var CloudCommander, Util, DOM, $, Github, cb; DOM.anyLoadInParallel(lFiles, function(){ console.timeEnd('github load'); DOM.Images.hideLoad(); - + Util.exec(pCallBack); - }); + }); } function setConfig(pCallBack){ cloudcmd.getConfig(function(pConfig){ GitHub_ID = pConfig.github_key; + APIURL = pConfig.api_url; Util.exec(pCallBack); }); } @@ -86,7 +87,7 @@ var CloudCommander, Util, DOM, $, Github, cb; function getUserData(pCallBack){ var lName, - + lShowUserInfo = function(pError, pData){ if(!pError){ lName = pData.name; @@ -96,7 +97,7 @@ var CloudCommander, Util, DOM, $, Github, cb; else DOM.Cache.remove('token'); }; - + User.show(null, lShowUserInfo); Util.exec(pCallBack); @@ -136,7 +137,7 @@ var CloudCommander, Util, DOM, $, Github, cb; public: true }; - + lFiles[pFileName] ={ content: pContent };