From 7243fbb705deac6c0042e0b756edd6a899c6e3c1 Mon Sep 17 00:00:00 2001 From: Flancian <0@flancia.org> Date: Sun, 7 Mar 2021 21:36:13 +0100 Subject: [PATCH] Work around etherpad focus grabbing. --- app/static/js/main.js | 11 +++++++++-- app/templates/stoa.html | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/static/js/main.js b/app/static/js/main.js index da300e21e..84c911f0e 100644 --- a/app/static/js/main.js +++ b/app/static/js/main.js @@ -41,8 +41,15 @@ document.addEventListener("DOMContentLoaded", function() { localStorage.setItem("theme", "light"); } }); - // this doesn't really work to prevent focus grabbing by etherpad. - document.getElementById("mini-cli").focus(); + + // icky but I'm not above this. + // this is to work around etherpad grabbing focus. + var element = document.getElementById("mini-cli"); + setTimeout( function() { element.focus() }, 1000 ); + setTimeout( function() { element.focus() }, 2000 ); + setTimeout( function() { element.focus() }, 3000 ); + setTimeout( function() { element.focus() }, 4000 ); + setTimeout( function() { element.focus() }, 5000 ); }); function processSettings(args){ diff --git a/app/templates/stoa.html b/app/templates/stoa.html index 87376ae97..b13d67b17 100644 --- a/app/templates/stoa.html +++ b/app/templates/stoa.html @@ -18,7 +18,7 @@ Stoa for [[{{node.uri}}]] ↓
from stoa.anagora.org/p/{{node.uri}}
- +