loading indicator tests, slight rework
This commit is contained in:
parent
6f517b2c6e
commit
c3af7b2afa
|
@ -17,3 +17,7 @@ tr.htmx-swapping td {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.htmx-indicator{
|
||||||
|
display:none;
|
||||||
|
}
|
|
@ -23,7 +23,7 @@ class OpenTrashmailBackend{
|
||||||
case 'attachment':
|
case 'attachment':
|
||||||
return $this->getAttachment($this->url[2],$this->url[3]);
|
return $this->getAttachment($this->url[2],$this->url[3]);
|
||||||
case 'delete':
|
case 'delete':
|
||||||
return $this->deleteMail($_REQUEST['email'],$_REQUEST['id']);
|
return $this->deleteMail($_REQUEST['email']?:$this->url[2],$_REQUEST['id']?:$this->url[3]);
|
||||||
case 'random':
|
case 'random':
|
||||||
$addr = generateRandomEmail();
|
$addr = generateRandomEmail();
|
||||||
//add header HX-Redirect
|
//add header HX-Redirect
|
||||||
|
|
|
@ -30,17 +30,13 @@
|
||||||
<td><?= escape($ed['from']) ?></td>
|
<td><?= escape($ed['from']) ?></td>
|
||||||
<td><?= escape($ed['subject']) ?></td>
|
<td><?= escape($ed['subject']) ?></td>
|
||||||
<td>
|
<td>
|
||||||
<form>
|
|
||||||
<input type="hidden" name="email" value="<?= $email ?>">
|
|
||||||
<input type="hidden" name="id" value="<?= $ed['id'] ?>">
|
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div><input type="submit" value="Read" hx-post="/api/read" hx-target="#main"></div>
|
<div><input type="submit" value="Read" hx-get="/api/read/<?= $email ?>/<?= $ed['id'] ?>" hx-push-url="/read/<?= $email ?>/<?= $ed['id'] ?>" hx-target="#main"></div>
|
||||||
<div><input type="submit" value="Delete" hx-post="/api/delete" hx-confirm="Are you sure?" hx-target="closest tr" hx-swap="outerHTML swap:1s"></div>
|
<div><input type="submit" value="Delete" hx-get="/api/delete/<?= $email ?>/<?= $ed['id'] ?>" hx-confirm="Are you sure?" hx-target="closest tr" hx-swap="outerHTML swap:1s"></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script>history.pushState({email:"<?= $email ?>"}, "", "/address/<?= $email ?>");</script>
|
<script>history.pushState({urlpath:"/address/<?= $email ?>"}, "", "/address/<?= $email ?>");</script>
|
|
@ -42,5 +42,5 @@
|
||||||
<pre><button hx-get="/api/raw/<?= $email ?>/<?= $mailid ?>" hx-swap="outerHTML">Load Raw Email</button></pre>
|
<pre><button hx-get="/api/raw/<?= $email ?>/<?= $mailid ?>" hx-swap="outerHTML">Load Raw Email</button></pre>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
<!--
|
||||||
<script>history.pushState({email:"<?= $email ?>",id:"<?= $mailid ?>"}, "", "/read/<?= $email ?>/<?= $mailid ?>");</script>
|
<script>history.pushState({email:"<?= $email ?>",id:"<?= $mailid ?>"}, "", "/read/<?= $email ?>/<?= $mailid ?>");</script> -->
|
|
@ -22,6 +22,8 @@
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button class="htmx-indicator" aria-busy="true">Loading…</button>
|
||||||
|
|
||||||
<main id="main" class="container" hx-get="/api/<?= $url ?>" hx-trigger="load">
|
<main id="main" class="container" hx-get="/api/<?= $url ?>" hx-trigger="load">
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
Loading…
Reference in a new issue