PageSourceSearch

https://viamala.ch/layout/of-tablesort.556f5a89.js

js viamala.ch collected 2026-10-02 11:15:15 UTC 3,696 bytes, 1 lines download raw bytes

1(self.webpackChunk=self.webpackChunk||[]).push([[7095],{51654:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>o});const n=r(16314);n.extend("number",(t=>t.match(/^\d+$/)),((t,e)=>Number.parseFloat(e)-Number.parseFloat(t)));const o=t=>{for(const e of t){let t;try{t=JSON.parse(e.dataset.ofTableSort||"{}")}catch(e){console.error(e),t={}}const r=e.querySelector("thead");r&&t.index>=0&&r.children[0].children[t.index].setAttribute("data-sort-default",""),n(e,{descending:"desc"===t.direction,sortAttribute:"data-of-table-sort-value"})}}},16314:t=>{!function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(!t||"TABLE"!==t.tagName)throw new Error("Element must be a table");this.init(t,r||{})}var r=[],n=function(t){var e;return window.CustomEvent&&"function"==typeof window.CustomEvent?e=new CustomEvent(t):(e=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!1,void 0),e},o=function(t,e){var r=e.sortAttribute||"data-sort";return t.hasAttribute(r)?t.getAttribute(r):t.textContent||t.innerText||""},s=function(t,e){return(t=t.trim().toLowerCase())===(e=e.trim().toLowerCase())?0:t<e?1:-1},i=function(t,e){return[].slice.call(t).find((function(t){return t.getAttribute("data-sort-column-key")===e}))},a=function(t,e){return function(r,n){var o=t(r.td,n.td);return 0===o?e?n.index-r.index:r.index-n.index:o}};e.extend=function(t,e,n){if("function"!=typeof e||"function"!=typeof n)throw new Error("Pattern and sort must be a function");r.push({name:t,pattern:e,sort:n})},e.prototype={init:function(t,e){var r,n,o,s,i=this;if(i.table=t,i.thead=!1,i.options=e,t.rows&&t.rows.length>0)if(t.tHead&&t.tHead.rows.length>0){for(o=0;o<t.tHead.rows.length;o++)if("thead"===t.tHead.rows[o].getAttribute("data-sort-method")){r=t.tHead.rows[o];break}r||(r=t.tHead.rows[t.tHead.rows.length-1]),i.thead=!0}else r=t.rows[0];if(r){var a=function(){i.current&&i.current!==this&&i.current.removeAttribute("aria-sort"),i.current=this,i.sortTable(this)};for(o=0;o<r.cells.length;o++)(s=r.cells[o]).setAttribute("role","columnheader"),"none"!==s.getAttribute("data-sort-method")&&(s.tabIndex=0,s.addEventListener("click",a,!1),s.addEventListener("keydown",(function(t){"Enter"===t.key&&(t.preventDefault(),a.call(this))})),null!==s.getAttribute("data-sort-default")&&(n=s));n&&(i.current=n,i.sortTable(n))}},sortTable:function(t,e){var d=this,u=t.getAttribute("data-sort-column-key"),l=t.cellIndex,c=s,f="",h=[],b=d.thead?0:1,w=t.getAttribute("data-sort-method"),g=t.hasAttribute("data-sort-reverse"),m=t.getAttribute("aria-sort");if(d.table.dispatchEvent(n("beforeSort")),e||(m="ascending"===m?"descending":"descending"===m?"ascending":!!d.options.descending!=g?"descending":"ascending",t.setAttribute("aria-sort",m)),!(d.table.rows.length<2)){if(!w){for(;h.length<3&&b<d.table.tBodies[0].rows.length;)(f=(f=(k=u?i(d.table.tBodies[0].rows[b].cells,u):d.table.tBodies[0].rows[b].cells[l])?o(k,d.options):"").trim()).length>0&&h.push(f),b++;if(!h)return}for(b=0;b<r.length;b++)if(f=r[b],w){if(f.name===w){c=f.sort;break}}else if(h.every(f.pattern)){c=f.sort;break}for(d.col=l,b=0;b<d.table.tBodies.length;b++){var p,v=[],A={},x=0,E=0;if(!(d.table.tBodies[b].rows.length<2)){for(p=0;p<d.table.tBodies[b].rows.length;p++){var k;"none"===(f=d.table.tBodies[b].rows[p]).getAttribute("data-sort-method")?A[x]=f:(k=u?i(f.cells,u):f.cells[d.col],v.push({tr:f,td:k?o(k,d.options):"",index:x})),x++}for("descending"===m?v.sort(a(c,!0)):(v.sort(a(c,!1)),v.reverse()),p=0;p<x;p++)A[p]?(f=A[p],E++):f=v[p-E].tr,d.table.tBodies[b].appendChild(f)}}d.table.dispatchEvent(n("afterSort"))}},refresh:function(){void 0!==this.current&&this.sortTable(this.current,!0)}},t.exports?t.exports=e:window.Tablesort=e}()}}]);

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.