1function callNavigation(link, datatype) { 2 link += "&json=1"; 3 4 var xhr = new XMLHttpRequest(); 5 xhr.open("GET", link); 6 xhr.setRequestHeader("accept", "application/json; charset=utf-8") 7 xhr.onload = function () { 8 try { 9 if (xhr.status != 200) { 10 alert('error ' + xhr.statusText); 11 return; 12 } 13 14 var json = JSON.parse(xhr.responseText); 15 if (!json || !json.data) { 16 if (typeof datatype == 'undefined') { 17 return callNavigation(link, "json"); 18 } 19 alert('could not get calendar'); 20 return; 21 } 22 if (json.script) { 23 //alert(json.script); 24 try { 25 var script = JSON.parse(json.script); 26 linkprevious = script.linkprevious; 27 linknext = script.linknext; 28 } 29 catch (e) 30 { 31 // fallback to old version 32 eval(json.script); 33 } 34 } 35 var myspan = document.getElementById("testspan" + json.modid); 36 var modbody = myspan.parentNode; 37 modbody.innerHTML = json.data; 38 // we may have tooltips to re-enable too! 39 try { 40 if (typeof jevPopover == "function") 41 { 42 jevPopover('.hasjevtip', modbody); 43 } 44 else { 45 // Joomla 4/Bootstrap 5 changes 46 var bootstrap5 = false; 47 var bootstrap4 = false; 48 try { 49 var testClass = window.bootstrap.Tooltip || window.bootstrap.Modal; 50 var bsVersion = testClass.VERSION.substr(0,1); 51 bootstrap5 = bsVersion >= 5; 52 bootstrap4 = bsVersion >= 4 && !bootstrap5; 53 } catch (e) { 54 } 55 popoveroptions = { 56 'html': true, 57 'placement': 'top', 58 'title': '', 59 'trigger': 'hover focus', 60 'content': '', 61 'delay': {'hide': 150, 'show': 150}, 62 'container': modbody 63 }; 64 if (bootstrap5) 65 { 66 modbody.querySelectorAll('.hasjevtip').forEach(function (el) { 67 var pop = new window.bootstrap.Popover(el, popoveroptions); 68 }); 69 } 70 else { 71 if (typeof jQuery !== 'undefined') { 72 jQuery(modbody).find('.hasjevtip').popover(popoveroptions); 73 } 74 } 75 } 76 } 77 catch (e) { 78 } 79 80 // we may have popup links too 81 try { 82 setupEventPopups(); 83 } 84 catch (e) { 85 } 86 87 setupSpecificNavigation(); 88 89 } catch (e) { 90 alert('bad response = ' + e + "\n" + xhr.responseText ); 91 } 92 } 93 94 xhr.onerror = function () { 95 alert('error ' + xhr.statusText); 96 97 } 98 99 xhr.send(); 100 101} 102 103// setup touch interaction 104document.addEventListener('DOMContentLoaded', function () { 105 setupSpecificNavigation(); 106}); 107 108var jevMiniTouchStartX = false; 109var jevMiniTouchStartY = false; 110 111function setupMiniCalTouchInteractions(selector, parent) { 112 var target = parent ? document.querySelector(selector).parentNode : document.querySelector(selector); 113 if ('ontouchstart' in document.documentElement) { 114 var target = parent ? document.querySelector(selector).parentNode : document.querySelector(selector); 115 target.addEventListener("touchend", function (evt) { 116 var touchobj = evt.originalEvent.changedTouches[0]; 117 var vdist = touchobj.pageY - jevMiniTouchStartY; 118 if (Math.abs(vdist) > 50) { 119 evt.preventDefault(); 120 return; 121 } 122 var distX = touchobj.pageX - jevMiniTouchStartX; 123 if (distX > 10) { 124 if (linkprevious) callNavigation(linkprevious); 125 evt.preventDefault(); 126 } 127 else if (distX < -10) { 128 if (linknext) callNavigation(linknext); 129 evt.preventDefault(); 130 } 131 }); 132 target.addEventListener("touchstart", function (evt) { 133 //evt.preventDefault(); 134 var touchobj = evt.originalEvent.changedTouches[0]; 135 jevMiniTouchStartX = touchobj.pageX; 136 jevMiniTouchStartY = touchobj.pageY; 137 }); 138 target.addEventListener("touchmove", function (evt) { 139 // top stop scrolling etc. but only in the horizontal 140 var touchobj = evt.originalEvent.changedTouches[0]; 141 142 var distX = touchobj.pageX - jevMiniTouchStartX; 143 //jevlog(distX + " "+Math.abs(distX)); 144 if (Math.abs(distX) > 5) { 145 evt.preventDefault(); 146 147 } 148 /* 149 var vdist = touchobj.pageY - jevMiniTouchStartY ; 150 jevlog(vdist + " "+Math.abs(vdist)); 151 if (Math.abs(vdist)<20) { 152 evt.preventDefault(); 153 } 154 */ 155 }); 156 } 157} 158 159function jevlog(msg) { 160 try { 161 console.log(msg); 162 } 163 catch (e) { 164 165 } 166 167}
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.