Included fetching tite

This commit is contained in:
Brychan Dempsey 2021-06-08 22:10:38 +12:00
parent 6aab0ee986
commit e00558937a

View File

@ -7,6 +7,9 @@
background-color: #383c4a; background-color: #383c4a;
} }
</style> </style>
<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/css/theme-night-sky.css">
<script> <script>
const queryString = window.location.search; const queryString = window.location.search;
const queryLoc = window.location.origin; const queryLoc = window.location.origin;
@ -29,11 +32,13 @@
var htmlTrimmed = doc.querySelector(selector); var htmlTrimmed = doc.querySelector(selector);
if (htmlTrimmed) { if (htmlTrimmed) {
htmlTrimmed = htmlTrimmed.parentElement; htmlTrimmed = htmlTrimmed.parentElement;
/*
var styleSheets = doc.querySelectorAll("link"); var styleSheets = doc.querySelectorAll("link");
for (var i = 0; i < styleSheets.length; i++) { for (var i = 0; i < styleSheets.length; i++) {
document.head.appendChild(styleSheets[i]); document.head.appendChild(styleSheets[i]);
} } */
// Fetch and refactor links, to use this html doc where appropriate // Fetch and refactor links, to use this html doc where appropriate
document.title = doc.title;
var hlinks = htmlTrimmed.querySelectorAll("a"); var hlinks = htmlTrimmed.querySelectorAll("a");
for (var i = 0; i < hlinks.length; i++) { for (var i = 0; i < hlinks.length; i++) {
if (hlinks[i].href.replace(queryLoc, "").startsWith("/")) { if (hlinks[i].href.replace(queryLoc, "").startsWith("/")) {