fix: user avatar mime change from gif to avif
This commit is contained in:
parent
ffdb767518
commit
6e0f2985b9
20 changed files with 219 additions and 104 deletions
|
@ -90,7 +90,7 @@
|
|||
}),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
trigger(\"atto::toast\", [
|
||||
res.ok ? \"success\" : \"error\",
|
||||
res.message,
|
||||
|
@ -98,7 +98,7 @@
|
|||
|
||||
if (res.ok) {
|
||||
// update tokens
|
||||
const new_tokens = ns(\"me\").LOGIN_ACCOUNT_TOKENS;
|
||||
const new_tokens = (await ns(\"me\")).LOGIN_ACCOUNT_TOKENS;
|
||||
new_tokens[e.target.username.value] = res.message;
|
||||
trigger(\"me::set_login_account_tokens\", [new_tokens]);
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
}),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
trigger(\"atto::toast\", [
|
||||
res.ok ? \"success\" : \"error\",
|
||||
res.message,
|
||||
|
@ -115,7 +115,7 @@
|
|||
|
||||
if (res.ok) {
|
||||
// update tokens
|
||||
const new_tokens = ns(\"me\").LOGIN_ACCOUNT_TOKENS;
|
||||
const new_tokens = (await ns(\"me\")).LOGIN_ACCOUNT_TOKENS;
|
||||
new_tokens[e.target.username.value] = res.message;
|
||||
trigger(\"me::set_login_account_tokens\", [new_tokens]);
|
||||
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
|
||||
; random js
|
||||
(text "<script data-turbo-permanent=\"true\" id=\"init-script\">
|
||||
document.documentElement.addEventListener(\"turbo:load\", () => {
|
||||
const atto = ns(\"atto\");
|
||||
document.documentElement.addEventListener(\"turbo:load\", async () => {
|
||||
const atto = await ns(\"atto\");
|
||||
|
||||
if (!atto) {
|
||||
window.location.reload();
|
||||
|
|
|
@ -572,9 +572,9 @@
|
|||
(text "{%- endif %}"))
|
||||
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
(text "setTimeout(async () => {
|
||||
const element = document.getElementById(\"membership_info\");
|
||||
const ui = ns(\"ui\");
|
||||
const ui = await ns(\"ui\");
|
||||
|
||||
const uid = new URLSearchParams(window.location.search).get(\"uid\");
|
||||
if (uid) {
|
||||
|
@ -665,7 +665,7 @@
|
|||
`/api/v1/communities/{{ community.id }}/memberships/${e.target.uid.value}`,
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
trigger(\"atto::toast\", [
|
||||
res.ok ? \"success\" : \"error\",
|
||||
res.message,
|
||||
|
@ -676,7 +676,7 @@
|
|||
}
|
||||
|
||||
// permissions manager
|
||||
const get_permissions_html = trigger(
|
||||
const get_permissions_html = await trigger(
|
||||
\"ui::generate_permissions_ui\",
|
||||
[
|
||||
{
|
||||
|
@ -750,8 +750,8 @@
|
|||
(text "{{ community.context|json_encode()|safe }}"))
|
||||
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
const ui = ns(\"ui\");
|
||||
(text "setTimeout(async () => {
|
||||
const ui = await ns(\"ui\");
|
||||
const settings = JSON.parse(
|
||||
document.getElementById(\"settings_json\").innerHTML,
|
||||
);
|
||||
|
|
|
@ -761,8 +761,8 @@
|
|||
(text "{{ text \"communities:action.remove_drawing\" }}"))
|
||||
|
||||
(script
|
||||
(text "globalThis.attach_drawing = () => {
|
||||
globalThis.gerald = trigger(\"carp::new\", [document.querySelector(\"[ui_ident=carp_canvas_field]\")]);
|
||||
(text "globalThis.attach_drawing = async () => {
|
||||
globalThis.gerald = await trigger(\"carp::new\", [document.querySelector(\"[ui_ident=carp_canvas_field]\")]);
|
||||
globalThis.gerald.create_canvas();
|
||||
|
||||
document.querySelector(\"[ui_ident=add_drawing]\").classList.add(\"hidden\");
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
(text "Unban"))
|
||||
(text "{%- endif %}")))
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
const ui = ns(\"ui\");
|
||||
(text "setTimeout(async () => {
|
||||
const ui = await ns(\"ui\");
|
||||
const element = document.getElementById(\"mod_options\");
|
||||
|
||||
async function profile_request(do_confirm, path, body) {
|
||||
|
@ -216,6 +216,52 @@
|
|||
("class" "card lowered flex flex-wrap gap-2")
|
||||
(text "{{ components::user_plate(user=invite[0], show_menu=false) }}")))
|
||||
(text "{%- endif %}")
|
||||
(div
|
||||
("class" "card-nest w-full")
|
||||
(div
|
||||
("class" "card small flex items-center justify-between gap-2")
|
||||
(div
|
||||
("class" "flex items-center gap-2")
|
||||
(text "{{ icon \"square-function\" }}")
|
||||
(span
|
||||
(text "{{ text \"mod_panel:label.send_debug_payload\" }}"))))
|
||||
(form
|
||||
("class" "card flex flex-col gap-2")
|
||||
("onsubmit" "send_debug_payload(event)")
|
||||
(div
|
||||
("class" "flex flex-col gap-1")
|
||||
(label
|
||||
("for" "title")
|
||||
(text "{{ text \"communities:label.content\" }}"))
|
||||
(textarea
|
||||
("type" "text")
|
||||
("name" "content")
|
||||
("id" "content")
|
||||
("placeholder" "javascript content")
|
||||
("required" "")
|
||||
("minlength" "2")))
|
||||
(button
|
||||
("class" "primary")
|
||||
(text "{{ text \"mod_panel:action.send\" }}"))))
|
||||
(script
|
||||
(text "globalThis.send_debug_payload = async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (
|
||||
!(await trigger(\"atto::confirm\", [
|
||||
\"Are you sure you would like to do this? This will only work if the user is online.\",
|
||||
]))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await trigger(
|
||||
\"streams::send_packet_to\",
|
||||
[\"{{ profile.id }}\", \"notifs\", { Forward: \"Javascript\" }, { js: e.target.content.value }]
|
||||
);
|
||||
|
||||
trigger(\"atto::toast\", [res.ok ? \"success\" : \"error\", res.message]);
|
||||
}"))
|
||||
(div
|
||||
("class" "card-nest w-full")
|
||||
(div
|
||||
|
@ -235,8 +281,8 @@
|
|||
("class" "card lowered flex flex-col gap-2")
|
||||
("id" "permission_builder")))
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
const get_permissions_html = trigger(
|
||||
(text "setTimeout(async () => {
|
||||
const get_permissions_html = await trigger(
|
||||
\"ui::generate_permissions_ui\",
|
||||
[
|
||||
{
|
||||
|
|
|
@ -145,8 +145,8 @@
|
|||
(span
|
||||
(text "{{ text \"general:action.save\" }}")))
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
const ui = ns(\"ui\");
|
||||
(text "setTimeout(async () => {
|
||||
const ui = await ns(\"ui\");
|
||||
const element = document.getElementById(\"post_context\");
|
||||
const settings = JSON.parse(\"{{ post_context_serde|safe }}\");
|
||||
|
||||
|
|
|
@ -1035,8 +1035,8 @@
|
|||
("id" "settings_json")
|
||||
(text "{{ profile.settings|json_encode()|remove_script_tags|safe }}"))
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
const ui = ns(\"ui\");
|
||||
(text "setTimeout(async () => {
|
||||
const ui = await ns(\"ui\");
|
||||
const settings = JSON.parse(
|
||||
document.getElementById(\"settings_json\").innerHTML,
|
||||
);
|
||||
|
|
|
@ -21,10 +21,9 @@
|
|||
{%- endif %}")
|
||||
|
||||
(text "<script>
|
||||
globalThis.ns_verbose = false;
|
||||
globalThis.ns_config = {
|
||||
root: \"/js/\",
|
||||
verbose: globalThis.ns_verbose,
|
||||
verbose: false,
|
||||
version: \"tetratto-{{ random_cache_breaker }}\",
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue