summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/js/lib/views/index/threadbox.js2
-rw-r--r--public/assets/js/util/format.js11
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 '<a href="' + str + '" target="_blank">[' + get_domain(str) + ']</a>'
+ return line.replace(/https?:\/\/[^ ]+/g, function(url){
+ if (url.match(/(gif|jpe?g|png)\?.*$/) {
+ return '<a href="' + url + '" target="_blank"><img src="' + url + '"></a>'
+ }
+ else if (short_urls) {
+ return '<a href="' + url + '" target="_blank">[' + get_domain(url) + ']</a>'
}
else {
- return '<a href="' + str + '" target="_blank">' + str + '</a>'
+ return '<a href="' + url + '" target="_blank">' + str + '</a>'
}
});