PageSourceSearch

https://docaccess.com/docbox-sb707.js

js docaccess.com collected 2026-10-02 03:40:33 UTC 5,476 bytes, 151 lines download raw bytes

1
2(function () {
3    'use strict';
4
5    window.DocAccess = window.DocAccess || {};
6
7    const DEFAULT_LANGUAGES = ['en', 'es', 'zh-CN', 'vi', 'tl', 'ko', 'hy', 'fa'];
8
9    const PUBLIC_MEETINGS_TRANSLATIONS = {
10        'en': 'Public Meetings',
11        'es': 'Reuniones Públicas',
12        'zh-CN': '公开会议',
13        'zh-TW': '公開會議',
14        'vi': 'Cuộc Họp Công Cộng',
15        'tl': 'Mga Pampublikong Pulong',
16        'ko': '공개 회의',
17        'hy': 'Հdelays delays',
18        'fa': 'جلسات عمومی',
19        'ru': 'Публичные собрания',
20        'ar': 'الاجتماعات العامة',
21        'ja': '公開会議',
22        'pa': 'ਜਨਤਕ ਮੀਟਿੰਗਾਂ',
23        'hi': 'सार्वजनिक बैठकें',
24        'th': 'การประชุมสาธารณะ',
25        'km': 'កិច្ចប្រជុំសាធារណៈ',
26        'hmn': 'Rooj Sib Tham Rau Pej Xeem',
27        'lo': 'ກອງປະຊຸມສາທາລະນະ',
28        'de': 'Öffentliche Sitzungen',
29        'fr': 'Réunions Publiques',
30        'pt': 'Reuniões Públicas',
31        'my': 'အများပြည်သူ အစည်းအဝေးများ',
32        'am': 'የሕዝብ ስብሰባዎች',
33        'uk': 'Публічні засідання'
34    };
35
36    window.DocAccess.SB707 = {
37        config: null,
38        blockInserted: false,
39
40        init: function (config) {
41            this.config = config;
42
43            if (!this.isHomepage()) {
44                console.log('DocAccess SB707: Not on homepage, skipping block');
45                return;
46            }
47
48            if (!config || !config.enabled) {
49                console.log('DocAccess SB707: Not enabled, skipping block');
50                return;
51            }
52
53            if (document.readyState === 'loading') {
54                document.addEventListener('DOMContentLoaded', () => this.insertBlock());
55            } else {
56                this.insertBlock();
57            }
58        },
59
60        isHomepage: function () {
61            const path = window.location.pathname;
62            return path === '/' || path === '' || path === '/index.html' || path === '/index.php';
63        },
64
65        getCivicClerkUrl: function (lang) {
66            if (!this.config || !this.config.civicclerk_tenant) {
67                return null;
68            }
69
70            let url = `https://${this.config.civicclerk_tenant}.portal.civicclerk.com`;
71
72            if (lang && !lang.startsWith('en')) {
73                url += `?lang=${encodeURIComponent(lang)}`;
74            }
75
76            return url;
77        },
78
79        getTranslation: function (langCode) {
80            return PUBLIC_MEETINGS_TRANSLATIONS[langCode] || PUBLIC_MEETINGS_TRANSLATIONS['en'];
81        },
82
83        insertBlock: function () {
84            if (this.blockInserted) return;
85
86            const languages = this.config.languages || DEFAULT_LANGUAGES;
87            const tenant = this.config.civicclerk_tenant;
88
89            if (!tenant) {
90                console.warn('DocAccess SB707: No CivicClerk tenant configured');
91                return;
92            }
93
94            const footer = document.querySelector('footer[data-cprole="structuralContainer"]') ||
95                document.querySelector('footer#footerContainerTS') ||
96                document.querySelector('footer') ||
97                document.querySelector('[role="contentinfo"]') ||
98                document.querySelector('#footer') ||
99                document.querySelector('.footer');
100
101            if (!footer) {
102                console.warn('DocAccess SB707: Could not find footer element');
103                return;
104            }
105
106            const block = document.createElement('section');
107            block.id = 'docaccess-sb707-block';
108            block.setAttribute('role', 'region');
109            block.setAttribute('aria-label', 'Public Meetings Links');
110
111            const links = languages.map(langCode => {
112                const url = this.getCivicClerkUrl(langCode);
113                const text = this.getTranslation(langCode);
114                return `<a href="${url}" ${langCode !== 'en' ? `hreflang="${langCode}"` : ''}>${text}</a>`;
115            }).join(' · ');
116
117            block.innerHTML = `
118                <style>
119                    #docaccess-sb707-block {
120                        background-color: #555;
121                        padding: 20px;
122                        text-align: center;
123                        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
124                    }
125                    
126                    #docaccess-sb707-block a {
127                        color: white;
128                        text-decoration: none;
129                        font-size: 14px;
130                        transition: opacity 0.2s ease;
131                    }
132                    
133                    #docaccess-sb707-block a:hover,
134                    #docaccess-sb707-block a:focus {
135                        text-decoration: underline;
136                        opacity: 0.9;
137                    }
138                </style>
139                ${links}
140            `;
141
142            footer.parentNode.insertBefore(block, footer.nextSibling);
143
144            this.blockInserted = true;
145            console.log('DocAccess SB707: Public Meetings block 
145inserted after footer');
146        }
147    };
148
149    window.DocAccess.SB707Block = window.DocAccess.SB707;
150
151})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.