Archive link.

This commit is contained in:
milky 2014-02-06 05:02:36 +11:00
parent a234bdb2a5
commit 3284de0d06
3 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,7 @@
<div><input name="boardnav" class="field" spellcheck="false"></div>
<div>In the following, <code>board</code> can translate to a board ID (<code>a</code>, <code>b</code>, etc...), the current board (<code>current</code>), or the Twitter link (<code>@</code>).</div>
<div>Board link: <code>board</code></div>
<div>Archive link: <code>board-archive</code></div>
<div>Title link: <code>board-title</code></div>
<div>Board link (Replace with title when on that board): <code>board-replace</code></div>
<div>Full text link: <code>board-full</code></div>

View File

@ -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'

View File

@ -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