Fixed timeslider when hot reloading

This commit is contained in:
SamTv12345 2024-07-17 10:55:30 +02:00
parent bbf4adb075
commit 456f904050
3 changed files with 2 additions and 5 deletions

View file

@ -183,7 +183,7 @@ const handleLiveReload = async (args: any, padString: string, timeSliderString:
// can be removed when require-kernel is dropped // can be removed when require-kernel is dropped
res.header('Feature-Policy', 'sync-xhr \'self\''); res.header('Feature-Policy', 'sync-xhr \'self\'');
const content = eejs.require('ep_etherpad-lite/templates/pad.html', { const content = eejs.require('ep_etherpad-lite/templates/timeslider.html', {
req, req,
toolbar, toolbar,
isReadOnly, isReadOnly,

View file

@ -31,7 +31,7 @@ const randomString = require('./pad_utils').randomString;
const hooks = require('./pluginfw/hooks'); const hooks = require('./pluginfw/hooks');
const padutils = require('./pad_utils').padutils; const padutils = require('./pad_utils').padutils;
const socketio = require('./socketio'); const socketio = require('./socketio');
import html10n from '../js/vendors/html10n'
let token, padId, exportLinks, socket, changesetLoader, BroadcastSlider; let token, padId, exportLinks, socket, changesetLoader, BroadcastSlider;
const init = () => { const init = () => {

View file

@ -483,7 +483,6 @@ export class Html10n {
}) })
this.build(langs, (er: null, translations: Map<string, any>) =>{ this.build(langs, (er: null, translations: Map<string, any>) =>{
console.log("Translations are", translations)
this.translations = translations this.translations = translations
this.translateElement(translations) this.translateElement(translations)
this.mt.trigger('localized') this.mt.trigger('localized')
@ -852,7 +851,6 @@ class Loader {
if (xhr.readyState == 4) { if (xhr.readyState == 4) {
if (xhr.status == 200 || xhr.status === 0) { if (xhr.status == 200 || xhr.status === 0) {
const data = JSON.parse(xhr.responseText); const data = JSON.parse(xhr.responseText);
console.log("Data is", data)
this.cache.set(href, data) this.cache.set(href, data)
// Pass on the contents for parsing // Pass on the contents for parsing
this.parse(lang, href, data, callback) this.parse(lang, href, data, callback)
@ -972,7 +970,6 @@ class Loader {
return return
} }
console.log("Setting lang", lang)
this.langs.set(lang,data[lang]) this.langs.set(lang,data[lang])
// TODO: Also store accompanying langs // TODO: Also store accompanying langs
callback() callback()