diff --git a/web/static/js/bulma.js b/web/static/js/bulma.js index f116d2e..138efda 100644 --- a/web/static/js/bulma.js +++ b/web/static/js/bulma.js @@ -1,6 +1,16 @@ // Hamburger menu script for mobile. document.addEventListener('DOMContentLoaded', () => { + // Make all off-site hyperlinks open in a new tab. + (document.querySelectorAll("a") || []).forEach(node => { + let href = node.attributes.href; + if (href === undefined) return; + href = href.textContent; + if (href.indexOf("http:") === 0 || href.indexOf("https:") === 0) { + node.target = "_blank"; + } + }); + // Hamburger menu script. (function() { // Get all "navbar-burger" elements diff --git a/web/templates/forum/new_post.html b/web/templates/forum/new_post.html index 3425f50..3b65670 100644 --- a/web/templates/forum/new_post.html +++ b/web/templates/forum/new_post.html @@ -145,16 +145,4 @@ - - {{end}} \ No newline at end of file