feat: ajouter classe loading-input pour animation de chargement des métadonnées, classe lf_input aux champs URL et titre pour ciblage JavaScript, et inclusion conditionnelle du script metadata.min.js avec versioning pour nouveaux liens avec métadonnées asynchrones

This commit is contained in:
Bruno Charest 2026-02-18 13:51:21 -05:00
parent 5b6b0fd163
commit 5bf384a8d6

View File

@ -11,7 +11,7 @@
{ignore}Lil hack: when included in a loop in batch mode, `$value` is assigned by RainTPL with template vars.{/ignore} {ignore}Lil hack: when included in a loop in batch mode, `$value` is assigned by RainTPL with template vars.{/ignore}
{function="extract($value) ? '' : ''"} {function="extract($value) ? '' : ''"}
{/if} {/if}
{$asyncLoadClass=$link_is_new && $async_metadata && empty($link.title) ? 'loading-wrapper' : ''} {$asyncLoadClass=$link_is_new && $async_metadata && empty($link.title) ? 'loading-wrapper loading-input' : ''}
{if="!isset($index)"} {if="!isset($index)"}
{$index=""} {$index=""}
{/if} {/if}
@ -48,12 +48,12 @@
<div class="card-body"> <div class="card-body">
<div class="form-group bookmark-field-group"> <div class="form-group bookmark-field-group">
<label class="form-label" for="lf_url{$index}">{'URL'|t}</label> <label class="form-label" for="lf_url{$index}">{'URL'|t}</label>
<input type="text" class="form-control" name="lf_url" id="lf_url{$index}" value="{$link.url}" placeholder="https://..."> <input type="text" class="form-control lf_input" name="lf_url" id="lf_url{$index}" value="{$link.url}" placeholder="https://...">
</div> </div>
<div class="form-group bookmark-field-group"> <div class="form-group bookmark-field-group">
<label class="form-label" for="lf_title{$index}">{'Title'|t}</label> <label class="form-label" for="lf_title{$index}">{'Title'|t}</label>
<div class="{$asyncLoadClass}"> <div class="{$asyncLoadClass}">
<input type="text" class="form-control{if="empty($batch_mode) && $link.title==''"} autofocus{/if}" name="lf_title" id="lf_title{$index}" value="{$link.title}" placeholder="Page title"> <input type="text" class="form-control lf_input{if="empty($batch_mode) && $link.title==''"} autofocus{/if}" name="lf_title" id="lf_title{$index}" value="{$link.title}" placeholder="Page title">
</div> </div>
</div> </div>
<div class="form-group bookmark-field-group"> <div class="form-group bookmark-field-group">
@ -121,6 +121,7 @@
</div> </div>
{if="empty($batch_mode)"} {if="empty($batch_mode)"}
{include="page.footer"} {include="page.footer"}
{if="$link_is_new && $async_metadata"}<script src="{$index_url}js/metadata.min.js?v={$version_hash}"></script>{/if}
{/if} {/if}
</body> </body>
</html> </html>