Merge commit '15935ec673c770a63e6185b2ba3a9d62eb516811'

This commit is contained in:
ccd0 2018-10-03 02:22:58 -07:00
commit b75cbc5cab
4 changed files with 15 additions and 3 deletions

View File

@ -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

View File

@ -72,6 +72,11 @@
<div><input name="backlink" class="field" spellcheck="false">: <span class="backlink-preview"></span></div>
</fieldset>
<fieldset>
<legend>Default pasted content filename</legend>
<div><input name="pastedname" class="field" spellcheck="false">: <span class="pastedname-preview"></span></div>
</fieldset>
<fieldset>
<legend>File Info Formatting <span class="warning" data-feature="File Info Formatting">is disabled.</span></legend>
<div><input name="fileInfo" class="field" spellcheck="false">: <span class="file-info file-info-preview"></span></div>

View File

@ -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

View File

@ -851,6 +851,8 @@ Config =
backlink: '>>%id'
pastedname: 'file'
fileInfo: '%l %d (%p%s, %r%g)'
favicon: 'ferongr'