refactored

This commit is contained in:
coderaiser 2013-01-28 08:27:54 -05:00
parent a537c56e46
commit ebeffdc16e
8 changed files with 133 additions and 79 deletions

View file

@ -3,22 +3,25 @@
<head></head>
<body>
<script>
(function(){
var Util;
(function(Util){
"use strict";
if(window.opener){
var cloudcmd = window.opener.CloudCommander;
cloudcmd.getConfig(function(pConfig){
var lGitHub = pConfig.github,
GitHub_ID = lGitHub && lGitHub.key;
cloudcmd.getModules(function(pModules){
var lStorage = Util.findObjByNameInArr(pModules, 'storage'),
lGitHub = Util.findObjByNameInArr(lStorage.data, 'GitHub'),
GitHub_ID = lGitHub && lGitHub.key;
window.location =
'https://github.com/login/oauth/authorize?client_id=' +
GitHub_ID + '&&scope=repo,user,gist';
});
}
})();
})(Util);
</script>
</body>
</html>