Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriodiste authored Sep 24, 2023
1 parent 51112ec commit 1f9feaa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import TWEEN from './tween/tween.esm.js';
// Get the path of the root folder
const root_folder = window.location.href.substring(0, window.location.href.lastIndexOf("/")) + "/";
const hostname = window.location.hostname;
// Path from the hostname to the root folder
const root_absolute_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/")) + "/";
console.log("Root folder path: " + root_folder);
console.log("Root absolute path: " + root_absolute_path);
console.log("Hostname: " + hostname);

console.log("Version 1.4.0");
Expand All @@ -23,7 +26,7 @@ function get_url(resource, flag = false) {
if (!flag || true) {
if (resource.startsWith("/")) to_ret = resource.substring(1);
if (resource.startsWith("./")) to_ret = resource.substring(2);
to_ret = root_folder + to_ret;
to_ret = root_absolute_path + to_ret;
} else {
if (resource.startsWith("/")) to_ret = ".." + resource;
if (resource.startsWith("./")) to_ret = "." + resource;
Expand Down

0 comments on commit 1f9feaa

Please sign in to comment.