From dc908110901f0ad6e8c18ccaec053c3ca8db5c5e Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 24 Oct 2017 16:56:08 +0200 Subject: [PATCH 1/6] only call onReady once in sframe-listmap --- www/common/sframe-chainpad-listmap.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/common/sframe-chainpad-listmap.js b/www/common/sframe-chainpad-listmap.js index 22b7e6216..a4c63641d 100644 --- a/www/common/sframe-chainpad-listmap.js +++ b/www/common/sframe-chainpad-listmap.js @@ -685,7 +685,9 @@ define([ }); }; + var ready = false; realtimeOptions.onReady = function (info) { + if (ready) { return; } // create your patcher if (realtime !== info.realtime) { realtime = rt.realtime = info.realtime; @@ -709,6 +711,7 @@ define([ DeepProxy.checkLocalChange(proxy, onLocal); initializing = false; + ready = true; }; realtimeOptions.onAbort = function (info) { From aa37997aa32295420290d70b3b1b552ace5040b2 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Tue, 24 Oct 2017 18:02:03 +0300 Subject: [PATCH 2/6] Enable JSON-OT again because it is working now that the arguments are passed in the right order --- www/common/sframe-app-framework.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/common/sframe-app-framework.js b/www/common/sframe-app-framework.js index 2bb6090aa..ea7c81175 100644 --- a/www/common/sframe-app-framework.js +++ b/www/common/sframe-app-framework.js @@ -364,8 +364,7 @@ define([ // really basic operational transform transformFunction: options.transformFunction || JsonOT.validate, - // This one causes a big mess. - //patchTransformer: options.patchTransformer || JsonOT.patchTransformer, + patchTransformer: options.patchTransformer || JsonOT.patchTransformer, // cryptpad debug logging (default is 1) // logLevel: 0, From 69f9a7ebf395bb5b4545cff331b11e8ba1626ec1 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 24 Oct 2017 17:29:58 +0200 Subject: [PATCH 3/6] make userlist change notifications configurable --- customize.dist/application_config.js | 1 + www/common/toolbar3.js | 1 + 2 files changed, 2 insertions(+) diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index 9cf29d565..079c36eab 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -12,6 +12,7 @@ define(function() { * You can change their duration here (measured in milliseconds) */ config.notificationTimeout = 5000; + config.disableUserlistNotifications = false; config.enablePinning = true; diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index fdebae133..29d78e91c 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -886,6 +886,7 @@ define([ // type : 1 (+1 user), 0 (rename existing user), -1 (-1 user) if (typeof name === "undefined") { return; } name = name || Messages.anonymous; + if (Config.disableUserlistNotifications) { return; } switch(type) { case 1: Cryptpad.log(Messages._getKey("notifyJoined", [name])); From 8359902f6a6b5cf154ee238096a4bcbc19a7bf81 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 24 Oct 2017 17:42:08 +0200 Subject: [PATCH 4/6] fix typo in poll --- www/poll/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/poll/inner.js b/www/poll/inner.js index 767817ddd..eb62cddcd 100644 --- a/www/poll/inner.js +++ b/www/poll/inner.js @@ -651,7 +651,7 @@ define([ if (editable === false) { // disable all the things - $('.icp-app-poll-realtime input, .cp-app-poll-realtime button, .cp-app-poll-upper button, .cp-app-poll-realtime textarea').attr('disabled', true); + $('.cp-app-poll-realtime input, .cp-app-poll-realtime button, .cp-app-poll-upper button, .cp-app-poll-realtime textarea').attr('disabled', true); $('span.cp-app-poll-table-edit, span.cp-app-poll-table-remove').hide(); $('span.cp-app-poll-table-lock').addClass('fa-lock').removeClass('fa-unlock') .attr('title', Messages.poll_locked) From 6157c57a4be24e4fecc66839bd843837202d8966 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 24 Oct 2017 17:59:19 +0200 Subject: [PATCH 5/6] disable color palette when interface is not editable --- www/whiteboard/inner.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index f5ccd22b9..e71b7fe69 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -208,6 +208,7 @@ define([ }); var setEditable = function (bool) { + APP.editable = bool; if (readOnly && bool) { return; } if (bool) { $controls.css('display', 'flex'); } else { $controls.hide(); } @@ -287,6 +288,7 @@ define([ }) .on('dblclick', function (e) { e.preventDefault(); + if (!APP.editable) { return; } pickColor(Colors.rgb2hex($color.css('background-color')), function (c) { $color.css({ 'background-color': c, From ba97aa7ad2343d712c86f03673816d75bedb2cbd Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 24 Oct 2017 18:09:38 +0200 Subject: [PATCH 6/6] allow file upload handler to create thumbnails for whiteboard --- www/whiteboard/inner.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index e71b7fe69..626ad1a90 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -238,17 +238,9 @@ define([ APP.upload = function (title) { var canvas = $canvas[0]; APP.canvas.deactivateAll().renderAll(); - var finish = function (thumb) { - canvas.toBlob(function (blob) { - blob.name = title; - APP.FM.handleFile(blob, void 0, thumb); - }); - }; - - Thumb.fromCanvas(canvas, function (e, blob) { - // carry on even if you can't get a thumbnail - if (e) { console.error(e); } - finish(blob); + canvas.toBlob(function (blob) { + blob.name = title; + APP.FM.handleFile(blob); }); };