From fda2ed36bd01e22cc91ab7e84f87f0de9ae58ac8 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Mon, 25 May 2026 09:55:53 +0200 Subject: [PATCH] option to enable/disable item titles --- config_example.json | 1 + public/s/js/upload.js | 12 +++++++----- src/index.mjs | 1 + views/item-partial-legacy.html | 6 +++--- views/item-partial-modern.html | 6 +++--- views/snippets/header.html | 2 +- views/snippets/upload-form.html | 2 +- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/config_example.json b/config_example.json index cd6032b..4b1bb2f 100644 --- a/config_example.json +++ b/config_example.json @@ -112,6 +112,7 @@ "user_alternative_infobox": false, "enable_swf": false, "swf_thumb": "/s/img/swf.png", + "enable_item_title": true, "open_registration": true, "open_registration_web_toggle": false, "open_registration_require_mail_andor_token": false, diff --git a/public/s/js/upload.js b/public/s/js/upload.js index 220ae96..951a5ff 100644 --- a/public/s/js/upload.js +++ b/public/s/js/upload.js @@ -1013,11 +1013,13 @@ window.initUploadForm = (selector) => { `; - titleUI = ` -
- -
- `; + if (window.f0ckEnableItemTitle !== false) { + titleUI = ` +
+ +
+ `; + } const commentPlaceholder = window.f0ckI18n?.upload_comment_placeholder || 'AddComment...'; const maxLenHtml = (commentMaxLen !== null && !isNaN(commentMaxLen)) ? ` maxlength="${commentMaxLen}"` : ''; diff --git a/src/index.mjs b/src/index.mjs index 4dbd41d..f27d913 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -1133,6 +1133,7 @@ process.on('uncaughtException', err => { comment_max_length: cfg.main.comment_max_length ?? null, enable_swf: !!cfg.websrv.enable_swf, enable_danmaku: cfg.websrv.enable_danmaku !== false, + enable_item_title: cfg.websrv.enable_item_title !== false, enable_global_chat: !!cfg.websrv.enable_global_chat, embed_youtube_in_comments: cfg.websrv.embed_youtube_in_comments !== false, koepfe_json: JSON.stringify(cfg.websrv.koepfe || []), diff --git a/views/item-partial-legacy.html b/views/item-partial-legacy.html index c9b507e..389c734 100644 --- a/views/item-partial-legacy.html +++ b/views/item-partial-legacy.html @@ -9,7 +9,7 @@
{{ link.main }}{{ item.id }}{{ link.suffix }}
- @if(item.title) + @if(enable_item_title && item.title)
{!! item.title !!}
@endif @@ -201,7 +201,7 @@