Stop accidentally capturing static file links

pull/18/head
knotteye 3 years ago
parent 2a121d27ee
commit f703d5af7f
  1. 2
      site/index.js

@ -167,7 +167,7 @@ function handleLoad() {
function modifyLinks() { function modifyLinks() {
for (var ls = document.links, numLinks = ls.length, i=0; i<numLinks; i++){ for (var ls = document.links, numLinks = ls.length, i=0; i<numLinks; i++){
if(ls[i].href.indexOf(location.protocol+'//'+location.host) !== -1) { if(ls[i].href.indexOf(location.protocol+'//'+location.host) !== -1 && ls[i].href.match(new RegExp(/\/\w+\.\w+$/)) === null) {
//should be a regular link //should be a regular link
ls[i].setAttribute('onclick', 'return internalLink(\"'+ls[i].href.substring((location.protocol+'//'+location.host).length)+'\")'); ls[i].setAttribute('onclick', 'return internalLink(\"'+ls[i].href.substring((location.protocol+'//'+location.host).length)+'\")');
} }