From d3555dfbf3e8b5840c002adbc10c4d53d5931898 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 11 Jan 2021 15:36:16 -0800 Subject: [PATCH] Sync with Etiquette. --- frontends/ycdl_flask/static/css/common.css | 4 ++-- frontends/ycdl_flask/static/js/common.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/frontends/ycdl_flask/static/css/common.css b/frontends/ycdl_flask/static/css/common.css index 4912022..bd32129 100644 --- a/frontends/ycdl_flask/static/css/common.css +++ b/frontends/ycdl_flask/static/css/common.css @@ -23,15 +23,15 @@ html { height: 100vh; box-sizing: border-box; + color: var(--color_text_normal); } *, *:before, *:after { box-sizing: inherit; + color: inherit; } -* { color: var(--color_text_normal); } - body { display: grid; diff --git a/frontends/ycdl_flask/static/js/common.js b/frontends/ycdl_flask/static/js/common.js index 508b50e..1fab00a 100644 --- a/frontends/ycdl_flask/static/js/common.js +++ b/frontends/ycdl_flask/static/js/common.js @@ -171,6 +171,19 @@ function size_iframe_to_content(iframe) iframe.style.height = iframe.contentWindow.document.documentElement.scrollHeight + 'px'; } +common.update_dynamic_elements = +function update_dynamic_elements(class_name, text) +{ + /* + Find all elements with this class and set their innertext to this text. + */ + const elements = document.getElementsByClassName(class_name); + for (const element of elements) + { + element.innerText = text; + } +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // HOOKS & ADD-ONS ///////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////