|
|
@ -8,8 +8,6 @@ define([
|
|
|
|
'json.sortify',
|
|
|
|
'json.sortify',
|
|
|
|
'/common/cryptpad-common.js',
|
|
|
|
'/common/cryptpad-common.js',
|
|
|
|
'/file/fileObject.js',
|
|
|
|
'/file/fileObject.js',
|
|
|
|
'/bower_components/jquery/dist/jquery.min.js',
|
|
|
|
|
|
|
|
'/bower_components/bootstrap/dist/js/bootstrap.min.js',
|
|
|
|
|
|
|
|
'/customize/pad.js'
|
|
|
|
'/customize/pad.js'
|
|
|
|
], function (Config, Listmap, Crypto, TextPatcher, Messages, JSONSortify, Cryptpad, FO) {
|
|
|
|
], function (Config, Listmap, Crypto, TextPatcher, Messages, JSONSortify, Cryptpad, FO) {
|
|
|
|
var module = window.MODULE = {};
|
|
|
|
var module = window.MODULE = {};
|
|
|
@ -1316,25 +1314,33 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
files.on('change', [], function () {
|
|
|
|
var onRefresh = {
|
|
|
|
|
|
|
|
refresh: function() {
|
|
|
|
|
|
|
|
if (onRefresh.to) {
|
|
|
|
|
|
|
|
window.clearTimeout(onRefresh.to);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
onRefresh.to = window.setTimeout(refresh, 500);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
files.on('change', [], function (o, n, p) {
|
|
|
|
var path = arguments[2];
|
|
|
|
var path = arguments[2];
|
|
|
|
if ((filesOp.isPathInUnsorted(currentPath) && filesOp.isPathInUnsorted(path)) ||
|
|
|
|
if ((filesOp.isPathInUnsorted(currentPath) && filesOp.isPathInUnsorted(path)) ||
|
|
|
|
(path.length >= currentPath.length && filesOp.isSubpath(path, currentPath)) ||
|
|
|
|
(path.length >= currentPath.length && filesOp.isSubpath(path, currentPath)) ||
|
|
|
|
(filesOp.isPathInTrash(currentPath) && filesOp.isPathInTrash(path))) {
|
|
|
|
(filesOp.isPathInTrash(currentPath) && filesOp.isPathInTrash(path))) {
|
|
|
|
// Reload after 50ms to make sure all the change events have been received
|
|
|
|
// Reload after a few ms to make sure all the change events have been received
|
|
|
|
window.setTimeout(refresh, 200);
|
|
|
|
onRefresh.refresh();
|
|
|
|
} else if (path.length && path[0] === FILES_DATA) {
|
|
|
|
} else if (path.length && path[0] === FILES_DATA) {
|
|
|
|
refreshFilesData();
|
|
|
|
refreshFilesData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module.resetTree();
|
|
|
|
module.resetTree();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}).on('remove', [], function () {
|
|
|
|
}).on('remove', [], function (o, p) {
|
|
|
|
var path = arguments[1];
|
|
|
|
var path = arguments[1];
|
|
|
|
if ((filesOp.isPathInUnsorted(currentPath) && filesOp.isPathInUnsorted(path)) ||
|
|
|
|
if ((filesOp.isPathInUnsorted(currentPath) && filesOp.isPathInUnsorted(path)) ||
|
|
|
|
(path.length >= currentPath.length && filesOp.isSubpath(path, currentPath)) ||
|
|
|
|
(path.length >= currentPath.length && filesOp.isSubpath(path, currentPath)) ||
|
|
|
|
(filesOp.isPathInTrash(currentPath) && filesOp.isPathInTrash(path))) {
|
|
|
|
(filesOp.isPathInTrash(currentPath) && filesOp.isPathInTrash(path))) {
|
|
|
|
// Reload after 50ms to make sure all the change events have been received
|
|
|
|
// Reload after a few to make sure all the change events have been received
|
|
|
|
window.setTimeout(refresh, 200);
|
|
|
|
onRefresh.to = window.setTimeout(refresh, 500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module.resetTree();
|
|
|
|
module.resetTree();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -1373,7 +1379,7 @@ define([
|
|
|
|
readOnly: false,
|
|
|
|
readOnly: false,
|
|
|
|
validateKey: secret.keys.validateKey || undefined,
|
|
|
|
validateKey: secret.keys.validateKey || undefined,
|
|
|
|
crypto: Crypto.createEncryptor(secret.keys),
|
|
|
|
crypto: Crypto.createEncryptor(secret.keys),
|
|
|
|
//logging: true
|
|
|
|
logging: false
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var rt = window.rt = module.rt = Listmap.create(listmapConfig);
|
|
|
|
var rt = window.rt = module.rt = Listmap.create(listmapConfig);
|
|
|
|