DropBox, GDrive and GitHub modules now look the same

This commit is contained in:
coderaiser 2012-12-21 08:41:49 -05:00
parent 56a8922691
commit bfc4baab0f
7 changed files with 101 additions and 103 deletions

View file

@ -84,21 +84,8 @@ var CloudCommander, Util, DOM, $, Github, cb;
DOM.ajax(lData);
}
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);
var lUrl = '//' + window.location.host + '/auth/github';
DOM.openWindow(lUrl);
}
}
};
@ -142,11 +129,14 @@ var CloudCommander, Util, DOM, $, Github, cb;
/**
* function creates gist
*/
cloudcmd.GitHub.uploadFile = function(pContent, pFileName){
if(pContent){
cloudcmd.GitHub.uploadFile = function(pParams, pCallBack){
var lContent = pParams.data,
lName = pParams.name;
if(lContent){
DOM.Images.showLoad();
if(!pFileName)
pFileName = Util.getDate();
if(!lName)
lName = Util.getDate();
var lGist = GithubLocal.getGist(),
lFiles = {},
@ -157,8 +147,8 @@ var CloudCommander, Util, DOM, $, Github, cb;
public: true
};
lFiles[pFileName] ={
content: pContent
lFiles[lName] ={
content: lContent
};
lOptions.files = lFiles;
@ -167,10 +157,12 @@ var CloudCommander, Util, DOM, $, Github, cb;
DOM.Images.hideLoad();
console.log(pError || pData);
console.log(pData && pData.html_url);
Util.exec(pCallBack);
});
}
return pContent;
return lContent;
};
cloudcmd.GitHub.init = function(pCallBack){