From 7bdd367d887b403ce7abddda098dd39871973f77 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Apr 2020 09:15:42 -0400 Subject: [PATCH 1/6] remove log statements --- www/common/inner/common-mediatag.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/www/common/inner/common-mediatag.js b/www/common/inner/common-mediatag.js index 3e1f2e75b..295d8b6b5 100644 --- a/www/common/inner/common-mediatag.js +++ b/www/common/inner/common-mediatag.js @@ -256,11 +256,9 @@ define([ $inner.append(cfg.svg); if (!cfg.render) { $spinner.hide(); - console.error('here'); locked = false; return; } - console.error('there'); setTimeout(cfg.render); tag = cfg.svg; } else { From 440980c4afed1b596cdbff5c9b5975deb459f85a Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 21 Apr 2020 16:40:19 +0200 Subject: [PATCH 2/6] Display preview with a single click --- customize.dist/src/less2/include/markdown.less | 3 +++ www/common/diffMarked.js | 16 +++++++++------- www/common/inner/common-mediatag.js | 2 -- www/common/sframe-common-outer.js | 1 + 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/customize.dist/src/less2/include/markdown.less b/customize.dist/src/less2/include/markdown.less index 1bd592d63..7a8fc0ddf 100644 --- a/customize.dist/src/less2/include/markdown.less +++ b/customize.dist/src/less2/include/markdown.less @@ -1,3 +1,5 @@ +@import (reference) "./tools.less"; + .markdown_main() { blockquote { background: #e5e5e5; @@ -95,6 +97,7 @@ svg { max-width: 100%; cursor: pointer; + .tools_unselectable(); } } } diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index adba02656..fc9c4046c 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -447,7 +447,9 @@ define([ idx = 0; } - common.getMediaTagPreview(mts, idx); + setTimeout(function () { + common.getMediaTagPreview(mts, idx); + }); }; }; @@ -465,10 +467,10 @@ define([ contextMenu.show(e); }); if ($mt.children().length) { - $mt.off('dblclick preview'); + $mt.off('click dblclick preview'); $mt.on('preview', onPreview($mt)); if ($mt.find('img').length) { - $mt.on('dblclick', function () { + $mt.on('click dblclick', function () { $mt.trigger('preview'); }); } @@ -485,10 +487,10 @@ define([ observer.disconnect(); } }); - $mt.off('dblclick preview'); + $mt.off('click dblclick preview'); $mt.on('preview', onPreview($mt)); if ($mt.find('img').length) { - $mt.on('dblclick', function () { + $mt.on('click dblclick', function () { $mt.trigger('preview'); }); } @@ -518,9 +520,9 @@ define([ $(contextMenu.menu).find('li:not(.cp-svg)').hide(); contextMenu.show(e); }); - $el.off('dblclick preview'); + $el.off('dblclick click preview'); $el.on('preview', onPreview($el)); - $el.on('dblclick', function () { + $el.on('dblclick click', function () { $el.trigger('preview'); }); diff --git a/www/common/inner/common-mediatag.js b/www/common/inner/common-mediatag.js index 3e1f2e75b..295d8b6b5 100644 --- a/www/common/inner/common-mediatag.js +++ b/www/common/inner/common-mediatag.js @@ -256,11 +256,9 @@ define([ $inner.append(cfg.svg); if (!cfg.render) { $spinner.hide(); - console.error('here'); locked = false; return; } - console.error('there'); setTimeout(cfg.render); tag = cfg.svg; } else { diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 681701129..8c30f2886 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -1003,6 +1003,7 @@ define([ if (typeof(SecureModal.cb) !== "function") { return; } SecureModal.cb(data); }; + config.onFileUpload = onFileUpload; config.onClose = function () { SecureModal.$iframe.hide(); }; From e05891184e27d4915d258ac1ceb1a19706ad6879 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Apr 2020 12:23:48 -0400 Subject: [PATCH 3/6] fix regression in maxWorkers --- lib/workers/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/workers/index.js b/lib/workers/index.js index 6a163cadc..911b34337 100644 --- a/lib/workers/index.js +++ b/lib/workers/index.js @@ -203,6 +203,7 @@ Workers.initialize = function (Env, config, _cb) { Log.info("INSUFFICIENT_MAX_WORKERS", max); limit = 1; } + limit = max; } else { Log.error("INVALID_MAX_WORKERS", '[' + max + ']'); } From b0b4029556d89d8b6b0c30e9dfab528edb65813b Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Apr 2020 12:45:47 -0400 Subject: [PATCH 4/6] modify changelog with updated instructions for author colors --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 137c1665b..700d70409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ As usual, updating from the previous release can be accomplished by: ## Features -* As mentioned above, we've built upon a very helpful PR to introduce author colors in our code editor. It's still experimental, but you can test it out by enabling author colors in a code pad via the pad's properties modal. +* As mentioned above, we've built upon a very helpful [PR](https://github.com/xwiki-labs/cryptpad/pull/522) from members of the Piratenpartei (German Pirate Party) to introduce author colors in our code editor. It's still experimental, but registered users can enable it on pads that they own via the "Author colors" entry in the `...` menu found beneath their user admin menu. * Serverside performance optimizations * Automatically expiring pads work by creating a task to be run at the target date. This process involves a little bit of hashing, so we've changed it to be run in the worker. * The act of deleting a file from the server actually moves it to an archive which is not publicly accessible. These archived files are regularly cleaned up if you run `scripts/evict-inactive.js`. Unfortunately, moving files is more expensive than deletion, so we've noticed spikes in CPU when users delete many files at once (like when emptying the trash from their drive). To avoid such spikes while the server is already under load we've implemented per-user queues for deletion. From 0d2f37890ba7bb7f88b7cf60828edff515c63a0f Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 22 Apr 2020 10:37:46 +0200 Subject: [PATCH 5/6] 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 37bbb815f0920443b90308dfb54f6031012c4acf Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 22 Apr 2020 10:44:16 +0200 Subject: [PATCH 6/6] 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);