From c6d2e8da992db456683e38b8fdcaa9c6d404a3f6 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 26 Oct 2023 20:48:00 +0200 Subject: viewer,timer: replace deprecated substr --- beamer/viewer/screen/timer.js | 2 +- beamer/viewer/viewer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beamer/viewer/screen/timer.js b/beamer/viewer/screen/timer.js index 112a421..0f5d9bc 100644 --- a/beamer/viewer/screen/timer.js +++ b/beamer/viewer/screen/timer.js @@ -78,7 +78,7 @@ class Timer { _setDisplay(seconds) { const dateObj = new Date(null); dateObj.setSeconds(seconds); - this.display.textContent = dateObj.toISOString().substr(11, 8); + this.display.textContent = dateObj.toISOString().slice(11, 11+8); } _toggleDisplay(active) { diff --git a/beamer/viewer/viewer.js b/beamer/viewer/viewer.js index 28c0187..d8d7668 100644 --- a/beamer/viewer/viewer.js +++ b/beamer/viewer/viewer.js @@ -107,7 +107,7 @@ class Viewer { _hash_params() { const queryDict = {}; - location.hash.substr(1).split("&").forEach(item => { + location.hash.slice(1).split("&").forEach(item => { const pair = item.split("="); queryDict[pair[0]] = pair[1]; }); -- cgit v1.2.3