From 543e94fd4a76cbd2a454f2c102a86afbbbaa2356 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 21 Feb 2021 17:59:15 +0000 Subject: [PATCH] timeslider: slight improvement on code quality (#4836) This is an interim patch, ultimately the JS needs to be thrown out of the HTML... --- src/templates/timeslider.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html index f04bf0c23..c577f3013 100644 --- a/src/templates/timeslider.html +++ b/src/templates/timeslider.html @@ -265,12 +265,12 @@ // server sends the CLIENT_VARS message. randomVersionString: <%-JSON.stringify(settings.randomVersionString)%>, }; - var BroadcastSlider; + let BroadcastSlider; (function () { - var pathComponents = location.pathname.split('/'); + const pathComponents = location.pathname.split('/'); // Strip 'p', the padname and 'timeslider' from the pathname and set as baseURL - var baseURL = pathComponents.slice(0,pathComponents.length-3).join('/') + '/'; + const baseURL = pathComponents.slice(0,pathComponents.length-3).join('/') + '/'; require.setRootURI(baseURL + "javascripts/src"); @@ -280,20 +280,20 @@ $ = jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; // Expose jQuery #HACK browser = require('ep_etherpad-lite/static/js/vendors/browser'); - var plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); - var socket = require('ep_etherpad-lite/static/js/timeslider').socket; + const plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); + const socket = require('ep_etherpad-lite/static/js/timeslider').socket; BroadcastSlider = require('ep_etherpad-lite/static/js/timeslider').BroadcastSlider; plugins.baseURL = baseURL; plugins.update(function () { - var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); - var timeslider = require('ep_etherpad-lite/static/js/timeslider') + const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); + const timeslider = require('ep_etherpad-lite/static/js/timeslider') timeslider.baseURL = baseURL; timeslider.init(); /* TODO: These globals shouldn't exist. */ - padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar; - padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp; + const padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar; + const padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp; padeditbar.init() });