Implement -expired header links. #274
This commit is contained in:
parent
050daf3f1a
commit
abd74fc0ce
@ -173,7 +173,7 @@ Header =
|
|||||||
return unless boardnav
|
return unless boardnav
|
||||||
boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' '
|
boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' '
|
||||||
as = $$ '#full-board-list a[title]', Header.boardList
|
as = $$ '#full-board-list a[title]', Header.boardList
|
||||||
nodes = boardnav.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map (t) ->
|
nodes = boardnav.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map (t) ->
|
||||||
if /^[^\w@]/.test t
|
if /^[^\w@]/.test t
|
||||||
return $.tn t
|
return $.tn t
|
||||||
text = url = null
|
text = url = null
|
||||||
@ -222,6 +222,12 @@ Header =
|
|||||||
else
|
else
|
||||||
return $.tn a.textContent
|
return $.tn a.textContent
|
||||||
|
|
||||||
|
if /-expired/.test t
|
||||||
|
if boardID not in ['b', 'f']
|
||||||
|
a.href = "/#{boardID}/archive"
|
||||||
|
else
|
||||||
|
return $.tn a.textContent
|
||||||
|
|
||||||
$.addClass a, 'navSmall' if boardID is '@'
|
$.addClass a, 'navSmall' if boardID is '@'
|
||||||
return a
|
return a
|
||||||
$.tn t
|
$.tn t
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<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 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>Board link: <code>g</code></div>
|
||||||
<div>Archive link: <code>g-archive</code></div>
|
<div>Archive link: <code>g-archive</code></div>
|
||||||
|
<div>Internal archive link: <code>g-expired</code></div>
|
||||||
<div>Title link: <code>g-title</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>Board link (Replace with title when on that board): <code>g-replace</code></div>
|
||||||
<div>Full text link: <code>g-full</code></div>
|
<div>Full text link: <code>g-full</code></div>
|
||||||
|
|||||||
@ -52,6 +52,7 @@ CatalogLinks =
|
|||||||
continue if a.hostname not in ['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'] or
|
continue if a.hostname not in ['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'] or
|
||||||
!(board = a.pathname.split('/')[1]) or
|
!(board = a.pathname.split('/')[1]) or
|
||||||
board in ['f', 'status', '4chan'] or
|
board in ['f', 'status', '4chan'] or
|
||||||
|
a.pathname.split('/')[2] is 'archive' or
|
||||||
$.hasClass a, 'external'
|
$.hasClass a, 'external'
|
||||||
|
|
||||||
# Href is easier than pathname because then we don't have
|
# Href is easier than pathname because then we don't have
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user