diff options
| author | winter | 2025-03-16 02:04:04 +0000 |
|---|---|---|
| committer | winter | 2025-03-16 02:04:04 +0000 |
| commit | dd4d47bde45d20954129ba256696bf12c3826cdd (patch) | |
| tree | 83029bead8fbd1fe7206961b8d0145b1400f6f38 /templates | |
| parent | 23ddb01a20788da2c98c4d5bb9bd271ceff532c8 (diff) | |
fix hx-target everywhere :<
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/actor/profile_block_button.php | 2 | ||||
| -rw-r--r-- | templates/actor/profile_editable.php | 3 | ||||
| -rw-r--r-- | templates/actor/profile_follow_button.php | 2 | ||||
| -rw-r--r-- | templates/actor/profile_poke_form.php | 3 | ||||
| -rw-r--r-- | templates/actor/profile_reset_avatar.php | 2 | ||||
| -rw-r--r-- | templates/change_password_form.php | 3 | ||||
| -rw-r--r-- | templates/login_form.php | 2 | ||||
| -rw-r--r-- | templates/note/reply_form.php | 3 | ||||
| -rw-r--r-- | templates/note/write_form.php | 4 | ||||
| -rw-r--r-- | templates/preferences_form.php | 2 | ||||
| -rw-r--r-- | templates/settings_editor.php | 2 | ||||
| -rw-r--r-- | templates/user_mention_pill.php | 5 |
12 files changed, 19 insertions, 14 deletions
diff --git a/templates/actor/profile_block_button.php b/templates/actor/profile_block_button.php index 1b71613..98ed438 100644 --- a/templates/actor/profile_block_button.php +++ b/templates/actor/profile_block_button.php @@ -3,7 +3,7 @@ $blocks = $user->actor->blocks($actor); $action = $blocks ? 'unblock' : 'block'; ?> <button hx-confirm="<?= __("user.profile.$action.confirm") ?>" hx-post="/fragment/actor/<?= $actor->id ?>/blockButton" - hx-swap="outerHTML"> + hx-swap="outerHTML" hx-target="this"> <span class="material-symbols <?= $blocks ? 'remove' : 'block' ?>"></span> <span><?= __("user.profile.$action") ?></span> </button>
\ No newline at end of file diff --git a/templates/actor/profile_editable.php b/templates/actor/profile_editable.php index fc969bd..f4318fd 100644 --- a/templates/actor/profile_editable.php +++ b/templates/actor/profile_editable.php @@ -1,4 +1,5 @@ -<form class="fullProfile" hx-post="/fragment/profile" hx-swap="outerHTML" enctype="multipart/form-data"> +<form class="fullProfile" hx-post="/fragment/profile" hx-swap="outerHTML" hx-target="this" + enctype="multipart/form-data"> <div class="basicInfo"> <?php call_template('actor/avatar', ['actor' => $actor]); ?> <div> diff --git a/templates/actor/profile_follow_button.php b/templates/actor/profile_follow_button.php index e2b314d..a99656c 100644 --- a/templates/actor/profile_follow_button.php +++ b/templates/actor/profile_follow_button.php @@ -10,7 +10,7 @@ $state = match ($relation?->status) { }; ?> <button class="<?= $state == 'active' ? 'secondary' : 'primary' ?>" - hx-post="/fragment/actor/<?= $actor->id ?>/followButton" hx-swap="outerHTML" <?= $state == 'pending' ? 'disabled' : '' ?> hx-disabled-elt="this"> + hx-post="/fragment/actor/<?= $actor->id ?>/followButton" hx-swap="outerHTML" <?= $state == 'pending' ? 'disabled' : '' ?> hx-target="this" hx-disabled-elt="this"> <?= __(match ($state) { 'active' => 'user.profile.unfollow.action', 'pending' => 'user.profile.follow.pending', diff --git a/templates/actor/profile_poke_form.php b/templates/actor/profile_poke_form.php index 7dcc360..df511ef 100644 --- a/templates/actor/profile_poke_form.php +++ b/templates/actor/profile_poke_form.php @@ -1,5 +1,6 @@ <?php /** @var \Digitigrade\Model\Actor $actor */ ?> -<form class="nobackground pokeForm" hx-post="/fragment/actor/<?= $actor->id ?>/poke" hx-disabled-elt="find button"> +<form class="nobackground pokeForm" hx-post="/fragment/actor/<?= $actor->id ?>/poke" hx-disabled-elt="find button" + hx-target="this" hx-swap="outerHTML"> <div class="row"> <div class="column"> <select id="pokeVerb-<?= $actor->id ?>" name="verb"> diff --git a/templates/actor/profile_reset_avatar.php b/templates/actor/profile_reset_avatar.php index 86a3507..5eb0a68 100644 --- a/templates/actor/profile_reset_avatar.php +++ b/templates/actor/profile_reset_avatar.php @@ -1,3 +1,3 @@ -<button type="button" class="secondary inline" hx-post="/fragment/profile/resetAvatar" <?= ($reset ?? false) ? 'disabled' : '' ?>> +<button type="button" class="secondary inline" hx-post="/fragment/profile/resetAvatar" <?= ($reset ?? false) ? 'disabled' : '' ?> hx-target="this"> <?= __(($reset ?? false) ? 'user.profile.avatarReset' : 'user.profile.resetAvatar') ?> </button>
\ No newline at end of file diff --git a/templates/change_password_form.php b/templates/change_password_form.php index 7a463fd..43d61c3 100644 --- a/templates/change_password_form.php +++ b/templates/change_password_form.php @@ -1,4 +1,5 @@ -<form method="post" action="/todo" hx-post="/fragment/changePassword" hx-disabled-elt="find button" hx-swap="outerHTML"> +<form method="post" action="/todo" hx-post="/fragment/changePassword" hx-disabled-elt="find button" hx-swap="outerHTML" + hx-target="this"> <div class="row"> <label for="changePassword-current"><?= __('changePassword.currentPassword') ?></label> <input type="password" id="changePassword-current" name="current" autocomplete="off" required diff --git a/templates/login_form.php b/templates/login_form.php index 74bb823..4185c0d 100644 --- a/templates/login_form.php +++ b/templates/login_form.php @@ -1,4 +1,4 @@ -<form method="post" hx-post="" hx-swap="outerHTML" hx-disabled-elt="find button"> +<form method="post" hx-post="" hx-swap="outerHTML" hx-target="this" hx-disabled-elt="find button"> <div class="row"> <label for="emailInput"><?= __('login.email') ?></label> <input type="email" id="emailInput" name="email" value="<?= $email ?>" required> diff --git a/templates/note/reply_form.php b/templates/note/reply_form.php index 2d8cfc3..cd67ce8 100644 --- a/templates/note/reply_form.php +++ b/templates/note/reply_form.php @@ -23,7 +23,8 @@ $selectedScope = $note->privacy->scope->value; ?> <form class="noteReplyForm" id="replyForm-<?= $note->id ?>" _="on submit send toggle to previous <button.reply/> then wait 1s then trigger update on #liveTimelineUpdater on toggle or submit toggle @hidden" - hidden hx-post="/fragment/note/<?= $note->id ?>/reply" hx-disabled-elt="find button" hx-swap="outerHTML"> + hidden hx-post="/fragment/note/<?= $note->id ?>/reply" hx-disabled-elt="find button" hx-swap="outerHTML" + hx-target="this"> <div class="row summaryAndContent"> <label for="replyContent-<?= $note->id ?>"><?= __('writeReply.label') ?></label> <input type="text" id="replySummary-<?= $note->id ?>" name="summary" autocomplete="off" diff --git a/templates/note/write_form.php b/templates/note/write_form.php index add00ec..f7b0b06 100644 --- a/templates/note/write_form.php +++ b/templates/note/write_form.php @@ -3,11 +3,11 @@ <input hidden type="file" name="file" id="noteAttachmentFile" _="on change send submit to closest <form/>"> </form> -<form id="writeNoteForm" action="/todo" method="post" hx-post="/fragment/note" hx-swap="outerHTML" +<form id="writeNoteForm" action="/todo" method="post" hx-post="/fragment/note" hx-swap="outerHTML" hx-target="this" hx-disabled-elt="find button" _="on submit wait 1s then trigger update on #liveTimelineUpdater" <?= ($_SERVER['REQUEST_METHOD'] == 'GET') ? 'hx-preserve' : '' ?>> <div class="row miniProfile"> - <a href="/@/<?= $actor->handle ?>"> + <a href="/@/<?= $actor->handle ?>" hx-target="#centrePane" hx-swap="outerHTML show:window:top"> <?php call_template('actor/avatar', ['actor' => $actor]); ?> </a> <div class="basicInfo"> diff --git a/templates/preferences_form.php b/templates/preferences_form.php index afd487b..ed13731 100644 --- a/templates/preferences_form.php +++ b/templates/preferences_form.php @@ -16,7 +16,7 @@ function _user_pref(string $id, mixed $value, string $type) { ?> <form class="settings" method="post" action="/todo" hx-post="/fragment/preferences" - hx-disabled-elt="find <button[type='submit']/>" hx-swap="outerHTML"> + hx-disabled-elt="find <button[type='submit']/>" hx-swap="outerHTML" hx-target="this"> <?php _user_pref('requestToFollow', $user->actor->requestToFollow, 'boolean'); diff --git a/templates/settings_editor.php b/templates/settings_editor.php index 6b7f08c..5da4a8c 100644 --- a/templates/settings_editor.php +++ b/templates/settings_editor.php @@ -4,7 +4,7 @@ use Digitigrade\GlobalSettings; $settings = GlobalSettings::getInstance(); ?> <form class="settings" action="/todo" hx-post="/fragment/admin/settings/<?= $prefix ?>" hx-swap="outerHTML" - hx-disabled-elt="find button"> + hx-target="this" hx-disabled-elt="find button"> <?php foreach ($settings->getAllInPrefix($prefix) as $key => $value) { $info = $settings->getInfo($key); call_template('settings_field', [ diff --git a/templates/user_mention_pill.php b/templates/user_mention_pill.php index 3b9a018..9cc3ad8 100644 --- a/templates/user_mention_pill.php +++ b/templates/user_mention_pill.php @@ -4,7 +4,8 @@ $type ??= 'add'; <?php if ($type == 'add'): ?> - <button class="inlinePill" type="button" hx-get="/fragment/note/mentionPill" hx-disabled-elt="this" hx-swap="outerHTML"> + <button class="inlinePill" type="button" hx-get="/fragment/note/mentionPill" hx-disabled-elt="this" hx-swap="outerHTML" + hx-target="this"> <span class="pillIcon material-symbols add"></span> <span class="pillText"><?= __('writeNote.mentions.add.action') ?></span> </button> @@ -12,7 +13,7 @@ $type ??= 'add'; <?php elseif ($type == 'edit'): ?> <form class="inlinePill nopanel <?= ($invalid ?? false) ? 'invalid' : '' ?>" hx-get="/fragment/note/mentionPill" - hx-disabled-elt="this" hx-swap="outerHTML"> + hx-disabled-elt="this" hx-swap="outerHTML" hx-target="this"> <span class="pillIcon material-symbols alternate-email"></span> <input type="text" name="handle" class="pillInput" value="<?= $value ?? '' ?>" placeholder="<?= __('writeNote.mentions.placeholder') ?>" required autofocus> |
