From 41e4bb8fae03e27df0e6a3625676afa308dddf16 Mon Sep 17 00:00:00 2001 From: schrumpel <Ă‚git@f0ck.it> Date: Thu, 27 Oct 2022 17:58:30 +0200 Subject: [PATCH 1/4] css changes --- public/s/css/f0ck.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/s/css/f0ck.css b/public/s/css/f0ck.css index c9f7565..e65faed 100644 --- a/public/s/css/f0ck.css +++ b/public/s/css/f0ck.css @@ -2780,10 +2780,11 @@ ul.navbar-nav-guests li.nav-item { .random { width: 100%; - height: 100%; + height: 100px; transition: .5s ease-out; display: block; - } + } + .random a { width: 100%; @@ -2797,4 +2798,4 @@ ul.navbar-nav-guests li.nav-item { .random:active { background: #00000036; } -} +} \ No newline at end of file From ca516ded7c09889c7a828ab24eab1c56b8681597 Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 19 Dec 2022 01:08:50 +0000 Subject: [PATCH 2/4] revert cb0a5f7ee8502d4502c20a14359f654c2ea4bce3 revert scroll content instead of body --- public/s/css/f0ck.css | 11 ++++------- views/item.html | 3 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/s/css/f0ck.css b/public/s/css/f0ck.css index 4dda1fb..e65faed 100644 --- a/public/s/css/f0ck.css +++ b/public/s/css/f0ck.css @@ -1136,9 +1136,9 @@ body { line-height: 2; scrollbar-color: var(--scrollbar-color) transparent; scrollbar-width: thin; + overscroll-behavior-y: contain; + overflow: unset; font-size: 14px; - overflow: hidden; - height: 100%; } .wrapper { @@ -1247,6 +1247,8 @@ div.posts>a:hover::after { } .navbar { + position: sticky; + top: 0; padding: 0; width: 100%; z-index: 3; @@ -2796,9 +2798,4 @@ ul.navbar-nav-guests li.nav-item { .random:active { background: #00000036; } -} - -#main { - overflow: auto; - height: calc(100%); } \ No newline at end of file diff --git a/views/item.html b/views/item.html index 13b4c8b..78869f3 100644 --- a/views/item.html +++ b/views/item.html @@ -97,6 +97,9 @@ @endif +
+ +
@include(snippets/footer) \ No newline at end of file From 2186fc85d4f60e3397b615fb0e934d6c5689bd98 Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 3 Apr 2023 05:00:59 +0200 Subject: [PATCH 3/4] update modules --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 18 +++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index f9db9a5..5a0adf8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,24 @@ { "name": "f0ckv2", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "f0ckv2", - "version": "2.2.0", + "version": "2.2.1", "license": "MIT", "dependencies": { - "cuffeo": "^1.1.0", + "cuffeo": "^1.2.1", "flumm-fetch": "^1.0.1", "flummpress": "^2.0.5", - "postgres": "^3.0.1" + "postgres": "^3.3.4" } }, "node_modules/cuffeo": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.1.0.tgz", - "integrity": "sha512-7lmx2dvREqCYwy8oUzk3Q0EkyLZkKQTYTBLEjNqKVbinzdEL45Oimi54lmBDFPlrrvTLzQkFvzKmiJ7Zcegi2w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.2.1.tgz", + "integrity": "sha512-nQMrXj7xR4RWO6nS8Un4uFuiVSIzVOgvShEeJvWyEHnW38X9g+BicrY8Lc/lqcw6mmtsED6KuuOs9KHD3Y6oIA==", "dependencies": { "flumm-fetch": "^1.0.1" } @@ -34,9 +34,9 @@ "integrity": "sha512-C/8Im6OvoZw67q9DvYIXKjKr28zHYLJdH4DucQ6zpVbN1eWPySmxkJTURbkq3uEwABXLngXLifS6mjxAC++umQ==" }, "node_modules/postgres": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.1.0.tgz", - "integrity": "sha512-yQbJtA7z6SsQuFiF01rmHlkG2gU5IEv9D/Pn2fu8Tz6x3/suNWZs4fIPd59rkL+dfVfhDqYQ7DU3YnUqzEDB5Q==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.3.4.tgz", + "integrity": "sha512-XVu0+d/Y56pl2lSaf0c7V19AhAEfpVrhID1IENWN8nf0xch6hFq6dAov5dtUX6ZD46wfr1TxvLhxLtV8WnNsOg==", "funding": { "type": "individual", "url": "https://github.com/sponsors/porsager" @@ -45,9 +45,9 @@ }, "dependencies": { "cuffeo": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.1.0.tgz", - "integrity": "sha512-7lmx2dvREqCYwy8oUzk3Q0EkyLZkKQTYTBLEjNqKVbinzdEL45Oimi54lmBDFPlrrvTLzQkFvzKmiJ7Zcegi2w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.2.1.tgz", + "integrity": "sha512-nQMrXj7xR4RWO6nS8Un4uFuiVSIzVOgvShEeJvWyEHnW38X9g+BicrY8Lc/lqcw6mmtsED6KuuOs9KHD3Y6oIA==", "requires": { "flumm-fetch": "^1.0.1" } @@ -63,9 +63,9 @@ "integrity": "sha512-C/8Im6OvoZw67q9DvYIXKjKr28zHYLJdH4DucQ6zpVbN1eWPySmxkJTURbkq3uEwABXLngXLifS6mjxAC++umQ==" }, "postgres": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.1.0.tgz", - "integrity": "sha512-yQbJtA7z6SsQuFiF01rmHlkG2gU5IEv9D/Pn2fu8Tz6x3/suNWZs4fIPd59rkL+dfVfhDqYQ7DU3YnUqzEDB5Q==" + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.3.4.tgz", + "integrity": "sha512-XVu0+d/Y56pl2lSaf0c7V19AhAEfpVrhID1IENWN8nf0xch6hFq6dAov5dtUX6ZD46wfr1TxvLhxLtV8WnNsOg==" } } } diff --git a/package.json b/package.json index fff5ec4..1b036aa 100644 --- a/package.json +++ b/package.json @@ -4,20 +4,20 @@ "description": "f0ck, kennste?", "main": "index.mjs", "scripts": { - "start": "node --experimental-json-modules src/index.mjs", - "trigger": "node --experimental-json-modules debug/trigger.mjs", - "autotagger": "node --experimental-json-modules debug/autotagger.mjs", - "thumbnailer": "node --experimental-json-modules debug/thumbnailer.mjs", - "test": "node --experimental-json-modules debug/test.mjs", - "clean": "node --experimental-json-modules debug/clean.mjs", - "adduser": "node --experimental-json-modules debug/adduser.mjs" + "start": "node --trace-uncaught src/index.mjs", + "trigger": "node debug/trigger.mjs", + "autotagger": "node debug/autotagger.mjs", + "thumbnailer": "node debug/thumbnailer.mjs", + "test": "node debug/test.mjs", + "clean": "node debug/clean.mjs", + "adduser": "node debug/adduser.mjs" }, "author": "Flummi", "license": "MIT", "dependencies": { - "cuffeo": "^1.1.0", + "cuffeo": "^1.2.1", "flumm-fetch": "^1.0.1", "flummpress": "^2.0.5", - "postgres": "^3.0.1" + "postgres": "^3.3.4" } } From e16197f8e44db1259f4bda3d3d740218510fd4e4 Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 3 Apr 2023 05:01:50 +0200 Subject: [PATCH 4/4] random(?) --- src/inc/trigger/f0ckrand.mjs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/inc/trigger/f0ckrand.mjs b/src/inc/trigger/f0ckrand.mjs index ca337cc..c695e95 100644 --- a/src/inc/trigger/f0ckrand.mjs +++ b/src/inc/trigger/f0ckrand.mjs @@ -10,6 +10,7 @@ export default async bot => { active: false, f: async e => { let args = e.args.slice(1); + /*let rows = sql("items").select("id", "username", "mime", "size"); for(let i = 0; i < args.length; i++) { @@ -21,6 +22,26 @@ export default async bot => { rows = await rows.orderByRaw("random()").limit(1);*/ + const rows = await db` + select id, mime, username, size + from "items" + where + ${ args.map(a => a.charAt(0) === "!" + ? db`username not ilike ${a.slice(1)}` + : db`username ilike ${a}` + ).join(' and ')} + order by random() + `; + + console.log(`select id, mime, username, size + from "items" + where + ${ args.map(a => a.charAt(0) === "!" + ? `username not ilike ${a.slice(1)}` + : `username ilike ${a}` + ).join(' and ')} + order by random()`); + if(rows.length === 0) return e.reply("nothing found, f0cker");