From 0ca5a3459f808bad3edbc70bbf96344e695b3216 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 2 Aug 2021 19:57:33 -0400 Subject: [PATCH] Timeslider: Install an error handler --- src/static/js/pad_utils.js | 1 + src/static/js/timeslider.js | 2 ++ src/templates/timeslider.html | 1 + 3 files changed, 4 insertions(+) diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js index fbb9f1637..7b2d50604 100644 --- a/src/static/js/pad_utils.js +++ b/src/static/js/pad_utils.js @@ -296,6 +296,7 @@ const padutils = { let globalExceptionHandler = null; padutils.setupGlobalExceptionHandler = () => { if (globalExceptionHandler == null) { + require('./vendors/gritter'); globalExceptionHandler = (e) => { let type; let err; diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index 47246b4a1..2b226aef0 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -29,11 +29,13 @@ require('./vendors/jquery'); const Cookies = require('./pad_utils').Cookies; const randomString = require('./pad_utils').randomString; const hooks = require('./pluginfw/hooks'); +const padutils = require('./pad_utils').padutils; const socketio = require('./socketio'); let token, padId, exportLinks, socket, changesetLoader, BroadcastSlider; const init = () => { + padutils.setupGlobalExceptionHandler(); $(document).ready(() => { // start the custom js if (typeof customStart === 'function') customStart(); // eslint-disable-line no-undef diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html index 2070f56f5..dc351b1d0 100644 --- a/src/templates/timeslider.html +++ b/src/templates/timeslider.html @@ -29,6 +29,7 @@ for the JavaScript code in this page.| */ +