Add 'Randomize Filename' option. #452
This commit is contained in:
parent
d769c01c80
commit
b829bde742
@ -431,6 +431,11 @@ Config =
|
|||||||
'Remember the spoiler state, instead of resetting after posting.'
|
'Remember the spoiler state, instead of resetting after posting.'
|
||||||
1
|
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': [
|
'Show New Thread Option in Threads': [
|
||||||
false
|
false
|
||||||
'Show the option to post a new / different thread from inside a thread.'
|
'Show the option to post a new / different thread from inside a thread.'
|
||||||
|
|||||||
@ -10,6 +10,15 @@ QR =
|
|||||||
'swf': 'application/vnd.adobe.flash.movie'
|
'swf': 'application/vnd.adobe.flash.movie'
|
||||||
'webm': 'video/webm'
|
'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: ->
|
init: ->
|
||||||
return unless Conf['Quick Reply']
|
return unless Conf['Quick Reply']
|
||||||
|
|
||||||
|
|||||||
@ -179,7 +179,10 @@ QR.post = class
|
|||||||
return
|
return
|
||||||
|
|
||||||
setFile: (@file) ->
|
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
|
@filesize = $.bytesToString @file.size
|
||||||
@checkSize()
|
@checkSize()
|
||||||
@nodes.label.hidden = false if QR.spoiler
|
@nodes.label.hidden = false if QR.spoiler
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user