|
11 | 11 | <link rel="stylesheet" href="js/ui/stylesScreensaver.css"> |
12 | 12 | <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> |
13 | 13 | <script defer src="js/polliLib/polliLib-web.global.js"></script> |
14 | | - <script defer> |
15 | | - // Configure polliLib default client and expose an explicit client for MCP helpers |
16 | | - (function(){ |
17 | | - try { |
18 | | - if (window.polliLib) { |
19 | | - // Derive base referrer from attribute or window location (no path segments) |
20 | | - const cur = document.currentScript; |
21 | | - const attrRef = cur && cur.getAttribute('data-referrer'); |
22 | | - let base = window.location.origin; |
23 | | - if (attrRef) { |
24 | | - // Support values missing protocol by resolving against window.location.origin |
25 | | - try { base = new URL(attrRef, window.location.origin).origin; } catch {} |
26 | | - } |
27 | | - const referrer = base.endsWith('/') ? base : base + '/'; |
28 | | - window.polliLib.configure({ referrer }); |
29 | | - window.polliClient = window.polliLib.getDefaultClient(); |
30 | | - |
31 | | - // Provide basic helpers used by image features |
32 | | - if (!window.randomSeed) { |
33 | | - window.randomSeed = function randomSeed() { return Math.floor(Math.random() * 1000000); }; |
34 | | - } |
35 | | - if (!window.imagePatterns) { |
36 | | - window.imagePatterns = [ |
37 | | - { pattern: /```image\n([\s\S]*?)\n```/i, group: 1 }, |
38 | | - ]; |
39 | | - } |
40 | | - if (!window.audioPatterns) { |
41 | | - window.audioPatterns = [ |
42 | | - { pattern: /```audio\n([\s\S]*?)\n```/i, group: 1 }, |
43 | | - ]; |
44 | | - } |
45 | | - if (!window.uiPatterns) { |
46 | | - window.uiPatterns = [ |
47 | | - { pattern: /```ui\n([\s\S]*?)\n```/i, group: 1 }, |
48 | | - ]; |
49 | | - } |
50 | | - if (!window.voicePatterns) { |
51 | | - window.voicePatterns = [ |
52 | | - { pattern: /```voice\n([\s\S]*?)\n```/i, group: 1 }, |
53 | | - ]; |
54 | | - } |
55 | | - if (!window.videoPatterns) { |
56 | | - window.videoPatterns = [ |
57 | | - { pattern: /```video\n([\s\S]*?)\n```/i, group: 1 }, |
58 | | - ]; |
59 | | - } |
60 | | - } |
61 | | - } catch (e) { console.warn('polliLib configure failed', e); } |
62 | | - })(); |
63 | | - </script> |
| 14 | + <script defer src="js/pollilib-init.js"></script> |
64 | 15 | </head> |
65 | 16 | <body> |
66 | 17 | <div id="screensaver-container" class="screensaver hidden"> |
|
0 commit comments