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.