diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index ffe41d3ac..b8a8d32cd 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -519,7 +519,7 @@ Settings = $.id('lastarchivecheck').textContent = 'never' items = {} - for name in ['archiveLists', 'archiveAutoUpdate', 'captchaLanguage', 'boardnav', 'time', 'timeLocale', 'backlink', 'fileInfo', 'QR.personas', 'favicon', 'usercss', 'customCooldown', 'jsWhitelist'] + for name in ['archiveLists', 'archiveAutoUpdate', 'captchaLanguage', 'boardnav', 'time', 'timeLocale', 'backlink', 'pastedname', 'fileInfo', 'QR.personas', 'favicon', 'usercss', 'customCooldown', 'jsWhitelist'] items[name] = Conf[name] input = inputs[name] event = if name in ['archiveLists', 'archiveAutoUpdate', 'QR.personas', 'favicon', 'usercss'] then 'change' else 'input' @@ -678,6 +678,9 @@ Settings = backlink: -> @nextElementSibling.textContent = @value.replace /%(?:id|%)/g, (x) -> ({'%id': '123456789', '%%': '%'})[x] + pastedname: -> + @nextElementSibling.textContent = "#{@value}.png" + fileInfo: -> data = isReply: true diff --git a/src/General/Settings/Advanced.html b/src/General/Settings/Advanced.html index 53dd2f680..fb81b2946 100644 --- a/src/General/Settings/Advanced.html +++ b/src/General/Settings/Advanced.html @@ -72,6 +72,11 @@
:
+
+ Default pasted content filename +
:
+
+
File Info Formatting is disabled.
:
diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 3bd19a0a7..5cd458058 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -385,7 +385,8 @@ QR = if file {type} = file blob = new Blob [file], {type} - blob.name = "file.#{QR.extensionFromType[type] or 'jpg'}" + pastedname = Conf['pastedname'] + blob.name = "#{pastedname}.#{QR.extensionFromType[type] or 'jpg'}" QR.open() QR.handleFiles [blob] $.addClass QR.nodes.el, 'dump' @@ -404,7 +405,8 @@ QR = for i in [0...bstr.length] arr[i] = bstr.charCodeAt(i) blob = new Blob [arr], {type: m[1]} - blob.name = "file.#{m[2]}" + pastedname = Conf['pastedname'] + blob.name = "#{pastedname}.#{m[2]}" QR.handleFiles [blob] else if /^https?:\/\//.test src QR.handleUrl src diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 871a3ded3..83da402ed 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -851,6 +851,8 @@ Config = backlink: '>>%id' + pastedname: 'file' + fileInfo: '%l %d (%p%s, %r%g)' favicon: 'ferongr'