1function initShortCuts(){ 2 let url = document.currentScript.dataset.baseurl; 3 let json = []; 4 if(document.currentScript.dataset.json){ 5 json = JSON.parse(document.currentScript.dataset.json); 6 } 7 let allEvents = ''; 8 for(let i=0; i<json.length; i++){ 9 let key = json[i]; 10 allEvents += key.klawisz+','; 11 } 12 allEvents +='0'; // otwarcie modala 13 14 hotkeys(allEvents, function (event, handler){ 15 16 for(let i=0; i<json.length; i++){ 17 18 19 let key = json[i]; 20 21 22 if(handler.key === key.klawisz){ 23 24 if(key.typ_linku === 'zewnetrzny'){ 25 location.href = key.link; 26 } 27 else if(key.typ_linku === 'wewnetrzny'){ 28 let innerLink = key.link; 29 let divider = ''; 30 if(innerLink.startsWith("/") && url.endsWith("/")){ 31 innerLink = innerLink.substring(1); 32 divider = ''; 33 } 34 else if(innerLink.startsWith("/") || url.endsWith("/")){ 35 divider = ''; 36 } 37 else { 38 divider = '/'; 39 } 40 let link = url+divider+innerLink; 41 location.href = link; 42 } 43 } 44 } 45 46 if(handler.key === '0'){ 47 $('#shortCutsModal').modal('toggle'); 48 } 49 }); 50 51 52 53 let template = '<ul>'; 54 for(let i=0; i<json.length; i++){ 55 let key = json[i]; 56 template += `<li><strong>${key.klawisz}</strong> - ${key.nazwa}</li>`; 57 } 58 template += `</ul>`; 59 $(document).ready(function(){ 60 $('#shortCutsModal').find('.modal-body').html(template); 61 }); 62 $('#showShortcutsInfo').click(function(){ 63 $('#shortCutsModal').modal('toggle'); 64 }); 65} 66initShortCuts();
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.