Copy fix from Mayhem, hopefully I didn't break anything
This commit is contained in:
parent
eccc5b5c2a
commit
3986298f4f
@ -1,12 +1,18 @@
|
|||||||
Redirect =
|
Redirect =
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
o =
|
o =
|
||||||
thread: {}
|
thread: {}
|
||||||
post: {}
|
post: {}
|
||||||
file: {}
|
file: {}
|
||||||
|
|
||||||
{archives} = Redirect
|
archives = {}
|
||||||
|
for {name, boards, files, data} in Redirect.archives
|
||||||
|
archives[name] = {boards, files, data}
|
||||||
|
{software} = data
|
||||||
|
for boardID in boards
|
||||||
|
o.thread[boardID] = data unless boardID of o.thread
|
||||||
|
o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka'
|
||||||
|
o.file[boardID] = data unless boardID of o.file or boardID not in files
|
||||||
|
|
||||||
for boardID, record of Conf['selectedArchives']
|
for boardID, record of Conf['selectedArchives']
|
||||||
for type, id of record when (archive = archives[id])
|
for type, id of record when (archive = archives[id])
|
||||||
@ -14,13 +20,6 @@ Redirect =
|
|||||||
continue unless boardID in boards
|
continue unless boardID in boards
|
||||||
o[type][boardID] = archive.data
|
o[type][boardID] = archive.data
|
||||||
|
|
||||||
for name, {data, boards, files} of archives
|
|
||||||
{software} = data
|
|
||||||
for boardID in boards
|
|
||||||
o.thread[boardID] = data unless boardID of o.thread
|
|
||||||
o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka'
|
|
||||||
o.file[boardID] = data unless boardID of o.file or boardID not in files
|
|
||||||
|
|
||||||
Redirect.data = o
|
Redirect.data = o
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
|
|||||||
@ -429,19 +429,9 @@ QR =
|
|||||||
status: '[type=submit]'
|
status: '[type=submit]'
|
||||||
fileInput: '[type=file]'
|
fileInput: '[type=file]'
|
||||||
}
|
}
|
||||||
|
|
||||||
check =
|
|
||||||
jpg: 'image/jpeg'
|
|
||||||
pdf: 'application/pdf'
|
|
||||||
swf: 'application/x-shockwave-flash'
|
|
||||||
|
|
||||||
# Allow only this board's supported files.
|
# Allow only this board's supported files.
|
||||||
mimeTypes = $('ul.rules > li').textContent.trim().match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) ->
|
mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', '']
|
||||||
check[type] or "image/#{type}"
|
|
||||||
|
|
||||||
QR.mimeTypes = mimeTypes.split ', '
|
|
||||||
# Add empty mimeType to avoid errors with URLs selected in Window's file dialog.
|
|
||||||
QR.mimeTypes.push ''
|
|
||||||
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
|
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
|
||||||
|
|
||||||
QR.spoiler = !!$ 'input[name=spoiler]'
|
QR.spoiler = !!$ 'input[name=spoiler]'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user