From af8aa25228c1f1af496501824e80db5a569fc086 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 17 Nov 2017 10:57:54 +0100 Subject: [PATCH] Add an option to never rename a file during the session --- customize.dist/translations/messages.fr.js | 1 + customize.dist/translations/messages.js | 1 + www/common/sframe-common-file.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 9a9bc0b53..1a11f2c7d 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -201,6 +201,7 @@ define(function () { out.cancel = "Annuler"; out.cancelButton = 'Annuler (Échap)'; + out.doNotAskAgain = "Ne jamais renommer (Échap)"; out.historyText = "Historique"; out.historyButton = "Afficher l'historique du document"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 23a1f56c2..aa3ef4e8e 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -204,6 +204,7 @@ define(function () { out.cancel = "Cancel"; out.cancelButton = 'Cancel (esc)'; + out.doNotAskAgain = "Always keep existing name (Esc)"; out.historyText = "History"; out.historyButton = "Display the document history"; diff --git a/www/common/sframe-common-file.js b/www/common/sframe-common-file.js index 9d8fb65b2..a07ce8e0c 100644 --- a/www/common/sframe-common-file.js +++ b/www/common/sframe-common-file.js @@ -231,7 +231,7 @@ define([ var newExt = newExtIdx !== -1 ? newName.slice(newExtIdx) : ""; if (newExt !== ext) { newName += ext; } cb(newName); - }, null, true); + }, {cancel: Messages.doNotAskAgain}, true); }; var handleFileState = { queue: [], @@ -259,6 +259,7 @@ define([ if (handleFileState.queue.length) { handleFile(handleFileState.queue.shift()); } }; var getName = function () { + if (!showNamePrompt) { return void finish(); } promptName(file, function (newName) { name = newName; finish();