PageSourceSearch

https://www.ne.go.kr/platform/resources/user/fcsOpnn/user/js/viz-controls.js?v=4.15.29

js ne.go.kr collected 2026-09-29 22:46:23 UTC 2,443 bytes, 56 lines download raw bytes

1(function () {
2    'use strict';
3    function button(action, label, icon) {
4        return `<button type="button" data-viz="${action}" aria-label="${label}" title="${label}">${icon}</button>`;
5    }
6    function attach(el) {
7        if (!el)
8            return;
9        const V = window.NativeViz;
10        if (!V)
11            return;
12        const controller = V.ensureController(el);
13        if (!controller)
14            return;
15        const current = el.querySelector(':scope > .viz-control-panel');
16        if (el.dataset.vizControlsAttached === 'Y' && current)
17            return;
18        if (current)
19            current.remove();
20        el.dataset.vizControlsAttached = 'Y';
21        el.classList.add('viz-control-host');
22        el.style.position = 'relative';
23        el.style.overflow = 'hidden';
24        const panel = document.createElement('div');
25        panel.className = 'viz-control-panel';
26        panel.setAttribute('aria-label', '시각화 확대와 이동');
27        panel.style.position = 'absolute';
28        panel.style.zIndex = '20';
29        panel.style.right = '8px';
30        panel.style.top = '8px';
31        panel.style.margin = '0';
32        panel.innerHTML = `<div class="viz-zoom-group">
33<span>확대</span>${button('zoomOut', '축소', '−')}${button('reset', '원래 크기', '◎')}${button('zoomIn', '확대', '+')}</div>
34      <div class="viz-move-group">
35<span>이동</span>
36<div class="viz-move-grid">
37        ${button('panUpLeft', '왼쪽 위로 이동', '↖')}${button('panUp', '위로 이동', '↑')}${button('panUpRight', '오른쪽 위로 이동', '↗')}
38        ${button('panLeft', '왼쪽으로 이동', '←')}${button('reset', '가운데로 이동', '●')}${button('panRight', '오른쪽으로 이동', '→')}
39        ${button('panDownLeft', '왼쪽 아래로 이동', '↙')}${button('panDown', '아래로 이동', '↓')}${button('panDownRight', '오른쪽 아래로 이동', '↘')}
40      </div>
41</div>`;
42        panel.addEventListener('click', e => {
43            const b = e.target.closest('button[data-viz]');
44            if (!b)
45                return;
46            e.preventDefault();
47            e.stopPropagation();
48            const live = V.ensureController(el) || controller;
49            const fn = live[b.dataset.viz];
50            if (typeof fn === 'function')
51                fn();
52        });
53        el.appendChild(panel);
54    }
55    window.CivicVizControls = { attach };
56})();

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.