Changeset c901131 in Klonkt for src/views/pages


Ignore:
Timestamp:
06/24/2026 02:59:22 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
77ccd5d
Parents:
40cf2ef
Message:

style(activitypub): nicer reply-address field + localized placeholder

Pill-style input matching the button, accent focus ring, localized placeholder
(@naam@…) via data-fedi-ph instead of the hardcoded @jij.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/post.ejs

    r40cf2ef rc901131  
    9494  <% var _postAbsUrl = (typeof ogOrigin !== 'undefined' && ogOrigin ? ogOrigin : '') + (typeof _base !== 'undefined' && _base ? _base : '') + '/' + post.slug; %>
    9595  <div class="post-fediverse-cta">
    96     <button type="button" class="btn fedi-remote-reply-btn" data-fedi-uri="<%= _postAbsUrl %>" data-fedi-prompt="<%= t('fedi.remote_prompt') %>">
     96    <button type="button" class="btn fedi-remote-reply-btn" data-fedi-uri="<%= _postAbsUrl %>" data-fedi-ph="<%= t('fedi.remote_ph') %>">
    9797      <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg>
    9898      <%= t('fedi.remote_reply') %>
     
    118118      f.className = 'fedi-remote-form';
    119119      f.dataset.uri = b.getAttribute('data-fedi-uri') || '';
    120       f.innerHTML = '<input type="text" placeholder="@jij@mastodon.social" autocomplete="off" spellcheck="false">'
    121         + '<button type="submit" class="btn btn-primary fedi-remote-go">&rarr;</button>'
     120      f.innerHTML = '<input type="text" autocomplete="off" spellcheck="false">'
     121        + '<button type="submit" class="btn btn-primary fedi-remote-go" aria-label="ok">&rarr;</button>'
    122122        + '<button type="button" class="fedi-remote-cancel" aria-label="x">&times;</button>';
     123      var inp = f.querySelector('input');
     124      inp.placeholder = b.getAttribute('data-fedi-ph') || '@name@mastodon.social';
    123125      b.parentNode.insertBefore(f, b.nextSibling);
    124       f.querySelector('input').focus();
     126      inp.focus();
    125127    });
    126128    document.addEventListener('submit', function(e){
Note: See TracChangeset for help on using the changeset viewer.