Changeset d22b55c in Klonkt for src/views/pages/post.ejs


Ignore:
Timestamp:
06/26/2026 04:10:22 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
781d613
Parents:
84903a1
Message:

feat(fedi): Bandcamp+Apple Music embeds in feed, server autofill, NL/DE Newspaper label

  • timelineEmbedHtml now also embeds Bandcamp + Apple Music (all 6 external providers + Klonkt now embed inline in the feed).
  • The 'interact via the fediverse' popover remembers your server (localStorage) and suggests common Mastodon servers (datalist); prefilled + selected on open.
  • Newspaper label localised: NL 'Krant', DE 'Zeitung', EN 'Newspaper'.
File:
1 edited

Legend:

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

    r84903a1 rd22b55c  
    109109    function go(raw, uri){
    110110      var d = (raw||'').trim().replace(/^@?[^@\s]*@/, '').replace(/^https?:\/\//i, '').replace(/\/.*$/, '').trim();
    111       if (d) location.href = 'https://' + d + '/authorize_interaction?uri=' + encodeURIComponent(uri||'');
     111      if (d) { try { localStorage.setItem('pcmsFediServer', d); } catch(e){} location.href = 'https://' + d + '/authorize_interaction?uri=' + encodeURIComponent(uri||''); }
    112112    }
    113113    function place(f, b){
     
    127127        f.className = 'fedi-remote-form';
    128128        f.dataset.uri = b.getAttribute('data-fedi-uri') || '';
    129         f.innerHTML = '<input type="text" autocomplete="off" spellcheck="false">'
     129        f.innerHTML = '<input type="text" name="fediserver" autocomplete="on" list="pcms-fedi-srv" spellcheck="false">'
    130130          + '<button type="submit" class="btn btn-primary fedi-remote-go" aria-label="ok">&rarr;</button>'
    131           + '<button type="button" class="fedi-remote-cancel" aria-label="x">&times;</button>';
    132         f.querySelector('input').placeholder = b.getAttribute('data-fedi-ph') || 'mastodon.social';
     131          + '<button type="button" class="fedi-remote-cancel" aria-label="x">&times;</button>'
     132          + '<datalist id="pcms-fedi-srv"><option value="mastodon.social"></option><option value="mastodon.online"></option><option value="mas.to"></option><option value="fosstodon.org"></option><option value="hachyderm.io"></option></datalist>';
     133        var _inp = f.querySelector('input');
     134        _inp.placeholder = b.getAttribute('data-fedi-ph') || 'mastodon.social';
     135        try { var _sv = localStorage.getItem('pcmsFediServer'); if (_sv) _inp.value = _sv; } catch(e){}
    133136        document.body.appendChild(f);            // floating popover → no layout reflow
    134137        place(f, b); current = f; currentBtn = b;
    135         f.querySelector('input').focus();
     138        _inp.focus(); _inp.select();
    136139        return;
    137140      }
Note: See TracChangeset for help on using the changeset viewer.