1(function(){ 2 //fordÃtatlan JS 3 4 //configure systemjs 5 var loaderConfiguration = document.querySelector("script[data-name='portal:loaderConfiguration']").text; 6 SystemJS.config(JSON.parse(loaderConfiguration)); 7 8 //register clientData module 9 var clientData = document.querySelector("script[data-name='portal:clientData']").text; 10 SystemJS.set("clientData", SystemJS.newModule({default: JSON.parse(clientData)})); 11 12 //domReady 13 var domReady = new Promise(function(resolve) { 14 if (document.readyState === "interactive" || document.readyState === "complete") { 15 resolve(); 16 return; 17 } 18 document.addEventListener("DOMContentLoaded", function load() { 19 document.removeEventListener("DOMContentLoaded", load, false); 20 resolve(); 21 }); 22 }); 23 24 //inline require support 25 window.require = function() { 26 var args = Array.from(arguments); 27 domReady.then(function() { 28 SystemJS.amdRequire.apply(SystemJS, args); 29 }); 30 }; 31 32 //autoload 33 var autoloadProm = domReady.then(function() { 34 var autoLoadModulesString = document.querySelector("meta[name='portal:autoLoadModules']").getAttribute("content"); 35 if (!autoLoadModulesString) return; 36 37 var autoloadModules = JSON.parse(autoLoadModulesString) || []; 38 return Promise.all(autoloadModules.map(function(m) { 39 return SystemJS.import(m); 40 })); 41 }); 42 43 44 //bootstrap portal 45 var bootstrapPortalProm = domReady.then(function() { 46 return SystemJS.import("portal"); 47 }).then(function(mod) { 48 return mod.bootstrap(); 49 }).catch(function(err) { 50 console.error(err); 51 }); 52 53 //finish loading notification 54 function doneLoading() { 55 document.documentElement.classList.remove("loading"); 56 } 57 58 //add "Open in new tab" information to links with target="_blank" 59 document.addEventListener('DOMContentLoaded', function() { 60 const language = document.documentElement.lang || 'hu'; 61 const links = document.querySelectorAll('a'); 62 63 const texts = { 64 'en': 'Open in new tab', 65 'hu': 'Ãj lapon nyÃlik meg' 66 } 67 68 const text = texts[language] || texts['hu']; 69 70 links.forEach(function(link) { 71 if(link.getAttribute('target') === '_blank') { 72 73 const title = link.getAttribute('title'); 74 if(title) { 75 link.setAttribute('title', `${text} - ${title}`); 76 } else { 77 link.setAttribute('title', text); 78 } 79 80 81 const ariaLabel = link.getAttribute('aria-label'); 82 if(ariaLabel) { 83 link.setAttribute('aria-label', `${text} - ${ariaLabel}`); 84 } else { 85 link.setAttribute('aria-label', text); 86 } 87 } 88 }); 89 }); 90 91 window.portalReady = Promise.all([bootstrapPortalProm, autoloadProm]).then(doneLoading, doneLoading); 92})();
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.