Compare commits

..

2 Commits

Author SHA1 Message Date
6aab0ee986 fixed links, testing container 2021-06-08 22:05:12 +12:00
2bc53528d0 Fixed an issue with link calculation 2021-06-08 22:01:11 +12:00
2 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,7 @@
const queryString = window.location.search; const queryString = window.location.search;
const queryLoc = window.location.origin; const queryLoc = window.location.origin;
const queryRequest = window.location.href.split('?')[0]; const queryRequest = window.location.href.split('?')[0];
const windowLoc = window.location.toString();
console.log(queryString); console.log(queryString);
const urlParams = new URLSearchParams(queryString); const urlParams = new URLSearchParams(queryString);
const requestURL = urlParams.get('url') const requestURL = urlParams.get('url')
@ -27,6 +28,7 @@
// Select the correct container // Select the correct container
var htmlTrimmed = doc.querySelector(selector); var htmlTrimmed = doc.querySelector(selector);
if (htmlTrimmed) { if (htmlTrimmed) {
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]);
@ -38,7 +40,7 @@
// Replace either http://<somehost>/<somedoc> or http://<somehost> with "" so that: // Replace either http://<somehost>/<somedoc> or http://<somehost> with "" so that:
// 1.) links to elements on the same page work // 1.) links to elements on the same page work
// 2.) disable cross-origin requests // 2.) disable cross-origin requests
var fixedURL = hlinks[i].href.replace(window.location, "").replace(queryLoc, "") var fixedURL = hlinks[i].href.replace(windowLoc.split('#')[0], "").replace(queryLoc, "")
// If the remaining character is the hash, this is a same-page section link // If the remaining character is the hash, this is a same-page section link
if (fixedURL.startsWith("#")) { if (fixedURL.startsWith("#")) {
fixedURL = requestURL + fixedURL; fixedURL = requestURL + fixedURL;

View File

@ -18,7 +18,7 @@ Before attempting to use a system, it must be registered.
Registration requires a call to `registerSystem(String systemName, ECSSystem system)`, with params of the `String name` and a object reference of the [ECSSystem](./ECSSystem.md). Using the object reference, a system can be invoked at any time. Registration requires a call to `registerSystem(String systemName, ECSSystem system)`, with params of the `String name` and a object reference of the [ECSSystem](./ECSSystem.md). Using the object reference, a system can be invoked at any time.
See [EntityManager.java](/BrychanD/JaveECS/src/branch/master/javaecs/src/main/java/nz/ac/massey/programming_project_159333_s1_2021/EntityManager.java) See [EntityManager.java](/BrychanD/JaveECS/src/branch/master/javaecs/src/main/java/nz/ac/massey/javaecs/EntityManager.java)
## Constructors ## Constructors
``` java ``` java