Update frontend minification config and dependencies

This commit is contained in:
Timothy Warren 2024-02-15 15:21:26 -05:00
parent 144718866d
commit 7afdab80ac
10 changed files with 869 additions and 756 deletions

View File

@ -9,13 +9,13 @@
"watch": "concurrently \"npm:watch:css\" \"npm:watch:js\" --kill-others"
},
"devDependencies": {
"@swc/cli": "^0.1.39",
"@swc/core": "^1.2.54",
"concurrently": "^8.2.0",
"cssnano": "^6.0.1",
"postcss": "^8.2.6",
"postcss-import": "^15.0.0",
"postcss-preset-env": "^8.0.1",
"@swc/cli": "^0.3.9",
"@swc/core": "^1.4.1",
"concurrently": "^8.2.2",
"cssnano": "^6.0.3",
"postcss": "^8.4.35",
"postcss-import": "^16.0.1",
"postcss-preset-env": "^9.3.0",
"watch": "^1.0.2"
}
}

View File

@ -14,11 +14,22 @@ module.exports = config({
syntax: "ecmascript",
jsx: false,
},
target: 'es2016',
target: 'es2018',
loose: false,
// keepClassNames: true,
// preserveAllComments: true,
minify: {
compress: {
unused: true,
},
mangle: true,
format: {
comments: false,
}
}
},
minify: true,
sourceMaps: false,
sourceMaps: true,
isModule: true,
}
});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
const LightTableSorter=(()=>{let th=null;let cellIndex=null;let order="";const text=row=>row.cells.item(cellIndex).textContent.toLowerCase();const sort=(a,b)=>{let textA=text(a);let textB=text(b);console.log("Comparing "+textA+" and "+textB);if(th.classList.contains("numeric")){let arrayA=textA.replace("episodes: ","").replace("-",0).split("/");let arrayB=textB.replace("episodes: ","").replace("-",0).split("/");if(arrayA.length>1){textA=parseInt(arrayA[0],10)/parseInt(arrayA[1],10);textB=parseInt(arrayB[0],10)/parseInt(arrayB[1],10)}else{textA=parseInt(arrayA[0],10);textB=parseInt(arrayB[0],10)}}else if(parseInt(textA,10)){textA=parseInt(textA,10);textB=parseInt(textB,10)}if(textA>textB)return 1;if(textA<textB)return -1;return 0};const toggle=()=>{const c=order!=="sorting-asc"?"sorting-asc":"sorting-desc";th.className=(th.className.replace(order,"")+" "+c).trim();return order=c};const reset=()=>{th.classList.remove("sorting-asc","sorting-desc");th.classList.add("sorting");return order=""};const onClickEvent=e=>{if(th&&cellIndex!==e.target.cellIndex)reset();th=e.target;if(th.nodeName.toLowerCase()==="th"){cellIndex=th.cellIndex;const tbody=th.offsetParent.getElementsByTagName("tbody")[0];let rows=Array.from(tbody.rows);if(rows){rows.sort(sort);if(order==="sorting-asc")rows.reverse();toggle();tbody.innerHtml="";rows.forEach(row=>{tbody.appendChild(row)})}}};return{init:()=>{let ths=document.getElementsByTagName("th");let results=[];for(let i=0,len=ths.length;i<len;i++){let th=ths[i];th.classList.add("sorting");th.classList.add("testing");results.push(th.onclick=onClickEvent)}return results}}})();LightTableSorter.init();
(()=>{let e=null,t=null,s="",r=e=>e.cells.item(t).textContent.toLowerCase(),n=(t,s)=>{let n=r(t),a=r(s);if(console.log("Comparing "+n+" and "+a),e.classList.contains("numeric")){let e=n.replace("episodes: ","").replace("-",0).split("/"),t=a.replace("episodes: ","").replace("-",0).split("/");e.length>1?(n=parseInt(e[0],10)/parseInt(e[1],10),a=parseInt(t[0],10)/parseInt(t[1],10)):(n=parseInt(e[0],10),a=parseInt(t[0],10))}else parseInt(n,10)&&(n=parseInt(n,10),a=parseInt(a,10));return n>a?1:n<a?-1:0},a=()=>{let t="sorting-asc"!==s?"sorting-asc":"sorting-desc";return e.className=(e.className.replace(s,"")+" "+t).trim(),s=t},l=()=>(e.classList.remove("sorting-asc","sorting-desc"),e.classList.add("sorting"),s=""),i=r=>{if(e&&t!==r.target.cellIndex&&l(),"th"===(e=r.target).nodeName.toLowerCase()){t=e.cellIndex;let r=e.offsetParent.getElementsByTagName("tbody")[0],l=Array.from(r.rows);l&&(l.sort(n),"sorting-asc"===s&&l.reverse(),a(),r.innerHtml="",l.forEach(e=>{r.appendChild(e)}))}};return{init:()=>{let e=document.getElementsByTagName("th"),t=[];for(let s=0,r=e.length;s<r;s++){let r=e[s];r.classList.add("sorting"),r.classList.add("testing"),t.push(r.onclick=i)}return t}}})().init();

View File

@ -1 +1 @@
{"version":3,"sources":["/var/www/htdocs/github.timshomepage.net/animeclient/frontEndSrc/js/base/sort-tables.js"],"sourcesContent":["const LightTableSorter = (() => {\n\tlet th = null;\n\tlet cellIndex = null;\n\tlet order = '';\n\tconst text = (row) => row.cells.item(cellIndex).textContent.toLowerCase();\n\tconst sort = (a, b) => {\n\t\tlet textA = text(a);\n\t\tlet textB = text(b);\n\t\tconsole.log(\"Comparing \" + textA + \" and \" + textB)\n\n\t\tif(th.classList.contains(\"numeric\")){\n\t\t\tlet arrayA = textA.replace('episodes: ','').replace('-',0).split(\"/\");\n\t\t\tlet arrayB = textB.replace('episodes: ','').replace('-',0).split(\"/\");\n\t\t\tif(arrayA.length > 1) {\n\t\t\t\ttextA = parseInt(arrayA[0],10) / parseInt(arrayA[1],10);\n\t\t\t\ttextB = parseInt(arrayB[0],10) / parseInt(arrayB[1],10);\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttextA = parseInt(arrayA[0],10);\n\t\t\t\ttextB = parseInt(arrayB[0],10);\n\t\t\t}\n\t\t}\n\t\telse if (parseInt(textA, 10)) {\n\t\t\ttextA = parseInt(textA, 10);\n\t\t\ttextB = parseInt(textB, 10);\n\t\t}\n\t\tif (textA > textB) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (textA < textB) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t};\n\tconst toggle = () => {\n\t\tconst c = order !== 'sorting-asc' ? 'sorting-asc' : 'sorting-desc';\n\t\tth.className = (th.className.replace(order, '') + ' ' + c).trim();\n\t\treturn order = c;\n\t};\n\tconst reset = () => {\n\t\tth.classList.remove('sorting-asc', 'sorting-desc');\n\t\tth.classList.add('sorting');\n\t\treturn order = '';\n\t};\n\tconst onClickEvent = (e) => {\n\t\tif (th && (cellIndex !== e.target.cellIndex)) {\n\t\t\treset();\n\t\t}\n\t\tth = e.target;\n\t\tif (th.nodeName.toLowerCase() === 'th') {\n\t\t\tcellIndex = th.cellIndex;\n\t\t\tconst tbody = th.offsetParent.getElementsByTagName('tbody')[0];\n\t\t\tlet rows = Array.from(tbody.rows);\n\t\t\tif (rows) {\n\t\t\t\trows.sort(sort);\n\t\t\t\tif (order === 'sorting-asc') {\n\t\t\t\t\trows.reverse();\n\t\t\t\t}\n\t\t\t\ttoggle();\n\t\t\t\ttbody.innerHtml = '';\n\n\t\t\t\trows.forEach(row => {\n\t\t\t\t\ttbody.appendChild(row);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\treturn {\n\t\tinit: () => {\n\t\t\tlet ths = document.getElementsByTagName('th');\n\t\t\tlet results = [];\n\t\t\tfor (let i = 0, len = ths.length; i < len; i++) {\n\t\t\t\tlet th = ths[i];\n\t\t\t\tth.classList.add('sorting');\n\t\t\t\tth.classList.add('testing');\n\t\t\t\tresults.push(th.onclick = onClickEvent);\n\t\t\t}\n\t\t\treturn results;\n\t\t}\n\t};\n})();\n\nLightTableSorter.init();"],"names":[],"mappings":"AAAA,MAAM,iBAAmB,AAAC,CAAA,KACzB,IAAI,GAAK,KACT,IAAI,UAAY,KAChB,IAAI,MAAQ,GACZ,MAAM,KAAO,AAAC,KAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,WAAW,CAAC,WAAW,GACvE,MAAM,KAAO,CAAC,EAAG,KAChB,IAAI,MAAQ,KAAK,GACjB,IAAI,MAAQ,KAAK,GACjB,QAAQ,GAAG,CAAC,aAAe,MAAQ,QAAU,OAE7C,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CACnC,IAAI,OAAS,MAAM,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,KAClE,IAAI,OAAS,MAAM,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,KAAK,C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ACnB,EACD,CACD,CACD,EACA,MAAO,CACN,KAAM,KACL,IAAI,IAAM,SAAS,oBAAoB,CAAC,MACxC,IAAI,QAAU,EAAE,CAChB,IAAK,IAAI,EAAI,EAAG,IAAM,IAAI,MAAM,CAAE,EAAI,IAAK,IAAK,CAC/C,IAAI,GAAK,GAAG,CAAC,EAAE,CACf,GAAG,SAAS,CAAC,GAAG,CAAC,WACjB,GAAG,SAAS,CAAC,GAAG,CAAC,WACjB,QAAQ,IAAI,CAAC,GAAG,OAAO,CAAG,aAC3B,CACA,OAAO,OACR,CACD,CACD,CAAA,IAEA,iBAAiB,IAAI"}
{"version":3,"sources":["/var/www/htdocs/github.timshomepage.net/animeclient/frontEndSrc/js/base/sort-tables.js"],"sourcesContent":["const LightTableSorter = (() => {\n\tlet th = null;\n\tlet cellIndex = null;\n\tlet order = '';\n\tconst text = (row) => row.cells.item(cellIndex).textContent.toLowerCase();\n\tconst sort = (a, b) => {\n\t\tlet textA = text(a);\n\t\tlet textB = text(b);\n\t\tconsole.log(\"Comparing \" + textA + \" and \" + textB)\n\n\t\tif(th.classList.contains(\"numeric\")){\n\t\t\tlet arrayA = textA.replace('episodes: ','').replace('-',0).split(\"/\");\n\t\t\tlet arrayB = textB.replace('episodes: ','').replace('-',0).split(\"/\");\n\t\t\tif(arrayA.length > 1) {\n\t\t\t\ttextA = parseInt(arrayA[0],10) / parseInt(arrayA[1],10);\n\t\t\t\ttextB = parseInt(arrayB[0],10) / parseInt(arrayB[1],10);\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttextA = parseInt(arrayA[0],10);\n\t\t\t\ttextB = parseInt(arrayB[0],10);\n\t\t\t}\n\t\t}\n\t\telse if (parseInt(textA, 10)) {\n\t\t\ttextA = parseInt(textA, 10);\n\t\t\ttextB = parseInt(textB, 10);\n\t\t}\n\t\tif (textA > textB) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (textA < textB) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t};\n\tconst toggle = () => {\n\t\tconst c = order !== 'sorting-asc' ? 'sorting-asc' : 'sorting-desc';\n\t\tth.className = (th.className.replace(order, '') + ' ' + c).trim();\n\t\treturn order = c;\n\t};\n\tconst reset = () => {\n\t\tth.classList.remove('sorting-asc', 'sorting-desc');\n\t\tth.classList.add('sorting');\n\t\treturn order = '';\n\t};\n\tconst onClickEvent = (e) => {\n\t\tif (th && (cellIndex !== e.target.cellIndex)) {\n\t\t\treset();\n\t\t}\n\t\tth = e.target;\n\t\tif (th.nodeName.toLowerCase() === 'th') {\n\t\t\tcellIndex = th.cellIndex;\n\t\t\tconst tbody = th.offsetParent.getElementsByTagName('tbody')[0];\n\t\t\tlet rows = Array.from(tbody.rows);\n\t\t\tif (rows) {\n\t\t\t\trows.sort(sort);\n\t\t\t\tif (order === 'sorting-asc') {\n\t\t\t\t\trows.reverse();\n\t\t\t\t}\n\t\t\t\ttoggle();\n\t\t\t\ttbody.innerHtml = '';\n\n\t\t\t\trows.forEach(row => {\n\t\t\t\t\ttbody.appendChild(row);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\treturn {\n\t\tinit: () => {\n\t\t\tlet ths = document.getElementsByTagName('th');\n\t\t\tlet results = [];\n\t\t\tfor (let i = 0, len = ths.length; i < len; i++) {\n\t\t\t\tlet th = ths[i];\n\t\t\t\tth.classList.add('sorting');\n\t\t\t\tth.classList.add('testing');\n\t\t\t\tresults.push(th.onclick = onClickEvent);\n\t\t\t}\n\t\t\treturn results;\n\t\t}\n\t};\n})();\n\nLightTableSorter.init();"],"names":[],"mappings":"AAAyB,CAAC,KACzB,IAAI,EAAK,KACL,EAAY,KACZ,EAAQ,GACN,EAAO,AAAC,GAAQ,EAAI,KAAK,CAAC,IAAI,CAAC,GAAW,WAAW,CAAC,WAAW,GACjE,EAAO,CAAC,EAAG,KAChB,IAAI,EAAQ,EAAK,GACb,EAAQ,EAAK,GAGjB,GAFA,QAAQ,GAAG,CAAC,aAAe,EAAQ,QAAU,GAE1C,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