Allow for links to open in a new tab

Closes #504
This commit is contained in:
Johnny 2019-08-18 22:17:29 +10:00 committed by GitHub
parent 5b4bc76537
commit 8e626d5d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,7 +191,7 @@ Header =
$.rmAll list $.rmAll list
return unless boardnav return unless boardnav
boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' ' boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' '
re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|nt|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g
nodes = (Header.mapCustomNavigation(t) for t in boardnav.match re) nodes = (Header.mapCustomNavigation(t) for t in boardnav.match re)
$.add list, nodes $.add list, nodes
CatalogLinks.setLinks list CatalogLinks.setLinks list
@ -294,6 +294,11 @@ Header =
else else
return a.firstChild # Its text node. return a.firstChild # Its text node.
if /-nt/.test t
a.target = '_blank'
a.rel = 'noopener noreferrer';
return a
$.addClass a, 'navSmall' if boardID is '@' $.addClass a, 'navSmall' if boardID is '@'
a a