mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-16 11:28:40 +00:00
Fix autocomplete and copy button
This commit is contained in:
@ -212,6 +212,9 @@
|
|||||||
&[icon='download']::before {
|
&[icon='download']::before {
|
||||||
background-image: url(https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/download/default/48px.svg);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -239,6 +242,12 @@
|
|||||||
icon="download"
|
icon="download"
|
||||||
id="download"
|
id="download"
|
||||||
type="button"></button>
|
type="button"></button>
|
||||||
|
<button
|
||||||
|
title="Copy the content of the editor to the clipboard"
|
||||||
|
class="icon"
|
||||||
|
icon="copy"
|
||||||
|
id="copy"
|
||||||
|
type="button"></button>
|
||||||
<input
|
<input
|
||||||
required
|
required
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
|
10
web/main.js
10
web/main.js
@ -569,6 +569,13 @@ require(['vs/editor/editor.main'], async () => {
|
|||||||
document.querySelector('#menu_url').classList.add('invalid');
|
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) => {
|
document.querySelector('#api_url').addEventListener('change', (e) => {
|
||||||
api_url = e.target.value;
|
api_url = e.target.value;
|
||||||
@ -661,7 +668,8 @@ require(['vs/editor/editor.main'], async () => {
|
|||||||
i--;
|
i--;
|
||||||
} while (
|
} while (
|
||||||
i >= 0 &&
|
i >= 0 &&
|
||||||
word.word[i].toUpperCase() != word.word[i].toLowerCase()
|
(word.word[i] == '_' ||
|
||||||
|
word.word[i].toUpperCase() != word.word[i].toLowerCase())
|
||||||
);
|
);
|
||||||
i++;
|
i++;
|
||||||
var range = {
|
var range = {
|
||||||
|
Reference in New Issue
Block a user