PageSourceSearch

https://reading.ac.uk/sc93/js/appSearch.min.js

js reading.ac.uk collected 2026-10-01 08:32:19 UTC 9,525 bytes, 1 lines download raw bytes

1var appSearch=function(n){var u={container:"#CoursesSearch",resultsContainer:".search-results",resultElements:"label",counterContainer:".selected-counter",searchField:".text-input",buttonCancel:".button-cancel",buttonReview:".button-review",buttonSearch:".button-search",buttonFinish:".button-finish",buttonABC:".icon-ss-abc",buttonQuery:".icon-ss-search",panelEmpty:".panel-empty",panelReview:".panel-review",panelQuery:".panel-query",panelButtonsReview:".panel-buttons-review",panelButtonsFinished:".panel-buttons-finished",panelAlphabet:".panel-alphabet",panelAlphabetScroll:".alphabet"},t=n.container?$(n.container):$(u.container),i=n.results?t.find(n.results):t.find(u.resultsContainer),c=n.elem?i.find(n.elem):i.find(u.resultElements),v=n.counter?t.find(n.counter):t.find(u.counterContainer),s=n.search?t.find(n.search):t.find(u.searchField),kt=n.cancel?t.find(n.cancel):t.find(u.buttonCancel),dt=n.buttonReview?t.find(n.buttonReview):n.buttonReview===null?null:t.find(u.buttonReview),gt=n.buttonSearch?t.find(n.buttonSearch):n.buttonSearch===null?null:t.find(u.buttonSearch),ni=n.buttonFinish?t.find(n.buttonFinish):n.buttonFinish===null?null:t.find(u.buttonFinish),ti=n.buttonABC?t.find(n.buttonABC):t.find(u.buttonABC),ii=n.buttonQuery?t.find(n.buttonQuery):t.find(u.buttonQuery),g=n.panelEmpty?t.find(n.panelEmpty):t.find(u.panelEmpty),w=n.panelReview?t.find(n.panelReview):t.find(u.panelReview),y=n.panelQuery?t.find(n.panelQuery):t.find(u.panelQuery),nt=n.panelButtonsReview?t.find(n.panelButtonsReview):t.find(u.panelButtonsReview),tt=n.panelButtonsFinished?t.find(n.panelButtonsFinished):t.find(u.panelButtonsFinished),h=n.panelAlphabet?t.find(n.panelAlphabet):t.find(u.panelAlphabet),ct=n.panelAlphabetScroll?t.find(n.panelAlphabetScroll):t.find(u.panelAlphabetScroll),lt=n.alphabetIgnore?n.alphabetIgnore:null,p={},b=[],k="desktop",et=n.focussed||!1,f,e=n.maxSelections,it=n.minSelections,at=n.globalCallback||!1,r="all",o={},ri=function(n){typeof n!="undefined"&&(n.externalFilter&&(r=n.externalFilter),n.maxSelections&&(e=n.maxSelections,ut()),n.minSelections&&(it=n.minSelections,ut()),n.resetSearch&&ut());f=i.find(":checked").length;t.find(".filtered-search-results").length||fi();ot();ft();e&&!nt.find(".maxCounterContainer").length&&(nt.prepend('<span class="pull-left maxCounterContainer m-bg-white m-pad-around-small" aria-live="polite" aria-role="region" id="MaxCounter" aria-atomic="true">Maximum selections left:<span class="maxCounter">'+(e-f)+"<\/span><\/span>"),vt());e&&!tt.find(".maxCounterContainer").length&&(tt.prepend('<span class="pull-left maxCounterContainer m-bg-white m-pad-around-small" aria-live="polite" aria-role="region" id="MaxCounter" aria-atomic="true">Maximum selections left:<span class="maxCounter">'+(e-f)+"<\/span><\/span>"),vt());f===e&&e>0?(i.find("input:not(:checked)").prop("disabled",!0),t.find(".maxCounterContainer").addClass("text-color-standout m-bg-white m-pad-around-small")):i.find("input").prop("disabled",!1);it&&!f?$(v).parent().prop("disabled",!0):$(v).parent().prop("disabled",!1);wi();t.find(".panel-review-scroll").length&&ht();ui()},ui=function(){var n={tab:9,enter:13,esc:27,space:32,end:35,home:36,left:37,up:38,right:39,down:40},t,i=h.find("a"),r=function(n){var u=i.filter(".active"),f=u.index(t),r=f+n;t.attr("tabindex","-1");r<0?r=u.length-1:r>u.length-1&&(r=0);t=u.eq(r).attr("tabindex","0");t.focus()};i.on("keydown",function(t){switch(t.keyCode){case n.tab:case n.esc:case n.home:case n.end:return!0;case n.right:case n.down:r(1);break;case n.left:case n.up:r(-1);break;case n.enter:case n:return!0}return!1});i.attr("tabindex","-1");i.eq(2).attr("tabindex","0");t=i.filter("[tabindex=0]")},vt=function(){i.find("input").attr("aria-controls","MaxCounter")},fi=function(){p.all=[];o.all=$();c.each(function(){var i=$(this).parent(),r=$(this),u=$(this).siblings("input"),n=u.attr("data-filter"),t={txt:r.children(".name").text(),helper:si(r)};o[n]&&o[n].length?($.merge(o[n],i),p[n].push(t)):(p[n]=[],p[n].push(t),o[n]=i);$.merge(o.all,$(this).parent());p.all.push(t)})}
1,l=function(n){var i=n.type?n.type:"content",t=n.term?n.term:"";i==="attribute"&&(d(),s.val(""),r=t);r&&!t.length&&rt(r);i==="content"&&ei(t);(i!=="content"||t.length!==0||r&&r!=="all")&&(i!=="attribute"||t.length!==0)||hi()},rt=function(n,t){if(n!==r){r=n;for(var u in o)if(u===n){o[u].show();break}else o[u].hide();st();s.val().length>=3&&l({type:"content",term:s.val()});t==="uncheck all"&&(i.find(":checked").prop("checked",!1),a())}s.val().length>=3&&(l({type:"content",term:s.val()}),a())},ei=function(n){var t,f,u,e,s,h;if($(g).hide(),$(i).show(),n){for(u=0,e=c.length;u<e;u++)t=c.eq(u),f=t.siblings("input"),s=t.children(".name").eq(0).text(),h=function(){return r&&f.attr("data-filter")===r?!0:r==="all"?!0:void 0},s.toLowerCase().indexOf(n.toLowerCase())>=0&&h()?(ci(t),oi(t,n),i.scrollTop(0)):li(t);i.find("label:visible").length||($(i).hide(),$(g).show())}else o[r].show()},oi=function(n,t){var r=n.children(".name").eq(0),i=r.text(),f=i.toLowerCase(),e=t.toLowerCase(),u=f.indexOf(e),o=u+t.length;t=i.substring(u,o);r.html(i.split(t).join('<span class="text-bg-standout" style="padding:0">'+t+"<\/span>"))},si=function(n){return lt==="bachelorType"?n.siblings("input").attr("data-coursename"):null},hi=function(){o.all.show();r="all";st()},ci=function(n){n.parent().show()},li=function(n){n.parent().hide()},ot=function(){rt(r);st()},st=function(){var t=0,u=i.scrollTop(),n;b.splice(0,b.length);n=p[r];
1h.find("a").each(function(){var e=$(this),f=e.text().toLowerCase(),l="",a=0,i,s,h,c,v;for(e.removeClass("active").removeAttr("data-id"),i=a,s=n.length;i<s;i++)h=0,c=n[i],lt==="bachelorType"&&(h=c.txt.indexOf(n[i].helper)),v=c.txt.charAt(h).toLowerCase(),f===v&&f!==l&&(b.push({txt:f,pos:o[r].eq(i).position().top+u,elem:o[r].eq(i)}),e.addClass("active").attr("data-id",t),l=f,t++,a=i,i=s)})},yt=function(){i.is(":visible")?f=i.find(":checked").length:w.is(":visible")&&(f=w.find(":checked").length);ai();vi()},ai=function(){!f&&it?(v.html(""),v.parent().prop("disabled",!0)):v.parent().prop("disabled",!1)},vi=function(){t.find(".maxCounter").text(e-f);v.text(f===0?"":f)},a=function(){if(yt(),f&&f===e?(i.is(":visible")?i.find("input:not(:checked)").prop("disabled",!0):w.is(":visible")&&i.find("input:not(:checked)").prop("disabled",!0),t.find(".maxCounterContainer").addClass("text-color-standout")):(i.find("input").prop("disabled",!1),t.find(".maxCounterContainer").removeClass("text-color-standout")),at){var n=[];return i.find(":checked").next().each(function(){var i=$(this),t={};i.find("*").each(function(){var n=$(this).attr("class").split(" ")[0];t[n]=$(this).text()});n.push(t)}),at(n)}},ut=function(n){r=n?n:r;i.find("input").prop("disabled",!1).prop("checked",!1);l({content:"",type:"content"});s.val("");rt(r);d();a()},yi=function(n){if(n>=0){var t=b[n].pos;$(i).animate({scrollTop:t-20},200);b[n].elem.find("input").focus()}},d=function(){for(var n=0;n<c.length;n++)c.eq(n).find(".name").html(c.eq(n).find(".name").text());$(g).hide()},pi=function(n){n.is(":checked")&&i.find("input:not(:checked)").prop("disabled",!1);a()},ht=function(){d();$(s).val("");$(i).hide();$(y).hide();$(h).hide();$(nt).hide();$(w).fadeIn();$(tt).fadeIn();a();t.addClass("focus")},pt=function(){$(w).hide();$(tt).hide();$(i).fadeIn(function(){ot()});$(nt).fadeIn();$(y).fadeIn();k!=="mobile"&&$(h).fadeIn();l({type:"content",term:""});a();t.removeClass("focus")},wt=function(){return e&&f>e?!0:!1},bt=function(){g.hide();i.show()},wi=function(){$(i).find("input").off("change").on("change",function(){pi($(this))});$(h).find("a").off("click").on("click",function(){bt();d();s.val("");l({term:"",type:"content"});var n=$(this).attr("data-id");return yi(n),!1});$(s).off("keyup").on("keyup",function(n){var t=$(this).val();return t.length>=3?l({term:t,type:"content"}):l({term:"",type:"content"}),t.length===0&&(bt(),d(),$(s).val("")),n.which===13?(n.preventDefault(),i.find("input:visible").eq(0).focus(),!1):void 0});$(s).off("keydown").on("keydown",function(n){if(n.which===13)return n.preventDefault(),!1});$(s).off("focus").on("focus",function(){t.addClass("focus");$("html").addClass("m-locked");et=!0});$(kt).off("click").on("click",function(){t.removeClass("focus");$("html").removeClass("m-locked");et=!1;ft()});$(ni).off("click").on("click",function(){t.removeClass("focus");$("html").removeClass("m-locked")});$(dt).off("click").on("click",function(){return f>0||n.limit!==0?wt()?alert("Error: You can only set "+n.limit+" items"):ht():n.required&&alert("Error: No items selected"),!1});$(gt).off("click").on("click",function(){return pt(),!1});$(ti).off("click").on("click",function(){return ki(),!1});$(ii).off("click").on("click",function(){return bi(),!1});c.siblings("input").off("focus").on("focus",function(){var r=$(this),u=r.position().top,t=r.parent().outerHeight(),n=i.scrollTop(),f=i.outerHeight();n+u+t>n+f?i.scrollTop(n+t):n+u<n&&i.scrollTop(n-t)})},bi=function(){$(h).hide();$(y).show()},ki=function(){ft();$(y).hide();$(h).show()},di=function(){$(y).show();$(h).show()},gi=function(){$(y).show();$(h).hide()},ft=function(){var n=$(window).width(),t;n>=767?k!=="desktop"&&(ct.removeAttr("style"),di(),k="desktop"):k!=="mobile"?(gi(),k="mobile"):(t=0,t=et?n-80:n-110,ct.css("width",t))};$(window).on("resize",function(){ft()});return{init:ri,recalculatePositions:ot,count:yt,filterList:rt,updateSelected:a,resetSearch:ut,limitReached:wt,showReview:ht,showSearch:pt,maximumSelections:function(){return e!==0&&f>=e?!0:!1},isRequired:it?!0:!1}};

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.