mirror of
https://github.com/LalleSX/4chan-XZ.git
synced 2026-01-30 09:48:12 +01:00
Types bugfixes and name change
This commit is contained in:
parent
e4dda4dbf8
commit
cdc878e1f2
2
Makefile
2
Makefile
@ -3,7 +3,7 @@ clean:
|
||||
|
||||
sneed: clean
|
||||
npm run build
|
||||
cat ./dist/4chan-XT.user.js | xclip -selection clipboard
|
||||
cat ./dist/4chan-XZ.user.js | xclip -selection clipboard
|
||||
|
||||
diagnostic:
|
||||
tsc >> temp.txt
|
||||
|
||||
2585
package-lock.json
generated
2585
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "4chan-XT",
|
||||
"description": "4chan XT is a script that adds various features to anonymous imageboards.",
|
||||
"name": "4chanxz",
|
||||
"description": "4chan XZ is a script that adds various features to anonymous imageboards.",
|
||||
"meta": {
|
||||
"name": "4chan XT",
|
||||
"path": "4chan-XT",
|
||||
"fork": "TuxedoTako",
|
||||
"name": "4chan XZ",
|
||||
"path": "4chan-XZ",
|
||||
"fork": "LalleSX",
|
||||
"page": "https://github.com/TuxedoTako/4chan-xt",
|
||||
"downloads": "https://github.com/TuxedoTako/4chan-xt/releases",
|
||||
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",
|
||||
@ -107,13 +107,8 @@
|
||||
"@types/node": "^18.14.5",
|
||||
"@violentmonkey/types": "^0.1.5",
|
||||
"chrome-webstore-upload": "^1.0.0",
|
||||
"esprima": "^4.0.1",
|
||||
"font-awesome": "=4.7.0",
|
||||
"jshint": "^2.13.4",
|
||||
"jszip": "^3.10.0",
|
||||
"lodash.template": "^4.5.0",
|
||||
"markdown-it": "^12.3.2",
|
||||
"markdown-it-anchor": "^7.1.0",
|
||||
"request": "^2.88.2",
|
||||
"rollup": "^3.17.2",
|
||||
"tslib": "^2.5.0",
|
||||
|
||||
248
pnpm-lock.yaml
generated
248
pnpm-lock.yaml
generated
@ -51,27 +51,12 @@ devDependencies:
|
||||
chrome-webstore-upload:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
esprima:
|
||||
specifier: ^4.0.1
|
||||
version: 4.0.1
|
||||
font-awesome:
|
||||
specifier: '=4.7.0'
|
||||
version: 4.7.0
|
||||
jshint:
|
||||
specifier: ^2.13.4
|
||||
version: 2.13.4
|
||||
jszip:
|
||||
specifier: ^3.10.0
|
||||
version: 3.10.0
|
||||
lodash.template:
|
||||
specifier: ^4.5.0
|
||||
version: 4.5.0
|
||||
markdown-it:
|
||||
specifier: ^12.3.2
|
||||
version: 12.3.2
|
||||
markdown-it-anchor:
|
||||
specifier: ^7.1.0
|
||||
version: 7.1.0(markdown-it@12.3.2)
|
||||
request:
|
||||
specifier: ^2.88.2
|
||||
version: 2.88.2
|
||||
@ -499,6 +484,7 @@ packages:
|
||||
|
||||
/argparse@2.0.1:
|
||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||
dev: false
|
||||
|
||||
/array-buffer-byte-length@1.0.0:
|
||||
resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==}
|
||||
@ -573,6 +559,7 @@ packages:
|
||||
|
||||
/balanced-match@1.0.2:
|
||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||
dev: false
|
||||
|
||||
/bcrypt-pbkdf@1.0.2:
|
||||
resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}
|
||||
@ -585,6 +572,7 @@ packages:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
concat-map: 0.0.1
|
||||
dev: false
|
||||
|
||||
/braces@3.0.2:
|
||||
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
|
||||
@ -648,14 +636,6 @@ packages:
|
||||
got: 11.8.6
|
||||
dev: true
|
||||
|
||||
/cli@1.0.1:
|
||||
resolution: {integrity: sha512-41U72MB56TfUMGndAKK8vJ78eooOD4Z5NOL4xEfjc0c23s+6EYKXlXsmACBVclLP1yOfWCgEganVzddVrSNoTg==}
|
||||
engines: {node: '>=0.2.5'}
|
||||
dependencies:
|
||||
exit: 0.1.2
|
||||
glob: 7.2.3
|
||||
dev: true
|
||||
|
||||
/clone-response@1.0.3:
|
||||
resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==}
|
||||
dependencies:
|
||||
@ -682,21 +662,12 @@ packages:
|
||||
|
||||
/concat-map@0.0.1:
|
||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||
|
||||
/console-browserify@1.1.0:
|
||||
resolution: {integrity: sha512-duS7VP5pvfsNLDvL1O4VOEbw37AI3A4ZUQYemvDlnpGrNu9tprR7BYWpDYwC0Xia0Zxz5ZupdiIrUp0GH1aXfg==}
|
||||
dependencies:
|
||||
date-now: 0.1.4
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/core-util-is@1.0.2:
|
||||
resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
|
||||
dev: true
|
||||
|
||||
/core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
dev: true
|
||||
|
||||
/create-require@1.1.1:
|
||||
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
|
||||
dev: false
|
||||
@ -717,10 +688,6 @@ packages:
|
||||
assert-plus: 1.0.0
|
||||
dev: true
|
||||
|
||||
/date-now@0.1.4:
|
||||
resolution: {integrity: sha512-AsElvov3LoNB7tf5k37H2jYSB+ZZPMT5sG2QjJCcdlV5chIv6htBUBUui2IKRjgtKAKtCBN7Zbwa+MtwLjSeNw==}
|
||||
dev: true
|
||||
|
||||
/debug@3.2.7:
|
||||
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
|
||||
peerDependencies:
|
||||
@ -799,34 +766,6 @@ packages:
|
||||
esutils: 2.0.3
|
||||
dev: false
|
||||
|
||||
/dom-serializer@0.2.2:
|
||||
resolution: {integrity: sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==}
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
entities: 2.2.0
|
||||
dev: true
|
||||
|
||||
/domelementtype@1.3.1:
|
||||
resolution: {integrity: sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==}
|
||||
dev: true
|
||||
|
||||
/domelementtype@2.3.0:
|
||||
resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
|
||||
dev: true
|
||||
|
||||
/domhandler@2.3.0:
|
||||
resolution: {integrity: sha512-q9bUwjfp7Eif8jWxxxPSykdRZAb6GkguBGSgvvCrhI9wB71W2K/Kvv4E61CF/mcCfnVJDeDWx/Vb/uAqbDj6UQ==}
|
||||
dependencies:
|
||||
domelementtype: 1.3.1
|
||||
dev: true
|
||||
|
||||
/domutils@1.5.1:
|
||||
resolution: {integrity: sha512-gSu5Oi/I+3wDENBsOWBiRK1eoGxcywYSqg3rR960/+EfY0CF4EX1VPkgHOZ3WiS/Jg2DtliF6BhWcHlfpYUcGw==}
|
||||
dependencies:
|
||||
dom-serializer: 0.2.2
|
||||
domelementtype: 1.3.1
|
||||
dev: true
|
||||
|
||||
/ecc-jsbn@0.1.2:
|
||||
resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==}
|
||||
dependencies:
|
||||
@ -840,18 +779,6 @@ packages:
|
||||
once: 1.4.0
|
||||
dev: true
|
||||
|
||||
/entities@1.0.0:
|
||||
resolution: {integrity: sha512-LbLqfXgJMmy81t+7c14mnulFHJ170cM6E+0vMXR9k/ZiZwgX8i5pNgjTCX3SO4VeUsFLV+8InixoretwU+MjBQ==}
|
||||
dev: true
|
||||
|
||||
/entities@2.1.0:
|
||||
resolution: {integrity: sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==}
|
||||
dev: true
|
||||
|
||||
/entities@2.2.0:
|
||||
resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==}
|
||||
dev: true
|
||||
|
||||
/es-abstract@1.21.2:
|
||||
resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@ -1180,12 +1107,6 @@ packages:
|
||||
eslint-visitor-keys: 3.4.0
|
||||
dev: false
|
||||
|
||||
/esprima@4.0.1:
|
||||
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
|
||||
engines: {node: '>=4'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/esquery@1.5.0:
|
||||
resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
|
||||
engines: {node: '>=0.10'}
|
||||
@ -1219,11 +1140,6 @@ packages:
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/exit@0.1.2:
|
||||
resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
dev: true
|
||||
|
||||
/extend@3.0.2:
|
||||
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
|
||||
dev: true
|
||||
@ -1320,6 +1236,7 @@ packages:
|
||||
|
||||
/fs.realpath@1.0.0:
|
||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||
dev: false
|
||||
|
||||
/fsevents@2.3.2:
|
||||
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
|
||||
@ -1398,6 +1315,7 @@ packages:
|
||||
minimatch: 3.1.2
|
||||
once: 1.4.0
|
||||
path-is-absolute: 1.0.1
|
||||
dev: false
|
||||
|
||||
/globals@13.20.0:
|
||||
resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==}
|
||||
@ -1504,16 +1422,6 @@ packages:
|
||||
dependencies:
|
||||
function-bind: 1.1.1
|
||||
|
||||
/htmlparser2@3.8.3:
|
||||
resolution: {integrity: sha512-hBxEg3CYXe+rPIua8ETe7tmG3XDn9B0edOE/e9wH2nLczxzgdu0m0aNHY+5wFZiviLWLdANPJTssa92dMcXQ5Q==}
|
||||
dependencies:
|
||||
domelementtype: 1.3.1
|
||||
domhandler: 2.3.0
|
||||
domutils: 1.5.1
|
||||
entities: 1.0.0
|
||||
readable-stream: 1.1.14
|
||||
dev: true
|
||||
|
||||
/http-cache-semantics@4.1.1:
|
||||
resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==}
|
||||
dev: true
|
||||
@ -1540,10 +1448,6 @@ packages:
|
||||
engines: {node: '>= 4'}
|
||||
dev: false
|
||||
|
||||
/immediate@3.0.6:
|
||||
resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
|
||||
dev: true
|
||||
|
||||
/import-fresh@3.3.0:
|
||||
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
|
||||
engines: {node: '>=6'}
|
||||
@ -1562,9 +1466,11 @@ packages:
|
||||
dependencies:
|
||||
once: 1.4.0
|
||||
wrappy: 1.0.2
|
||||
dev: false
|
||||
|
||||
/inherits@2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
dev: false
|
||||
|
||||
/internal-slot@1.0.5:
|
||||
resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
|
||||
@ -1697,14 +1603,6 @@ packages:
|
||||
call-bind: 1.0.2
|
||||
dev: false
|
||||
|
||||
/isarray@0.0.1:
|
||||
resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==}
|
||||
dev: true
|
||||
|
||||
/isarray@1.0.0:
|
||||
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
|
||||
dev: true
|
||||
|
||||
/isexe@2.0.0:
|
||||
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
|
||||
dev: false
|
||||
@ -1728,19 +1626,6 @@ packages:
|
||||
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
|
||||
dev: true
|
||||
|
||||
/jshint@2.13.4:
|
||||
resolution: {integrity: sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
cli: 1.0.1
|
||||
console-browserify: 1.1.0
|
||||
exit: 0.1.2
|
||||
htmlparser2: 3.8.3
|
||||
lodash: 4.17.21
|
||||
minimatch: 3.0.8
|
||||
strip-json-comments: 1.0.4
|
||||
dev: true
|
||||
|
||||
/json-buffer@3.0.1:
|
||||
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
|
||||
dev: true
|
||||
@ -1777,15 +1662,6 @@ packages:
|
||||
verror: 1.10.0
|
||||
dev: true
|
||||
|
||||
/jszip@3.10.0:
|
||||
resolution: {integrity: sha512-LDfVtOLtOxb9RXkYOwPyNBTQDL4eUbqahtoY6x07GiDJHwSYvn8sHHIw8wINImV3MqbMNve2gSuM1DDqEKk09Q==}
|
||||
dependencies:
|
||||
lie: 3.3.0
|
||||
pako: 1.0.11
|
||||
readable-stream: 2.3.8
|
||||
setimmediate: 1.0.5
|
||||
dev: true
|
||||
|
||||
/keyv@4.5.2:
|
||||
resolution: {integrity: sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==}
|
||||
dependencies:
|
||||
@ -1800,18 +1676,6 @@ packages:
|
||||
type-check: 0.4.0
|
||||
dev: false
|
||||
|
||||
/lie@3.3.0:
|
||||
resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==}
|
||||
dependencies:
|
||||
immediate: 3.0.6
|
||||
dev: true
|
||||
|
||||
/linkify-it@3.0.3:
|
||||
resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==}
|
||||
dependencies:
|
||||
uc.micro: 1.0.6
|
||||
dev: true
|
||||
|
||||
/locate-path@6.0.0:
|
||||
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
|
||||
engines: {node: '>=10'}
|
||||
@ -1840,10 +1704,6 @@ packages:
|
||||
lodash._reinterpolate: 3.0.0
|
||||
dev: true
|
||||
|
||||
/lodash@4.17.21:
|
||||
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
|
||||
dev: true
|
||||
|
||||
/lowercase-keys@2.0.0:
|
||||
resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==}
|
||||
engines: {node: '>=8'}
|
||||
@ -1860,29 +1720,6 @@ packages:
|
||||
resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
|
||||
dev: false
|
||||
|
||||
/markdown-it-anchor@7.1.0(markdown-it@12.3.2):
|
||||
resolution: {integrity: sha512-loQggrwsIkkP7TOrESvmYkV2ikbQNNKhHcWyqC7/C2CmfHl1tkUizJJU8C5aGgg7J6oXVQJx17gk7i47tNn/lQ==}
|
||||
peerDependencies:
|
||||
markdown-it: '*'
|
||||
dependencies:
|
||||
markdown-it: 12.3.2
|
||||
dev: true
|
||||
|
||||
/markdown-it@12.3.2:
|
||||
resolution: {integrity: sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
entities: 2.1.0
|
||||
linkify-it: 3.0.3
|
||||
mdurl: 1.0.1
|
||||
uc.micro: 1.0.6
|
||||
dev: true
|
||||
|
||||
/mdurl@1.0.1:
|
||||
resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==}
|
||||
dev: true
|
||||
|
||||
/merge2@1.4.1:
|
||||
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
||||
engines: {node: '>= 8'}
|
||||
@ -1918,16 +1755,11 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/minimatch@3.0.8:
|
||||
resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==}
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
dev: true
|
||||
|
||||
/minimatch@3.1.2:
|
||||
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
dev: false
|
||||
|
||||
/minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
@ -2018,10 +1850,6 @@ packages:
|
||||
p-limit: 3.1.0
|
||||
dev: false
|
||||
|
||||
/pako@1.0.11:
|
||||
resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
|
||||
dev: true
|
||||
|
||||
/parent-module@1.0.1:
|
||||
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
|
||||
engines: {node: '>=6'}
|
||||
@ -2037,6 +1865,7 @@ packages:
|
||||
/path-is-absolute@1.0.1:
|
||||
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/path-key@3.1.1:
|
||||
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
|
||||
@ -2064,10 +1893,6 @@ packages:
|
||||
engines: {node: '>= 0.8.0'}
|
||||
dev: false
|
||||
|
||||
/process-nextick-args@2.0.1:
|
||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
dev: true
|
||||
|
||||
/psl@1.9.0:
|
||||
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
|
||||
dev: true
|
||||
@ -2097,27 +1922,6 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/readable-stream@1.1.14:
|
||||
resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==}
|
||||
dependencies:
|
||||
core-util-is: 1.0.3
|
||||
inherits: 2.0.4
|
||||
isarray: 0.0.1
|
||||
string_decoder: 0.10.31
|
||||
dev: true
|
||||
|
||||
/readable-stream@2.3.8:
|
||||
resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
|
||||
dependencies:
|
||||
core-util-is: 1.0.3
|
||||
inherits: 2.0.4
|
||||
isarray: 1.0.0
|
||||
process-nextick-args: 2.0.1
|
||||
safe-buffer: 5.1.2
|
||||
string_decoder: 1.1.1
|
||||
util-deprecate: 1.0.2
|
||||
dev: true
|
||||
|
||||
/regexp.prototype.flags@1.5.0:
|
||||
resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@ -2208,10 +2012,6 @@ packages:
|
||||
queue-microtask: 1.2.3
|
||||
dev: false
|
||||
|
||||
/safe-buffer@5.1.2:
|
||||
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
|
||||
dev: true
|
||||
|
||||
/safe-buffer@5.2.1:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
dev: true
|
||||
@ -2241,10 +2041,6 @@ packages:
|
||||
lru-cache: 6.0.0
|
||||
dev: false
|
||||
|
||||
/setimmediate@1.0.5:
|
||||
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
|
||||
dev: true
|
||||
|
||||
/shebang-command@2.0.0:
|
||||
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
|
||||
engines: {node: '>=8'}
|
||||
@ -2311,16 +2107,6 @@ packages:
|
||||
es-abstract: 1.21.2
|
||||
dev: false
|
||||
|
||||
/string_decoder@0.10.31:
|
||||
resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==}
|
||||
dev: true
|
||||
|
||||
/string_decoder@1.1.1:
|
||||
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
|
||||
dependencies:
|
||||
safe-buffer: 5.1.2
|
||||
dev: true
|
||||
|
||||
/strip-ansi@6.0.1:
|
||||
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
|
||||
engines: {node: '>=8'}
|
||||
@ -2333,12 +2119,6 @@ packages:
|
||||
engines: {node: '>=4'}
|
||||
dev: false
|
||||
|
||||
/strip-json-comments@1.0.4:
|
||||
resolution: {integrity: sha512-AOPG8EBc5wAikaG1/7uFCNFJwnKOuQwFTpYBdTW6OvWHeZBQBrAA/amefHGrEiOnCPcLFZK6FUPtWVKpQVIRgg==}
|
||||
engines: {node: '>=0.8.0'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/strip-json-comments@3.1.1:
|
||||
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
|
||||
engines: {node: '>=8'}
|
||||
@ -2467,10 +2247,6 @@ packages:
|
||||
engines: {node: '>=4.2.0'}
|
||||
hasBin: true
|
||||
|
||||
/uc.micro@1.0.6:
|
||||
resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==}
|
||||
dev: true
|
||||
|
||||
/unbox-primitive@1.0.2:
|
||||
resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
|
||||
dependencies:
|
||||
@ -2485,10 +2261,6 @@ packages:
|
||||
dependencies:
|
||||
punycode: 2.3.0
|
||||
|
||||
/util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: true
|
||||
|
||||
/uuid@3.4.0:
|
||||
resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}
|
||||
deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
|
||||
|
||||
@ -32,6 +32,8 @@ import NavLinksPage from './Index/NavLinks.html'
|
||||
import PageList from './Index/PageList.html'
|
||||
import UI from './UI'
|
||||
interface Index {
|
||||
enabled: any
|
||||
menu: any
|
||||
req: boolean
|
||||
liveThreadData: any
|
||||
pageNum: any
|
||||
|
||||
@ -315,7 +315,7 @@ Enable it on boards.${location.hostname.split('.')[1]}.org in your browser's pri
|
||||
}
|
||||
}
|
||||
return ($.delete(['hiddenThreads', 'hiddenPosts'], dict())
|
||||
})
|
||||
)})
|
||||
})
|
||||
return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div)
|
||||
},
|
||||
|
||||
@ -430,7 +430,7 @@ const Gallery = {
|
||||
$.rmClass(doc, 'gallery-open')
|
||||
if (Conf['Fullscreen Gallery']) {
|
||||
$.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close)
|
||||
d.mozCancelFullScreen?.()
|
||||
document.mozCancelFullScreen?.()
|
||||
d.webkitExitFullscreen?.()
|
||||
}
|
||||
delete Gallery.nodes
|
||||
|
||||
@ -3,18 +3,12 @@ import Notice from "../classes/Notice"
|
||||
import { Conf, d, g } from "../globals/globals"
|
||||
import $ from "../platform/$"
|
||||
import CrossOrigin from "../platform/CrossOrigin"
|
||||
import { dict } from "../platform/helpers"
|
||||
import ImageHost from "./ImageHost"
|
||||
import Volume from "./Volume"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS104: Avoid inline assignments
|
||||
* DS204: Change includes calls to have a more natural evaluation order
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
const ImageCommon = {
|
||||
cache: null,
|
||||
// Pause and mute video in preparation for removing the element from the document.
|
||||
pause(video) {
|
||||
if (video.nodeName !== 'VIDEO') { return }
|
||||
|
||||
@ -1,18 +1,13 @@
|
||||
import Callbacks from "../classes/Callbacks"
|
||||
import Post from "../classes/Post"
|
||||
import Header from "../General/Header"
|
||||
import UI from "../General/UI"
|
||||
import { Conf, doc, g } from "../globals/globals"
|
||||
import $ from "../platform/$"
|
||||
import { SECOND } from "../platform/helpers"
|
||||
import type { File } from "../types/globals"
|
||||
import ImageCommon from "./ImageCommon"
|
||||
import Volume from "./Volume"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS101: Remove unnecessary use of Array.from
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
const ImageHover = {
|
||||
init() {
|
||||
if (!['index', 'thread'].includes(g.VIEW)) { return }
|
||||
@ -31,7 +26,7 @@ const ImageHover = {
|
||||
},
|
||||
|
||||
node() {
|
||||
return this.files.filter((file) => (file.isImage || file.isVideo) && file.thumb).map((file) =>
|
||||
return this.files.filter((file) => (file.isImage || file.isVideo) && file.thumb).map((file: File) =>
|
||||
$.on(file.thumb, 'mouseover', ImageHover.mouseover(this, file)))
|
||||
},
|
||||
|
||||
@ -47,19 +42,24 @@ const ImageHover = {
|
||||
return $.on(this.nodes.thumb, 'mouseover', hover)
|
||||
},
|
||||
|
||||
mouseover(post, file) {
|
||||
mouseover(post: Post, file: File) {
|
||||
return function (e) {
|
||||
let el, height, width
|
||||
// @ts-ignore
|
||||
if (!doc.contains(this)) { return }
|
||||
const { isVideo } = file
|
||||
if (file.isExpanding || file.isExpanded || g.SITE.isThumbExpanded?.(file)) { return }
|
||||
const error = ImageHover.error(post, file)
|
||||
const error = ImageHover.error(this.post, file)
|
||||
if (ImageCommon.cache?.dataset.fileID === `${post.fullID}.${file.index}`) {
|
||||
el = ImageCommon.popCache()
|
||||
$.on(el, 'error', error)
|
||||
} else {
|
||||
el = $.el((isVideo ? 'video' : 'img'))
|
||||
el = $.el((isVideo ? 'video' : 'img'), {
|
||||
className: 'ihover',
|
||||
style: {
|
||||
maxWidth: '100%',
|
||||
maxHeight: '100%'
|
||||
}
|
||||
})
|
||||
el.dataset.fileID = `${post.fullID}.${file.index}`
|
||||
$.on(el, 'error', error)
|
||||
el.src = file.url
|
||||
@ -77,7 +77,6 @@ const ImageHover = {
|
||||
Volume.setup(el)
|
||||
if (Conf['Autoplay']) {
|
||||
el.play()
|
||||
// @ts-ignore
|
||||
if (this.nodeName === 'VIDEO') { this.currentTime = el.currentTime }
|
||||
}
|
||||
}
|
||||
@ -111,7 +110,7 @@ const ImageHover = {
|
||||
}
|
||||
},
|
||||
|
||||
error(post, file) {
|
||||
error(post: HTMLElement, file: File) {
|
||||
return function () {
|
||||
if (ImageCommon.decodeError(this, file)) { return }
|
||||
return ImageCommon.error(this, post, file, 3 * SECOND, URL => {
|
||||
|
||||
@ -2,12 +2,7 @@ import DataBoard from "../classes/DataBoard"
|
||||
import { Conf, d, g } from "../globals/globals"
|
||||
import $ from "../platform/$"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS101: Remove unnecessary use of Array.from
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const PostSuccessful = {
|
||||
init() {
|
||||
if (!Conf['Remember Your Posts']) { return }
|
||||
@ -18,16 +13,16 @@ const PostSuccessful = {
|
||||
if (d.title !== 'Post successful!') { return }
|
||||
|
||||
let [_, threadID, postID] = Array.from($('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/))
|
||||
postID = +postID
|
||||
postID = +postID
|
||||
threadID = +threadID || postID
|
||||
|
||||
const db = new DataBoard('yourPosts')
|
||||
const db = new DataBoard('yourPosts', true, true)
|
||||
return db.set({
|
||||
boardID: g.BOARD.ID,
|
||||
threadID,
|
||||
postID,
|
||||
val: true
|
||||
})
|
||||
}, true)
|
||||
}
|
||||
}
|
||||
export default PostSuccessful
|
||||
|
||||
@ -16,14 +16,7 @@ import { DAY, dict, SECOND } from '../platform/helpers'
|
||||
import Captcha from './Captcha'
|
||||
import QuickReplyPage from './QR/QuickReply.html'
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS101: Remove unnecessary use of Array.from
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS202: Simplify dynamic range loops
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
|
||||
const QR = {
|
||||
mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
|
||||
|
||||
@ -6,11 +6,7 @@ import QuoteInline from "./QuoteInline"
|
||||
import QuotePreview from "./QuotePreview"
|
||||
import QuoteYou from "./QuoteYou"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const QuoteBacklink = {
|
||||
// Backlinks appending need to work for:
|
||||
// - previous, same, and following posts.
|
||||
|
||||
@ -4,11 +4,7 @@ import { Conf, g } from "../globals/globals"
|
||||
import ExpandComment from "../Miscellaneous/ExpandComment"
|
||||
import $ from "../platform/$"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const QuoteCT = {
|
||||
init() {
|
||||
if (!['index', 'thread'].includes(g.VIEW) || !Conf['Mark Cross-thread Quotes']) { return }
|
||||
|
||||
@ -6,12 +6,7 @@ import ExpandComment from "../Miscellaneous/ExpandComment"
|
||||
import Unread from "../Monitoring/Unread"
|
||||
import $ from "../platform/$"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS101: Remove unnecessary use of Array.from
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const QuoteInline = {
|
||||
init() {
|
||||
if (!['index', 'thread'].includes(g.VIEW) || !Conf['Quote Inlining']) { return }
|
||||
|
||||
@ -1,13 +1,9 @@
|
||||
import Callbacks from "../classes/Callbacks"
|
||||
import Get from "../General/Get"
|
||||
import { Conf,g } from "../globals/globals"
|
||||
import { Conf, g } from "../globals/globals"
|
||||
import $ from "../platform/$"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const QuoteStrikeThrough = {
|
||||
init() {
|
||||
if (!['index', 'thread'].includes(g.VIEW) ||
|
||||
@ -15,14 +11,14 @@ const QuoteStrikeThrough = {
|
||||
|
||||
return Callbacks.Post.push({
|
||||
name: 'Strike-through Quotes',
|
||||
cb: this.node
|
||||
cb: this.node
|
||||
})
|
||||
},
|
||||
|
||||
node() {
|
||||
if (this.isClone) { return }
|
||||
for (const quotelink of this.nodes.quotelinks) {
|
||||
const {boardID, postID} = Get.postDataFromLink(quotelink)
|
||||
const { boardID, postID } = Get.postDataFromLink(quotelink)
|
||||
if (g.posts.get(`${boardID}.${postID}`)?.isHidden) {
|
||||
$.addClass(quotelink, 'filtered')
|
||||
}
|
||||
|
||||
@ -7,11 +7,7 @@ import Unread from "../Monitoring/Unread"
|
||||
import $ from "../platform/$"
|
||||
import { dict } from "../platform/helpers"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
/*
|
||||
<3 aeosynth
|
||||
*/
|
||||
|
||||
@ -10,16 +10,13 @@ import $ from "../platform/$"
|
||||
import $$ from "../platform/$$"
|
||||
import PostRedirect from "../Posting/PostRedirect"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const QuoteYou = {
|
||||
db: DataBoard,
|
||||
init() {
|
||||
if (!Conf['Remember Your Posts']) { return }
|
||||
|
||||
this.db = new DataBoard('yourPosts')
|
||||
this.db = new DataBoard('yourPosts', true, true)
|
||||
$.sync('Remember Your Posts', enabled => Conf['Remember Your Posts'] = enabled)
|
||||
$.on(d, 'QRPostSuccessful', function (e) {
|
||||
const cb = PostRedirect.delay()
|
||||
|
||||
@ -6,12 +6,7 @@ import ExpandComment from "../Miscellaneous/ExpandComment"
|
||||
import $ from "../platform/$"
|
||||
import $$ from "../platform/$$"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS101: Remove unnecessary use of Array.from
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const Quotify = {
|
||||
init() {
|
||||
if (!['index', 'thread'].includes(g.VIEW) || !Conf['Resurrect Quotes']) { return }
|
||||
|
||||
@ -8,7 +8,7 @@ import Thread from "./Thread"
|
||||
export default class Board {
|
||||
ID: string
|
||||
boardID: number | string
|
||||
siteID: number
|
||||
siteID: string
|
||||
threads: SimpleDict<Thread>
|
||||
posts: SimpleDict<Post>
|
||||
config: any
|
||||
|
||||
@ -11,6 +11,12 @@ import { dict, HOUR } from "../platform/helpers"
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
export default class DataBoard {
|
||||
static set(data, cb) {
|
||||
this.set(data, cb)
|
||||
}
|
||||
static get(cb) {
|
||||
this.get(cb)
|
||||
}
|
||||
static keys: string[]
|
||||
static changes: string[]
|
||||
key: string
|
||||
@ -22,7 +28,7 @@ export default class DataBoard {
|
||||
this.changes = []
|
||||
}
|
||||
|
||||
constructor(key, sync, dontClean) {
|
||||
constructor(key: string, sync: boolean, dontClean: boolean) {
|
||||
this.onSync = this.onSync.bind(this)
|
||||
this.key = key
|
||||
this.initData(Conf[this.key])
|
||||
@ -33,7 +39,7 @@ export default class DataBoard {
|
||||
// so we only start syncing when we're ready.
|
||||
const init = () => {
|
||||
$.off(d, '4chanXInitFinished', init)
|
||||
return this.sync = sync
|
||||
return this.sync = () => this.forceSync()
|
||||
}
|
||||
$.on(d, '4chanXInitFinished', init)
|
||||
}
|
||||
@ -70,7 +76,7 @@ export default class DataBoard {
|
||||
})
|
||||
}
|
||||
|
||||
forceSync(cb) {
|
||||
forceSync(cb?) {
|
||||
return $.get(this.key, { boards: dict() }, items => {
|
||||
if ((items[this.key].version || 0) > (this.data.version || 0)) {
|
||||
this.initData(items[this.key])
|
||||
|
||||
@ -3,7 +3,7 @@ import { d } from "../globals/globals"
|
||||
import $ from "../platform/$"
|
||||
import { SECOND } from "../platform/helpers"
|
||||
|
||||
type NoticeType = "success" | "warning" | "error"
|
||||
type NoticeType = "success" | "warning" | "error" | "info"
|
||||
|
||||
export default class Notice {
|
||||
private el: HTMLDivElement
|
||||
|
||||
@ -3,6 +3,7 @@ import { Conf, g } from "../globals/globals"
|
||||
import ImageExpand from "../Images/ImageExpand"
|
||||
import $ from "../platform/$"
|
||||
import $$ from "../platform/$$"
|
||||
import type { File } from "../types/globals"
|
||||
import type Board from "./Board"
|
||||
import Callbacks from "./Callbacks"
|
||||
import type Thread from "./Thread"
|
||||
@ -27,8 +28,8 @@ export default class Post {
|
||||
declare isFetchedQuote: boolean
|
||||
declare isClone: boolean
|
||||
declare quotes: string[]
|
||||
declare file: ReturnType<Post['parseFile']>
|
||||
declare files: ReturnType<Post['parseFile']>[]
|
||||
declare file: File
|
||||
declare files: File[]
|
||||
|
||||
declare info: {
|
||||
subject: string,
|
||||
@ -267,7 +268,7 @@ export default class Post {
|
||||
}
|
||||
|
||||
parseFiles() {
|
||||
let file
|
||||
let file: File
|
||||
this.files = []
|
||||
const fileRoots = this.fileRoots()
|
||||
let index = 0
|
||||
@ -293,15 +294,6 @@ export default class Post {
|
||||
}
|
||||
|
||||
parseFile(fileRoot: HTMLElement) {
|
||||
interface File {
|
||||
text: string,
|
||||
link: HTMLAnchorElement,
|
||||
thumb: HTMLElement,
|
||||
thumbLink: HTMLElement,
|
||||
size: string,
|
||||
sizeInBytes: number,
|
||||
isDead: boolean,
|
||||
}
|
||||
|
||||
const file: Partial<File> = { isDead: false }
|
||||
for (const key in g.SITE.selectors.file) {
|
||||
@ -327,7 +319,7 @@ export default class Post {
|
||||
return file as File
|
||||
}
|
||||
|
||||
kill(file: any, index = 0) {
|
||||
kill(file: File, index = 0) {
|
||||
let strong: { textContent: string }
|
||||
if (file) {
|
||||
if (this.isDead || this.files[index].isDead) { return }
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { g } from "../globals/globals"
|
||||
import $ from "../platform/$"
|
||||
import Board from "./Board"
|
||||
import CatalogThreadNative from "./CatalogThreadNative"
|
||||
import Post from "./Post"
|
||||
import SimpleDict from "./SimpleDict"
|
||||
|
||||
export default class Thread {
|
||||
catalogViewNative: CatalogThreadNative
|
||||
ID: number | string
|
||||
OP: Post
|
||||
isArchived: boolean
|
||||
|
||||
@ -7,6 +7,7 @@ import type SWTinyboard from "../site/SW.tinyboard"
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
wrappedJSObject: any
|
||||
Tegaki: any
|
||||
FCX: any
|
||||
}
|
||||
@ -61,7 +62,7 @@ export const g: {
|
||||
VERSION: version.version,
|
||||
NAMESPACE: meta.name,
|
||||
sites: Object.create(null),
|
||||
boards: Object.create(null)
|
||||
boards: Object.create(null),
|
||||
}
|
||||
|
||||
export const E = (function () {
|
||||
@ -97,4 +98,4 @@ export const c = console
|
||||
export const docSet = function () {
|
||||
// return (doc = d.documentElement);
|
||||
return doc
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,6 @@ import UnreadIndex from "../Monitoring/UnreadIndex"
|
||||
import $ from "../platform/$"
|
||||
import $$ from "../platform/$$"
|
||||
import { dict, platform } from "../platform/helpers"
|
||||
import Captcha from "../Posting/Captcha"
|
||||
import CaptchaReplace from "../Posting/Captcha.replace"
|
||||
import PassLink from "../Posting/PassLink"
|
||||
import PostRedirect from "../Posting/PostRedirect"
|
||||
@ -102,6 +101,7 @@ import SW from "../site/SW"
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
const Main = {
|
||||
expectInitFinished: true,
|
||||
init() {
|
||||
// XXX dwb userscripts extension reloads scripts run at document-start when replaceState/pushState is called.
|
||||
// XXX Firefox reinjects WebExtension content scripts when extension is updated / reloaded.
|
||||
@ -115,7 +115,7 @@ const Main = {
|
||||
|
||||
// Don't run inside ad iframes.
|
||||
try {
|
||||
if (window.frameElement && ['', 'about:blank'].includes(window.frameElement.src)) { return }
|
||||
if (window.frameElement && ['', 'about:blank'].includes(window.location.href)) { return }
|
||||
} catch (error1) { /* empty */ }
|
||||
|
||||
// Detect multiple copies of 4chan X
|
||||
@ -136,12 +136,12 @@ const Main = {
|
||||
// Detect "mounted" event from Kissu
|
||||
const mountedCB = function () {
|
||||
d.removeEventListener('mounted', mountedCB, true)
|
||||
Main.isMounted = true
|
||||
Main.mounted(true)
|
||||
return Main.mountedCBs.map((cb) =>
|
||||
(() => {
|
||||
try {
|
||||
return cb()
|
||||
} catch (error2) { }
|
||||
} catch (error2) { /* empty */ }
|
||||
})())
|
||||
}
|
||||
d.addEventListener('mounted', mountedCB, true)
|
||||
@ -167,12 +167,13 @@ const Main = {
|
||||
return String.fromCharCode = function () {
|
||||
if (document.body) {
|
||||
String.fromCharCode = fromCharCode0
|
||||
} else if (document.currentScript && !document.currentScript.src) {
|
||||
} else if (document.currentScript && !document.location.href) {
|
||||
throw Error()
|
||||
}
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
return fromCharCode0.apply(this, arguments)
|
||||
}
|
||||
})
|
||||
}, 'String.fromCharCode')
|
||||
$.asap(docSet, () => $.onExists(doc, 'iframe[srcdoc]', $.rm))
|
||||
}
|
||||
|
||||
@ -211,7 +212,7 @@ const Main = {
|
||||
!SW.yotsuba.regexp.captcha.test(location.href) &&
|
||||
!$$('script:not([src])', d).filter(s => /this\[/.test(s.textContent)).length
|
||||
) {
|
||||
($.getSync || $.get)({ 'jsWhitelist': Conf['jsWhitelist'] }, ({ jsWhitelist }) => $.addCSP(`script-src ${jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}`))
|
||||
($.getSync || $.get)({ 'jsWhitelist': Conf['jsWhitelist'] }, ({ jsWhitelist }) => $.addCSP(`script-src ${jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}`), 'jsWhitelist')
|
||||
}
|
||||
|
||||
// Get saved values as items
|
||||
@ -233,8 +234,9 @@ const Main = {
|
||||
} else if ((items.previousversion == null)) {
|
||||
Main.isFirstRun = true
|
||||
Main.ready(function () {
|
||||
$.set('previousversion', g.VERSION)
|
||||
return Settings.open()
|
||||
$.set('previousversion', g.VERSION, function () {
|
||||
return Settings.open(true)
|
||||
})
|
||||
})
|
||||
|
||||
// Migrate old settings
|
||||
@ -250,8 +252,14 @@ const Main = {
|
||||
|
||||
return Site.init(Main.initFeatures)
|
||||
})
|
||||
}, function () {
|
||||
return Main.ready(function () {
|
||||
return Settings.open(true)
|
||||
})
|
||||
})
|
||||
},
|
||||
isFirstRun: true,
|
||||
bgColorStyle: null,
|
||||
|
||||
upgrade(items) {
|
||||
const { previousversion } = items
|
||||
@ -263,11 +271,13 @@ const Main = {
|
||||
{ innerHTML: `${meta.name} has been updated to <a href="${meta.changelog}" target="_blank">version ${g.VERSION}</a>.` })
|
||||
return new Notice('info', el, 15)
|
||||
}
|
||||
}, function () {
|
||||
return console.warn('Failed to save settings.')
|
||||
})
|
||||
},
|
||||
|
||||
parseURL(site = g.SITE, url = location) {
|
||||
const r = {}
|
||||
const r = dict()
|
||||
|
||||
if (!site) { return r }
|
||||
r.siteID = site.ID
|
||||
@ -294,11 +304,13 @@ const Main = {
|
||||
}
|
||||
return r
|
||||
},
|
||||
|
||||
jsEnabled: false,
|
||||
initFeatures() {
|
||||
$.global(function () {
|
||||
document.documentElement.classList.add('js-enabled')
|
||||
return window.FCX = {}
|
||||
}, function () {
|
||||
return window.FCX = {}
|
||||
})
|
||||
Main.jsEnabled = $.hasClass(doc, 'js-enabled')
|
||||
|
||||
@ -321,7 +333,7 @@ const Main = {
|
||||
return Redirect.navigate('file', {
|
||||
boardID: g.BOARD.ID,
|
||||
filename: pathname[pathname.length - 1]
|
||||
})
|
||||
}, { replace: true })
|
||||
} else if (video = $('video')) {
|
||||
if (Conf['Volume in New Tab']) {
|
||||
Volume.setup(video)
|
||||
@ -351,7 +363,7 @@ const Main = {
|
||||
feature.init()
|
||||
} catch (err) {
|
||||
Main.handleErrors({
|
||||
message: `\"${name}\" initialization crashed.`,
|
||||
message: `"${name}" initialization crashed.`,
|
||||
error: err
|
||||
})
|
||||
}
|
||||
@ -378,7 +390,7 @@ const Main = {
|
||||
$.ready(function () {
|
||||
if ((d.body.clientHeight > doc.clientHeight) && ((window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar'])) {
|
||||
Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar']
|
||||
$.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar'])
|
||||
$.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar'], true)
|
||||
return $.toggleClass(doc, 'autohiding-scrollbar')
|
||||
}
|
||||
})
|
||||
@ -447,7 +459,7 @@ const Main = {
|
||||
background: ${bgColor};
|
||||
}
|
||||
.unread-mark-read {
|
||||
background-color: rgba(${rgb.slice(0, 3).join(', ')}, ${0.5 * (rgb[3] || 1)});
|
||||
background-color: rgba(${rgb.slice(0, 3).join(', ')}, ${0.5 * (1 - $.luma(rgb))}) !important;
|
||||
}\
|
||||
`
|
||||
if ($.luma(rgb) < 100) {
|
||||
@ -517,9 +529,11 @@ const Main = {
|
||||
}
|
||||
} else {
|
||||
Main.expectInitFinished = true
|
||||
return $.event('4chanXInitFinished')
|
||||
return $.event('4chanXInitFinished', { detail: { board: g.BOARD } })
|
||||
}
|
||||
},
|
||||
addThreadsObserver: null,
|
||||
addPostsObserver: null,
|
||||
|
||||
initThread() {
|
||||
let board
|
||||
@ -552,17 +566,17 @@ const Main = {
|
||||
return Main.callbackNodesDB('Post', posts, function () {
|
||||
for (const post of posts) { QuoteThreading.insert(post) }
|
||||
Main.expectInitFinished = true
|
||||
return $.event('4chanXInitFinished')
|
||||
return $.event('4chanXInitFinished', { board: g.BOARD, threads, posts })
|
||||
})
|
||||
|
||||
} else {
|
||||
Main.expectInitFinished = true
|
||||
return $.event('4chanXInitFinished')
|
||||
return $.event('4chanXInitFinished', { board: g.BOARD })
|
||||
}
|
||||
},
|
||||
|
||||
parseThreads(threadRoots, threads, posts, errors) {
|
||||
for (var threadRoot of threadRoots) {
|
||||
for (const threadRoot of threadRoots) {
|
||||
const boardObj = (() => {
|
||||
let boardID
|
||||
if (boardID = threadRoot.dataset.board) {
|
||||
@ -662,6 +676,7 @@ const Main = {
|
||||
}
|
||||
})
|
||||
},
|
||||
addCatalogThreadsObserver: null,
|
||||
|
||||
initCatalog() {
|
||||
let board
|
||||
@ -680,7 +695,7 @@ const Main = {
|
||||
}
|
||||
|
||||
Main.expectInitFinished = true
|
||||
return $.event('4chanXInitFinished')
|
||||
return $.event('4chanXInitFinished', { board: g.BOARD })
|
||||
},
|
||||
|
||||
parseCatalogThreads(threadRoots, threads, errors) {
|
||||
@ -762,7 +777,7 @@ const Main = {
|
||||
|
||||
// Detect conflicts with native extension
|
||||
if (g.SITE.testNativeExtension && !$.hasClass(doc, 'tainted')) {
|
||||
const { enabled } = g.SITE.testNativeExtension()
|
||||
const enabled = g.SITE.testNativeExtension()
|
||||
if (enabled) {
|
||||
$.addClass(doc, 'tainted')
|
||||
if (Conf['Disable Native Extension'] && !Main.isFirstRun) {
|
||||
@ -796,13 +811,13 @@ const Main = {
|
||||
)), ref
|
||||
})
|
||||
|
||||
var logs = $.el('div',
|
||||
const logs = $.el('div',
|
||||
{ hidden: true })
|
||||
for (error of errors) {
|
||||
$.add(logs, Main.parseError(error))
|
||||
$.add(logs, Main.parseError(error, Main.reportLink([error])))
|
||||
}
|
||||
|
||||
return new Notice('error', [div, logs], 30)
|
||||
return new Notice('error', [div, logs], 15)
|
||||
},
|
||||
|
||||
parseError(data, reportLink) {
|
||||
@ -869,7 +884,7 @@ User agent: ${navigator.userAgent}\
|
||||
},
|
||||
|
||||
mounted(cb) {
|
||||
if (Main.isMounted) {
|
||||
if (Main.mounted) {
|
||||
return cb()
|
||||
} else {
|
||||
return Main.mountedCBs.push(cb)
|
||||
|
||||
@ -4,15 +4,15 @@ import $ from "../platform/$"
|
||||
import $$ from "../platform/$$"
|
||||
import { dict } from "../platform/helpers"
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const SWTinyboard = {
|
||||
name: 'Tinyboard',
|
||||
isOPContainerThread: true,
|
||||
mayLackJSON: true,
|
||||
threadModTimeIgnoresSage: true,
|
||||
testNativeExtension() {
|
||||
return false
|
||||
},
|
||||
|
||||
disabledFeatures: [
|
||||
'Resurrect Quotes',
|
||||
@ -40,7 +40,7 @@ const SWTinyboard = {
|
||||
|
||||
detect() {
|
||||
for (const script of $$('script:not([src])', d.head)) {
|
||||
var m
|
||||
let m
|
||||
if (m = script.textContent.match(/\bvar configRoot=(".*?")/)) {
|
||||
const properties = dict()
|
||||
try {
|
||||
@ -50,13 +50,31 @@ const SWTinyboard = {
|
||||
} else if (/^https?:/.test(root)) {
|
||||
properties.root = root
|
||||
}
|
||||
} catch (error) { }
|
||||
} catch (error) { /* empty */ }
|
||||
return properties
|
||||
}
|
||||
}
|
||||
return false
|
||||
},
|
||||
|
||||
ID: 'sw-tinyboard',
|
||||
parseThreadMetadata(el: HTMLElement) {
|
||||
const thread = dict()
|
||||
const op = el.querySelector('.op')
|
||||
thread.id = op.id
|
||||
thread.threadID = op.id.match(/^thread_(\d+)$/)[1]
|
||||
thread.boardID = Conf.BOARD.boardID
|
||||
thread.siteID = Conf.BOARD.siteID
|
||||
thread.isArchived = !!el.closest('.archive')
|
||||
},
|
||||
isAuxiliaryPage(url) {
|
||||
return url.pathname === '/catalog.html'
|
||||
},
|
||||
isBoardlessPage(url) {
|
||||
return url.pathname === '/catalog.html'
|
||||
},
|
||||
initAuxiliary() {
|
||||
return Main.mounted(true)
|
||||
},
|
||||
awaitBoard(cb) {
|
||||
let reactUI
|
||||
if (reactUI = $.id('react-ui')) {
|
||||
@ -104,6 +122,11 @@ const SWTinyboard = {
|
||||
},
|
||||
|
||||
selectors: {
|
||||
boardFor: {
|
||||
index: '.page-container',
|
||||
catalog: '.page-container',
|
||||
thread: '.page-container'
|
||||
},
|
||||
board: 'form[name="postcontrols"]',
|
||||
thread: 'input[name="board"] ~ div[id^="thread_"]',
|
||||
threadDivider: 'div[id^="thread_"] > hr:last-child',
|
||||
@ -181,7 +204,7 @@ const SWTinyboard = {
|
||||
$\
|
||||
`),
|
||||
quotelinkHTML:
|
||||
/<a [^>]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g
|
||||
/<a [^>]*\bhref="[^"]*\/([^/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g
|
||||
},
|
||||
|
||||
Build: {
|
||||
@ -226,7 +249,7 @@ $\
|
||||
},
|
||||
|
||||
isFileURL(url) {
|
||||
return /\/src\/[^\/]+/.test(url.pathname)
|
||||
return /\/src\/[^/]+/.test(url.pathname)
|
||||
},
|
||||
|
||||
preParsingFixes(board) {
|
||||
@ -267,6 +290,12 @@ $\
|
||||
return undefined
|
||||
},
|
||||
|
||||
is404() {
|
||||
return !!$('#error')
|
||||
},
|
||||
isIncomplete() {
|
||||
return !!$('#incomplete')
|
||||
},
|
||||
parseFile(post, file) {
|
||||
let info, infoNode
|
||||
const { text, link, thumb } = file
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import Redirect from "../Archive/Redirect"
|
||||
import Callbacks from "../classes/Callbacks"
|
||||
import CSS from "../css/CSS"
|
||||
import BoardConfig from "../General/BoardConfig"
|
||||
import { Conf, d, doc,E, g } from "../globals/globals"
|
||||
import { Conf, d, doc, g } from "../globals/globals"
|
||||
import h, { hFragment, isEscaped } from "../globals/jsx"
|
||||
import ImageHost from "../Images/ImageHost"
|
||||
import PassMessage from "../Miscellaneous/PassMessage"
|
||||
@ -15,13 +16,7 @@ import generateCatalogThreadHtml from "./SW.yotsuba.Build/CatalogThreadHtml"
|
||||
import generateFileHtml from "./SW.yotsuba.Build/FileHtml"
|
||||
import generatePostInfoHtml from './SW.yotsuba.Build/PostInfoHtml'
|
||||
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS101: Remove unnecessary use of Array.from
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS205: Consider reworking code to avoid use of IIFEs
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
||||
*/
|
||||
|
||||
const SWYotsuba = {
|
||||
isOPContainerThread: false,
|
||||
hasIPCount: true,
|
||||
@ -177,17 +172,17 @@ $\
|
||||
},
|
||||
|
||||
initAuxiliary() {
|
||||
const pathname = location.pathname.split(/\/+/)
|
||||
switch (location.hostname) {
|
||||
case 'www.4chan.org': case 'www.4channel.org':
|
||||
if (SWYotsuba.regexp.pass.test(location.href)) {
|
||||
PassMessage.init()
|
||||
} else {
|
||||
$.onExists(doc, 'body', () => $.addStyle(CSS.www))
|
||||
$.onExists(doc, 'body', () => $.addStyle(CSS.www, 'www-css'))
|
||||
Captcha.replace.init()
|
||||
}
|
||||
return
|
||||
case 'sys.4chan.org': case 'sys.4channel.org':
|
||||
var pathname = location.pathname.split(/\/+/)
|
||||
if (pathname[2] === 'imgboard.php') {
|
||||
let match
|
||||
if (/\bmode=report\b/.test(location.search)) {
|
||||
@ -198,7 +193,7 @@ $\
|
||||
return Redirect.navigate('thread', {
|
||||
boardID: g.BOARD.ID,
|
||||
postID: +match[1]
|
||||
})
|
||||
}, {replace: true})
|
||||
}})
|
||||
}
|
||||
} else if (pathname[2] === 'post') {
|
||||
@ -231,18 +226,18 @@ $\
|
||||
return file.text.dataset.md5 = (file.MD5 = this.response.posts[0].md5)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}, Callbacks.call('parseThreadMetadata'))
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseNodes(post, nodes) {
|
||||
// Add CSS classes to sticky/closed icons on /f/ to match other boards.
|
||||
if (post.boardID === 'f') {
|
||||
return (() => {
|
||||
const result = []
|
||||
for (const type of ['Sticky', 'Closed']) {
|
||||
var icon
|
||||
let icon
|
||||
if (icon = $(`img[alt=${type}]`, nodes.info)) {
|
||||
result.push($.addClass(icon, `${type.toLowerCase()}Icon`, 'retina'))
|
||||
}
|
||||
@ -290,7 +285,7 @@ $\
|
||||
$.rm(node)
|
||||
}
|
||||
for (let i = 0; i < 2; i++) {
|
||||
var br
|
||||
let br
|
||||
if ((br = abbr.previousSibling) && (br.nodeName === 'BR')) { $.rm(br) }
|
||||
}
|
||||
return $.rm(abbr)
|
||||
@ -337,7 +332,7 @@ $\
|
||||
testNativeExtension() {
|
||||
return $.global(function() {
|
||||
if (window.Parser?.postMenuIcon) { return this.enabled = 'true' }
|
||||
})
|
||||
}, null)
|
||||
},
|
||||
|
||||
transformBoardList() {
|
||||
@ -347,6 +342,7 @@ $\
|
||||
const items = $.X('.//a|.//text()[not(ancestor::a)]', $(SWYotsuba.selectors.boardList))
|
||||
let i = 0
|
||||
while ((node = items.snapshotItem(i++))) {
|
||||
const a = node.cloneNode(true)
|
||||
switch (node.nodeName) {
|
||||
case '#text':
|
||||
for (const chr of node.nodeValue) {
|
||||
@ -358,7 +354,6 @@ $\
|
||||
}
|
||||
break
|
||||
case 'A':
|
||||
var a = node.cloneNode(true)
|
||||
nodes.push(a)
|
||||
break
|
||||
}
|
||||
@ -372,7 +367,7 @@ $\
|
||||
spoilerRange: Object.create(null),
|
||||
|
||||
shortFilename(filename) {
|
||||
const ext = filename.match(/\.?[^\.]*$/)[0]
|
||||
const ext = filename.match(/\.?[^.]*$/)[0]
|
||||
if ((filename.length - ext.length) > 30) {
|
||||
return `${filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]}(...)${ext}`
|
||||
} else {
|
||||
@ -423,22 +418,27 @@ $\
|
||||
isArchived: !!data.archived,
|
||||
// file status
|
||||
fileDeleted: !!data.filedeleted,
|
||||
filesDeleted: data.filedeleted ? [0] : []
|
||||
}
|
||||
o.info = {
|
||||
subject: $.unescape(data.sub),
|
||||
email: $.unescape(data.email),
|
||||
name: $.unescape(data.name) || '',
|
||||
tripcode: data.trip,
|
||||
pass: (data.since4pass != null) ? `${data.since4pass}` : undefined,
|
||||
uniqueID: data.id,
|
||||
flagCode: data.country,
|
||||
flagCodeTroll: data.board_flag,
|
||||
flag: $.unescape((data.country_name || data.flag_name)),
|
||||
dateUTC: data.time,
|
||||
dateText: data.now,
|
||||
// Yes, we use the raw string here
|
||||
commentHTML: { innerHTML: data.com || '', [isEscaped]: true }
|
||||
filesDeleted: data.filedeleted ? [0] : [],
|
||||
info: {
|
||||
subject: $.unescape(data.sub),
|
||||
email: $.unescape(data.email),
|
||||
name: $.unescape(data.name) || '',
|
||||
tripcode: data.trip,
|
||||
pass: (data.since4pass != null) ? `${data.since4pass}` : undefined,
|
||||
uniqueID: data.id,
|
||||
flagCode: data.country,
|
||||
flagCodeTroll: data.board_flag,
|
||||
flag: $.unescape((data.country_name || data.flag_name)),
|
||||
dateUTC: data.time,
|
||||
dateText: data.now,
|
||||
capcode: null,
|
||||
// Yes, we use the raw string here
|
||||
commentHTML: { innerHTML: data.com || '', [isEscaped]: true }},
|
||||
files: [],
|
||||
file: null,
|
||||
capcodeHighlight: !!data.capcode_highlight,
|
||||
extra: {}
|
||||
|
||||
}
|
||||
if (data.capcode) {
|
||||
o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase())
|
||||
@ -478,7 +478,8 @@ $\
|
||||
twidth: data.tn_w,
|
||||
isSpoiler: !!data.spoiler,
|
||||
tag: data.tag,
|
||||
hasDownscale: !!data.m_img
|
||||
hasDownscale: !!data.m_img,
|
||||
dimensions: null
|
||||
}
|
||||
if ((data.h != null) && !/\.pdf$/.test(o.url)) { o.dimensions = `${o.width}x${o.height}` }
|
||||
return o
|
||||
@ -585,7 +586,7 @@ $\
|
||||
quote.href = this.threadURL(boardID, threadID) + href
|
||||
}
|
||||
} else {
|
||||
var match
|
||||
let match
|
||||
if ((match = quote.href.match(SWYotsuba.regexp.quotelink)) && (this.sameThread(match[1], match[2]))) {
|
||||
quote.href = href.match(/(#[^#]*)?$/)[0] || '#'
|
||||
}
|
||||
|
||||
17
src/types/globals.d.ts
vendored
17
src/types/globals.d.ts
vendored
@ -1,2 +1,19 @@
|
||||
declare const cloneInto: Function
|
||||
declare const XPCNativeWrapper: any
|
||||
export interface File {
|
||||
isImage: boolean
|
||||
isVideo: boolean
|
||||
thumb: HTMLElement
|
||||
url: string
|
||||
dimensions: string
|
||||
index: number
|
||||
isExpanding: boolean
|
||||
isExpanded: boolean
|
||||
text: string,
|
||||
link: HTMLAnchorElement
|
||||
thumbLink: HTMLElement
|
||||
size: string
|
||||
sizeInBytes: number
|
||||
isDead: boolean
|
||||
docIndex: number
|
||||
}
|
||||
@ -26,7 +26,7 @@
|
||||
"outDir": "builds/test/crx/tsOutput",
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"/node_modules/*",
|
||||
"tools/*",
|
||||
"dist/*",
|
||||
"src/meta/*",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user