From e5f1fa7ef0f7817399804cf6f75fd9aa3a755c24 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 22 Apr 2020 10:37:46 +0200 Subject: [PATCH 1/3] Fix color by author automatically enabled for non-owned pads --- www/code/markers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/code/markers.js b/www/code/markers.js index fb44707e0..326de8be0 100644 --- a/www/code/markers.js +++ b/www/code/markers.js @@ -689,7 +689,7 @@ define([ Markers.create = function (config) { var Env = config; - Env.authormarks = Util.clone(DEFAULT); + Env.authormarks = {}; Env.enabled = false; Env.myAuthorId = 0; From cf8841cdfaa000dfa95edba71cc83660aff97cdf Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 22 Apr 2020 10:44:16 +0200 Subject: [PATCH 2/3] Remove cba on non-owned pads --- www/code/inner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/code/inner.js b/www/code/inner.js index 7b654a3b1..3ffb2baef 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -452,6 +452,7 @@ define([ markers.ready(); common.getPadMetadata(null, function (md) { if (md && md.error) { return; } + if (!Array.isArray(md.owners)) { return void markers.setState(false); } if (!common.isOwned(md.owners)) { return; } // We're the owner: add the button and enable the colors if needed mkColorByAuthor(framework, markers); From c860819eb1a76f46a42f11dc13369a7e7c599cd4 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 22 Apr 2020 15:09:27 -0400 Subject: [PATCH 3/3] guard against coercing `undefined` to a string visible in the author's tooltip when author marks were enabled for the document, but hidden by the local user --- www/code/markers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/code/markers.js b/www/code/markers.js index 326de8be0..bf3f00f82 100644 --- a/www/code/markers.js +++ b/www/code/markers.js @@ -46,7 +46,7 @@ define([ inclusiveRight: uid === Env.myAuthorId, css: "background-color: " + rgba, attributes: { - title: Env.opacity ? Messages._getKey('cba_writtenBy', [name]) : undefined, + title: Env.opacity ? Messages._getKey('cba_writtenBy', [name]) : '', 'data-type': 'authormark', 'data-uid': uid }