mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 08:14:00 +01:00
Add base app.js, opening external links in new tabs
This commit is contained in:
parent
f328b8bfe8
commit
72d773c182
15
app.js
Normal file
15
app.js
Normal file
@ -0,0 +1,15 @@
|
||||
;(function(window, document, undefined) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// Open all external links in new tabs
|
||||
var links = document.getElementsByTagName("a");
|
||||
|
||||
for(var i = 0; i < links.length; i++) {
|
||||
var thisLink = links[i];
|
||||
if(thisLink.getAttribute("href") && thisLink.hostName !== location.hostname) {
|
||||
thisLink.target = "_blank";
|
||||
}
|
||||
}
|
||||
|
||||
})(window, document);
|
Loading…
Reference in New Issue
Block a user