PageSourceSearch

https://www.kommunikasjon.no/_/service/no.seeds.kom/asset/000001a0ce442e90/js/kom/podcast-list.js

js kommunikasjon.no collected 2026-10-02 12:25:26 UTC 1,701 bytes, 53 lines download raw bytes

1document.addEventListener('DOMContentLoaded', () => {
2	const buttonElement = document.querySelector('[data-id="load-content-button"]')
3
4	if (buttonElement) {
5		buttonElement.addEventListener('click', (e) => {
6			const shouldLoadMore = buttonElement.getAttribute('data-load-more') === 'true'
7			const shouldLoadAll = buttonElement.getAttribute('data-load-all') === 'true'
8
9			if (shouldLoadMore || shouldLoadAll) {
10				const url = buttonElement.getAttribute('href')
11				e.preventDefault()
12				fetch(url)
13					.then(response => response.json())
14					.then(data => {
15						if (data.items && data.items.length) {
16							const sectionParent = buttonElement.parentElement
17
18							const currentIframeSources = []
19
20							document.querySelectorAll('iframe').forEach(iframe => {
21								currentIframeSources.push(iframe.getAttribute('src'))
22							})
23
24							data.items.forEach(podcast => {
25								if (currentIframeSources.some(src => src && src.includes(podcast.url))) return
26
27								sectionParent.insertAdjacentHTML('beforebegin', `
28									<iframe
29										style="border-radius:12px"
30										src="${podcast.url}&theme=0"
31										width="100%"
32										height="352"
33										frameBorder="0"
34										allowfullscreen=""
35										allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy">
36									</iframe>
37								`)
38							})
39
40							const totalItems = buttonElement.getAttribute('data-total')
41
42							if (shouldLoadAll) buttonElement.remove()
43
44							if ((data.start + data.count) >= totalItems) buttonElement.remove()
45							else {
46								if (shouldLoadMore) buttonElement.setAttribute('href', data.button.link)
47							}
48						}
49					})
50			}
51		})
52	}
53})

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.