Copy fix from Mayhem, hopefully I didn't break anything

This commit is contained in:
Kabir Sala 2014-02-20 20:56:49 +01:00
parent eccc5b5c2a
commit 3986298f4f
2 changed files with 12 additions and 23 deletions

View File

@ -1,12 +1,18 @@
Redirect =
init: ->
o =
thread: {}
post: {}
file: {}
post: {}
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 type, id of record when (archive = archives[id])
@ -14,13 +20,6 @@ Redirect =
continue unless boardID in boards
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
archives:

View File

@ -429,19 +429,9 @@ QR =
status: '[type=submit]'
fileInput: '[type=file]'
}
check =
jpg: 'image/jpeg'
pdf: 'application/pdf'
swf: 'application/x-shockwave-flash'
# Allow only this board's supported files.
mimeTypes = $('ul.rules > li').textContent.trim().match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) ->
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 ''
mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', '']
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
QR.spoiler = !!$ 'input[name=spoiler]'