feat: sync GridSmart agendas and use event-relative demo time
Support script and URL sources, automatic Sessionize polling, staff-linked service sessions, chronological agenda blocks, and inline Placeholders. Fix demo mode to use the active event date and document deployed behavior with regression coverage. Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
f32289f583
commit
84691de6ee
27 files changed
+1215
-60
No files matched your search
@@ -0,0 +1,19 @@
|
||||
export function normalizeSessionizeSource(value: string): string | null {
|
||||
let source = value.trim();
|
||||
if (!source) return null;
|
||||
if (source.startsWith('<')) {
|
||||
const document = new DOMParser().parseFromString(source, 'text/html');
|
||||
const scripts = document.querySelectorAll('script[src]');
|
||||
if (scripts.length !== 1) throw new Error('Paste one Sessionize script tag or URL');
|
||||
source = scripts[0].getAttribute('src') || '';
|
||||
}
|
||||
let url: URL;
|
||||
try { url = new URL(source); } catch { throw new Error('Enter a valid Sessionize URL or script tag'); }
|
||||
if (url.protocol !== 'https:' || url.hostname !== 'sessionize.com' || url.port
|
||||
|| url.username || url.password || !/^\/api\/v2\/[a-z0-9]+\/view\/(All|GridSmart)$/i.test(url.pathname)) {
|
||||
throw new Error('Use a Sessionize HTTPS All or GridSmart endpoint');
|
||||
}
|
||||
url.search = '';
|
||||
url.hash = '';
|
||||
return url.href;
|
||||
}
|
||||
Reference in new issue
Block a user