diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 0dedf52ef..3b88a26ab 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -162,6 +162,7 @@ define(function () { out.tags_searchHint = "Commencez une recherche par # dans votre CryptDrive pour retrouver vos pads par mot-clé."; out.tags_notShared = "Vos mots-clés ne sont pas partagés avec les autres utilisateurs."; out.tags_duplicate = "Mot-clé déjà présent : {0}"; + out.tags_noentry = "Vous ne pouvez pas ajouter de mots-clés à un pad supprimé!"; out.slideOptionsText = "Options"; out.slideOptionsTitle = "Personnaliser la présentation"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index a3e254fbe..ba55838a9 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -164,8 +164,8 @@ define(function () { out.tags_searchHint = "Find files by their tags by searching in your CryptDrive"; out.tags_searchHint = "Start a search with # in your CryptDrive to find your tagged pads."; out.tags_notShared = "Your tags are not shared with other users"; - out.tags_duplicate = "Duplicate tag: {0}"; + out.tags_noentry = "You can't tag a deleted pad!"; out.slideOptionsText = "Options"; out.slideOptionsTitle = "Customize your slides"; diff --git a/www/common/sframe-common-interface.js b/www/common/sframe-common-interface.js index 97fcc9fb6..422b76bfe 100644 --- a/www/common/sframe-common-interface.js +++ b/www/common/sframe-common-interface.js @@ -31,7 +31,12 @@ define([ UI.updateTags = function (common, href) { var sframeChan = common.getSframeChannel(); sframeChan.query('Q_TAGS_GET', href || null, function (err, res) { - if (err || res.error) { return void console.error(err || res.error); } + if (err || res.error) { + if (res.error === 'NO_ENTRY') { + Cryptpad.alert(Messages.tags_noentry); + } + return void console.error(err || res.error); + } Cryptpad.dialog.tagPrompt(res.data, function (tags) { if (!Array.isArray(tags)) { return; } sframeChan.event('EV_TAGS_SET', { diff --git a/www/common/userObject.js b/www/common/userObject.js index 8a3662a7b..658a0243c 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -499,7 +499,6 @@ define([ }); }; var spliceFileData = exp.removeData = function (id) { - files[FILES_DATA][id] = undefined; delete files[FILES_DATA][id]; }; @@ -649,7 +648,6 @@ define([ var hash = f.indexOf('#') !== -1 ? f.slice(f.indexOf('#') + 1) : null; if (hash && key.indexOf(hash) === 0) { debug("Deleting pad attribute in the realtime object"); - files[key] = undefined; delete files[key]; } }); @@ -709,7 +707,6 @@ define([ var parentPath = path.slice(); var key = parentPath.pop(); var parentEl = find(parentPath); - parentEl[key] = undefined; delete parentEl[key]; }); @@ -728,7 +725,6 @@ define([ return; } // Trash but not root: it's just a tree so remove the key - parentEl[key] = undefined; delete parentEl[key]; }); deleteMultipleTrashRoot(trashRoot); @@ -767,7 +763,6 @@ define([ return; } parentEl[newName] = element; - parentEl[oldName] = undefined; delete parentEl[oldName]; if (typeof cb === "function") { cb(); } return; @@ -777,7 +772,6 @@ define([ var data = files[FILES_DATA][element]; if (!data) { return; } if (!newName || newName.trim() === "") { - data.filename = undefined; delete data.filename; if (typeof cb === "function") { cb(); } return; @@ -899,9 +893,7 @@ define([ delete parent[okey]; }); }); - files[OLD_FILES_DATA] = undefined; delete files[OLD_FILES_DATA]; - files.migrate = undefined; delete files.migrate; console.log('done'); todo(); @@ -942,7 +934,6 @@ define([ for (var el in element) { if (!isFile(element[el], true) && !isFolder(element[el])) { debug("An element in ROOT was not a folder nor a file. ", element[el]); - element[el] = undefined; delete element[el]; continue; } @@ -994,11 +985,9 @@ define([ for (var el in tr) { if (!Array.isArray(tr[el])) { debug("An element in TRASH root is not an array. ", tr[el]); - tr[el] = undefined; delete tr[el]; } else if (tr[el].length === 0) { debug("Empty array in TRASH root. ", tr[el]); - tr[el] = undefined; delete tr[el]; } else { toClean = [];