From 9b89a7b2f2a667ac1ea75a2a63cb6eb31ba3b616 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 17 Feb 2019 12:02:47 +0100 Subject: [PATCH] Port upstream's javascript to the error page --- app/javascript/flavours/glitch/packs/error.js | 13 +++++++++++++ app/javascript/flavours/glitch/theme.yml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 app/javascript/flavours/glitch/packs/error.js diff --git a/app/javascript/flavours/glitch/packs/error.js b/app/javascript/flavours/glitch/packs/error.js new file mode 100644 index 0000000000..81c86c3abb --- /dev/null +++ b/app/javascript/flavours/glitch/packs/error.js @@ -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'; + }); +}); diff --git a/app/javascript/flavours/glitch/theme.yml b/app/javascript/flavours/glitch/theme.yml index 0c8342c443..d8f3133818 100644 --- a/app/javascript/flavours/glitch/theme.yml +++ b/app/javascript/flavours/glitch/theme.yml @@ -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: