openvibers/openvibe.tools Commits

Add visit history metadata (#275)

OP OpenVibers committed 2 days ago · 48005f8f4f · 1 file, +1 −1

Changes

ddiff --git a/apps/gateway/public/js/site.js b/apps/gateway/public/js/site.js
iindex 328303d..7654c4d 100644
---- a/apps/gateway/public/js/site.js
++++ b/apps/gateway/public/js/site.js
@@@ -7,7 +7,7 @@
var cookie = function (n) { var m = document.cookie.match(new RegExp('(?:^|; )' + n + '=([^;]*)')); return m ? decodeURIComponent(m[1]) : null; };
var token = null; try { token = cookie('ov_token') || localStorage.getItem('ov_token'); } catch (e) { token = cookie('ov_token'); }
var links = Array.from(document.querySelectorAll('#navbar-mount [data-ov-nav-link]')).map(function (a) { return { label: a.textContent, href: a.getAttribute('href') }; });
-- try { if (window.OpenVibeNavbar) OpenVibeNavbar.init({ service: 'tools', links: links, apiBase: 'https://openvibe.network', token: token, history: { type: 'tool', title: document.title }, silentLogin: 'https://openvibe.tools/auth/login?silent=1&next={url}' }); } catch (e) { /* non-critical */ }
++ try { if (window.OpenVibeNavbar) OpenVibeNavbar.init({ service: 'tools', links: links, apiBase: 'https://openvibe.network', token: token, history: { type: 'tool', title: document.title, image_url: document.querySelector('meta[property="og:image"]')?.content || null }, silentLogin: 'https://openvibe.tools/auth/login?silent=1&next={url}' }); } catch (e) { /* non-critical */ }
try { if (window.OpenVibeFooter) OpenVibeFooter.init({ service: 'tools', variant: 'full', mount: '#ov-footer', apiBase: 'https://openvibe.network', updates: '/updates' }); } catch (e) { /* */ }
// Cards link to the search-friendly host; people go straight to the short one (no redirect hop).