diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index c99a10c06..15ae9a9d1 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -161,6 +161,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 df86d5be3..163197956 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -163,8 +163,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/common-file.js b/www/common/common-file.js index 6b1f33505..97705e556 100644 --- a/www/common/common-file.js +++ b/www/common/common-file.js @@ -28,6 +28,9 @@ define([ var u8 = file.blob; // This is not a blob but a uint8array var metadata = file.metadata; + // if it exists, dropEvent contains the new pad location in the drive + var dropEvent = file.dropEvent; + var key = Nacl.randomBytes(32); var next = FileCrypto.encrypt(u8, metadata, key); @@ -73,6 +76,7 @@ define([ if (noStore) { return void onComplete(href); } + common.initialPath = dropEvent && dropEvent.path; common.renamePad(title || "", href, function (err) { if (err) { return void console.error(err); } onComplete(href); diff --git a/www/common/sframe-common-file.js b/www/common/sframe-common-file.js index a2abd006a..b4e167690 100644 --- a/www/common/sframe-common-file.js +++ b/www/common/sframe-common-file.js @@ -93,7 +93,6 @@ define([ var metadata = file.metadata; var id = file.id; var dropEvent = file.dropEvent; - delete file.dropEvent; if (queue.inProgress) { return; } queue.inProgress = true; diff --git a/www/common/sframe-common-interface.js b/www/common/sframe-common-interface.js index 52d95b040..884f1b65c 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', { @@ -98,6 +103,7 @@ define([ break; case 'template': if (!AppConfig.enableTemplates) { return; } + if (!common.isLoggedIn()) { return; } button = $('