From c2ef8a9874da71e52be515f703e6b563db4e7f30 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Wed, 26 Oct 2022 19:40:43 +0200 Subject: more trim --- public/assets/js/lib/views/stream/hootstream.js | 1 + public/assets/js/util/format.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index 2de184a..e4bee0b 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -130,6 +130,7 @@ var HootStream = View.extend({ return ["
Missing thread!
"]; } thread = thread.shift(); + console.log(query, thread.id); const isViewingThread = query.thread === thread.id; // console.log(thread, comments, files, images); const postedToday = +new Date() / 1000 - thread.lastmodified < 86400; diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 61ff234..c477a9a 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -303,7 +303,7 @@ function get_scale_opacity(value, scale) { } function trimComment(isViewingThread) { return function (comment) { - return isViewingThread || comment.comment.length < 1024 + return isViewingThread || comment.comment.length < 256 ? comment : { ...comment, @@ -312,7 +312,7 @@ function trimComment(isViewingThread) { .split("\n") .slice(0, 5) .join("\n") - .substr(0, 1024) + .substr(0, 512) .replace(/\s+\w+$/, "") + `... Read more...`, }; -- cgit v1.2.3-70-g09d2