1 2function loadKyriosMassesSchedules() { 3 if (document.getElementById("kyriosMassesSchedulesCategorySelector1")) { 4 document.getElementById("kyriosMassesSchedulesCategorySelector1").addEventListener("click", function() {kyriosSetMassScheduleTypeFilter(1);}); 5 } 6 if (document.getElementById("kyriosMassesSchedulesCategorySelector2")) { 7 document.getElementById("kyriosMassesSchedulesCategorySelector2").addEventListener("click", function() {kyriosSetMassScheduleTypeFilter(2);}); 8 } 9 document.getElementById("kyriosMassesSchedulesForm1Data").onsubmit = function() { 10 kyriosMassesScheduleSubmitForm('kyriosMassesSchedulesForm1Data'); 11 return false; 12 }; 13 document.getElementById("kyriosMassesSchedulesForm2Data").onsubmit = function() { 14 kyriosMassesScheduleSubmitForm('kyriosMassesSchedulesForm2Data'); 15 return false; 16 }; 17} 18 19function kyriosSetMassScheduleTypeFilter(type) { 20 //Remove selected 21 document.getElementById("kyriosMassesSchedulesCategorySelector1").classList.remove('selected'); 22 document.getElementById("kyriosMassesSchedulesCategorySelector2").classList.remove('selected'); 23 document.getElementById("kyriosMassesSchedulesForm1").style.display = "none"; 24 document.getElementById("kyriosMassesSchedulesForm2").style.display = "none"; 25 //set selected 26 if (type == 1) { 27 document.getElementById("kyriosMassesSchedulesCategorySelector1").classList.add('selected'); 28 document.getElementById("kyriosMassesSchedulesForm1").style.display = "block"; 29 } else if (type == 2) { 30 document.getElementById("kyriosMassesSchedulesCategorySelector2").classList.add('selected'); 31 document.getElementById("kyriosMassesSchedulesForm2").style.display = "block"; 32 } 33 // kyriosShowPosts(); 34} 35 36function kyriosMassesScheduleSubmitForm(formElementId) { 37 form = document.getElementById(formElementId); 38 var archpriestship = form.elements["archpriestship"].value; 39 var chaperlry = form.elements["chaperlry"].value; 40 var day = form.elements["day"].value; 41 var hour_start = form.elements["hour_start"].value; 42 var hour_end = form.elements["hour_end"].value; 43 var chapelries = window[formElementId + 'Chapelries']; 44 var params = ""; 45 46 if (archpriestship) { 47 // console.log(archpriestship); 48 params += (params.length ? "&" : "") + "archpriestship=" + archpriestship; 49 } 50 if (chaperlry) { 51 // console.log(chaperlry); 52 params += (params.length ? "&" : "") + "chaperlry=" + chaperlry; 53 } 54 if (day) { 55 // console.log(day); 56 params += (params.length ? "&" : "") + "weekday=" + day; 57 } 58 if (hour_start) { 59 // console.log(hour_start); 60 params += (params.length ? "&" : "") + "starts_after=" + hour_start; 61 } 62 if (hour_end) { 63 // console.log(hour_end); 64 params += (params.length ? "&" : "") + "ends_before=" + hour_end; 65 } 66 if (chapelries) { 67 params += (params.length ? "&" : "") + "chapelries=" + chapelries; 68 } 69 if (params.length) { 70 params = "?" + params; 71 } 72 // var homeurl = document.querySelector('link[rel="https://api.w.org/"]').href.replace('/wp-json/','') 73 var homeurl = window.location.origin; 74 75 var theUrl = homeurl + "/wp-json/kyrios_integration/search_available_masses" + params; 76 kyriosHttpGetAsync(theUrl,(resp) => { 77 var responsesContainer = document.getElementById("kyriosMassesSchedulesSearchResponse"); 78 responsesContainer.innerHTML = ""; // clear code 79 var masses =JSON.parse(resp); 80 if (kyriosMassesSchedulesSelectedLayout == 1) { 81 kyriosMassesSchedulesLayout1(responsesContainer, masses); 82 } 83 else if (kyriosMassesSchedulesSelectedLayout == 2) { 84 kyriosMassesSchedulesLayout2(responsesContainer, masses); 85 } 86 else if (kyriosMassesSchedulesSelectedLayout == 3) { 87 kyriosMassesSchedulesLayout3(responsesContainer, masses); 88 } 89 90 }); 91} 92 93 94 95function kyriosMassesScheduleChapelryPage(containerId, masses) { 96 var responsesContainer = document.getElementById(containerId); 97 responsesContainer.innerHTML = ""; // clear code
98 kyriosMassesSchedulesLayout3(responsesContainer, masses); 99} 100 101function kyriosMassesProcessWorshipplaceDescription(description) { 102 if (description) { 103 return description.split(' > ').pop(); 104 } else { 105 return ''; 106 } 107} 108 109function kyriosMassesSchedulesLayout1(responsesContainer,masses) { 110 Object.keys(masses).forEach(chapelrie_id => { 111 const worshipPlacesList = masses[chapelrie_id] 112 const chapelriesContainer = document.createElement("div"); 113 const chapelrieName = document.createElement("span"); 114 chapelriesContainer.classList.add("chapelrieContainer"); 115 chapelrieName.classList.add("chapelrieName"); 116 const worshipPlaceKeys = Object.keys(worshipPlacesList); 117 chapelrieName.innerHTML = worshipPlacesList[worshipPlaceKeys[0]][0].chapelrie_description; 118 chapelriesContainer.appendChild(chapelrieName); 119 if (worshipPlacesList[worshipPlaceKeys[0]][0].url) { 120 chapelrieName.onclick = function () { kyriosAgendaOpenPage(worshipPlacesList[worshipPlaceKeys[0]][0].url); };; 121 } 122 worshipPlaceKeys.forEach(worshipPlaceKey => { 123 const worshipplace = worshipPlacesList[worshipPlaceKey]; 124 const worshipplaceContainer = document.createElement("div"); 125 const worshipplaceDesciption = document.createElement("span"); 126 //Set classes 127 worshipplaceContainer.classList.add("worshipplaceContainer"); 128 worshipplaceDesciption.classList.add("worshipplaceDescription"); 129 // Set text 130 worshipplaceDesciption.innerHTML = kyriosMassesProcessWorshipplaceDescription(worshipplace[0].worshipplace_description); 131 // Make worshipplaceContainer 132 worshipplaceContainer.appendChild(worshipplaceDesciption); 133 worshipplace.forEach(mass => { 134 const massLine = document.createElement("span"); 135 massLine.classList.add("massLine"); 136 var massInfo = "";// mass.mass_start_hour + ' a ' + mass.mass_end_hour 137 var massWeekDaysInfo = ""; 138 if (mass.weekdays.includes("1")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[0];} 139 if (mass.weekdays.includes("2")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[1];} 140 if (mass.weekdays.includes("3")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[2];} 141 if (mass.weekdays.includes("4")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[3];} 142 if (mass.weekdays.includes("5")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[4];} 143 if (mass.weekdays.includes("6")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeekend + " ") + kyriosCalendarDays[5];} 144 if (mass.weekdays.includes("7")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeekend + " ") + kyriosCalendarDays[6];} 145 switch(mass.frequency) { 146 case '1'://diaria 147 massInfo = kyriosEveryday + ' ' + mass.mass_start_hour; 148 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 149 break; 150 case '3'://quinzenal 151 massInfo = kyriosByweekly + ' ' + massWeekDaysInfo + " " + dayToHourSeparator + " " + mass.mass_start_hour; 152 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 153 break; 154 case '4'://mensal 155 massInfo = kyriosMonthly + ' ' + massWeekDaysInfo + " " + dayToHourSeparator + " " + mass.mass_start_hour; 156 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 157 break; 158 default: // semanal 159 massInfo = kyriosFirstLetterUp(massWeekDaysInfo) + " " + dayToHourSeparator + " " + mass.mass_start_hour; 160 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 161 break; 162 } 163 massLine.innerHTML = massInfo; 164 worshipplaceContainer.appendChild(massLine); 165 }); 166 167 chapelriesContainer.appendChild(worshipplaceContainer); 168 }); 169 responsesContainer.appendChild(chapelriesContainer); 170 }); 171} 172 173function kyriosMassesSchedulesLayout2(responsesContainer, masses) { 174 const chapelriesTable = document.createElement("table"); 175 const chapelriesHeader = document.createElement("thead"); 176 const chapelriesHeader1 = document.createElement("th"); 177 const chapelriesHeader2 = document.createElement("th"); 178 const chapelriesHeader3 = document.createElement("th"); 179 chapelriesTable.classList.add("chapelrieContainer"); 180 chapelriesHeader1.innerHTML = kyriosMassesSchedulesParishText; 181 chapelriesHeader2.innerHTML = kyriosMassesSchedulesPlaceText; 182 chapelriesHeader3.innerHTML = kyriosMassesSchedulesMassText; 183 chapelriesHeader.appendChild(chapelriesHeader1); 184 chapelriesHeader.appendChild(chapelriesHeader2); 185 chapelriesHeader.appendChild(chapelriesHeader3); 186 chapelriesTable.appendChild(chapelriesHeader);//TopLine
187 Object.keys(masses).forEach(chapelrie_id => {//Each Line 188 const worshipPlacesList = masses[chapelrie_id] 189 //Dynamic 190 // const chapelrieLine = document.createElement("tr"); 191 const chapelrieName = document.createElement("td"); 192 const worshipPlaceKeys = Object.keys(worshipPlacesList); 193 194 chapelrieName.classList.add("chapelrieName"); 195 chapelrieName.rowSpan = worshipPlaceKeys.length; 196 chapelrieName.innerHTML = worshipPlacesList[worshipPlaceKeys[0]][0].chapelrie_description; 197 198 if (worshipPlacesList[worshipPlaceKeys[0]][0].url) { 199 chapelrieName.onclick = function () { kyriosAgendaOpenPage(worshipPlacesList[worshipPlaceKeys[0]][0].url); };; 200 } 201 let first = true; 202 // console.log('chapelrie ->' + worshipPlacesList[worshipPlaceKeys[0]][0].chapelrie_description); 203 // console.log(worshipPlaceKeys); 204 worshipPlaceKeys.forEach(worshipPlaceKey => { 205 const worshipplaceMasses = worshipPlacesList[worshipPlaceKey]; 206 const worshipplaceLine = document.createElement("tr"); 207 const worshipplaceContainer = document.createElement("td"); 208 const worshipplaceDesciption = document.createElement("td"); 209 //Set classes 210 worshipplaceContainer.classList.add("worshipplaceContainer"); 211 worshipplaceDesciption.classList.add("worshipplaceDescription"); 212 // Set text 213 worshipplaceDesciption.innerHTML = kyriosMassesProcessWorshipplaceDescription(worshipplaceMasses[0].worshipplace_description); 214 // console.log(first + ' - ' + worshipPlaceKeys.length); 215 if (first) { worshipplaceLine.appendChild(chapelrieName); first = false;} 216 worshipplaceLine.appendChild(worshipplaceDesciption); 217 worshipplaceMasses.forEach(mass => { 218 const massLine = document.createElement("span"); 219 massLine.classList.add("massLine"); 220 var massInfo = "";// mass.mass_start_hour + ' a ' + mass.mass_end_hour 221 var massWeekDaysInfo = ""; 222 if (mass.weekdays.includes("1")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[0];} 223 if (mass.weekdays.includes("2")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[1];} 224 if (mass.weekdays.includes("3")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[2];} 225 if (mass.weekdays.includes("4")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[3];} 226 if (mass.weekdays.includes("5")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeek + " ") + kyriosCalendarDays[4];} 227 if (mass.weekdays.includes("6")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeekend + " ") + kyriosCalendarDays[5];} 228 if (mass.weekdays.includes("7")) {massWeekDaysInfo += (massWeekDaysInfo.length ? ", ": kyriosAtWeekend + " ") + kyriosCalendarDays[6];} 229 230 switch(mass.frequency) { 231 case '1'://diaria 232 massInfo = kyriosEveryday + ' ' + mass.mass_start_hour; 233 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 234 break; 235 case '3'://quinzenal 236 massInfo = kyriosByweekly + ' ' + massWeekDaysInfo + " " + dayToHourSeparator + " " + mass.mass_start_hour; 237 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 238 break; 239 case '4'://mensal 240 massInfo = kyriosMonthly + ' ' + massWeekDaysInfo + " " + dayToHourSeparator + " " + mass.mass_start_hour; 241 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 242 break; 243 default: // semanal 244 massInfo = kyriosFirstLetterUp(massWeekDaysInfo) + " " + dayToHourSeparator + " " + mass.mass_start_hour; 245 if (mass.mass_end_hour) { massInfo += " " + hourSeparator + " " + mass.mass_end_hour; } 246 break; 247 } 248 massLine.innerHTML = massInfo; 249 worshipplaceContainer.appendChild(massLine);//Add mass to container 250 }); 251 worshipplaceLine.appendChild(worshipplaceContainer);//Add masses to line 252 chapelriesTable.appendChild(worshipplaceLine);//Add Line to Table 253 }); 254 }); 255 responsesContainer.appendChild(chapelriesTable);//Set table on view 256} 257 258 259function kyriosMassesSchedulesLayout3(responsesContainer,masses) {
260 Object.keys(masses).forEach(chapelrie_id => { 261 const worshipPlacesList = masses[chapelrie_id] 262 const chapelriesContainer = document.createElement("div"); 263 const chapelrieName = document.createElement("span"); 264 chapelriesContainer.classList.add("chapelrieContainer"); 265 chapelrieName.classList.add("chapelrieName"); 266 const worshipPlaceKeys = Object.keys(worshipPlacesList); 267 chapelrieName.innerHTML = worshipPlacesList[worshipPlaceKeys[0]][0].chapelrie_description; 268 chapelriesContainer.appendChild(chapelrieName); 269 if (worshipPlacesList[worshipPlaceKeys[0]][0].url) { 270 chapelrieName.onclick = function () { kyriosAgendaOpenPage(worshipPlacesList[worshipPlaceKeys[0]][0].url); };; 271 } 272 worshipPlaceKeys.forEach(worshipPlaceKey => { 273 const worshipplace = worshipPlacesList[worshipPlaceKey]; 274 const worshipplaceContainer = document.createElement("div"); 275 const worshipplaceDesciption = document.createElement("span"); 276 //Set classes 277 worshipplaceContainer.classList.add("worshipplaceContainer"); 278 worshipplaceDesciption.classList.add("worshipplaceDescription"); 279 // Set text 280 worshipplaceDesciption.innerHTML = kyriosMassesProcessWorshipplaceDescription(worshipplace[0].worshipplace_description); 281 // Make worshipplaceContainer 282 const massLine = document.createElement("span"); 283 massLine.classList.add("massLine"); 284 worshipplaceContainer.appendChild(worshipplaceDesciption); 285 var massList = { all: [], quarterly: { }, monthly: { }, weekly: { }}; 286 worshipplace.forEach(mass => { 287 const massHourInfo = { 288 from: mass.mass_start_hour, 289 to: mass.mass_end_hour, 290 months: mass.months.split(','), 291 start_date: mass.start_date, 292 end_date: mass.end_date, 293 for_confessions: mass.for_confessions 294 }; 295 switch(mass.frequency) { 296 case '1'://diaria 297 massList.all.push(massHourInfo); 298 break; 299 case '3'://quinzenal 300 massList.quarterly = makeWeekdayMassList(mass, massHourInfo, massList.quarterly); 301 break; 302 case '4'://mensal 303 massList.monthly = makeWeekdayMassList(mass, massHourInfo, massList.monthly); 304 break; 305 default: // semanal 306 massList.weekly = makeWeekdayMassList(mass, massHourInfo, massList.weekly); 307 break; 308 } 309 }); 310 // Make worshipplace Masses List 311 massInfo = ((massList.all.length > 0) ? "<div class=\"kyriosMassAllDays\">" + kyriosEveryday + ' ' + processMassesToHourAndMonthsString(massList.all) +/* "." + */ "</div>" : "") 312 + ( (Object.keys(massList.weekly).length > 0) ? "<div class=\"kyriosMassWeekly\">" + kyriosWeekly + ":" + ' ' + processWeekdayMassList(massList.weekly) + "</div>" : "") 313 + ( (Object.keys(massList.quarterly).length > 0) ? "<div class=\"kyriosMassQuarterly\">" + kyriosByweekly + ":" + ' ' + processWeekdayMassList(massList.quarterly) + "</div>" : "") 314 + ( (Object.keys(massList.monthly).length > 0) ? "<div class=\"kyriosMassMonthly\">" + kyriosMonthly + ":" + processWeekdayMassList(massList.monthly) + "</div>" : "") 315 massLine.innerHTML = massInfo; 316 worshipplaceContainer.appendChild(massLine); 317 chapelriesContainer.appendChild(worshipplaceContainer); 318 }); 319 responsesContainer.appendChild(chapelriesContainer); 320 }); 321} 322 323function makeWeekdayMassList(mass, massHourInfo, massListArray) { 324 if (mass.weekdays.includes("1")) {massListArray[1] ? massListArray[1].push(massHourInfo) : massListArray[1] = [massHourInfo];} 325 if (mass.weekdays.includes("2")) {massListArray[2] ? massListArray[2].push(massHourInfo) : massListArray[2] = [massHourInfo];} 326 if (mass.weekdays.includes("3")) {massListArray[3] ? massListArray[3].push(massHourInfo) : massListArray[3]
326= [massHourInfo];} 327 if (mass.weekdays.includes("4")) {massListArray[4] ? massListArray[4].push(massHourInfo) : massListArray[4] = [massHourInfo];} 328 if (mass.weekdays.includes("5")) {massListArray[5] ? massListArray[5].push(massHourInfo) : massListArray[5] = [massHourInfo];} 329 if (mass.weekdays.includes("6")) {massListArray[6] ? massListArray[6].push(massHourInfo) : massListArray[6] = [massHourInfo];} 330 if (mass.weekdays.includes("7")) {massListArray[7] ? massListArray[7].push(massHourInfo) : massListArray[7] = [massHourInfo];} 331 return massListArray; 332} 333function processWeekdayMassList(weekMassList) { 334 weekMassCode = ""; 335 if (weekMassList[1]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[0]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[1]) +/* "." + */ "</span>"; } 336 if (weekMassList[2]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[1]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[2]) +/* "." + */ "</span>"; } 337 if (weekMassList[3]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[2]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[3]) +/* "." + */ "</span>"; } 338 if (weekMassList[4]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[3]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[4]) +/* "." + */ "</span>"; } 339 if (weekMassList[5]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[4]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[5]) +/* "." + */ "</span>"; } 340 if (weekMassList[6]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[5]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[6]) +/* "." + */ "</span>"; } 341 if (weekMassList[7]) { weekMassCode += "</br><span class=\"kyriosMassWeekday\">" + kyriosCalendarDays[6]+ /* " " + kyriosMassFrom + */ ": " + processMassesToHourAndMonthsString(weekMassList[7]) +/* "." + */ "</span>"; } 342 return weekMassCode; 343} 344function processMassesToHourAndMonthsString(list) { 345 const hourSeparator = 'Ã '; 346 massesProcessed = ""; 347 list = [...new Map(list.map(x => [x.from, x])).values()]; // remove duplicates 348 // console.log('t1', list); 349 list.forEach((massInfo) => { 350 // massesProcessed += (massesProcessed.length ? ", " : "") + massInfo.from + (massInfo.to ? " " + hourSeparator + " " + massInfo.to : ""); 351 for_confessions = ''; 352 // For Confessions 353 if (massInfo.for_confessions === "1") { 354 for_confessions = kyriosConfessions; 355 } 356 357 startEndString = ''; 358 if (massInfo.start_date) { 359 var sd = new Date(massInfo.start_date); 360 var sdStr = sd.getDate() + "-" + (sd.getMonth() + 1 ) + "-" + sd.getFullYear(); 361 startEndString += kyriosMassDateFrom + ' ' + sdStr; 362 } 363 if (massInfo.end_date)Â { 364 var ed = new Date(massInfo.end_date); 365 var edStr = ed.getDate() + "-" + (ed.getMonth() + 1 ) + "-" + ed.getFullYear(); 366 startEndString += (startEndString.length == 0 ? '' : ' ' + kyriosMassDateTo + ' ') + edStr; 367 } 368 monthString = ''; 369 if (massInfo.months.length === 12) { 370 // Every Month // DO not warn, is better I belive 371 // monthString = kyriosEverymonth; 372 } else { 373 // make months str 374 first = true; 375 massInfo.months.forEach((mon) => { 376 if (first) { first = false; } else { monthString += ', '; } 377 monthString += kyriosCalendarMonths[mon - 1]; 378 }) 379 } 380 381 var extraInfo = ''; 382 if (for_confessions.length > 0) { 383 extraInfo += for_confessions; 384 } 385 if (monthString.length > 0) { 386 extraInfo += (extraInfo.length == 0 ? '' : ', ') + monthString; 387 } 388 if (startEndString.length > 0) { 389 extraInfo += (extraInfo.length == 0 ? '' : ', ') + startEndString; 390 } 391 if(extraInfo.length > 0) { 392 extraInfo = ' (' + extraInfo + ')'; 393 } 394 massesProcessed += "<span class='weekdayMassLine'>" + massInfo.from + (massInfo.to ? " " + hourSeparator + " " + massInfo.to : "") + extraInfo + "</span>"; 395 }); 396 return "<div class='dayMasses'>" + massesProcessed + '</div>'; 397} 398function kyriosFirstLetterUp(string) { 399 return string.charAt(0).toUpperCase() + string.slice(1) 400} 401 402function kyriosArraySortCompare( a, b ) { 403 if ( a < b ){ 404 return -1; 405 } 406 if ( a > b ){ 407 return 1; 408 } 409 return 0; 410 } 411function kyriosHttpGetAsync(theUrl, callback) 412{ 413 var xmlHttp = new XMLHttpRequest(); 414 xmlHttp.onreadystatechange = function() { 415 if (xmlHttp.readyState == 4 && xmlHttp.status == 200) 416 callback(xmlHttp.responseText); 417 } 418 xmlHttp.open("GET", theUrl, true); // true for asynchronous 419 xmlHttp.send(null); 420}
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.