PageSourceSearch

https://www.tcd.ie/media/tcd/site-assets/modules/php-search/php-search.min.js

js tcd.ie collected 2026-09-24 08:24:06 UTC 28,012 bytes, 1 lines download raw bytes

1"use strict";var t4PHPSearch={};t4PHPSearch={loadModules:function(){if(void 0!==t4Autocomplete)new t4Autocomplete(this);if(void 0!==t4Filter)new t4Filter(this);if(void 0!==t4Categories)new t4Categories(this);if(void 0!==t4CourseCompare)new t4CourseCompare(this);new t4Search(this)},init:function(t){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?this.loadModules().bind(t):document.addEventListener?document.addEventListener("DOMContentLoaded",this.loadModules.bind(t)):document.attachEvent&&document.attachEvent("DOMContentLoaded",this.loadModules.bind(t))}},0<document.querySelectorAll("[data-t4-ajax-group$=Search],[data-t4-ajax-group=courseCompare],[data-t4-compare-button]").length&&t4PHPSearch.init();var t4Generic={};function t4Autocomplete(a){this.constructor=function(){for(var t in this.autoCompleteInput="input[type=text][data-t4-autocomplete-url]",this.autoCompleteResults=".autocomplete-results",this.autoCompleteResultsList=".change-search-value",this.ScrollToOffset=0,this.keys={Escape:27,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Enter:13},a)void 0!==this[t]&&null!==this[t]&&(this[t]=a[t]);this.activeRequest=!1,this.keyUpTime,this.delayTimer;var e=document.querySelectorAll(this.autoCompleteInput);if(null!=e){for(var r=0;r<e.length;++r)e[r].hasAttribute("data-t4-autocomplete-url")&&e[r].setAttribute("autocomplete","off");document.addEventListener("click",this.eventList.bind(this),!1),document.addEventListener("change",this.eventList.bind(this),!1),document.addEventListener("input",this.eventList.bind(this),!1),document.addEventListener("keyup",this.eventList.bind(this),!1),document.addEventListener("keypress",this.eventList.bind(this),!1)}},this.eventList=function(t){var e=!1,r=document.querySelectorAll(this.autoCompleteInput);if(null!=r)for(var a=0;a<r.length;a++){var i;if(t.target.hasAttribute("name")&&t.target.hasAttribute("data-t4-autocomplete-url"))s=document.querySelector(this.autoCompleteResults+"[data-name="+t.target.name+"]"),l=t.target;else if(t.target.classList.contains(this.autoCompleteResults.replace("."," ").trim())?s=t.target:null!==t.target.parentNode&&t.target.parentNode.classList.contains(this.autoCompleteResults.replace("."," ").trim())&&(s=t.target.parentNode),null!==s){var o=this.getParent(s,"[role=combobox]");null!==o&&(l=o.querySelector("input[name="+s.getAttribute("data-name")+"]"))}if(void 0===s&&(s=null),i=null!==s?s.querySelectorAll(this.autoCompleteResultsList):[],void 0===l?this.removeAutoCompleteResultsDiv():l.setAttribute("autocomplete","off"),"click"===t.type){for(var n=0;n<i.length;++n){var s;if(t.target===i[n])if(null!==(s=t.target.parentNode)){var l=this.getParent(s,"div").querySelector("input[name="+t.target.parentNode.getAttribute("data-name")+"]"),u=t.target.getAttribute("data-value");l.value=u,l.dispatchEvent(this.getEvent("keyup")),e=!0}}null!==s&&t.target!==s&&t.target!==l&&this.removeAutoCompleteResultsDiv(s.getAttribute("data-name"))}if("keyup"===t.type){if(null!=l&&null!==l.name)var c=document.querySelectorAll(this.autoCompleteResults+":not([data-name="+l.name+"])");if(null!=c)for(n=0;n<c.length;++n)this.removeAutoCompleteResultsDiv(c[n].getAttribute("data-name"));if(t.target===r[a]){t.keyCode==this.keys.Escape&&(t.target.value="");var h=this.keys;-1===Object.keys(h).map(function(t){return h[t]}).indexOf(t.keyCode)&&t.target===document.activeElement&&(e=this.eventAutoComplete(t))}t.keyCode==this.keys.Escape&&(t.target===s||t.target.parentNode===s?(e=!(l.value=""),this.removeAutoCompleteResultsDiv(l.name),l.focus()):t.target===r[a]&&(e=!0,this.removeAutoCompleteResultsDiv(r[a].name))),t.target.parentNode===s&&t.keyCode==this.keys.DownArrow&&t.shiftKey?(s.lastChild.focus(),e=!0):t.target===r[a]&&null!==s&&t.keyCode==this.keys.DownArrow&&t.target===document.activeElement?(s.firstChild.focus(),e=!0):t.target.parentNode===s&&t.keyCode==this.keys.DownArrow&&t.target===document.activeElement&&(e=(null!==document.activeElement.nextSibling?document.activeElement.nextSibling.focus():s.firstChild.focus(),!0)),t.target.parentNode===s&&t.keyCode==this.keys.UpArrow&&t.shiftKey?(s.firstChild.focus(),e=!0):t.target===r[a]&&t.keyCode==this.keys.UpArrow&&t.target===document.activeElement?(s.lastChild.focus(),e=!0):t.target.parentNode===s&&t.keyCode==this.keys.UpArrow&&t.target===document.activeElement&&(e=(null!==document.activeElement.previousSibling?document.activeElement.previousSibling.focus():s.lastChild.focus(),!0)),t.target!==s&&t.target.parentNode!==s||t.keyCode!=this.keys.LeftArrow&&t.keyCode!=this.keys.RightArrow||(l.focus(),t.keyCode==this.keys.LeftArrow?(l.selectionStart=0<l.value.length?l.value.length-1:0,l.selectionEnd=0<l.value.length?l.value.length-1:0):(l.selectionStart=0<l.value.length?1:0,l.selectionEnd=0<l.value.length?1:0))}if("keypress"===t.type){e=t.target===r[a]&&t.keyCode==this.keys.Enter;for(n=0;n<i.length;++n)if(t.target===i[n]&&t.keyCode==this.keys.Enter){var d=t.target.querySelector("a");if(null!==d)""!=d.getAttribute("href")&&(window.location.href=d.getAttribute("href"));else{u=t.target.getAttribute("data-value");l.value=u,l.dispatchEvent(this.getEvent("keyup")),this.removeAutoCompleteResultsDiv(l.name),e=!0}}var p=47<t.keyCode&&t.keyCode<58||32==t.keyCode||13==t.keyCode||64<t.keyCode&&t.keyCode<91||95<t.keyCode&&t.keyCode<112||185<t.keyCode&&t.keyCode<193||218<t.keyCode&&t.keyCode<223;t.target.parentNode===s&&p&&t.target===document.activeElement?(l.focus(),l.dispatchEvent(this.getEvent("keyup")),e=!1):t.target.parentNode!==s&&p&&this.removeAutoCompleteResultsDiv()}}!0===e&&(t.preventDefault(),t.stopPropagation())}
1,this.eventAutoComplete=function(o){if(o.target.hasAttribute("id"))var n=o.target.getAttribute("id");else{n="acTextBox"+Math.random();o.target.setAttribute("id",n)}o.target.setAttribute("aria-autocomplete","list"),o.target.setAttribute("aria-controls","autocompleteResults"),o.target.setAttribute("aria-activedescendant","autocompleteResults");var t=this.getParent(o.target,"div");t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-owns","autocompleteResults"),t.setAttribute("aria-expanded",!1);var e=o.target.value,r=o.target.getAttribute("data-t4-autocomplete-url"),s=o.target.name;if(0==e.length)return this.removeAutoCompleteResultsDiv(s),!1;if(!1!==r&&!1!==s){var a=document.querySelector(this.autoCompleteResults+"[data-name="+s+"]"),l=new XMLHttpRequest;return null!==a&&(a.innerHTML="",t.setAttribute("aria-expanded",!1)),r=-1===r.indexOf("?")?r+"?term="+e:r+"&term="+e,l.open("GET",r),l.onload=function(){if(!(200<=l.status&&l.status<400))return console.error("T4Search: AJAX URL returns Status "+l.status+' with element "'+s+'"'),!1;try{var t=JSON.parse(l.responseText)}catch(t){return console.error('T4Search: URL Response is not a valid JSON File for element "'+s+'"'),!1}var e=document.querySelector(this.autoCompleteResults+"[data-name="+s+"]");if(null===e){var r=document.createElement("ul");r.setAttribute("class",this.autoCompleteResults.replace("."," ")),r.setAttribute("role","listbox"),r.setAttribute("aria-labelledby",n),r.setAttribute("data-name",s),this.getParent(o.target,"div").appendChild(r),e=document.querySelector(this.autoCompleteResults+"[data-name="+s+"]")}var a="";if(0<t.length)for(var i=0;i<t.length;++i)t[i].value,o.target.value,a+='<li id="id'+i+'" role="option" data-value="'+t[i].value+'" class="search-info change-search-value" data-name="'+o.target.getAttribute("name")+'"  tabindex="-1">'+t[i].label+"</li>";e.innerHTML=a,this.getParent(o.target,"div").setAttribute("aria-expanded",!0),this.activeRequest=!1}.bind(this),l.onerror=function(){return console.error("T4Search: AJAX URL returns Status "+l.status+' with element "'+s+'"'),this.activeRequest=!1},l.send(),!0}},this.removeAutoCompleteResultsDiv=function(t){t=void 0===t?"":"[data-name="+t+"]";var e=document.querySelector(this.autoCompleteResults+t);null!==e&&(this.getParent(e,"div").setAttribute("aria-expanded",!1),e.parentNode.removeChild(e))},this.constructor(this)}function t4Categories(e){this.constructor=function(){for(var t in e)void 0!==this[t]&&null!==this[t]&&(this[t]=e[t]);this.ajaxCatLinkSel="[data-catlink][data-catname]",this.ajaxGroupSel="[data-t4-ajax-group]",document.addEventListener("t4-after-ajax",this.eventList.bind(this),!1),window.addEventListener("load",this.eventList.bind(this),!1),document.addEventListener("click",this.eventList.bind(this),!1)},this.loadCategories=function(){for(var t=document.querySelectorAll(this.ajaxCatLinkSel),e=0;e<t.length;e++){var r=t[e].getAttribute("data-catlink")+"?"+t[e].getAttribute("data-catname")+"=",a="",i=t[e].innerText;if(""!=i){var o=[];o=t[e].hasAttribute("data-separator")?i.split(t[e].getAttribute("data-separator")):[i];for(var n=0;n<o.length;++n){var s=t[e].getAttribute("data-child-separator"),l=o[n];if("string"==typeof s){var u=t[e].getAttribute("data-child-to");if("string"==typeof u)l=l.replace(s,u);else{var c=o[n].split(t[e].getAttribute("data-child-separator"));l=c[c.length-1]}}""!==t[e].getAttribute("data-catname")?a+='<a href="'+r+o[n]+'" data-t4-ajax-link="true" >'+l+"</a>":a+=l,t[e].hasAttribute("data-separator")&&n<o.length-1&&(a+=t[e].getAttribute("data-separator"))}t[e].innerHTML=a}}},this.eventList=function(t){if("load"!==t.type&&"t4-after-ajax"!==t.type||this.loadCategories(),"click"===t.type)for(var e=document.querySelectorAll(this.ajaxCatLinkSel),r=0;r<e.length;++r)t.target===e[r]&&this.linkCategories(t)},this.linkCategories=function(t){t.target;for(var e=document.querySelectorAll(this.ajaxGroupSel+' form input[type=radio][name="'+name+'"][data-category="'+category+'"],'+this.ajaxGroupSel+' form input[type=checkbox][name="'+name+'"][data-category="'+category+'"]'),r=0;r<e.length;r++)e[r].checked=!1,e[r].dispatchEvent(this.getEvent("change"))},this.checkLoad=function(){},this.constructor(this)}function t4CourseCompare(r){this.disableSel=".disabled",this.courseCompareSubmitSel="[type=submit]",this.min=2,this.max=3,this.relTop=-60,this.constructor=function(){null!==(t=document.querySelector("[compare-min]"))&&(this.min=t.getAttribute("compare-min"));var t=document.querySelector("[compare-max]");for(var e in null!==t&&(this.max=t.getAttribute("compare-max")),r)void 0!==this[e]&&null!==this[e]&&(this[e]=r[e]);this.courseCompareButtonsSel="[data-t4-compare-button]",this.ErrorMessageSel="[data-t4-compare=error]",this.tableSel="[data-t4-compare=table]",this.ajaxGroupSel="[data-t4-ajax-group=courseCompare]",this.ajaxSaveSel="[data-t4-ajax-save]",this.ignoreHeader="[data-t4-compare-ignore]",this.cookieName="saved_courses_compare",this.buttonSavedCourse="saved_courses_compare",window.addEventListener("load",this.eventList.bind(this),!1),document.addEventListener("t4-after-ajax",this.eventList.bind(this),!1),window.addEventListener("resize",this.eventList.bind(this),!1),window.addEventListener("scroll",this.eventList.bind(this),!1),document.addEventListener("click",this.eventList.bind(this),!1)},this.eventList=function(t){var e=!1;
1if("load"!==t.type&&"t4-after-ajax"!==t.type||(this.checkSavedCoursesForm(),this.StickyLoad(),this.Sticky(),this.checkSavedCourse()),"click"===t.type){for(var r=document.querySelectorAll(this.ajaxGroupSel+" input[type=checkbox]"),a=0;a<r.length;++a)t.target===r[a]&&this.checkSavedCoursesForm();var i=document.querySelector(this.ajaxGroupSel+" "+this.courseCompareSubmitSel);null!==i&&t.target===i&&this.handleForm(i,this.ajaxGroupSel);var o=document.querySelectorAll("a"+this.courseCompareButtonsSel+","+this.courseCompareButtonsSel+" a");for(a=0;a<o.length;++a)t.target===o[a]&&(e=this.eventSave(t),e=!0)}"resize"===t.type&&(this.StickyLoad(),this.Sticky()),"scroll"===t.type&&this.Sticky(),!0===e&&(t.preventDefault(),t.stopPropagation())},this.eventSave=function(t){var e=t.target.getAttribute("href"),r=this.getParent(t.target,"[data-t4-ajax-group]");return this.runAjax(e,"[data-t4-ajax-group]",r,!1,!0,!0)},this.checkSavedCoursesForm=function(){var t=document.querySelectorAll(this.ajaxGroupSel+" input:checked"),e=document.querySelectorAll(this.ajaxGroupSel+" input
1:not(:checked)");if(null!==document.querySelector(this.ajaxGroupSel)){if(t.length>=this.max){for(var r=0;r<e.length;++r)e[r].classList.add(this.disableSel.replace("."," ").trim()),e[r].disabled=!0;null!==document.querySelector(this.ajaxGroupSel+" "+this.ErrorMessageSel)&&(document.querySelector(this.ajaxGroupSel+" "+this.ErrorMessageSel).style.display="block")}else{for(r=0;r<e.length;++r)e[r].classList.remove(this.disableSel.replace("."," ").trim()),e[r].disabled=!1;null!==document.querySelector(this.ajaxGroupSel+" "+this.ErrorMessageSel)&&(document.querySelector(this.ajaxGroupSel+" "+this.ErrorMessageSel).style.display="none")}var a=document.querySelector(this.ajaxGroupSel+" "+this.courseCompareSubmitSel);null!==a&&(t.length<this.min?(a.classList.add(this.disableSel.replace("."," ").trim()),a.disabled=!0):(a.classList.remove(this.disableSel.replace("."," ").trim()),a.disabled=!1))}},this.StickyLoad=function(){if(this.sticky=0,this.margin=0,this.width=0,null!==document.querySelector(this.tableSel)){var t=document.querySelector(this.tableSel),e=document.querySelector(this.tableSel+" thead");t.classList.remove("sticky"),this.sticky=e.getBoundingClientRect().top+window.pageYOffset;for(var r=document.querySelectorAll(this.ignoreHeader),a=0,i=0;i<r.length;++i)a+=r[i].getBoundingClientRect().height;this.sticky-=a,document.querySelector(this.tableSel+" thead").style.top=a+"px",this.margin=e.getBoundingClientRect().height,this.width=e.getBoundingClientRect().width}},this.Sticky=function(){var t=document.querySelector(this.tableSel),e=document.querySelector(this.tableSel+" thead"),r=document.querySelector(this.tableSel+" tbody");null!==e&&(window.pageYOffset>this.sticky?(t.classList.add("sticky"),e.style.width=this.width+"px",r.style.marginTop=this.margin+"px"):(t.classList.remove("sticky"),e.style.width="auto",r.style.marginTop=0))},this.getCookie=function(t){for(var e=t+"=",r=decodeURIComponent(document.cookie).split(";"),a=0;a<r.length;a++){for(var i=r[a];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(e))return i.substring(e.length,i.length)}return""},this.checkSavedCourse=function(){for(var t=document.querySelectorAll("a"+this.courseCompareButtonsSel+"[data-t4-id],"+this.courseCompareButtonsSel+"[data-t4-id] a"),e=this.getCookie(this.cookieName)?this.getCookie(this.cookieName):"{}",r=Object.values(JSON.parse(e)),a=0;a<t.length;++a){var i=parseInt(t[a].getAttribute("data-t4-id"));if(-1<r.indexOf(i)){t[a].setAttribute("aria-pressed",!0);var o=t[a].getAttribute("data-t4-saved-html"),n=t[a].innerHTML,s=t[a].getAttribute("data-t4-saved-href"),l=t[a].href;t[a].innerHTML=o,t[a].href=s,t[a].setAttribute("data-t4-saved-html",n),t[a].setAttribute("data-t4-saved-href",l)}else if(1==t[a].getAttribute("aria-pressed")){t[a].setAttribute("aria-pressed",!1);o=t[a].getAttribute("data-t4-saved-html"),n=t[a].innerHTML,s=t[a].getAttribute("data-t4-saved-href"),l=t[a].href;t[a].innerHTML=o,t[a].href=s,t[a].setAttribute("data-t4-saved-html",n),t[a].setAttribute("data-t4-saved-href",l)}}},this.constructor(this)}function t4Filter(e){this.constructor=function(){for(var t in this.hideClass="hide",e)void 0!==this[t]&&null!==this[t]&&(this[t]=e[t]);this.mainFilterSel="[data-t4-filter]",this.ajaxGroupSel="[data-t4-ajax-group]",this.clearFilterSel="[data-t4-clear]",this.resultSel="[role^=main]",window.addEventListener("load",this.eventList.bind(this),!1),document.addEventListener("t4-after-ajax",this.eventList.bind(this),!1),document.addEventListener("click",this.eventList.bind(this),!1)},this.eventList=function(t){if("load"!==t.type&&"t4-after-ajax"!==t.type||this.loadClearFilters(),"click"===t.type){for(var e=document.querySelectorAll(this.mainFilterSel+", "+this.mainFilterSel+" *"),r=0;r<e.length;++r)t.target===e[r]&&this.eventFilterBox(t);var a=document.querySelectorAll(this.ajaxGroupSel+" "+this.clearFilterSel);for(r=0;r<a.length;++r)t.target===a[r]&&this.eventClearFilters(t)}},this.eventFilterBox=function(t){var e=t.target;if(!t.target.hasAttribute("data-t4-filter"))e=this.getParent(t.target,"[data-t4-filter]");if(e.hasAttribute("data-t4-filter")){var r=e.getAttribute("data-t4-filter");if(e.hasAttribute("data-t4-value")){for(var a=e.getAttribute("data-t4-value"),i=document.querySelectorAll('select[name="'+r+'"]'),o=0;o<i.length;o++)for(var n=0;n<i[o].options.length;n++)i[o].options[n].getAttribute("value")==a&&!0===i[o].options[n].selected&&(i[o].options[n].selected=!1,i[o].value="",i[o].dispatchEvent(this.getEvent("change")));var s=document.querySelectorAll(this.ajaxGroupSel+' form input[type=radio][name="'+r+'"][data-t4-value="'+a+'"],'+this.ajaxGroupSel+' form input[type=checkbox][name="'+r+'"][data-category="'+a+'"]');for(o=0;o<s.length;o++)s[o].checked=!1,s[o].dispatchEvent(this.getEvent("change"))}else{var l=document.querySelectorAll(this.ajaxGroupSel+' form input[type=date][name="'+r+'"]');for(o=0;o<l.length;o++)l[o].value="",l[o].dispatchEvent(this.getEvent("change"));var u=document.querySelectorAll(this.ajaxGroupSel+' form input[type=range][name="'+r+'"]');for(o=0;o<u.length;o++)u[o].value=u[o].getAttribute("max"),u[o].dispatchEvent(this.getEvent("change"));var c=document.querySelectorAll(this.ajaxGroupSel+' form input[type=text][name="'+r+'"]');for(o=0;o<c.length;o++)c[o].value="",c[o].dispatchEvent(this.getEvent("keydown"))}}else console.error('T4 Search: "'+this.mainFilterSel+'" should have attribute "data-t4-filter"')},this.loadClearFilters=function(t){var e=document.querySelectorAll(this.clearFilterSel);if(0<e.length)for(var r=0;r<e.length;++r){var a=e[r].getAttribute("data-t4-clear");if(a.indexOf(","))var i=a.split(",");else i=[a];for(var o=!1,n=0;n<i.length;++n){var s,l=i[n];if(0<(s=document.querySelectorAll(this.ajaxGroupSel+" form select[name="+l+"]")).length)for(var u=0;u<s.length;++u)for(var c=0;c<s[u].options.length;c++)0!=s[u].options[c].selected&&""!=s[u].options[c].value&&(o=!0);if(0<(s=document.querySelectorAll(this.ajaxGroupSel+" form input[type=date][name="+l+"],"+this.ajaxGroupSel+" form input[type=text][name="+l+"]")).length)for(u=0;
1u<s.length;++u)""!=s[u].value&&(o=!0);if(0<(s=document.querySelectorAll(this.ajaxGroupSel+" form input[type=radio][name="+l+"],"+this.ajaxGroupSel+" form input[type=checkbox][name="+l+"]")).length)for(u=0;u<s.length;++u)0!=s[u].checked&&(o=!0);if(0<(s=document.querySelectorAll(this.ajaxGroupSel+" form input[type=range][name="+l+"]")).length)for(u=0;u<s.length;++u)s[u].value!=s[u].getAttribute("max")&&(o=!0)}0!=o||e[r].classList.contains(this.hideClass)?1==o&&e[r].classList.contains(this.hideClass)&&e[r].classList.remove(this.hideClass):e[r].classList.add(this.hideClass)}},this.eventClearFilters=function(t){var e=t.target.getAttribute("data-t4-clear");if(e.indexOf(","))var r=e.split(",");else r=[e];for(var a=0;a<r.length;++a){var i,o=r[a];if(0<(i=document.querySelectorAll(this.ajaxGroupSel+" form select[name="+o+"]")).length)for(var n=0;n<i.length;++n)for(var s=0;s<i[n].options.length;s++)i[n].options[s].selected=!1;if(0<(i=document.querySelectorAll(this.ajaxGroupSel+" form input[type=date][name="+o+"],"+this.ajaxGroupSel+" form input[type=text][name="+o+"]")).length)for(n=0;n<i.length;++n)i[n].value="";if(0<(i=document.querySelectorAll(this.ajaxGroupSel+" form input[type=radio][name="+o+"],"+this.ajaxGroupSel+" form input[type=checkbox][name="+o+"]")).length)for(n=0;n<i.length;++n)i[n].checked=!1;if(0<(i=document.querySelectorAll(this.ajaxGroupSel+" form input[type=range][name="+o+"]")).length)for(n=0;n<i.length;++n)i[n].value=i[n].getAttribute("max"),0}this.handleForm(t.target,this.ajaxGroupSel)},this.constructor(this)}function t4Search(e){this.constructor=function(){for(var t in this.ScrollToOffset=0,this.ajaxGroupSel="[data-t4-ajax-group$=Search]",e)void 0!==this[t]&&null!==this[t]&&(this[t]=e[t]);this.resultSel="[role^=main]",this.ajaxLinkSel="[data-t4-ajax-link]",this.keyUpTime,this.delayTimer,document.addEventListener("click",this.eventList.bind(this),!1),document.addEventListener("change",this.eventList.bind(this),!1),document.addEventListener("input",this.eventList.bind(this),!1),document.addEventListener("keyup",this.eventList.bind(this),!1),document.addEventListener("keydown",this.eventList.bind(this),!1)},this.eventList=function(t){var e=!1;if("click"===t.type&&null!=document.querySelector(this.ajaxGroupSel+""+this.resultSel)){for(var r=document.querySelectorAll(this.ajaxGroupSel+" "+this.ajaxLinkSel+" a,"+this.ajaxGroupSel+" a"+this.ajaxLinkSel),a=0;a<r.length;++a)t.target===r[a]&&(e=this.eventAjaxLink(t));for(r=document.querySelectorAll(this.ajaxGroupSel+" form *[type=submit],"+this.ajaxGroupSel+" form button"),a=0;a<r.length;++a)t.target===r[a]&&(this.eventButton(r[a],this.ajaxGroupSel,t),e=!0)}if("change"===t.type){for(r=document.querySelectorAll(this.ajaxGroupSel+" form select,"+this.ajaxGroupSel+" form input[type=date]"),a=0;a<r.length;++a)t.target===r[a]&&this.handleForm(r[a],this.ajaxGroupSel);for(r=document.querySelectorAll(this.ajaxGroupSel+" form input[type=checkbox],"+this.ajaxGroupSel+" form input[type=radio]"),a=0;a<r.length;++a)t.target===r[a]&&this.handleForm(r[a],this.ajaxGroupSel);for(r=document.querySelectorAll(this.ajaxGroupSel+" form input[type=range]"),a=0;a<r.length;++a)t.target===r[a]&&this.handleForm(r[a],this.ajaxGroupSel)}if("keydown"===t.type){r=document.querySelectorAll(this.ajaxGroupSel+" form input[type=text]");var i=47<t.keyCode&&t.keyCode<58||32==t.keyCode||13==t.keyCode||64<t.keyCode&&t.keyCode<91||95<t.keyCode&&t.keyCode<112||185<t.keyCode&&t.keyCode<193||218<t.keyCode&&t.keyCode<223||8==t.keyCode;if(i&&t.isTrusted||!i&&!t.isTrusted){for(a=0;a<r.length;++a)t.target===r[a]&&27==t.keyCode&&(t.target.value=""),t.target===r[a]&&(this.keyUpTime=new Date,clearTimeout(this.delayTimer),this.delayTimer=setTimeout(function(){this.self.keyUpTime-this.time<50&&this.self.handleForm(this.container,this.ajaxGroupSel)}.bind({self:this,container:r[a],time:new Date,ajaxGroupSel:this.ajaxGroupSel}),500),e=!0);e=t.target===r[a]&&13==t.keyCode}}!0===e&&(t.preventDefault(),t.stopPropagation())},this.eventAjaxLink=function(t){for(var e=t.target.getAttribute("href"),r=document.querySelectorAll(this.ajaxGroupSel),a=0;a<r[a].length;++a)r[a]!==t.target&&r[a].contains(t.target)&&(found=!0);var i=this.getParent(t.target,this.ajaxGroupSel),o=null!==this.getParent(t.target,"*[data-t4-scroll]")||t.target.hasAttribute("data-t4-scroll"),n=null!==this.getParent(t.target,"*[data-t4-refresh]")||t.target.hasAttribute("data-t4-refresh"),s=this.runAjax(e,this.ajaxGroupSel,i,!1,!0,n);if(o){var l=i.getBoundingClientRect().top+window.scrollY-this.ScrollToOffset;this.scrollTo(l,1e3)}return s},this.eventButton=function(t,e,r){var a=this.getParent(t,e);null==a&&console.error("T4Search: An occured error trying to handle form "+e);var i=a.querySelector("form"),o=window.location.pathname;null!==i.getAttribute("action")&&(o=i.getAttribute("action"));var n=this.serializeArray(i);n[n.length]={name:r.target.name,value:r.target.value};var s=Object.keys(n).map(function(t){return encodeURIComponent(n[t].name)+"="+encodeURIComponent(n[t].value)}).join("&");return""!=s&&(o+="?"+s),this.runAjax(o,e,a)},this.scrollTo=function(t,e){var r=-window.scrollY/(e/15),a=setInterval(function(){window.scrollY>t?window.scrollBy(t,r):clearInterval(a)},15)},this.constructor(this)}t4Generic.prototype={events:[],ajaxGroupSel:"[data-t4-ajax-group]",ignoreParams:["page","paginte","addCourse","removeCourse"],getEvent:function(t){return void 0===this.events[t]&&("function"==typeof Event?this.events[t]=new Event(t,{bubbles:!0,cancelable:!0}):(this.events[t]=document.createEvent("Event"),this.events[t].initEvent(t,!0,!0))),this.events[t]},getParent:function(t,e){for(var r=document.querySelectorAll(e),a=-1,i=0;i<r.length;i++)r[i]!==t&&r[i].contains(t)&&(a=i);return-1==a?null:r[a]},urlParam:function(t,e){var r=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return null==r?null:decodeURI(r[1])||0},hasUrlParams:function(t){var e="[?|&]((?!("+this.ignoreParams.join("|")+")).+)=([^&#]*)";return null!=new RegExp(e).exec(t)},runAjax:function(t,e,r,a,i,o){if(void 0===a&&(a=!1),void 0===i&&(i=!0),void 0===o&&(o=!1),null!==r){var n=r.getAttribute("id");if(null==n)return console.error("T4Search: AJAX Error no id found for ",r),!1;for(var s=document.querySelectorAll(e),l=[],u="search"===r.getAttribute("role")?"search":"",c=0;c<s.length;++c){var h=s[c].getAttribute("id");if(null==h)console.error("T4Search: AJAX Error no id found for ",s[c]);else if(h!==n){var d="search"===s[c].getAttribute("role")?"search":"",p=s[c].querySelector(e),m=s[c].querySelector(e+"[role=search]");if("search"==d)if(null!=(b=s[c].querySelectorAll("[name]"))&&0<b.length){var v=!1;if(this.hasUrlParams(t)){for(var g=0;g<b.length;++g){var f=b[g].getAttribute("name"),y="hidden"==b[g].getAttribute("type");
1null===this.urlParam(t,f)||y||(l.push(h),v=!0)}if(null!==p&&0==v){var S=p.getAttribute("id");null==h?console.error("AJAX Error no id found for "+p):l.push(S)}}else l.push(h)}else l.push(h);else null!==p&&null===m||l.push(h)}}if("search"==u){var b=r.querySelectorAll("[name]:not(button):not([type=hidden])");a=!(null!=b&&0<b.length)}else"hidden"!=u&&(a=!0);if("true"===r.getAttribute("data-t4-force-reload")&&(a=!0),1==a&&(r.style.opacity=.5),void 0!==l)for(c=0;c<l.length;++c){var A=document.getElementById(l[c]);null!==A&&(A.style.opacity=.5)}}o&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());var x=new XMLHttpRequest;return x.open("GET",t,i),x.processData=!1,x.contentType=!1,x.crossDomain=!0,x.withCredentials=!0,x.onload=function(){if(!(200<=x.status&&x.status<400))return r.style.opacity=1,console.error("T4Search: AJAX Success with Status"+x.status),!1;var t=document.createElement("div");if(t.setAttribute("id","t4SearchAjax"),t.innerHTML=x.responseText,null!==r){if(1==a&&null!==t.querySelector("#"+n)&&(r.innerHTML=t.querySelector("#"+n).innerHTML),void 0!==l)for(c=0;c<l.length;++c){null!==(e=document.querySelector("#"+l[c]))&&(e.innerHTML=t.querySelector("#"+l[c]).innerHTML)}if(document.dispatchEvent(this.getEvent("t4-after-ajax")),1==a&&(r.style.opacity=1),void 0!==l)for(c=0;c<l.length;++c){var e;null!==(e=document.querySelector("#"+l[c]))&&(e.style.opacity=1)}}}.bind(this),x.onerror=function(){return console.error("T4Search: AJAX Error with Status"+x.status),this.activeRequest=!1},x.send(),!0},handleForm:function(t,e){var r=this.getParent(t,e);null==r&&console.error("T4Search: An occured error trying to handle form "+e);var a=r.querySelector("form"),i=window.location.pathname;null!==a.getAttribute("action")&&(i=a.getAttribute("action").replace("index.php",""));var o=i,n=this.serializeArray(a),s=Object.keys(n).map(function(t){return encodeURIComponent(n[t].name)+"="+encodeURIComponent(n[t].value)}).join("&");if(""!=s&&(o+="?"+s),i==window.location.pathname||null!=document.querySelector(this.ajaxGroupSel+""+this.resultSel))return this.runAjax(o,e,r);window.location.href=o},serializeArray:function(t){var e,r,a=[];if("object"==typeof t&&"FORM"==t.nodeName)for(var i=t.elements.length,o=0;o<i;o++)if((e=t.elements[o]).name&&!e.disabled&&"file"!=e.type&&"reset"!=e.type&&"submit"!=e.type&&"button"!=e.type)if("select-multiple"==e.type)for(r=t.elements[o].options.length,j=0;j<r;j++)e.options[j].selected&&(a[a.length]={name:e.name,value:e.options[j].value});else("checkbox"!=e.type&&"radio"!=e.type||e.checked)&&(a[a.length]={name:e.name,value:e.value});return a}},t4Autocomplete.prototype=Object.create(t4Generic.prototype),t4Autocomplete.prototype.constructor=t4Autocomplete,t4Categories.prototype=Object.create(t4Generic.prototype),t4Categories.prototype.constructor=t4Categories,t4CourseCompare.prototype=Object.create(t4Generic.prototype),t4CourseCompare.prototype.constructor=t4CourseCompare,t4Filter.prototype=Object.create(t4Generic.prototype),t4Filter.prototype.constructor=t4Filter,t4Search.prototype=Object.create(t4Generic.prototype),t4Search.prototype.constructor=t4Search;

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.