External links

This commit is contained in:
Jordan Bates 2013-05-10 03:25:25 -07:00
parent e0bb29e4a4
commit f1c2ca4691
5 changed files with 42 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -132,7 +132,7 @@ Header =
$.rmAll list $.rmAll list
return unless text return unless text
as = $$('#full-board-list a', Header.bar) as = $$('#full-board-list a', Header.bar)
nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map (t) -> nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+"))*|[^\w@]+/g).map (t) ->
if /^[^\w@]/.test t if /^[^\w@]/.test t
return $.tn t return $.tn t
if /^toggle-all/.test t if /^toggle-all/.test t
@ -142,6 +142,13 @@ Header =
href: 'javascript:;' href: 'javascript:;'
$.on a, 'click', Header.toggleBoardList $.on a, 'click', Header.toggleBoardList
return a return a
if /^external/.test t
a = $.el 'a',
href: (t.match(/-url:"(.+)"/) || [null, '+'])[1]
textContent: (t.match(/-text:"(.+)"-/) || [null, '+'])[1]
className: 'external'
target: '_blank'
return a
board = if /^current/.test t board = if /^current/.test t
g.BOARD.ID g.BOARD.ID
else else

View File

@ -21,6 +21,7 @@
<div>Custom text link: <code>board-text:"VIP Board"</code></div> <div>Custom text link: <code>board-text:"VIP Board"</code></div>
<div>Index-only link: <code>board-index</code></div> <div>Index-only link: <code>board-index</code></div>
<div>Catalog-only link: <code>board-catalog</code></div> <div>Catalog-only link: <code>board-catalog</code></div>
<div>External link: <code>external-text:"Google"-url:"http://www.google.com"</code></div>
<div>Combinations are possible: <code>board-index-text:"VIP Index"</code></div> <div>Combinations are possible: <code>board-index-text:"VIP Index"</code></div>
<div>Full board list toggle: <code>toggle-all</code></div> <div>Full board list toggle: <code>toggle-all</code></div>
</fieldset> </fieldset>