diff --git a/4chan_x.user.js b/4chan_x.user.js
index d30e74e77..d9bf50088 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -2763,8 +2763,8 @@
\
File Info Formatting\
- :
\
- - Link (with original file name): %l (lowercase L, truncated), %L (untruncated)
\
- - Original file name: %n (Truncated), %N (Untruncated)
\
+ - Link: %l (lowercase L, truncated), %L (untruncated), %t (Unix timestamp)
\
+ - Original file name: %n (truncated), %N (untruncated), %T (Unix timestamp)
\
- Spoiler indicator: %p
\
- Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
\
- Resolution: %r (Displays PDF on /po/, for PDFs)
\
@@ -2949,7 +2949,7 @@
},
fileInfo: function() {
FileInfo.data = {
- link: 'javascript:;',
+ link: '//images.4chan.org/g/src/1334437723720.jpg',
spoiler: true,
size: '276',
unit: 'KB',
@@ -3540,7 +3540,7 @@
},
setFormats: function() {
var code;
- code = Conf['fileInfo'].replace(/%([BKlLMnNprs])/g, function(s, c) {
+ code = Conf['fileInfo'].replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + f.formatters." + c + "() + '";
} else {
@@ -3575,6 +3575,12 @@
return "" + size + " " + unitT;
},
formatters: {
+ t: function() {
+ return FileInfo.data.link.match(/\d+\..+$/)[0];
+ },
+ T: function() {
+ return "" + (this.t()) + "";
+ },
l: function() {
return "" + (this.n()) + "";
},
diff --git a/changelog b/changelog
index 8b9339f1e..c0e6271a2 100644
--- a/changelog
+++ b/changelog
@@ -1,6 +1,8 @@
master
- noface
The Menu now has search links for Archivers.
+- Mayhem
+ Added possibility to display unix timestamps with File Info Formatting.
2.36.0
- Mayhem
diff --git a/script.coffee b/script.coffee
index 5c2857570..0ab49cf85 100644
--- a/script.coffee
+++ b/script.coffee
@@ -2199,8 +2199,8 @@ Options =
File Info Formatting
- :
- - Link (with original file name): %l (lowercase L, truncated), %L (untruncated)
- - Original file name: %n (Truncated), %N (Untruncated)
+ - Link: %l (lowercase L, truncated), %L (untruncated), %t (Unix timestamp)
+ - Original file name: %n (truncated), %N (untruncated), %T (Unix timestamp)
- Spoiler indicator: %p
- Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
- Resolution: %r (Displays PDF on /po/, for PDFs)
@@ -2367,7 +2367,7 @@ Options =
$.id('backlinkPreview').textContent = Conf['backlink'].replace /%id/, '123456789'
fileInfo: ->
FileInfo.data =
- link: 'javascript:;'
+ link: '//images.4chan.org/g/src/1334437723720.jpg'
spoiler: true
size: '276'
unit: 'KB'
@@ -2812,7 +2812,7 @@ FileInfo =
node.setAttribute 'data-filename', filename
node.innerHTML = FileInfo.funk FileInfo
setFormats: ->
- code = Conf['fileInfo'].replace /%([BKlLMnNprs])/g, (s, c) ->
+ code = Conf['fileInfo'].replace /%(.)/g, (s, c) ->
if c of FileInfo.formatters
"' + f.formatters.#{c}() + '"
else
@@ -2833,6 +2833,8 @@ FileInfo =
size = size.toFixed 2
"#{size} #{unitT}"
formatters:
+ t: -> FileInfo.data.link.match(/\d+\..+$/)[0]
+ T: -> "#{@t()}"
l: -> "#{@n()}"
L: -> "#{@N()}"
n: ->