PageSourceSearch

https://www.dagbladet.no/view-resources/baseview/public/common/baseview/moduleHandlers.js?v=1790252770-L4

js dagbladet.no collected 2026-09-24 15:16:43 UTC 1,917 bytes, 61 lines download raw bytes

1/* eslint-disable no-new */
2
3/**
4 * Some element-types store data for use by JS-logic in 'window.dachserData'
5 * This module import dependencies, read data, create instances and pass the data to them.
6 */
7
8import * as modules from '../build/baseview_dependencie_modules.js?v=25';
9
10const handlers = {
11    labradorsearch: (item) => new modules.LabradorSearch(item),
12    tagboard: (item) => new modules.Tagboard(item),
13    frontcontent: (item) => new modules.FrontContent(item),
14    audioInline: (item) => new modules.AudioInline(item)
15};
16
17const labradorsearchQueue = window.dachserData.get('labradorsearch') || [];
18while (labradorsearchQueue.length) {
19    handlers.labradorsearch(labradorsearchQueue.shift());
20}
21
22const tagboardQueue = window.dachserData.get('tagboard') || [];
23while (tagboardQueue.length) {
24    handlers.tagboard(tagboardQueue.shift());
25}
26
27const frontcontentQueue = window.dachserData.get('frontcontent') || [];
28while (frontcontentQueue.length) {
29    handlers.frontcontent(frontcontentQueue.shift());
30}
31
32const audioInlineQueue = window.dachserData.get('audioInline') || [];
33while (audioInlineQueue.length) {
34    handlers.audioInline(audioInlineQueue.shift());
35}
36
37// Editor - redraws
38window.baseviewModulesReflow = (key, identifierKey, identifierValue) => {
39    const keyArray = window.dachserData.get(key);
40    if (!Array.isArray(keyArray)) {
41        return;
42    }
43    // Each redraw will add to the key. Use last.
44    const last = keyArray.filter((item) => item[identifierKey] === identifierValue).pop();
45    if (last && typeof handlers[key] === 'function') {
46        handlers[key](last);
47    }
48};
49
50// Redraws
51window.baseviewModulesReflowAll = (key) => {
52    const keyArray = window.dachserData.get(key);
53    if (!Array.isArray(keyArray)) {
54        return;
55    }
56    keyArray.forEach((item) => {
57        if (typeof handlers[key] === 'function') {
58            handlers[key](item);
59        }
60    });
61};

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.