From 82b39a4fdfe0aa1a89be293b7fcc95373bbf0f5a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 25 Apr 2015 17:57:33 -0700 Subject: [PATCH] Add Flash tag to File Info Formatting. --- src/General/Config.coffee | 2 +- src/General/Settings.coffee | 1 + src/General/html/Settings/Advanced.html | 1 + src/General/lib/post.class | 1 + src/Miscellaneous/FileInfo.coffee | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index e18322dc0..d30f2cf91 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -742,7 +742,7 @@ Config = backlink: '>>%id' - fileInfo: '%l (%p%s, %r)' + fileInfo: '%l (%p%s, %r%g)' favicon: 'ferongr' diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 802c3a0d6..bd88fb1f2 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -462,6 +462,7 @@ Settings = isImage: true isVideo: false isSpoiler: true + tag: 'Loop' FileInfo.format @value, data, @nextElementSibling favicon: -> diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html index a9ddd65a0..8d5d60063 100755 --- a/src/General/html/Settings/Advanced.html +++ b/src/General/html/Settings/Advanced.html @@ -64,6 +64,7 @@
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
+
Tag: %g
Literal %: %%
diff --git a/src/General/lib/post.class b/src/General/lib/post.class index 455d9b7cb..6bb4ca81f 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -182,6 +182,7 @@ class Post isImage: /(jpg|png|gif)$/i.test link.href isVideo: /webm$/i.test link.href dimensions: info[0].match(/\d+x\d+/)?[0] + tag: info[0].match(/, ([a-z]+)\)/i)?[1] size = +@file.size.match(/[\d.]+/)[0] unit = ['B', 'KB', 'MB', 'GB'].indexOf @file.size.match(/\w+$/)[0] size *= 1024 while unit-- > 0 diff --git a/src/Miscellaneous/FileInfo.coffee b/src/Miscellaneous/FileInfo.coffee index 1b86d68c6..542fc43b7 100755 --- a/src/Miscellaneous/FileInfo.coffee +++ b/src/Miscellaneous/FileInfo.coffee @@ -46,4 +46,5 @@ FileInfo = K: -> <%= html('${Math.round(this.file.sizeInBytes/1024)} KB') %> M: -> <%= html('${Math.round(this.file.sizeInBytes/1048576*100)/100} MB') %> r: -> <%= html('${this.file.dimensions || "PDF"}') %> + g: -> <%= html('?{this.file.tag}{, ${this.file.tag}}{}') %> '%': -> <%= html('%') %>