From 4dbcff2578ef9cae52b462b23dda01d3c3e124eb Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 3 Jun 2020 13:30:41 -0400 Subject: [PATCH 1/3] redirect anon users to login from support --- www/common/application_config_internal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index 61a114a68..50249baa8 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -20,7 +20,7 @@ define(function() { * users and these users will be redirected to the login page if they still try to access * the app */ - config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'notifications']; + config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'notifications', 'support']; /* CryptPad is available is multiple languages, but only English and French are maintained * by the developers. The other languages may be outdated, and any missing string for a langauge From ad8c57031beb9f75cc1c475a5fa7dac1f11108e3 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 3 Jun 2020 15:08:51 -0400 Subject: [PATCH 2/3] update markedjs from 0.5.0 to 1.1.0 --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 3ad7d88d2..9fd787c20 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,7 @@ "ckeditor": "4.14.0", "codemirror": "^5.19.0", "requirejs": "2.3.5", - "marked": "0.5.0", + "marked": "1.1.0", "rangy": "rangy-release#~1.3.0", "json.sortify": "~2.1.0", "secure-fabric.js": "secure-v1.7.9", From fa16ce209454fc1dd160e0d18044335684210e2d Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 3 Jun 2020 15:42:16 -0400 Subject: [PATCH 3/3] disallow changing media-tag's attributes while in read-only mode --- www/pad/mediatag-plugin-dialog.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/www/pad/mediatag-plugin-dialog.js b/www/pad/mediatag-plugin-dialog.js index 472525edd..44503af9b 100644 --- a/www/pad/mediatag-plugin-dialog.js +++ b/www/pad/mediatag-plugin-dialog.js @@ -1,5 +1,19 @@ CKEDITOR.dialog.add('mediatag', function (editor) { var Messages = CKEDITOR._mediatagTranslations; + var isReadOnly = function (el) { + if (!el) { return; } + var parent = el; + while (parent) { + if (parent.nodeName.toUpperCase() === 'BODY') { + // I'm not sure why "false" is a string and not a boolean here + // but that's how it is and I'm scared to touch it + // --ansuz + return parent.getAttribute("contenteditable") === 'false'; + } + parent = parent.parentElement; + } + }; + return { title: Messages.title, minWidth: 400, @@ -118,6 +132,14 @@ CKEDITOR.dialog.add('mediatag', function (editor) { update(); }); + // disable all of the dialog's inputs if it is opened while in read-only mode + if (isReadOnly(element && element.$)) { + Array.prototype.slice.call(inputs).forEach(function (node) { + node.setAttribute('disabled', true); + }); + return; + } + setTimeout(update); }, onOk: function() {