From 3ccd125338ab913edc6a9f731087e1bbcd6375df Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sun, 3 Jan 2021 10:36:58 +0000 Subject: [PATCH 1/5] dont show file input when all file type boxes are unchecked, closes #304 --- views/includes/postform.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/includes/postform.pug b/views/includes/postform.pug index a8f64be8..338a570d 100644 --- a/views/includes/postform.pug +++ b/views/includes/postform.pug @@ -39,7 +39,7 @@ section.form-wrapper.flex-center - const minLength = (isThread ? board.settings.minReplyMessageLength : board.settings.minThreadMessageLength) || 0; - const maxLength = Math.min((isThread ? board.settings.maxReplyMessageLength : board.settings.maxThreadMessageLength), globalLimits.fieldLength.message) || globalLimits.fieldLength.message; textarea#message(name='message', rows='5', autocomplete='off' minlength=minLength maxlength=maxLength required=messageRequired) - if board.settings.maxFiles > 0 + if board.settings.maxFiles > 0 && Object.values(board.settings.allowedFileTypes).some(x => x === true) - const maxFiles = board.settings.maxFiles; section.row .label From bb0ff6216eb6f5cb0d47d49d74718d57a5878599 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Tue, 12 Jan 2021 13:55:14 +0000 Subject: [PATCH 2/5] special case for 0 timestampt video tthumbnails, solve issue for some audio files reference #308 --- helpers/files/videothumbnail.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/helpers/files/videothumbnail.js b/helpers/files/videothumbnail.js index ff839e3d..2e5601b9 100644 --- a/helpers/files/videothumbnail.js +++ b/helpers/files/videothumbnail.js @@ -3,23 +3,34 @@ const ffmpeg = require('fluent-ffmpeg') , uploadDirectory = require(__dirname+'/uploadDirectory.js'); module.exports = (file, geometry, timestamp) => { - return new Promise((resolve, reject) => { - ffmpeg(`${uploadDirectory}/file/${file.filename}`) + const command = ffmpeg(`${uploadDirectory}/file/${file.filename}`) .on('end', () => { return resolve(); }) .on('error', function(err, stdout, stderr) { return reject(err); }) - .screenshots({ - timestamps: [timestamp], - count: 1, - filename: `thumb-${file.hash}${file.thumbextension}`, - folder: `${uploadDirectory}/file/`, - size: geometry.width > geometry.height ? `${thumbSize}x?` : `?x${thumbSize}` - //keep aspect ratio, but also making sure taller/wider thumbs dont exceed thumbSize in either dimension - }); + if (timestamp === 0) { + //bypass issue with some dumb files like audio album art covert not working with .screenshots + command.inputOptions([ + '-t', + 0 + ]) + .outputOptions([ + `-vf scale=${geometry.width > geometry.height ? thumbSize + ':-2' : '-2:' + thumbSize}` + ]) + .output(`${uploadDirectory}/file/thumb-${file.hash}${file.thumbextension}`) + .run(); + } else { + command.screenshots({ + timestamps: [timestamp], + count: 1, + filename: `thumb-${file.hash}${file.thumbextension}`, + folder: `${uploadDirectory}/file/`, + size: geometry.width > geometry.height ? `${thumbSize}x?` : `?x${thumbSize}` + //keep aspect ratio, but also making sure taller/wider thumbs dont exceed thumbSize in either dimension + }); + } }); - }; From eb4fb5d9ed3d768f77c2e5c6c441b31b9b4fefda Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Tue, 12 Jan 2021 14:00:05 +0000 Subject: [PATCH 3/5] add theme --- gulp/res/css/themes/tempus-cozette.css | 71 ++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 gulp/res/css/themes/tempus-cozette.css diff --git a/gulp/res/css/themes/tempus-cozette.css b/gulp/res/css/themes/tempus-cozette.css new file mode 100644 index 00000000..7b25aef8 --- /dev/null +++ b/gulp/res/css/themes/tempus-cozette.css @@ -0,0 +1,71 @@ +:root { + --icon-color: invert(17%) sepia(89%) saturate(7057%) hue-rotate(2deg) brightness(93%) contrast(120%); + --alt-label-color: #260E22; + --alt-font-color: #c5c8c6; + --background-top: #260E22; + --background-rest: #090A18; + --navbar-color: #260E22; + --post-color: #260E22; + --post-outline-color: #090A18; + --label-color: #260E22; + --box-border-color: #111; + --darken: #00000050; + --highlighted-post-color: #54264C; + --highlighted-post-outline-color: #111; + --board-title: #c5c8c6; + --hr: #282a2e; + --font-color: #c5c8c6; + --name-color: #c5c8c6; + --capcode-color: #f00; + --subject-color: #b294bb; + --link-color: #c5c8c6; + --post-link-color: #5f89ac; + --link-hover: #81a2be; + --input-borders: #111; + --input-color: #c5c8c6; + --input-background: #090A18; + --dice-color: darkorange; + --title-color: #d70000; + --greentext-color: green; + --pinktext-color: #E0727F; +} +#float .post-container, div#livetext, div#threadstats, .catalog-tile, +nav.pages, div.pages, .post-container:not(.op), nav.stickynav, +summary.toggle-summary, table, div.catalog-tile, div.highlighted, +div.hoverhighlighted, a.toggle-summary, .board-banner { + border-width: 1px; + border-radius: 2px; +} +input[type], textarea, .label, .rlabel, button, select:not(.postmenu), +.close, #settingsmodal, .postform-style, img, .spoiler, .code, .mono, +.detected, #postform { + border-radius: 2px; +} +table { + box-shadow: 0 0 3px #00000040; +} +.post-container.op { + border-width: 1px; +} +.post-check { + opacity: 0; + margin-right: -1em; + transition: opacity 100ms, margin-right 100ms; +} +.post-check:hover { + opacity: 1; + margin-right: unset; +} +.post-file-info { + overflow-wrap: anywhere; +} +.spoiler { + padding: 0 1px +} +.wrapbar + hr:first-of-type { + margin: 1px 0 0 0; +} +body, small, .post-file-info, .quote, input, textarea { + font-family: monospace!important; + font-size: 9pt!important; +} From 6b1ae04c0affa2e3f2459cbf2c1eb98983172f4b Mon Sep 17 00:00:00 2001 From: SturgeonFish <17040-SturgeonFish@users.noreply.gitgud.io> Date: Tue, 12 Jan 2021 20:16:10 -0800 Subject: [PATCH 4/5] Update style.css --- gulp/res/css/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/gulp/res/css/style.css b/gulp/res/css/style.css index 30804390..721f8b79 100644 --- a/gulp/res/css/style.css +++ b/gulp/res/css/style.css @@ -504,6 +504,7 @@ td, th { padding: 5px; /*word-break: break-all;*/ overflow-wrap: anywhere; + width: 15%; /*Fixes log tables when large actions are taken*/ } td pre { From c9582b5281e0a8cd2210114b343b3e90cbbf632f Mon Sep 17 00:00:00 2001 From: SturgeonFish <17040-SturgeonFish@users.noreply.gitgud.io> Date: Tue, 12 Jan 2021 20:30:19 -0800 Subject: [PATCH 5/5] Update style.css to fix log table column width --- gulp/res/css/style.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gulp/res/css/style.css b/gulp/res/css/style.css index 721f8b79..2ccdb85c 100644 --- a/gulp/res/css/style.css +++ b/gulp/res/css/style.css @@ -500,11 +500,14 @@ th { color: var(--alt-font-color, --font-color) } +.fw td, .fw th { + width: 15%; /*Fixes log tables when large actions are taken*/ +} + td, th { padding: 5px; /*word-break: break-all;*/ overflow-wrap: anywhere; - width: 15%; /*Fixes log tables when large actions are taken*/ } td pre {