Remove disabled option in archive settings. #904

This commit is contained in:
ccd0 2016-06-13 02:39:54 -07:00
parent aaef0c8802
commit ae09e162f9
2 changed files with 15 additions and 25 deletions

View File

@ -22,23 +22,19 @@ Redirect =
for data in Conf['archives']
for key in ['boards', 'files']
data[key] = [] unless data[key] instanceof Array
{uid, name, boards, files, software, withCredentials} = data
{uid, name, boards, files, software} = data
continue unless software in ['fuuka', 'foolfuuka']
archives[JSON.stringify(uid ? name)] = data
for boardID in boards
unless withCredentials
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
o.report[boardID] = data if name is 'fgts'
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
o.report[boardID] = data if name is 'fgts'
for boardID, record of Conf['selectedArchives']
for type, id of record
if id is null
delete o[type][boardID]
else if archive = archives[JSON.stringify id]
boards = if type is 'file' then archive.files else archive.boards
o[type][boardID] = archive if boardID in boards
for type, id of record when (archive = archives[JSON.stringify id])
boards = if type is 'file' then archive.files else archive.boards
o[type][boardID] = archive if boardID in boards
Redirect.data = o

View File

@ -499,23 +499,17 @@ Settings =
$.rmAll tbody
archBoards = {}
for {uid, name, boards, files, software, withCredentials} in Conf['archives']
for {uid, name, boards, files, software} in Conf['archives']
continue unless software in ['fuuka', 'foolfuuka']
for boardID in boards
o = archBoards[boardID] or=
thread: [[], []]
post: [[], []]
file: [[], []]
i = +!!withCredentials
thread: []
post: []
file: []
archive = [uid ? name, name]
o.thread[i].push archive
o.post[i].push archive if software is 'foolfuuka'
o.file[i].push archive if boardID in files
for boardID, o of archBoards
for item in ['thread', 'post', 'file']
i = if o[item][0].length then 1 else 0
o[item][i].push [null, 'disabled']
o[item] = o[item][0].concat(o[item][1])
o.thread.push archive
o.post.push archive if software is 'foolfuuka'
o.file.push archive if boardID in files
rows = []
boardOptions = []