Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use datalist in pairing to make it searchable #212

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions public/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ <h1 id="client_loadingtext">Loading</h1>
<center>
<p>You seem to be new 👋</p>
<form method="POST">
<div class="h-captcha" data-sitekey="6cbe7d73-706d-4e4b-9147-8b9aebb83b5d" data-theme="dark" data-callback="hcallback"></div>
<div class="h-captcha" data-sitekey="6cbe7d73-706d-4e4b-9147-8b9aebb83b5d" data-theme="dark"
data-callback="hcallback"></div>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
</form>
</form>
</center>
</div>
<div id="client_charselect">
Expand Down Expand Up @@ -248,9 +249,10 @@ <h1 id="client_errortext">You were disconnected from the server.</h1>
onclick="toggleElement('pairing_settings')">Pairing</button>
<span id="pairing_settings" style="display: none">
<label for="pair_select">Pairing partner:</label>
<select name="pair_select" id="pair_select">
<input list="pair_select" placeholder="Search...">
<datalist name="pair_select" id="pair_select">
<option value="-1">None</option>
</select>
</datalist>
<table style="border: none;margin-left: auto;margin-right: auto;">
<tr>
<td>
Expand Down
6 changes: 3 additions & 3 deletions webAO/client/handleCharacterInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export const handleCharacterInfo = async (chargs: string[], charid: number) => {
document.getElementById("mute_select")
);
mute_select.add(new Option(safeTags(chargs[0]), String(charid)));
const pair_select = <HTMLSelectElement>(
const pair_select = <HTMLDataListElement>(
document.getElementById("pair_select")
);
pair_select.add(new Option(safeTags(chargs[0]), String(charid)));
pair_select.appendChild(new Option(safeTags(chargs[0]), String(charid)));

// sometimes ini files lack important settings
const default_options = {
Expand Down Expand Up @@ -102,4 +102,4 @@ export const handleCharacterInfo = async (chargs: string[], charid: number) => {
console.warn(`missing charid ${charid}`);
img.style.display = "none";
}
}
}
Loading