From d3a816cf6161ea9003f7e63b01d64f31b276601f Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 15 Oct 2019 08:20:28 +0000 Subject: [PATCH 01/12] Translated using Weblate (English) Currently translated at 100.0% (1127 of 1127 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index ddc6c8124..a811b3e1b 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -1220,5 +1220,6 @@ "team_demoteMeConfirm": "You are about to give up your rights. You will not be able to undo this action. Are you sure?", "team_title": "Team: {0}", "team_quota": "Your team's storage limit", - "drive_quota": "Your storage limit" + "drive_quota": "Your storage limit", + "settings_codeBrackets": "Auto-close brackets" } From 975275e47bb45e1170516da0250e01584e62884f Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 15 Oct 2019 08:20:28 +0000 Subject: [PATCH 02/12] Translated using Weblate (French) Currently translated at 100.0% (1127 of 1127 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index 5ede7e788..2e4574c72 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -1220,5 +1220,6 @@ "team_demoteMeConfirm": "Vous êtes sur le point de renoncer à vos droits. Vous ne serez pas en mesure d'annuler cette action. Continuer ?", "team_title": "Équipe : {0}", "team_quota": "Limite de stockage de votre équipe", - "drive_quota": "Votre limite de stockage" + "drive_quota": "Votre limite de stockage", + "settings_codeBrackets": "Fermer automatiquement les parenthèses" } From 60afb3e81106d3ee15a16f4de4c9dba4848bfdaf Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 15 Oct 2019 08:20:29 +0000 Subject: [PATCH 03/12] Translated using Weblate (German) Currently translated at 100.0% (1127 of 1127 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/de/ --- www/common/translations/messages.de.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index 62be310eb..70f4f946d 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -1220,5 +1220,6 @@ "survey": "CryptPad-Umfrage", "team_title": "Team: {0}", "team_quota": "Speicherplatzbegrenzung deines Teams", - "drive_quota": "Deine Speicherplatzbegrenzung" + "drive_quota": "Deine Speicherplatzbegrenzung", + "settings_codeBrackets": "Klammern automatisch schließen" } From e6eb3554d69e3d7a7df25b7ac396a8448d118db5 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 15 Oct 2019 18:00:54 +0200 Subject: [PATCH 04/12] Make autoCloseBrackets configurable per user --- www/common/sframe-common-codemirror.js | 7 ++++-- www/settings/inner.js | 30 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 3f312aa68..d16bea97a 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -379,13 +379,14 @@ define([ }; exp.mkIndentSettings = function (metadataMgr) { - var setIndentation = function (units, useTabs, fontSize, spellcheck) { + var setIndentation = function (units, useTabs, fontSize, spellcheck, brackets) { if (typeof(units) !== 'number') { return; } var doc = editor.getDoc(); editor.setOption('indentUnit', units); editor.setOption('tabSize', units); editor.setOption('indentWithTabs', useTabs); editor.setOption('spellcheck', spellcheck); + editor.setOption('autoCloseBrackets', brackets); editor.setOption("extraKeys", { Tab: function() { if (doc.somethingSelected()) { @@ -415,11 +416,13 @@ define([ var useTabs = data[useTabsKey]; var fontSize = data[fontKey]; var spellcheck = data[spellcheckKey]; + var brackets = data.brackets; setIndentation( typeof(indentUnit) === 'number'? indentUnit : 2, typeof(useTabs) === 'boolean'? useTabs : false, typeof(fontSize) === 'number' ? fontSize : 12, - typeof(spellcheck) === 'boolean' ? spellcheck : false); + typeof(spellcheck) === 'boolean' ? spellcheck : false, + typeof(brackets) === 'boolean' ? brackets : true); }; metadataMgr.onChangeLazy(updateIndentSettings); updateIndentSettings(); diff --git a/www/settings/inner.js b/www/settings/inner.js index 416f99bb8..37693d3c9 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -85,6 +85,7 @@ define([ 'code': [ 'cp-settings-code-indent-unit', 'cp-settings-code-indent-type', + 'cp-settings-code-brackets', 'cp-settings-code-font-size', 'cp-settings-code-spellcheck', ], @@ -1445,6 +1446,35 @@ define([ return $div; }; + create['code-brackets'] = function () { + var key = 'brackets'; + + var $div = $('
', { + 'class': 'cp-settings-code-brackets cp-sidebarlayout-element' + }); + $('