From 0e020e5afdfd39e18bfc2856f1882d1f78a04fc0 Mon Sep 17 00:00:00 2001 From: Patrick Heuser Date: Thu, 30 Jul 2026 12:16:51 +0200 Subject: [PATCH 1/2] fix(quill): rebase on 4.1.0, bind upload toolbar to composer, skip duplicate upload toasts Rebased onto upstream 4.1.0 and kept only fixes not yet covered upstream: upload progress alerts are delegated to uploadHelpers, and picture/upload toolbar handlers run in the active composer context instead of .formatting-bar. Co-authored-by: Cursor --- static/lib/quill-nbb.js | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/static/lib/quill-nbb.js b/static/lib/quill-nbb.js index 157eccb..96dd13d 100644 --- a/static/lib/quill-nbb.js +++ b/static/lib/quill-nbb.js @@ -76,23 +76,7 @@ define('quill-nbb', [ }); $(window).on('action:composer.uploadUpdate', (evt, data) => { - // when update progress the filename use timestamp, so we need to remove timestamp - const filename = data.filename.replace(/^\d+_\d+_/, ''); - const alertId = generateAlertId(data.post_uuid, filename); - if (!window.quill.uploads[filename]) { - console.warn(`[quill/uploads] Unable to find file (${filename}).`); - alerts.remove(alertId); - return; - } - - if (!data.text.startsWith('/')) { - alerts.alert({ - alert_id: alertId, - title: data.filename.replace(/\d_\d+_/, ''), - message: data.text, - timeout: 1000, - }); - } + // Upload progress is handled globally by uploadHelpers }); $(window).on('action:composer.upload', (evt, data) => { @@ -427,7 +411,9 @@ window.quill.configureToolbar = async (targetEl, data) => { if (app.user.privileges[privilege]) { const name = privilege === 'upload:post:image' ? 'picture' : 'upload'; group.unshift(name); - toolbar.handlers[name] = toolbarHandlers[name].bind($('.formatting-bar')); + toolbar.handlers[name] = function () { + return toolbarHandlers[name].apply(data.postContainer, arguments); + }; } }); toolbar.container.push(group); From ba82abec0f251b78847a31a115116d4b64ef178c Mon Sep 17 00:00:00 2001 From: Patrick Heuser Date: Thu, 30 Jul 2026 12:31:22 +0200 Subject: [PATCH 2/2] fix(quill): extend ignore list in toolbar configuration to include 'picture' and 'upload' --- .vscode/settings.json | 1 + static/lib/quill-nbb.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/static/lib/quill-nbb.js b/static/lib/quill-nbb.js index 96dd13d..bee1767 100644 --- a/static/lib/quill-nbb.js +++ b/static/lib/quill-nbb.js @@ -391,7 +391,7 @@ window.quill.configureToolbar = async (targetEl, data) => { const toolbarHandlers = formatting.getDispatchTable(); const group = []; data.formatting.forEach((option) => { - const ignoreNames = ['tags', 'thumbs']; + const ignoreNames = ['tags', 'thumbs', 'picture', 'upload']; if (ignoreNames.includes(option.name)) { return; }