From d991f7f180e8f57fac94d69015bbf26605da2721 Mon Sep 17 00:00:00 2001 From: Joseph Abbey Date: Sun, 28 Jan 2024 12:02:24 +0000 Subject: [PATCH] Fix autocomplete and copy button --- web/index.html | 9 +++++++++ web/main.js | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 9903e50..c4c7ec1 100644 --- a/web/index.html +++ b/web/index.html @@ -212,6 +212,9 @@ &[icon='download']::before { background-image: url(https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/download/default/48px.svg); } + &[icon='copy']::before { + background-image: url(https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/content_copy/default/48px.svg); + } } } @@ -239,6 +242,12 @@ icon="download" id="download" type="button"> + { document.querySelector('#menu_url').classList.add('invalid'); } }); + document.querySelector('#copy').addEventListener('click', async (e) => { + navigator.clipboard.writeText(model.getValue()); + toast({ + text: 'Copied!', + color: 'var(--ctp-mocha-green)', + }); + }); document.querySelector('#api_url').addEventListener('change', (e) => { api_url = e.target.value; @@ -661,7 +668,8 @@ require(['vs/editor/editor.main'], async () => { i--; } while ( i >= 0 && - word.word[i].toUpperCase() != word.word[i].toLowerCase() + (word.word[i] == '_' || + word.word[i].toUpperCase() != word.word[i].toLowerCase()) ); i++; var range = {