From 3284de0d06583f47176238b51eed2b4cfad6c4c0 Mon Sep 17 00:00:00 2001 From: milky Date: Thu, 6 Feb 2014 05:02:36 +1100 Subject: [PATCH 1/3] Archive link. --- html/General/Settings-section-Rice.html | 1 + src/Archive/Redirect.coffee | 5 ++++- src/General/Header.coffee | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/html/General/Settings-section-Rice.html b/html/General/Settings-section-Rice.html index 43a9a8622..fe89c50ef 100644 --- a/html/General/Settings-section-Rice.html +++ b/html/General/Settings-section-Rice.html @@ -3,6 +3,7 @@
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: board
+
Archive link: board-archive
Title link: board-title
Board link (Replace with title when on that board): board-replace
Full text link: board-full
diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 67cf6d575..21c4c0614 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -45,7 +45,7 @@ Redirect = cb?() to: (dest, data) -> - archive = (if dest is 'search' then Redirect.data.thread else Redirect.data[dest])[data.boardID] + archive = (if dest is 'search' or 'board' then Redirect.data.thread else Redirect.data[dest])[data.boardID] return '' unless archive Redirect[dest] archive, data @@ -80,6 +80,9 @@ Redirect = file: (archive, {boardID, filename}) -> "#{Redirect.protocol archive}#{archive.domain}/#{boardID}/full_image/#{filename}" + board: (archive, {boardID}) -> + "#{Redirect.protocol archive}#{archive.domain}/#{boardID}/" + search: (archive, {boardID, type, value}) -> type = if type is 'name' 'username' diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 6572b1146..2d04d262a 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -113,7 +113,7 @@ Header = $.rmAll list return unless text as = $$ '#full-board-list a[title]', Header.bar - nodes = text.match(/[\w@]+(-(all|title|replace|full|text:"[^"]+"))*|[^\w@]+/g).map (t) -> + nodes = text.match(/[\w@]+(-(all|title|replace|full|archive|text:"[^"]+"))*|[^\w@]+/g).map (t) -> if /^[^\w@]/.test t return $.tn t if /^toggle-all/.test t @@ -140,6 +140,10 @@ Header = else a.textContent + if /-archive/.test t + a.href = Redirect.to 'board', + boardID: board + $.addClass a, 'navSmall' if board is '@' return a $.tn t From 4eb0574505806676e030075d474dfbc11eacd71a Mon Sep 17 00:00:00 2001 From: milky Date: Thu, 6 Feb 2014 05:47:19 +1100 Subject: [PATCH 2/3] Further archive link work. --- src/Archive/Redirect.coffee | 2 +- src/General/Header.coffee | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 21c4c0614..25a773fc8 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -45,7 +45,7 @@ Redirect = cb?() to: (dest, data) -> - archive = (if dest is 'search' or 'board' then Redirect.data.thread else Redirect.data[dest])[data.boardID] + archive = (if dest in ['search', 'board'] then Redirect.data.thread else Redirect.data[dest])[data.boardID] return '' unless archive Redirect[dest] archive, data diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 2d04d262a..64d83ee37 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -140,9 +140,8 @@ Header = else a.textContent - if /-archive/.test t - a.href = Redirect.to 'board', - boardID: board + if /-archive/.test(t) and href = Redirect.to 'board', {boardID: board} + a.href = href $.addClass a, 'navSmall' if board is '@' return a From 6b45758198f123801e4fe969b3e63d19eb628655 Mon Sep 17 00:00:00 2001 From: milky Date: Thu, 6 Feb 2014 06:19:07 +1100 Subject: [PATCH 3/3] Changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d234a55b..4d5296d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Added `Archive link` to the Custom Board Navigation Rice - Added a setting to configure the number of threads per page for the paged mode of the index. ### 3.16.4 - *2014-02-04*