Merge branch 'staging' into communities-comments

pull/1/head
yflory 5 years ago
commit 7f2b44d6a5

@ -20,7 +20,7 @@ As usual, updating from the previous release can be accomplished by:
## Features ## 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 * 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. * 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. * 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.

@ -1,3 +1,5 @@
@import (reference) "./tools.less";
.markdown_main() { .markdown_main() {
blockquote { blockquote {
background: #e5e5e5; background: #e5e5e5;
@ -95,6 +97,7 @@
svg { svg {
max-width: 100%; max-width: 100%;
cursor: pointer; cursor: pointer;
.tools_unselectable();
} }
} }
} }

@ -203,6 +203,7 @@ Workers.initialize = function (Env, config, _cb) {
Log.info("INSUFFICIENT_MAX_WORKERS", max); Log.info("INSUFFICIENT_MAX_WORKERS", max);
limit = 1; limit = 1;
} }
limit = max;
} else { } else {
Log.error("INVALID_MAX_WORKERS", '[' + max + ']'); Log.error("INVALID_MAX_WORKERS", '[' + max + ']');
} }

@ -452,6 +452,7 @@ define([
markers.ready(); markers.ready();
common.getPadMetadata(null, function (md) { common.getPadMetadata(null, function (md) {
if (md && md.error) { return; } if (md && md.error) { return; }
if (!Array.isArray(md.owners)) { return void markers.setState(false); }
if (!common.isOwned(md.owners)) { return; } if (!common.isOwned(md.owners)) { return; }
// We're the owner: add the button and enable the colors if needed // We're the owner: add the button and enable the colors if needed
mkColorByAuthor(framework, markers); mkColorByAuthor(framework, markers);

@ -689,7 +689,7 @@ define([
Markers.create = function (config) { Markers.create = function (config) {
var Env = config; var Env = config;
Env.authormarks = Util.clone(DEFAULT); Env.authormarks = {};
Env.enabled = false; Env.enabled = false;
Env.myAuthorId = 0; Env.myAuthorId = 0;

@ -447,7 +447,9 @@ define([
idx = 0; idx = 0;
} }
common.getMediaTagPreview(mts, idx); setTimeout(function () {
common.getMediaTagPreview(mts, idx);
});
}; };
}; };
@ -465,10 +467,10 @@ define([
contextMenu.show(e); contextMenu.show(e);
}); });
if ($mt.children().length) { if ($mt.children().length) {
$mt.off('dblclick preview'); $mt.off('click dblclick preview');
$mt.on('preview', onPreview($mt)); $mt.on('preview', onPreview($mt));
if ($mt.find('img').length) { if ($mt.find('img').length) {
$mt.on('dblclick', function () { $mt.on('click dblclick', function () {
$mt.trigger('preview'); $mt.trigger('preview');
}); });
} }
@ -485,10 +487,10 @@ define([
observer.disconnect(); observer.disconnect();
} }
}); });
$mt.off('dblclick preview'); $mt.off('click dblclick preview');
$mt.on('preview', onPreview($mt)); $mt.on('preview', onPreview($mt));
if ($mt.find('img').length) { if ($mt.find('img').length) {
$mt.on('dblclick', function () { $mt.on('click dblclick', function () {
$mt.trigger('preview'); $mt.trigger('preview');
}); });
} }
@ -518,9 +520,9 @@ define([
$(contextMenu.menu).find('li:not(.cp-svg)').hide(); $(contextMenu.menu).find('li:not(.cp-svg)').hide();
contextMenu.show(e); contextMenu.show(e);
}); });
$el.off('dblclick preview'); $el.off('dblclick click preview');
$el.on('preview', onPreview($el)); $el.on('preview', onPreview($el));
$el.on('dblclick', function () { $el.on('dblclick click', function () {
$el.trigger('preview'); $el.trigger('preview');
}); });

@ -256,11 +256,9 @@ define([
$inner.append(cfg.svg); $inner.append(cfg.svg);
if (!cfg.render) { if (!cfg.render) {
$spinner.hide(); $spinner.hide();
console.error('here');
locked = false; locked = false;
return; return;
} }
console.error('there');
setTimeout(cfg.render); setTimeout(cfg.render);
tag = cfg.svg; tag = cfg.svg;
} else { } else {

@ -1003,6 +1003,7 @@ define([
if (typeof(SecureModal.cb) !== "function") { return; } if (typeof(SecureModal.cb) !== "function") { return; }
SecureModal.cb(data); SecureModal.cb(data);
}; };
config.onFileUpload = onFileUpload;
config.onClose = function () { config.onClose = function () {
SecureModal.$iframe.hide(); SecureModal.$iframe.hide();
}; };

Loading…
Cancel
Save