From e3110950ff2d9c057428237e4f5eacfe4ed9c730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 17 Oct 2022 20:47:10 -0400 Subject: [PATCH] chore: up deps move blockquote style to generics.scss get rid of voodoo selection code, selection.toString() seems to work --- install/package.json | 4 ++-- public/scss/generics.scss | 9 +++++++++ public/src/client/topic/postTools.js | 15 ++------------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/install/package.json b/install/package.json index 8a00afac77..5f8d7a3d89 100644 --- a/install/package.json +++ b/install/package.json @@ -91,7 +91,7 @@ "multiparty": "4.2.3", "nconf": "0.12.0", "nodebb-plugin-2factor": "6.0.2", - "nodebb-plugin-composer-default": "10.0.11", + "nodebb-plugin-composer-default": "10.0.12", "nodebb-plugin-dbsearch": "6.0.0", "nodebb-plugin-emoji": "5.0.2", "nodebb-plugin-emoji-android": "4.0.0", @@ -100,7 +100,7 @@ "nodebb-plugin-spam-be-gone": "2.0.1", "nodebb-rewards-essentials": "0.2.1", "nodebb-theme-peace": "2.0.5", - "nodebb-theme-persona": "13.0.11", + "nodebb-theme-persona": "13.0.12", "nodebb-widget-essentials": "7.0.1", "nodemailer": "6.7.8", "nprogress": "0.2.0", diff --git a/public/scss/generics.scss b/public/scss/generics.scss index 0971333c65..762a239f80 100644 --- a/public/scss/generics.scss +++ b/public/scss/generics.scss @@ -126,6 +126,15 @@ } } +blockquote { + font-style: italic; + border-left: 4px solid $primary; + padding: 1rem; + p:last-child { + margin-bottom: 0; + } +} + .necro-post { text-align: center; text-transform: uppercase; diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js index ee5f444e30..6c0c827e57 100644 --- a/public/src/client/topic/postTools.js +++ b/public/src/client/topic/postTools.js @@ -331,22 +331,11 @@ define('forum/topic/postTools', [ } }); - if (content) { - const bounds = document.createRange(); - bounds.selectNodeContents(content); - const range = selection.getRangeAt(0).cloneRange(); - if (range.compareBoundaryPoints(Range.START_TO_START, bounds) < 0) { - range.setStart(bounds.startContainer, bounds.startOffset); - } - if (range.compareBoundaryPoints(Range.END_TO_END, bounds) > 0) { - range.setEnd(bounds.endContainer, bounds.endOffset); - } - bounds.detach(); - selectedText = range.toString(); + if (content && selection) { + selectedText = selection.toString(); const postEl = $(content).parents('[component="post"]'); selectedPid = postEl.attr('data-pid'); username = await getUserSlug($(content)); - range.detach(); } return { text: selectedText, pid: selectedPid, username: username }; }