minor changes

This commit is contained in:
coderaiser 2012-12-18 07:15:57 -05:00
parent 38267102f5
commit ebb023c1ba
3 changed files with 37 additions and 11 deletions

View file

@ -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;

View file

@ -2,6 +2,18 @@
<html>
<head></head>
<body>
<script src=/lib/client/auth.js async></script>
<script>
(function(){
"use strict";
if(window.opener){
var lGitHub = window.opener.CloudCommander.Github;
lGitHub.init(lGitHub.getUserData, window.location.search);
window.close();
}
})();
</script>
</body>
</html>

View file

@ -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
};