Compare commits

..

No commits in common. "bfdcf2afed30046309233a5b79fb1f1264e9d77e" and "0d555adf2105c90258de7779403c31b6bca90c72" have entirely different histories.

4 changed files with 16 additions and 16 deletions

View File

@ -30,8 +30,8 @@
required
/>
<label for="join-session-colour">Personal Colour:</label>
<input type="color" id="join-session-colour" value="#ffffff" required />
<label for="join-session-colour">Colour:</label>
<input type="color" id="join-session-colour" value="#7ed0ff" required />
<label for="join-session-id">Session ID:</label>
<input

View File

@ -6,7 +6,7 @@ import {
import { emojify, findEmojis } from "./emojis.mjs?v=ee93fb";
import { linkify } from "./links.mjs?v=ee93fb";
import { joinSession } from "./watch-session.mjs?v=ee93fb";
import { pling } from "./pling.mjs?v=ee93fb";
import { pling } from "./pling.mjs?v=ee93fb"
import { state } from "./state.mjs";
function setCaretPosition(elem, caretPos) {
@ -44,7 +44,7 @@ const setupChatboxEvents = (socket) => {
emojiAutocomplete.textContent = "";
autocompleting = true;
let text = messageInput.value.slice(0, messageInput.selectionStart);
const match = text.match(/(:[^\s:]+)?:([^\s:]{2,})$/);
const match = text.match(/(:[^\s:]+)?:([^\s:]*)$/);
if (!match || match[1]) return (autocompleting = false); // We don't need to autocomplete.
const prefix = text.slice(0, match.index);
const search = text.slice(match.index + 1);
@ -133,7 +133,7 @@ const setupChatboxEvents = (socket) => {
selected.classList.add("selected");
selected.scrollIntoView({ scrollMode: "if-needed", block: "nearest" });
}
if (event.key == "Tab" || event.key == "Enter") {
if (event.key == "Tab") {
let selected = document.querySelector(".emoji-option.selected");
if (!selected) return;
event.preventDefault();

View File

@ -32,15 +32,7 @@ export async function emojify(text) {
const emojis = {};
export const emojisLoaded = Promise.all([
fetch("/emojis/unicode.json")
.then((e) => e.json())
.then((a) => {
for (let e of a) {
emojis[e[0][0]] = emojis[e[0][0]] || [];
emojis[e[0][0]].push([e[0], e[1], null, e[0]]);
}
}),
fetch("/emojos")
fetch("/emojis")
.then((e) => e.json())
.then((a) => {
for (let e of a) {
@ -50,6 +42,14 @@ export const emojisLoaded = Promise.all([
emojis[lower[0]].push([name, ":" + name + ":", e.slice(-4), lower]);
}
}),
fetch("/emojis/unicode.json")
.then((e) => e.json())
.then((a) => {
for (let e of a) {
emojis[e[0][0]] = emojis[e[0][0]] || [];
emojis[e[0][0]].push([e[0], e[1], null, e[0]]);
}
}),
]);
export async function findEmojis(search) {
@ -68,5 +68,5 @@ export async function findEmojis(search) {
}
}
}
return [...groups[1], ...groups[0]];
return [...groups[0], ...groups[1]];
}

View File

@ -62,7 +62,7 @@ async fn main() {
warb::reply::json(&json!({ "id": session_uuid.to_string(), "session": session_view }))
});
let get_emoji_route = warb::path!("emojos").and_then(get_emoji_list);
let get_emoji_route = warb::path!("emojis").and_then(get_emoji_list);
enum RequestedSession {
Session(Uuid, WatchSession),