Skip to content
Permalink
Browse files

Use absolute URLs for icons (on WayBack Machine)

  • Loading branch information
1j01 committed Jan 2, 2020
1 parent 60ba0df commit 4158bd603c3bb3aca14b1f65fd00f9f02f45701b
Showing with 11 additions and 6 deletions.
  1. +0 −2 TODO.md
  2. +3 −3 src/filesystem-setup.js
  3. +8 −1 src/helpers.js
@@ -5,8 +5,6 @@

* *Properly* link to the repo from within the app, not just with a URL in a virtual text file

* On the Wayback Machine, the filesystem fails to initialize, and so CREDITS.txt can't be viewed (among other things). What can I do about that? Can I add prefetch links to CREDITS.txt and filesystem-index.json?

* Start Menu

* Aria attributes
@@ -8,7 +8,7 @@ const desktop_folder_path = "/desktop/";

// For Wayback Machine, match URLs like https://web.archive.org/web/20191213113214/https://98.js.org/
// (also match URLs like https://98.js.org/ because why not)
const web_server_root =
const web_server_root_for_browserfs =
location.href.match(/98.js.org/) ?
location.href.match(/.*98.js.org/)[0] + "/" :
"/";
@@ -25,8 +25,8 @@ BrowserFS.configure({
readable: {
fs: "XmlHttpRequest",
options: {
index: web_server_root + "filesystem-index.json",
baseUrl: web_server_root
index: web_server_root_for_browserfs + "filesystem-index.json",
baseUrl: web_server_root_for_browserfs
}
}
}
@@ -37,8 +37,15 @@ var DESKTOP_ICON_SIZE = 32;
var TASKBAR_ICON_SIZE = 16;
var TITLEBAR_ICON_SIZE = 16;

// For Wayback Machine, match URLs like https://web.archive.org/web/20191213113214/https://98.js.org/
// (also match URLs like https://98.js.org/ because why not)
const web_server_root_for_icons =
location.href.match(/98.js.org/) ?
location.href.match(/.*98.js.org/)[0] + "/" :
"/";

function getIconPath(name, size){
return "/images/icons/" + name + "-" + size + "x" + size + ".png";
return web_server_root_for_icons + "images/icons/" + name + "-" + size + "x" + size + ".png";
}

function $Icon(name, size){

0 comments on commit 4158bd6

Please sign in to comment.
You can’t perform that action at this time.