From ebb023c1baa64984cd9d6524331a9a5079b60ca1 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 18 Dec 2012 07:15:57 -0500 Subject: [PATCH] minor changes --- cloudcmd.js | 5 +++++ html/auth.html | 14 +++++++++++++- lib/client/storage/_github.js | 29 +++++++++++++++++++---------- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index c8b9d521..1ad7c4e3 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -149,6 +149,11 @@ pParams.name = main.HTMLDIR + lName + '.html'; main.sendFile(pParams); lRet = true; + }else if( Util.strCmp(lName, '/auth/github') ){ + Util.log('-> github'); + pParams.name = main.HTMLDIR + lName + '.html'; + main.sendFile(pParams); + lRet = true; } return lRet; diff --git a/html/auth.html b/html/auth.html index 319102e5..5390efe7 100644 --- a/html/auth.html +++ b/html/auth.html @@ -2,6 +2,18 @@ - + \ No newline at end of file diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index fc9a1bf8..1892a137 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -72,7 +72,7 @@ var CloudCommander, Util, DOM, $, Github, cb; Util.exec(pCallBack); } else - Util.log("Worning: token not getted..."); + Util.log('Worning: token not getted...'); }, lData = { type : 'put', @@ -83,14 +83,23 @@ var CloudCommander, Util, DOM, $, Github, cb; DOM.ajax(lData); } - else - window.open('https://github.com/login/oauth/authorize?client_id=' + - GitHub_ID + '&&scope=repo,user,gist', 'Cloud Commander Auth'); - /* - window.location = - 'https://github.com/login/oauth/authorize?client_id=' + - GitHub_ID + '&&scope=repo,user,gist'; - */ + else{ + + var lUrl = '//' + window.location.host + '/auth/github', + left = 140, + top = 187, + width = 1000, + height = 650, + + lOptions = 'left=' + left + + ',top=' + top + + ',width=' + width + + ',height=' + height + + ',personalbar=0,toolbar=0' + + ',scrollbars=1,resizable=1'; + + window.open(lUrl, 'Cloud Commander Auth', lOptions); + } } }; @@ -143,7 +152,7 @@ var CloudCommander, Util, DOM, $, Github, cb; lFiles = {}, lHost = CloudCommander.HOST, lOptions = { - description: "Uplouded by Cloud Commander from " + lHost, + description: 'Uplouded by Cloud Commander from ' + lHost, public: true };