diff --git a/Gruntfile.js b/Gruntfile.js
index c8994d7..7ff8c1c 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -16,6 +16,9 @@ module.exports = grunt => {
images: {
files: [{expand: true, cwd: "src/main/", src: ["**/*.{ico,png,svg}"], dest: "dist/", flatten: true}]
},
+ js: {
+ files: [{expand: true, cwd: "src/main/", src: ["**/plain.js"], dest: "dist/", flatten: true}]
+ },
pwa: {
files: [{expand: true, cwd: "src/main/", src: ["manifest.json", "sw.js"], dest: "dist/", flatten: true}]
},
@@ -56,6 +59,10 @@ module.exports = grunt => {
files: ["src/main/**/*.html"],
tasks: ["copy:html"],
},
+ js: {
+ files: ["src/main/**/*.js"],
+ tasks: ["copy:js"],
+ },
ts: {
files: ["src/main/**/*.ts"],
tasks: ["webpack:dev", "replace:dev"],
@@ -105,6 +112,7 @@ module.exports = grunt => {
"copy:css",
"copy:html",
"copy:images",
+ "copy:js",
"copy:pwa",
// Compile
"webpack:dev",
@@ -119,6 +127,7 @@ module.exports = grunt => {
"copy:css",
"copy:html",
"copy:images",
+ "copy:js",
"copy:pwa",
// Compile JS
"webpack:deploy",
diff --git a/package.json b/package.json
index a4c2d8e..4b8b5e6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "fwdekker.com",
- "version": "0.40.5",
+ "version": "0.40.6",
"description": "The source code of [my personal website](https://fwdekker.com/).",
"author": "Felix W. Dekker",
"browser": "dist/bundle.js",
diff --git a/src/main/index.html b/src/main/index.html
index c901665..aee28c0 100644
--- a/src/main/index.html
+++ b/src/main/index.html
@@ -40,7 +40,7 @@
-->Please check the instructions how to enable JavaScript in your web browser.
This website does not function with Internet Explorer. Please install a newer browser such as
Microsoft Edge.
-
+
+
diff --git a/src/main/js/Main.ts b/src/main/js/Main.ts
index bceb773..12aa254 100644
--- a/src/main/js/Main.ts
+++ b/src/main/js/Main.ts
@@ -39,8 +39,8 @@ doAfterLoad(() => {
if (Persistence.getWasUpdated()) {
$("#terminalOutput").innerHTML = "" +
- "
The terminal application has been updated. To prevent unexpected errors, all " +
- "previous user changes have been reset.\n\n";
+ "
The terminal application has been updated. To prevent unexpected errors, " +
+ "all previous user changes have been reset.\n\n";
Persistence.setWasUpdated(false);
}
diff --git a/src/main/js/plain.js b/src/main/js/plain.js
new file mode 100644
index 0000000..ed7ee9c
--- /dev/null
+++ b/src/main/js/plain.js
@@ -0,0 +1,11 @@
+if (/MSIE|Trident/.test(window.navigator.userAgent)) {
+ window.onload = function() {
+ document.getElementById("ie-warning").className = "";
+ };
+}
+
+if ("serviceWorker" in navigator) {
+ window.addEventListener("load", function() {
+ return navigator.serviceWorker.register("sw.js?v=%%VERSION_NUMBER%%");
+ });
+}
diff --git a/src/main/sw.js b/src/main/sw.js
index 6f29caa..69f76e0 100644
--- a/src/main/sw.js
+++ b/src/main/sw.js
@@ -1,16 +1,19 @@
const CACHE_NAME = "fwdekker-%%VERSION_NUMBER%%";
const CACHE_FILES = [
"bundle.js",
+ "favicon.ico",
"favicon.png",
- "index.html",
- "manifest.json",
- "main.css",
+ "favicon.svg",
"icon_128x128.png",
"icon_144x144.png",
"icon_152x152.png",
"icon_192x192.png",
"icon_512x512.png",
- "icon_ios.png"
+ "icon_ios.png",
+ "index.html",
+ "main.css",
+ "manifest.json",
+ "plain.js",
];
self.addEventListener("install", event =>