From 54687be452c48f5d94f90bc185994f9567349e81 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 9 Aug 2014 08:14:19 -0700 Subject: [PATCH] allow all archives to be disabled, sort archives with HTTPS support first --- src/General/Settings.coffee | 24 ++++++++++++------------ src/General/html/Settings/Advanced.html | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index e304685bc..0afa5b112 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -317,21 +317,21 @@ Settings = $.on $('#apply-css', section), 'click', Settings.usercss archBoards = {} - for {name, boards, files, software, withCredentials} in Redirect.archives + for {name, boards, files, software, https, withCredentials} in Redirect.archives + rank = if withCredentials then 2 else if https then 0 else 1 for boardID in boards - o = archBoards[boardID] or= - 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 + unless o = archBoards[boardID] + o = archBoards[boardID] = {} + for item in ['thread', 'post', 'file'] + o[item] = [[], [], []] + o.thread[rank].push name + o.post[rank].push name if software is 'foolfuuka' + o.file[rank].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]) + rank = if o[item][0].length + o[item][1].length is 0 then 1 else 2 + o[item][rank].push 'disabled' + o[item] = [].concat.apply [], o[item] rows = [] boardOptions = [] diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html index a4f7171c0..18e5c2ccf 100755 --- a/src/General/html/Settings/Advanced.html +++ b/src/General/html/Settings/Advanced.html @@ -10,7 +10,6 @@ -Disabled selections indicate that only one archive is available for that board and redirection type.