From 691aeba1c47e5ab2067c5fd461c802164d8ca58c Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Apr 2021 11:23:29 +0200 Subject: [PATCH 1/2] Fix type error in rich text --- www/pad/inner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/pad/inner.js b/www/pad/inner.js index 18d4c18a5..b442de0b5 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -1445,9 +1445,6 @@ define([ editor.setKeystroke( CKEDITOR.CTRL + CKEDITOR.ALT + styleKeys[tag], tag); }); - var privateData = framework._.cpNfInner.metadataMgr.getPrivateData(); - var openLinkSetting = Util.find(privateData, ['settings', 'pad', 'openLink']); - Links.init(Ckeditor, editor, openLinkSetting); }).nThen(function() { // Move ckeditor parts to have a structure like the other apps var $contentContainer = $('#cke_1_contents'); @@ -1491,6 +1488,9 @@ define([ }).nThen(waitFor()); }).nThen(function(waitFor) { + var privateData = framework._.cpNfInner.metadataMgr.getPrivateData(); + var openLinkSetting = Util.find(privateData, ['settings', 'pad', 'openLink']); + Links.init(Ckeditor, editor, openLinkSetting); require(['/pad/csp.js'], waitFor()); }).nThen(function( /*waitFor*/ ) { From 935aa24f9fbcdf334add245dd65f521ef42930d7 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Apr 2021 14:52:06 +0200 Subject: [PATCH 2/2] Fix whiteboard embed size limit --- www/whiteboard/inner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index ac32f5dbd..13a0fa82f 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -373,8 +373,9 @@ define([ APP.FM.handleFile(blob); }); }; - var MAX_IMAGE_SIZE = 1 * 1024 * 1024; // 1 MB - var maxSizeStr = Util.bytesToMegabytes(MAX_IMAGE_SIZE); + var ONE_MB = 1 * 1024 * 1024; // 1 MB + var MAX_IMAGE_SIZE = Math.ceil(ONE_MB / 3) * 4 + 23; // 23 is the length of "data:image/jpeg;base64," + var maxSizeStr = Util.bytesToMegabytes(ONE_MB); var addImageToCanvas = function (img) { if (img.src && img.src.length > MAX_IMAGE_SIZE) { UI.warn(Messages._getKey('upload_tooLargeBrief', [maxSizeStr]));