|
|
@ -3597,19 +3597,16 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var downloadFolder = function (folderElement, folderName) {
|
|
|
|
var downloadFolder = function (folderElement, folderName, sfId) {
|
|
|
|
console.warn("downloadFolder");
|
|
|
|
|
|
|
|
var todo = function (data) {
|
|
|
|
var todo = function (data) {
|
|
|
|
data.folder = folderElement;
|
|
|
|
data.folder = folderElement;
|
|
|
|
folderName = Util.fixFileName(folderName) + '.zip';
|
|
|
|
data.sharedFolderId = sfId;
|
|
|
|
console.log("data", data);
|
|
|
|
data.folderName = Util.fixFileName(folderName) + '.zip';
|
|
|
|
console.log("folderName", folderName);
|
|
|
|
|
|
|
|
|
|
|
|
APP.FM.downloadFolder(data, function (err, obj) {
|
|
|
|
Backup.create(data, common.getPad, function (blob, errors) {
|
|
|
|
console.log(err, obj);
|
|
|
|
console.log("blob", blob);
|
|
|
|
console.log('DONE');
|
|
|
|
window.saveAs(blob, folderName);
|
|
|
|
});
|
|
|
|
console.error(errors);
|
|
|
|
|
|
|
|
}, function () {});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
todo({
|
|
|
|
todo({
|
|
|
|
uo: proxy,
|
|
|
|
uo: proxy,
|
|
|
@ -3711,29 +3708,21 @@ define([
|
|
|
|
if (paths.length !== 1) { return; }
|
|
|
|
if (paths.length !== 1) { return; }
|
|
|
|
var path = paths[0];
|
|
|
|
var path = paths[0];
|
|
|
|
el = manager.find(path.path);
|
|
|
|
el = manager.find(path.path);
|
|
|
|
console.log("el", el);
|
|
|
|
|
|
|
|
console.log('path', path);
|
|
|
|
|
|
|
|
// folder
|
|
|
|
// folder
|
|
|
|
if (manager.isFolder(el)) {
|
|
|
|
if (manager.isFolder(el)) {
|
|
|
|
// folder
|
|
|
|
// folder
|
|
|
|
var name, folderEl;
|
|
|
|
var name, folderEl;
|
|
|
|
if (!manager.isSharedFolder(el)) {
|
|
|
|
if (!manager.isSharedFolder(el)) {
|
|
|
|
console.log("--isFolder--");
|
|
|
|
|
|
|
|
name = path.path[path.path.length - 1];
|
|
|
|
name = path.path[path.path.length - 1];
|
|
|
|
console.log('name', name);
|
|
|
|
|
|
|
|
folderEl = el;
|
|
|
|
folderEl = el;
|
|
|
|
downloadFolder(folderEl, name);
|
|
|
|
downloadFolder(folderEl, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// shared folder
|
|
|
|
// shared folder
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
console.log("--isSharedFolder--");
|
|
|
|
|
|
|
|
data = manager.getSharedFolderData(el);
|
|
|
|
data = manager.getSharedFolderData(el);
|
|
|
|
name = data.title;
|
|
|
|
name = data.title;
|
|
|
|
folderEl = manager.find(path.path.concat("root"));
|
|
|
|
folderEl = manager.find(path.path.concat("root"));
|
|
|
|
console.log("folderEl", folderEl);
|
|
|
|
downloadFolder(folderEl, name, el);
|
|
|
|
console.log("data:", data);
|
|
|
|
|
|
|
|
console.log('name', name);
|
|
|
|
|
|
|
|
downloadFolder(folderEl, name);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// file
|
|
|
|
// file
|
|
|
|