summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-26 19:40:43 +0200
committerjulian laplace <julescarbon@gmail.com>2022-10-26 19:40:43 +0200
commitc2ef8a9874da71e52be515f703e6b563db4e7f30 (patch)
treef195ba688de6f4645f05fde74bf46e47de00a55a /public
parentf104b158fec9c8a49c052faeb2ee167743d87b14 (diff)
more trim
Diffstat (limited to 'public')
-rw-r--r--public/assets/js/lib/views/stream/hootstream.js1
-rw-r--r--public/assets/js/util/format.js4
2 files changed, 3 insertions, 2 deletions
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 ["<div>Missing thread!</div>"];
}
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+$/, "") +
`... <a href="/stream/thread/${comment.thread}" class="readMore">Read more...</a>`,
};