- Timestamp:
- 06/26/2026 04:10:22 PM (2 months ago)
- Branches:
- main
- Children:
- 781d613
- Parents:
- 84903a1
- Location:
- src/views/pages
- Files:
-
- 2 edited
-
newspaper.ejs (modified) (3 diffs)
-
post.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/newspaper.ejs
r84903a1 rd22b55c 107 107 .tl-embed-sc { aspect-ratio: auto; height: 166px; } 108 108 .tl-embed-klonkt { aspect-ratio: auto; height: 180px; background: var(--paper, #fff); } 109 .tl-embed-bandcamp { aspect-ratio: auto; height: 470px; } 110 .tl-embed-apple { aspect-ratio: auto; height: 175px; } 109 111 110 112 .tl-orig { display: inline-block; margin: .7rem 0 0; font-size: .82rem; color: var(--accent, #06c); text-decoration: none; } … … 138 140 var current = null, currentBtn = null; 139 141 function close(){ if (current) { current.remove(); current = null; currentBtn = null; } } 140 function go(raw, uri){ var d=(raw||'').trim().replace(/^@?[^@\s]*@/,'').replace(/^https?:\/\//i,'').replace(/\/.*$/,'').trim(); if(d) location.href='https://'+d+'/authorize_interaction?uri='+encodeURIComponent(uri||'');}142 function go(raw, uri){ var d=(raw||'').trim().replace(/^@?[^@\s]*@/,'').replace(/^https?:\/\//i,'').replace(/\/.*$/,'').trim(); if(d){ try{ localStorage.setItem('pcmsFediServer', d); }catch(e){} location.href='https://'+d+'/authorize_interaction?uri='+encodeURIComponent(uri||''); } } 141 143 function place(f, b){ var r=b.getBoundingClientRect(); f.style.top=(r.bottom+window.scrollY+6)+'px'; f.style.left=Math.max(8, Math.min(r.left+window.scrollX, window.scrollX+window.innerWidth-340))+'px'; } 142 144 document.addEventListener('click', function(e){ … … 149 151 close(); 150 152 var f = document.createElement('form'); f.className='fedi-remote-form'; f.dataset.uri = b.getAttribute('data-fedi-uri')||''; 151 f.innerHTML = '<input type="text" autocomplete="off" spellcheck="false"><button type="submit" class="btn btn-primary fedi-remote-go" aria-label="ok">→</button><button type="button" class="fedi-remote-cancel" aria-label="x">×</button>'; 152 f.querySelector('input').placeholder = b.getAttribute('data-fedi-ph') || 'mastodon.social'; 153 document.body.appendChild(f); place(f, b); current=f; currentBtn=b; f.querySelector('input').focus(); 153 f.innerHTML = '<input type="text" name="fediserver" autocomplete="on" list="pcms-fedi-srv" spellcheck="false"><button type="submit" class="btn btn-primary fedi-remote-go" aria-label="ok">→</button><button type="button" class="fedi-remote-cancel" aria-label="x">×</button><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>'; 154 var _inp = f.querySelector('input'); _inp.placeholder = b.getAttribute('data-fedi-ph') || 'mastodon.social'; 155 try{ var _sv = localStorage.getItem('pcmsFediServer'); if(_sv) _inp.value = _sv; }catch(e){} 156 document.body.appendChild(f); place(f, b); current=f; currentBtn=b; _inp.focus(); _inp.select(); 154 157 return; 155 158 } -
src/views/pages/post.ejs
r84903a1 rd22b55c 109 109 function go(raw, uri){ 110 110 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||''); } 112 112 } 113 113 function place(f, b){ … … 127 127 f.className = 'fedi-remote-form'; 128 128 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">' 130 130 + '<button type="submit" class="btn btn-primary fedi-remote-go" aria-label="ok">→</button>' 131 + '<button type="button" class="fedi-remote-cancel" aria-label="x">×</button>'; 132 f.querySelector('input').placeholder = b.getAttribute('data-fedi-ph') || 'mastodon.social'; 131 + '<button type="button" class="fedi-remote-cancel" aria-label="x">×</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){} 133 136 document.body.appendChild(f); // floating popover → no layout reflow 134 137 place(f, b); current = f; currentBtn = b; 135 f.querySelector('input').focus();138 _inp.focus(); _inp.select(); 136 139 return; 137 140 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)