Voice: multiline textarea input + Clear button
This commit is contained in:
@@ -10,11 +10,14 @@
|
|||||||
<form method="post" action="/voice" onsubmit="onSend()">
|
<form method="post" action="/voice" onsubmit="onSend()">
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<label for="message">Command</label>
|
<label for="message">Command</label>
|
||||||
<input class="text-input" id="message" name="message"
|
<textarea class="text-input" id="message" name="message" rows="2" required
|
||||||
placeholder="e.g. what time is it, what's the weather, turn on the lights, play some music, Donald tell me a joke…"
|
placeholder="e.g. what time is it, what's the weather, turn on the lights, play some music, Donald tell me a joke…"
|
||||||
value="{{ command or '' }}" required>
|
style="resize:vertical; min-height:2.9em">{{ command or '' }}</textarea>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex;gap:8px">
|
||||||
|
<button class="button button-primary" style="flex:1" type="submit" id="sendBtn">Send</button>
|
||||||
|
<button class="button button-utility" type="button" id="clearMsg">Clear</button>
|
||||||
</div>
|
</div>
|
||||||
<button class="button button-primary width-full" type="submit" id="sendBtn">Send</button>
|
|
||||||
</form>
|
</form>
|
||||||
<div id="waiting" class="waiting">
|
<div id="waiting" class="waiting">
|
||||||
<span class="spinner"></span> Working — asking Jervis…
|
<span class="spinner"></span> Working — asking Jervis…
|
||||||
@@ -31,6 +34,12 @@
|
|||||||
var w = document.getElementById('waiting');
|
var w = document.getElementById('waiting');
|
||||||
if (w) { w.style.display = 'flex'; }
|
if (w) { w.style.display = 'flex'; }
|
||||||
}
|
}
|
||||||
|
var clearMsg = document.getElementById('clearMsg');
|
||||||
|
if (clearMsg) clearMsg.addEventListener('click', function () {
|
||||||
|
var m = document.getElementById('message');
|
||||||
|
if (m) m.value = '';
|
||||||
|
m && m.focus();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{% if reply %}
|
{% if reply %}
|
||||||
<div class="linkout-card stack" style="margin-top:16px">
|
<div class="linkout-card stack" style="margin-top:16px">
|
||||||
|
|||||||
Reference in New Issue
Block a user