]> cat aescling's git repositories - mastodon.git/commitdiff
Port upstream's javascript to the error page
authorThibaut Girka <thib@sitedethib.com>
Sun, 17 Feb 2019 11:02:47 +0000 (12:02 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 17 Feb 2019 11:27:01 +0000 (12:27 +0100)
app/javascript/flavours/glitch/packs/error.js [new file with mode: 0644]
app/javascript/flavours/glitch/theme.yml

diff --git a/app/javascript/flavours/glitch/packs/error.js b/app/javascript/flavours/glitch/packs/error.js
new file mode 100644 (file)
index 0000000..81c86c3
--- /dev/null
@@ -0,0 +1,13 @@
+import ready from 'flavours/glitch/util/ready';
+
+ready(() => {
+  const image = document.querySelector('img');
+
+  image.addEventListener('mouseenter', () => {
+    image.src = '/oops.gif';
+  });
+
+  image.addEventListener('mouseleave', () => {
+    image.src = '/oops.png';
+  });
+});
index 0c8342c4436d1e8f7a423fa87534b05673a21a58..d8f3133818526118751b52a6c57232154889e67b 100644 (file)
@@ -7,7 +7,7 @@ pack:
     filename: packs/common.js
     stylesheet: true
   embed: packs/public.js
-  error:
+  error: packs/error.js
   home:
     filename: packs/home.js
     preload: