From 4dc4861f4ca1f3edac78872d8501ef9e0d8158cb Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Wed, 14 May 2025 13:31:03 +0545 Subject: [PATCH 1/4] prevent scroll-to-top on restart/fast buttons in termynal.js --- docs/en/docs/js/termynal.js | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/en/docs/js/termynal.js b/docs/en/docs/js/termynal.js index 4ac32708a..9872fad2e 100644 --- a/docs/en/docs/js/termynal.js +++ b/docs/en/docs/js/termynal.js @@ -127,32 +127,32 @@ class Termynal { } generateRestart() { - const restart = document.createElement('a') - restart.onclick = (e) => { - e.preventDefault() - this.container.innerHTML = '' - this.init() - } - restart.href = '#' - restart.setAttribute('data-terminal-control', '') - restart.innerHTML = "restart ↻" - return restart - } + const restart = document.createElement('a'); + restart.href = 'javascript:void(0)'; + restart.setAttribute('data-terminal-control', ''); + restart.innerHTML = "restart ↻"; + restart.onclick = (e) => { + e.preventDefault(); + this.container.innerHTML = ''; + this.init(); + }; + return restart; +} generateFinish() { - const finish = document.createElement('a') - finish.onclick = (e) => { - e.preventDefault() - this.lineDelay = 0 - this.typeDelay = 0 - this.startDelay = 0 - } - finish.href = '#' - finish.setAttribute('data-terminal-control', '') - finish.innerHTML = "fast →" - this.finishElement = finish - return finish - } + const finish = document.createElement('a'); + finish.href = 'javascript:void(0)'; + finish.setAttribute('data-terminal-control', ''); + finish.innerHTML = "fast →"; + finish.onclick = (e) => { + e.preventDefault(); + this.lineDelay = 0; + this.typeDelay = 0; + this.startDelay = 0; + }; + this.finishElement = finish; + return finish; +} addRestart() { const restart = this.generateRestart() From 67134165d5e9c183838e1ef6b7b04f012ec3433a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 07:53:35 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/js/termynal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/js/termynal.js b/docs/en/docs/js/termynal.js index 9872fad2e..d0c43968a 100644 --- a/docs/en/docs/js/termynal.js +++ b/docs/en/docs/js/termynal.js @@ -128,7 +128,7 @@ class Termynal { generateRestart() { const restart = document.createElement('a'); - restart.href = 'javascript:void(0)'; + restart.href = 'javascript:void(0)'; restart.setAttribute('data-terminal-control', ''); restart.innerHTML = "restart ↻"; restart.onclick = (e) => { @@ -141,7 +141,7 @@ class Termynal { generateFinish() { const finish = document.createElement('a'); - finish.href = 'javascript:void(0)'; + finish.href = 'javascript:void(0)'; finish.setAttribute('data-terminal-control', ''); finish.innerHTML = "fast →"; finish.onclick = (e) => { From 3a642a6488942453c6d68eff9be75f88af5c0ddf Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Tue, 22 Jul 2025 15:47:17 +0545 Subject: [PATCH 3/4] intended termynal.js --- docs/en/docs/js/termynal.js | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/en/docs/js/termynal.js b/docs/en/docs/js/termynal.js index 9872fad2e..2244244e5 100644 --- a/docs/en/docs/js/termynal.js +++ b/docs/en/docs/js/termynal.js @@ -127,32 +127,32 @@ class Termynal { } generateRestart() { - const restart = document.createElement('a'); - restart.href = 'javascript:void(0)'; - restart.setAttribute('data-terminal-control', ''); - restart.innerHTML = "restart ↻"; - restart.onclick = (e) => { - e.preventDefault(); - this.container.innerHTML = ''; - this.init(); - }; - return restart; -} + const restart = document.createElement('a'); + restart.href = 'javascript:void(0)'; + restart.setAttribute('data-terminal-control', ''); + restart.innerHTML = "restart ↻"; + restart.onclick = (e) => { + e.preventDefault(); + this.container.innerHTML = ''; + this.init(); + }; + return restart; + } generateFinish() { - const finish = document.createElement('a'); - finish.href = 'javascript:void(0)'; - finish.setAttribute('data-terminal-control', ''); - finish.innerHTML = "fast →"; - finish.onclick = (e) => { - e.preventDefault(); - this.lineDelay = 0; - this.typeDelay = 0; - this.startDelay = 0; - }; - this.finishElement = finish; - return finish; -} + const finish = document.createElement('a'); + finish.href = 'javascript:void(0)'; + finish.setAttribute('data-terminal-control', ''); + finish.innerHTML = "fast →"; + finish.onclick = (e) => { + e.preventDefault(); + this.lineDelay = 0; + this.typeDelay = 0; + this.startDelay = 0; + }; + this.finishElement = finish; + return finish; + } addRestart() { const restart = this.generateRestart() From 046227d2c45801efc6850fb02dbda67a53c9b083 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:22:30 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/js/termynal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/js/termynal.js b/docs/en/docs/js/termynal.js index b3a5c732b..82d04e2d0 100644 --- a/docs/en/docs/js/termynal.js +++ b/docs/en/docs/js/termynal.js @@ -261,4 +261,4 @@ if (document.currentScript.hasAttribute('data-termynal-container')) { const containers = document.currentScript.getAttribute('data-termynal-container'); containers.split('|') .forEach(container => new Termynal(container)) -} \ No newline at end of file +}