Archive link.

Conflicts:
	html/General/Settings-section-Rice.html
	src/General/Header.coffee
This commit is contained in:
milky 2014-02-06 05:02:36 +11:00 committed by ccd0
parent 2646e3d4f8
commit 9e1f0a12c0
3 changed files with 10 additions and 2 deletions

View File

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

View File

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

View File

@ -18,6 +18,7 @@
<span class=note>New lines will be converted into spaces.</span><br><br>
<div class=note>In the following examples for /g/, <code>g</code> can be changed to a different 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>g</code></div>
<div>Archive link: <code>g-archive</code></div>
<div>Title link: <code>g-title</code></div>
<div>Board link (Replace with title when on that board): <code>g-replace</code></div>
<div>Full text link: <code>g-full</code></div>