diff --git a/src/General/Config.coffee b/src/General/Config.coffee index e3e1962e0..685aeefdb 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -431,6 +431,11 @@ Config = 'Remember the spoiler state, instead of resetting after posting.' 1 ] + 'Randomize Filename': [ + false + 'Set the filename to a random timestamp within the past year. Disabled on /f/.' + 1 + ] 'Show New Thread Option in Threads': [ false 'Show the option to post a new / different thread from inside a thread.' diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 7ebc6d92d..7743ed5f7 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -10,6 +10,15 @@ QR = 'swf': 'application/vnd.adobe.flash.movie' 'webm': 'video/webm' + extensionFromType: + 'image/jpeg': 'jpg' + 'image/png': 'png' + 'image/gif': 'gif' + 'application/pdf': 'pdf' + 'application/vnd.adobe.flash.movie': 'swf' + 'application/x-shockwave-flash': 'swf' + 'video/webm': 'webm' + init: -> return unless Conf['Quick Reply'] diff --git a/src/Posting/QR.post.coffee b/src/Posting/QR.post.coffee index 5636ba648..79ebc7632 100644 --- a/src/Posting/QR.post.coffee +++ b/src/Posting/QR.post.coffee @@ -179,7 +179,10 @@ QR.post = class return setFile: (@file) -> - @filename = @file.name + @filename = if Conf['Randomize Filename'] and g.BOARD.ID isnt 'f' + "#{Date.now() - Math.floor(Math.random() * 365 * $.DAY)}.#{QR.extensionFromType[@file.type] or 'jpg'}" + else + @file.name @filesize = $.bytesToString @file.size @checkSize() @nodes.label.hidden = false if QR.spoiler