|
|
@ -205,7 +205,6 @@ define([
|
|
|
|
var $trashTreeContextMenu = $iframe.find("#trashTreeContextMenu");
|
|
|
|
var $trashTreeContextMenu = $iframe.find("#trashTreeContextMenu");
|
|
|
|
var $trashContextMenu = $iframe.find("#trashContextMenu");
|
|
|
|
var $trashContextMenu = $iframe.find("#trashContextMenu");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TOOLBAR
|
|
|
|
// TOOLBAR
|
|
|
|
|
|
|
|
|
|
|
|
/* add a "change username" button */
|
|
|
|
/* add a "change username" button */
|
|
|
@ -227,10 +226,14 @@ define([
|
|
|
|
if (AppConfig.enableTemplates) { displayedCategories.push(TEMPLATE); }
|
|
|
|
if (AppConfig.enableTemplates) { displayedCategories.push(TEMPLATE); }
|
|
|
|
if (isWorkgroup()) { displayedCategories = [ROOT, TRASH, SEARCH]; }
|
|
|
|
if (isWorkgroup()) { displayedCategories = [ROOT, TRASH, SEARCH]; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Cryptpad.isLoggedIn()) {
|
|
|
|
|
|
|
|
displayedCategories = [FILES_DATA];
|
|
|
|
|
|
|
|
currentPath = [FILES_DATA];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!APP.readOnly) {
|
|
|
|
if (!APP.readOnly) {
|
|
|
|
setEditable(true);
|
|
|
|
setEditable(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var appStatus = {
|
|
|
|
var appStatus = {
|
|
|
|
isReady: true,
|
|
|
|
isReady: true,
|
|
|
|
_onReady: [],
|
|
|
|
_onReady: [],
|
|
|
@ -1811,6 +1814,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
module.resetTree();
|
|
|
|
module.resetTree();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (displayedCategories.indexOf(SEARCH) !== -1) {
|
|
|
|
// in history mode we want to focus the version number input
|
|
|
|
// in history mode we want to focus the version number input
|
|
|
|
if (!history.isHistoryMode && !APP.mobile()) {
|
|
|
|
if (!history.isHistoryMode && !APP.mobile()) {
|
|
|
|
var st = $tree.scrollTop() || 0;
|
|
|
|
var st = $tree.scrollTop() || 0;
|
|
|
@ -1819,6 +1823,7 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$tree.find('#searchInput')[0].selectionStart = getSearchCursor();
|
|
|
|
$tree.find('#searchInput')[0].selectionStart = getSearchCursor();
|
|
|
|
$tree.find('#searchInput')[0].selectionEnd = getSearchCursor();
|
|
|
|
$tree.find('#searchInput')[0].selectionEnd = getSearchCursor();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!isWorkgroup()) {
|
|
|
|
if (!isWorkgroup()) {
|
|
|
|
setLastOpenedFolder(path);
|
|
|
|
setLastOpenedFolder(path);
|
|
|
@ -2310,6 +2315,19 @@ define([
|
|
|
|
else if ($(this).hasClass('delete')) {
|
|
|
|
else if ($(this).hasClass('delete')) {
|
|
|
|
var pathsList = [];
|
|
|
|
var pathsList = [];
|
|
|
|
paths.forEach(function (p) { pathsList.push(p.path); });
|
|
|
|
paths.forEach(function (p) { pathsList.push(p.path); });
|
|
|
|
|
|
|
|
if (!Cryptpad.isLoggedIn()) {
|
|
|
|
|
|
|
|
console.log(paths);
|
|
|
|
|
|
|
|
var msg = Messages._getKey("fm_removeSeveralPermanentlyDialog", [paths.length]);
|
|
|
|
|
|
|
|
if (paths.length === 1) {
|
|
|
|
|
|
|
|
msg = Messages.fm_removePermanentlyDialog;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Cryptpad.confirm(msg, function(res) {
|
|
|
|
|
|
|
|
$(ifrw).focus();
|
|
|
|
|
|
|
|
if (!res) { return; }
|
|
|
|
|
|
|
|
filesOp.delete(pathsList, refresh);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
moveElements(pathsList, [TRASH], false, refresh);
|
|
|
|
moveElements(pathsList, [TRASH], false, refresh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($(this).hasClass("properties")) {
|
|
|
|
else if ($(this).hasClass("properties")) {
|
|
|
@ -2432,7 +2450,9 @@ define([
|
|
|
|
$appContainer.on('keydown', function (e) {
|
|
|
|
$appContainer.on('keydown', function (e) {
|
|
|
|
// "Del"
|
|
|
|
// "Del"
|
|
|
|
if (e.which === 46) {
|
|
|
|
if (e.which === 46) {
|
|
|
|
if (filesOp.isPathIn(currentPath, [FILES_DATA])) { return; } // We can't remove elements directly from filesData
|
|
|
|
if (filesOp.isPathIn(currentPath, [FILES_DATA]) && Cryptpad.isLoggedIn()) {
|
|
|
|
|
|
|
|
return; // We can't remove elements directly from filesData
|
|
|
|
|
|
|
|
}
|
|
|
|
var $selected = $iframe.find('.selected');
|
|
|
|
var $selected = $iframe.find('.selected');
|
|
|
|
if (!$selected.length) { return; }
|
|
|
|
if (!$selected.length) { return; }
|
|
|
|
var paths = [];
|
|
|
|
var paths = [];
|
|
|
@ -2442,7 +2462,7 @@ define([
|
|
|
|
paths.push($(elmt).data('path'));
|
|
|
|
paths.push($(elmt).data('path'));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// If we are in the trash or anon pad or if we are holding the "shift" key, delete permanently,
|
|
|
|
// If we are in the trash or anon pad or if we are holding the "shift" key, delete permanently,
|
|
|
|
if (isTrash || e.shiftKey) {
|
|
|
|
if (!Cryptpad.isLoggedIn() || isTrash || e.shiftKey) {
|
|
|
|
var msg = Messages._getKey("fm_removeSeveralPermanentlyDialog", [paths.length]);
|
|
|
|
var msg = Messages._getKey("fm_removeSeveralPermanentlyDialog", [paths.length]);
|
|
|
|
if (paths.length === 1) {
|
|
|
|
if (paths.length === 1) {
|
|
|
|
msg = Messages.fm_removePermanentlyDialog;
|
|
|
|
msg = Messages.fm_removePermanentlyDialog;
|
|
|
|