From 3bfcb525760dff0613c7dbbf26749a2191ccc6ea Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 7 Sep 2015 10:01:24 -0400 Subject: embed images --- public/assets/js/lib/views/index/threadbox.js | 2 +- public/assets/js/util/format.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/public/assets/js/lib/views/index/threadbox.js b/public/assets/js/lib/views/index/threadbox.js index d9999a5..bcaaceb 100644 --- a/public/assets/js/lib/views/index/threadbox.js +++ b/public/assets/js/lib/views/index/threadbox.js @@ -48,7 +48,7 @@ var ThreadBox = View.extend({ .replace(/{{files_class}}/g, files[0]) .replace(/{{show_files}}/g, thread.file_count == 0 ? "hidden" : "") .replace(/{{size_class}}/g, size[0] ) - .replace(/{{color}}/g, thread.color || "plain" ) + .replace(/{{color}}/g, thread.color || "ivory" ) return t }, diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 00cc94c..272efaf 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -176,12 +176,15 @@ function tidy_urls (s, short_urls) { if (line.indexOf("<") !== -1) { return line } - return line.replace(/https?:\/\/[^ ]+/g, function(str){ - if (short_urls) { - return '[' + get_domain(str) + ']' + return line.replace(/https?:\/\/[^ ]+/g, function(url){ + if (url.match(/(gif|jpe?g|png)\?.*$/) { + return '' + } + else if (short_urls) { + return '[' + get_domain(url) + ']' } else { - return '' + str + '' + return '' + str + '' } }); -- cgit v1.2.3-70-g09d2