PageSourceSearch

https://www.croftoninfantschool.co.uk/js/vendors/table_sorter.min.js

js croftoninfantschool.co.uk collected 2026-09-29 11:28:53 UTC 14,483 bytes, 1 lines download raw bytes

1!function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];function benchmark(e,t){log(e+","+((new Date).getTime()-t.getTime())+"ms")}function log(e){"undefined"!=typeof console&&void 0!==console.debug?console.log(e):alert(e)}function buildParserCache(e,t){if(e.config.debug)var r="";if(0!=e.tBodies.length){var n=e.tBodies[0].rows;if(n[0])for(var o=[],a=n[0].cells.length,i=0;i<a;i++){var s=!1;$.metadata&&$(t[i]).metadata()&&$(t[i]).metadata().sorter?s=getParserById($(t[i]).metadata().sorter):e.config.headers[i]&&e.config.headers[i].sorter&&(s=getParserById(e.config.headers[i].sorter)),s=s||detectParserForColumn(e,n,-1,i),e.config.debug&&(r+="column:"+i+" parser:"+s.id+"\n"),o.push(s)}return e.config.debug&&log(r),o}}function detectParserForColumn(e,t,r,n){for(var o=parsers.length,a=!1,i=!1,s=!0;""==i&&s;)t[++r]?(a=getNodeFromRowAndCellIndex(t,r,n),i=trimAndGetNodeText(e.config,a),e.config.debug&&log("Checking if value was empty on row:"+r)):s=!1;for(var d=1;d<o;d++)if(parsers[d].is(i,e,a))return parsers[d];return parsers[0]}function getNodeFromRowAndCellIndex(e,t,r){return e[t].cells[r]}function trimAndGetNodeText(e,t){return $.trim(getElementText(e,t))}function getParserById(e){for(var t=parsers.length,r=0;r<t;r++)if(parsers[r].id.toLowerCase()==e.toLowerCase())return parsers[r];return!1}function buildCache(e){if(e.config.debug)var t=new Date;for(var r=e.tBodies[0]&&e.tBodies[0].rows.length||0,n=e.tBodies[0].rows[0]&&e.tBodies[0].rows[0].cells.length||0,o=e.config.parsers,a={row:[],normalized:[]},i=0;i<r;++i){var s=$(e.tBodies[0].rows[i]),d=[];if(s.hasClass(e.config.cssChildRow))a.row[a.row.length-1]=a.row[a.row.length-1].add(s);else{a.row.push(s);for(var c=0;c<n;++c)d.push(o[c].format(getElementText(e.config,s[0].cells[c]),e,s[0].cells[c]));d.push(a.normalized.length),a.normalized.push(d),d=null}}return e.config.debug&&benchmark("Building cache for "+r+" rows:",t),a}function getElementText(e,t){return t?(e.supportsTextContent||(e.supportsTextContent=t.textContent||!1),"simple"==e.textExtraction?e.supportsTextContent?t.textContent:t.childNodes[0]&&t.childNodes[0].hasChildNodes()?t.childNodes[0].innerHTML:t.innerHTML:"function"==typeof e.textExtraction?e.textExtraction(t):$(t).text()):""}function appendToTable(e,t){if(e.config.debug)var r=new Date;for(var n=t,o=n.row,a=n.normalized,i=a.length,s=a[0].length-1,d=$(e.tBodies[0]),c=[],u=0;u<i;u++){var l=a[u][s];if(c.push(o[l]),!e.config.appender)for(var f=o[l].length,h=0;h<f;h++)d[0].appendChild(o[l][h])}e.config.appender&&e.config.appender(e,c),c=null,e.config.debug&&benchmark("Rebuilt table:",r),applyWidget(e),setTimeout(function(){$(e).trigger("sortEnd")},0)}function buildHeaders(r){if(r.config.debug)var e=new Date;$.metadata;var n=computeTableHeaderCellIndexes(r);return $tableHeaders=$(r.config.selectorHeaders,r).each(function(e){if(this.column=n[this.parentNode.rowIndex+"-"+this.cellIndex],this.order=formatSortingOrder(r.config.sortInitialOrder),this.count=this.order,(checkHeaderMetadata(this)||checkHeaderOptions(r,e))&&(this.sortDisabled=!0),checkHeaderOptionsSortingLocked(r,e)&&(this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(r,e)),!this.sortDisabled){var t=$(this).addClass(r.config.cssHeader);r.config.onRenderHeader&&r.config.onRenderHeader.apply(t)}r.config.headerList[e]=this}),r.config.debug&&(benchmark("Built headers:",e),log($tableHeaders)),$tableHeaders}function computeTableHeaderCellIndexes(e){for(var t=[],r={},n=e.getElementsByTagName("THEAD")[0].getElementsByTagName("TR"),o=0;o<n.length;o++)for(var a=n[o].cells,i=0;i<a.length;i++){var s,d=a[i],c=d.parentNode.rowIndex,u=c+"-"+d.cellIndex,l=d.rowSpan||1,f=d.colSpan||1;void 0===t[c]&&(t[c]=[]);for(var h=0;h<t[c].length+1;h++)if(void 0===t[c][h]){s=h;break}r[u]=s;for(h=c;h<c+l;h++){void 0===t[h]&&(t[h]=[]);for(var g=t[h],m=s;m<s+f;m++)g[m]="x"}}return r}function checkCellColSpan(e,t,r){for(var n=[],o=e.tHead.rows,a=o[r].cells,i=0;i<a.length;i++){var s=a[i];1<s.colSpan?n=n.concat(checkCellColSpan(e,headerArr,r++)):(1==e.tHead.length||1<s.rowSpan||!o[r+1])&&n.push(s)}return n}function checkHeaderMetadata(e){return!(!$.metadata||!1!==$(e).metadata().sorter)}function checkHeaderOptions(e,t){return!(!e.config.headers[t]||!1!==e.config.headers[t].sorter)}function checkHeaderOptionsSortingLocked(e,t){return!(!e.config.headers[t]||!e.config.headers[t].lockedOrder)&&e.config.headers[t].lockedOrder}function applyWidget(e){for(var t=e.config.widgets,r=t.length,n=0;n<r;n++)getWidgetById(t[n]).format(e)}function getWidgetById(e){for(var t=widgets.length,r=0;r<t;r++)if(widgets[r].id.toLowerCase()==e.toLowerCase())return widgets[r]}function formatSortingOrder(e){return"Number"!=typeof e?"desc"==e.toLowerCase()?1:0:1==e?1:0}function isValueInArray(e,t){for(var r=t.length,n=0;n<r;n++)if(t[n][0]==e)return!0;return!1}function setHeadersCss(e,t,r,n){t.removeClass(n[0]).removeClass(n[1]);var o=[];t.each(function(e){this.sortDisabled||(o[this.column]=$(this))});for(var a=r.length,i=0;i<a;
1i++)o[r[i][0]].addClass(n[r[i][1]])}function fixColumnWidth(e,t){if(e.config.widthFixed){var r=$("<colgroup>");$("tr:first td",e.tBodies[0]).each(function(){r.append($("<col>").css("width",$(this).width()))}),$(e).prepend(r)}}function updateHeaderSortCount(e,t){for(var r=e.config,n=t.length,o=0;o<n;o++){var a=t[o],i=r.headerList[a[0]];i.count=a[1],i.count++}}function multisort(table,sortList,cache){if(table.config.debug)var sortTime=new Date;for(var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length,i=0;i<l;i++){var c=sortList[i][0],order=sortList[i][1],s="text"==table.config.parsers[c].type?makeSortFunction("text",0==order?"asc":"desc",c):makeSortFunction("numeric",0==order?"asc":"desc",c),e="e"+i;dynamicExp+="var "+e+" = "+s,dynamicExp+="if("+e+") { return "+e+"; } ",dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++)dynamicExp+="}; ";return dynamicExp+="return 0; ",dynamicExp+="}; ",table.config.debug&&benchmark("Evaling expression:"+dynamicExp,new Date),eval(dynamicExp),cache.normalized.sort(sortWrapper),table.config.debug&&benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime),cache}function makeSortFunction(e,t,r){var n="a["+r+"]",o="b["+r+"]";return"text"==e&&"asc"==t?"("+n+" == "+o+" ? 0 : ("+n+" === null ? Number.POSITIVE_INFINITY : ("+o+" === null ? Number.NEGATIVE_INFINITY : ("+n+" < "+o+") ? -1 : 1 )));":"text"==e&&"desc"==t?"("+n+" == "+o+" ? 0 : ("+n+" === null ? Number.POSITIVE_INFINITY : ("+o+" === null ? Number.NEGATIVE_INFINITY : ("+o+" < "+n+") ? -1 : 1 )));":"numeric"==e&&"asc"==t?"("+n+" === null && "+o+" === null) ? 0 :("+n+" === null ? Number.POSITIVE_INFINITY : ("+o+" === null ? Number.NEGATIVE_INFINITY : "+n+" - "+o+"));":"numeric"==e&&"desc"==t?"("+n+" === null && "+o+" === null) ? 0 :("+n+" === null ? Number.POSITIVE_INFINITY : ("+o+" === null ? Number.NEGATIVE_INFINITY : "+o+" - "+n+"));":void 0}function makeSortText(e){return"((a["+e+"] < b["+e+"]) ? -1 : ((a["+e+"] > b["+e+"]) ? 1 : 0));"}function makeSortTextDesc(e){return"((b["+e+"] < a["+e+"]) ? -1 : ((b["+e+"] > a["+e+"]) ? 1 : 0));"}function makeSortNumeric(e){return"a["+e+"]-b["+e+"];"}function makeSortNumericDesc(e){return"b["+e+"]-a["+e+"];"}function sortText(e,t){return table.config.sortLocaleCompare?e.localeCompare(t):e<t?-1:t<e?1:0}function sortTextDesc(e,t){return table.config.sortLocaleCompare?t.localeCompare(e):t<e?-1:e<t?1:0}function sortNumeric(e,t){return e-t}function sortNumericDesc(e,t){return t-e}function getCachedSortType(e,t){return e[t].type}this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:!0,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:!1,cancelSelection:!0,sortList:[],headerList:[],dateFormat:"us",decimal:"/.|,/g",onRenderHeader:null,selectorHeaders:"thead th",debug:!1},this.benchmark=benchmark,this.construct=function(e){return this.each(function(){if(this.tHead&&this.tBodies){var s,d,c,u;this.config={},u=$.extend(this.config,$.tablesorter.defaults,e),s=$(this),$.data(this,"tablesorter",u),d=buildHeaders(this),this.config.parsers=buildParserCache(this,d),c=buildCache(this);var l=[u.cssDesc,u.cssAsc];fixColumnWidth(this),d.click(function(e){var t=s[0].tBodies[0]&&s[0].tBodies[0].rows.length||0;if(!this.sortDisabled&&0<t){s.trigger("sortStart");$(this);var r=this.column;if(this.order=this.count++%2,this.lockedOrder&&(this.order=this.lockedOrder),e[u.sortMultiSortKey])if(isValueInArray(r,u.sortList))for(i=0;i<u.sortList.length;i++){var n=u.sortList[i],o=u.headerList[n[0]];n[0]==r&&(o.count=n[1],o.count++,n[1]=o.count%2)}else u.sortList.push([r,this.order]);else{if(u.sortList=[],null!=u.sortForce)for(var a=u.sortForce,i=0;i<a.length;i++)a[i][0]!=r&&u.sortList.push(a[i]);u.sortList.push([r,this.order])}return setTimeout(function(){setHeadersCss(s[0],d,u.sortList,l),appendToTable(s[0],multisort(s[0],u.sortList,c))},1),!1}}).mousedown(function(){if(u.cancelSelection)return!(this.onselectstart=function(){return!1})}),s.bind("update",function(){var e=this;setTimeout(function(){e.config.parsers=buildParserCache(e,d),c=buildCache(e)},1)}).bind("updateCell",function(e,t){var r=this.config,n=[t.parentNode.rowIndex-1,t.cellIndex];c.normalized[n[0]][n[1]]=r.parsers[n[1]].format(getElementText(r,t),t)}).bind("sorton",function(e,t){$(this).trigger("sortStart"),u.sortList=t;var r=u.sortList;updateHeaderSortCount(this,r),setHeadersCss(this,d,r,l),appendToTable(this,multisort(this,r,c))}).bind("appendCache",function(){appendToTable(this,c)}).bind("applyWidgetId",function(e,t){getWidgetById(t).format(this)}).bind("applyWidgets",function(){applyWidget(this)}),$.metadata&&$(this).metadata()&&$(this).metadata().sortlist&&(u.sortList=$(this).metadata().sortlist),0<u.sortList.length&&s.trigger("sorton",[u.sortList]),applyWidget(this)}})},this.addParser=function(e){for(var t=parsers.length,r=!0,n=0;n<t;n++)parsers[n].id.toLowerCase()==e.id.toLowerCase()&&(r=!1);r&&parsers.push(e)},this.addWidget=function(e){widgets.push(e)},this.formatFloat=function(e){var t=parseFloat(e);return isNaN(t)?0:t},this.formatInt=function(e){var t=parseInt(e);return isNaN(t)?0:t},this.isDigit=function(e,t){return/^[-+]?\d*$/.test($.trim(e.replace(/[,.']/g,"")))},this.clearTableBody=function(e){if($.browser.msie){(function(){for(;this.firstChild;)this.removeChild(this.firstChild)}).apply(e.tBodies[0])}else e.tBodies[0].innerHTML=""}}}),$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(e){return!0},format:function(e){return $.trim(e.toLocaleLowerCase())},type:"text"}),ts.addParser({id:"digit",is:function(e,t){var r=t.config;return $.tablesorter.isDigit(e,r)},format:function(e){return $.tablesorter.formatFloat(e)},type:"numeric"}),ts.addParser({id:"currency",is:function(e){return/^[£$€?.]/.test(e)},format:function(e){return $.tablesorter.formatFloat(e.replace(new RegExp(/[£$€]/g),""))},type:"numeric"}),ts.addParser({id:"ipAddress",is:function(e){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(e)},format:function(e){for(var t=e.split("."),r="",n=t.length,o=0;o<n;o++){var a=t[o];2==a.length?r+="0"+a:r+=a}return $.tablesorter.formatFloat(r)},type:"numeric"}),ts.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\/$/.test(e)},format:function(e){return jQuery.trim(e.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"}),ts.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(e)},format:function(e){return $.tablesorter.formatFloat(""!=e?new Date(e.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"}),ts.addParser({id:"percent",is:function(e){return/\%$/.test($.trim(e))},format:function(e){return $.tablesorter.formatFloat(e.replace(new RegExp(/%/g),""))},type:"numeric"}),ts.addParser({id:"usLongDate",is:function(e){return e.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(e){return $.tablesorter.formatFloat(new Date(e).getTime())},type:"numeric"}),ts.addParser({id:"shortDate",is:function(e){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(e)},format:function(e,t){var r=t.config;return e=e.replace(/\-/g,"/"),"us"==r.dateFormat?e=e.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2"):"uk"==r.dateFormat?e=e.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1"):"dd/mm/yy"!=r.dateFormat&&"dd-mm-yy"!=r.dateFormat||(e=e.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")),$.tablesorter.formatFloat(new Date(e).getTime())},type:"numeric"}),ts.addParser({id:"time",is:function(e){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(e)},format:function(e){return $.tablesorter.formatFloat(new Date("2000/01/01 "+e).getTime())},type:"numeric"}),ts.addParser({id:"metadata",is:function(e){return!1},format:function(e,t,r){var n=t.config,o=n.parserMetadataName?n.parserMetadataName:"sortValue";return $(r).metadata()[o]},type:"numeric"}),ts.addWidget({id:"zebra",format:function(t){if(t.config.debug)var e=new Date;var r,n,o=-1;$("tr:visible",t.tBodies[0]).each(function(e){(r=$(this)).hasClass(t.config.cssChildRow)||o++,n=o%2==0,r.removeClass(t.config.widgetZebra.css[n?0:1]).addClass(t.config.widgetZebra.css[n?1:0])}),t.config.debug&&$.tablesorter.benchmark("Applying Zebra widget",e)}})}(jQuery),$.tablesorter.addParser({id:"filesize",is:function(e){return e.match(new RegExp(/[0-9]+(\.[0-9]+)?(KB|B|GB|MB|TB)$/i))},format:function(e){var t=e.match(new RegExp(/(KB|B|GB|MB|TB)/i))[1],r=parseFloat(e.match(new RegExp(/^[0-9]+(\.[0-9]+)?/))[0]);switch(t){case"B":return r;case"KB":return 1024*r;case"MB":return 1024*r*1024;case"GB":return 1024*r*1024*1024;case"TB":return 1024*r*1024*1024*1024}},type:"numeric"});var lMonthNames={"Jan ":"01","Feb ":"02","Mar ":"03","Apr ":"04","May ":"05","Jun ":"06","Jul ":"07","Aug ":"08","Sep ":"09","Oct ":"10","Nov ":"11","Dec ":"12"};$.tablesorter.addParser({id:"dayMonthYear",is:function(e){return!1},format:function(e){if(0<e.length){var t=e.match(/^(\d{1,2}[sndrth]{2} )?(\w{3} )?(\d{4})$/),r="01";t[1]&&1==(r=""+parseInt(String(t[1]))).length&&(r="0"+r);var n="01";return t[2]&&(n=lMonthNames[t[2]]),""+t[3]+n+r}return""},type:"numeric"});

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.