Fix emoji search case again, and render issues.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4451 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-09-06 22:35:20 +00:00
parent 4833d18968
commit e8ac5b759d
2 changed files with 36 additions and 2 deletions

View File

@ -64,7 +64,7 @@ export function picker(callback, anchor) {
while (list.firstChild) {
list.removeChild(list.firstChild);
}
let search = input.value;
let search = input.value.toLowerCase();
let any_at_all = false;
for (let row of Object.entries(json)) {
let header = document.createElement('div');
@ -74,7 +74,7 @@ export function picker(callback, anchor) {
for (let entry of Object.entries(row[1])) {
if (search &&
search.length &&
entry[0].indexOf(search) == -1) {
entry[0].toLowerCase().indexOf(search) == -1) {
continue;
}
let emoji = document.createElement('span');

View File

@ -411,6 +411,40 @@ class TfMessageElement extends LitElement {
${this.render_children()}
</div>
`;
} else if (content.type === 'issue') {
let is_encrypted = this.message?.decrypted ? html`<span style="align-self: center">🔓</span>` : undefined;
let style_background = this.message?.decrypted ? 'rgba(255, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.1)';
return html`
<style>
code {
white-space: pre-wrap;
overflow-wrap: break-word;
}
div {
overflow-wrap: anywhere;
}
img {
max-width: 100%;
height: auto;
display: block;
}
</style>
<div style="border: 1px solid black; background-color: ${style_background}; margin-top: 8px; padding: 16px">
<div style="display: flex; flex-direction: row">
<tf-user id=${this.message.author} .users=${this.users}></tf-user>
${is_encrypted}
<span style="flex: 1"></span>
<span style="padding-right: 8px"><a target="_top" href=${'#' + self.message.id}>%</a> ${new Date(this.message.timestamp).toLocaleString()}</span>
<span>${raw_button}</span>
</div>
${content.text}
${this.render_votes()}
<div>
<input type="button" value="React" @click=${this.react}></input>
</div>
${this.render_children()}
</div>
`;
} else if (content.type === 'blog') {
let self = this;
tfrpc.rpc.get_blob(content.blog).then(function(data) {