← back to Bubbesblock

public/bookmarks.html

21 lines

<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BubbesBlock — Bookmarks</title><link rel="stylesheet" href="/styles.css" />
</head><body>
<div id="hdr"></div>
<div class="wrap"><div id="left"></div><main class="col-center" id="main"></main><div id="right"></div></div>
<script>window.__bbAutoInit = false;</script>
<script src="/chrome.js"></script><script src="/app.js"></script>
<script>
Promise.all([fetch('/api/me',{credentials:'same-origin'}).then(r=>r.json()), fetch('/api/bookmarks',{credentials:'same-origin'}).then(r=>r.json())]).then(([m,d])=>{
  document.getElementById('hdr').innerHTML=topbar(m.me);
  document.getElementById('left').innerHTML=leftRail(m.me);
  document.getElementById('right').innerHTML=rightRail(m.me);
  const cards = (d.posts||[]).map(p=>`<article class="card feedcard" onclick="location.href='/p/${p.id}'"><div class="post">${postHead(p)}${postBody(p)}</div>${photoBlock(p.photo)}</article>`).join('');
  const empty = `<div class="prose"><h1>🔖 No bookmarks yet</h1><p>Tap the ⋯ menu on any post and choose <b>Save post</b> to keep it here.${m.you?'':' Sign in first.'}</p></div>`;
  document.getElementById('main').innerHTML='<div class="listhd">🔖 Bookmarks</div>'+(d.posts&&d.posts.length?cards:empty);
  BB.init();
});
</script></body></html>