From c421f7989b713a687a551c01687c3d7c14154885 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Mar 2021 14:56:35 +0100 Subject: [PATCH 1/8] Readme feedback --- www/common/outer/async-store.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 530380746..629b10bc0 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -652,6 +652,7 @@ define([ if (data.expire) { pad.expire = data.expire; } if (data.password) { pad.password = data.password; } if (data.channel || secret) { pad.channel = data.channel || secret.channel; } + if (data.readme) { pad.readme = 1; } var s = getStore(data.teamId); if (!s || !s.manager) { return void cb({ error: 'ENOTFOUND' }); } @@ -839,6 +840,7 @@ define([ channel: channel, title: data.driveReadmeTitle, owners: [ store.proxy.edPublic ], + readme: true }; Store.addPad(clientId, fileData, cb); }, { @@ -1155,6 +1157,12 @@ define([ pad.owners = owners; } pad.expire = expire; + + if (pad.readme) { + delete pad.readme; + Feedback.send('OPEN_README'); + } + if (h.mode === 'view') { return; } // If we only have rohref, it means we have a stronger href From 676178c0bbb726e6c08a7ad2f245dfb5e0feaa7f Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 29 Mar 2021 11:41:23 +0200 Subject: [PATCH 2/8] Fix title reset in polls --- www/poll/inner.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/www/poll/inner.js b/www/poll/inner.js index 5d31d917d..a65a7b1c8 100644 --- a/www/poll/inner.js +++ b/www/poll/inner.js @@ -1166,6 +1166,7 @@ define([ var $drawer = APP.toolbar.$drawer; metadataMgr.onChange(function () { + if (!APP.proxy) { return; } var md = copyObject(metadataMgr.getMetadata()); APP.proxy.metadata = md; }); @@ -1365,23 +1366,23 @@ define([ $('#cp-app-poll-comments-add-title').remove(); } - var rt = APP.rt = Listmap.create(listmapConfig); - APP.proxy = rt.proxy; + common.getPadAttribute('userid', function (e, userid) { + if (e) { console.error(e); } + var rt = APP.rt = Listmap.create(listmapConfig); + APP.proxy = rt.proxy; - var firstConnection = true; - rt.proxy.on('create', onCreate) - .on('ready', function (info) { - if (!firstConnection) { return; } // TODO fix this issue in listmap - firstConnection = false; - common.getPadAttribute('userid', function (e, userid) { - if (e) { console.error(e); } + var firstConnection = true; + rt.proxy.on('create', onCreate) + .on('ready', function (info) { + if (!firstConnection) { return; } // TODO fix this issue in listmap + firstConnection = false; APP.userid = userid; onReady(info, userid); - }); - }) - .on('disconnect', onDisconnect) - .on('reconnect', onReconnect) - .on('error', onError); + }) + .on('disconnect', onDisconnect) + .on('reconnect', onReconnect) + .on('error', onError); + }); }); }; main(); From dcd6c15dc976408c712923af102a6a670a600b33 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 29 Mar 2021 13:35:40 +0200 Subject: [PATCH 3/8] Fix type error with sheet templates --- www/common/onlyoffice/inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 300186fd0..f4b39defa 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -861,7 +861,7 @@ define([ var handleNewLocks = function (o, n) { var hasNew = false; // Check if we have at least one new lock - Object.keys(n).some(function (id) { + Object.keys(n || {}).some(function (id) { if (typeof(n[id]) !== "object") { return; } // Ignore old format // n[id] = { uid: lock, uid2: lock2 }; return Object.keys(n[id]).some(function (uid) { @@ -873,7 +873,7 @@ define([ }); }); // Remove old locks - Object.keys(o).forEach(function (id) { + Object.keys(o || {}).forEach(function (id) { if (typeof(o[id]) !== "object") { return; } // Ignore old format Object.keys(o[id]).forEach(function (uid) { // Removed lock From 45af7f703f213031404a7cbc949028c2bceb22f4 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Mar 2021 15:05:55 +0100 Subject: [PATCH 4/8] Make links inside commented text clickable in rich text --- www/pad/links.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/pad/links.js b/www/pad/links.js index a79183fa6..779257dfb 100644 --- a/www/pad/links.js +++ b/www/pad/links.js @@ -7,7 +7,10 @@ define([ var onLinkClicked = function (e, inner) { var $target = $(e.target); - if (!$target.is('a')) { return; } + if (!$target.is('a')) { + $target = $target.closest('a'); + if (!$target.length) { return; } + } var href = $target.attr('href'); if (!href) { return; } var $inner = $(inner); @@ -66,7 +69,7 @@ define([ // Bubble to open the link in a new tab $inner.click(function (e) { removeClickedLink($inner); - if (e.target.nodeName.toUpperCase() === 'A') { + if (e.target.nodeName.toUpperCase() === 'A' || $(e.target).closest('a').length) { return void onLinkClicked(e, inner); } }); From 1ef5e857d7b041394e044f6dc03bf5e560e7f3d9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Mar 2021 15:20:37 +0100 Subject: [PATCH 5/8] Fix 'scroll on click' in rich text TOC and comments --- www/pad/comments.js | 2 +- www/pad/inner.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/pad/comments.js b/www/pad/comments.js index 8f13c2c7a..6069aa1d0 100644 --- a/www/pad/comments.js +++ b/www/pad/comments.js @@ -578,7 +578,7 @@ define([ // Scroll into view if (!$last.length) { return; } - var visible = UIElements.isVisible($last[0], Env.$inner); + var visible = UIElements.isVisible($last[0], Env.$contentContainer); if (!visible) { $last[0].scrollIntoView(); } }; diff --git a/www/pad/inner.js b/www/pad/inner.js index 96ea320bc..793d57b72 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -908,7 +908,7 @@ define([ $(a).click(function (e) { e.preventDefault(); e.stopPropagation(); - if (!obj.el || UIElements.isVisible(obj.el, $inner)) { return; } + if (!obj.el || UIElements.isVisible(obj.el, $contentContainer)) { return; } obj.el.scrollIntoView(); }); a.innerHTML = title; From 946173e0cdc9cd8e3329c173356e067bbf5bbd3f Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 29 Mar 2021 17:12:59 +0530 Subject: [PATCH 6/8] increment version string to 4.3.1 --- customize.dist/pages.js | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index ff2b90b40..a966da524 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -62,7 +62,7 @@ define([ var imprintUrl = AppConfig.imprint && (typeof(AppConfig.imprint) === "boolean" ? '/imprint.html' : AppConfig.imprint); - Pages.versionString = "v4.3.0"; + Pages.versionString = "v4.3.1"; // used for the about menu Pages.imprintLink = AppConfig.imprint ? footLink(imprintUrl, 'imprint') : undefined; diff --git a/package-lock.json b/package-lock.json index 447f6a468..3b0286e25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cryptpad", - "version": "4.3.0", + "version": "4.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c059c6bd0..3b540387f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cryptpad", "description": "realtime collaborative visual editor with zero knowlege server", - "version": "4.3.0", + "version": "4.3.1", "license": "AGPL-3.0+", "repository": { "type": "git", From 3ff889568f25b690442c73158cee1f68280546a3 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 29 Mar 2021 13:50:55 +0200 Subject: [PATCH 7/8] Recover from broken checkpoints in sheets --- www/common/onlyoffice/inner.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index f4b39defa..2fec3682b 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -369,7 +369,8 @@ define([ content.hashes[i] = { file: data.url, hash: ev.hash, - index: ev.index + index: ev.index, + version: NEW_VERSION }; oldHashes = JSON.parse(JSON.stringify(content.hashes)); content.locks = {}; @@ -596,7 +597,13 @@ define([ if (arrayBuffer) { var u8 = new Uint8Array(arrayBuffer); FileCrypto.decrypt(u8, key, function (err, decrypted) { - if (err) { return void console.error(err); } + if (err) { + if (err === "DECRYPTION_ERROR") { + console.warn(err); + return void onCpError(err); + } + return void console.error(err); + } var blob = new Blob([decrypted.content], {type: 'plain/text'}); if (cb) { return cb(blob, getFileType()); From f58a4efb5c41deaac5541752ba7ecd8aa3169712 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 30 Mar 2021 11:47:41 +0530 Subject: [PATCH 8/8] WIP 4.3.1 changelog --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ed091af3..c1f716e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 4.3.1 (WIP) + +This minor release addresses some bugs discovered after deploying and tagging 4.3.0 + +* better isLoggedIn() check +* fix templates in sheets +* include onlyOffice version along with checkpoint hashes +* send feedback when opening the readme + * so we can decide whether to remove it +* handle decryption errors for blobs + * prompted by a badly formed sheet checkpoint +* fix broken team creation +* CKEditor + * broken table of contents scrollTo + * show the link bubble for links inside of comments +* fix title reset in polls + # 4.3.0 (D) ## Goals