From 50549863f3737c330dcdd9d2c11a01b70a6aab03 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 10 May 2014 22:44:28 -0700 Subject: [PATCH] add disabled option when Foolz Beta is the only archive --- src/Archive/Redirect.coffee | 4 ++-- src/General/Settings.coffee | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 381c69ea9..4db6965ba 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -7,9 +7,9 @@ Redirect = archives = {} for data in Redirect.archives - {name, boards, files, software} = data + {name, boards, files, software, withCredentials} = data archives[name] = data - for boardID in boards + for boardID in boards when !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 diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index a80d27757..2c7ae7b3c 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -307,15 +307,21 @@ Settings = $.on $.id('apply-css'), 'click', Settings.usercss archBoards = {} - for {name, boards, files, software} in Redirect.archives + for {name, boards, files, software, withCredentials} in Redirect.archives for boardID in boards o = archBoards[boardID] or= - thread: [] - post: [] - file: [] - o.thread.push name - o.post.push name if software is 'foolfuuka' - o.file.push name if boardID in files + thread: [[], []] + post: [[], []] + file: [[], []] + i = +!!withCredentials + o.thread[i].push name + o.post[i].push name if software is 'foolfuuka' + o.file[i].push name if boardID in files + for boardID, o of archBoards + for item in ['thread', 'post', 'file'] + if o[item][0].length is 0 and o[item][1].length isnt 0 + o[item][0].push 'disabled' + o[item] = o[item][0].concat(o[item][1]) rows = [] boardOptions = []