From 9e1f0a12c04df65b930eb9ff191e384626bf8bdc Mon Sep 17 00:00:00 2001 From: milky Date: Thu, 6 Feb 2014 05:02:36 +1100 Subject: [PATCH] Archive link. Conflicts: html/General/Settings-section-Rice.html src/General/Header.coffee --- src/Archive/Redirect.coffee | 5 ++++- src/General/Header.coffee | 6 +++++- src/General/html/Settings/Advanced.html | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 854f09fae..707fd55e6 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -27,7 +27,7 @@ Redirect = archives: `<%= JSON.stringify(grunt.file.readJSON('src/Archive/archives.json')) %>` 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 @@ -64,6 +64,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 7c31d9ceb..17b127f14 100755 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -170,7 +170,7 @@ Header = $.rmAll list return unless text as = $$ '#full-board-list a[title]', Header.boardList - nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map (t) -> + nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|archive|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map (t) -> if /^[^\w@]/.test t return $.tn t if /^toggle-all/.test t @@ -208,6 +208,10 @@ Header = a.href = CatalogLinks[m[1]] board $.addClass a, 'catalog' if m[1] is 'catalog' + if /-archive/.test t + a.href = Redirect.to 'board', + boardID: board + $.addClass a, 'navSmall' if board is '@' return a $.tn t diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html index ce76429c2..a85e55ccd 100755 --- a/src/General/html/Settings/Advanced.html +++ b/src/General/html/Settings/Advanced.html @@ -18,6 +18,7 @@ New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
+
Archive link: g-archive
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full