diff --git a/public/s/js/upload.js b/public/s/js/upload.js index 0323cd1..de8d5bf 100644 --- a/public/s/js/upload.js +++ b/public/s/js/upload.js @@ -70,6 +70,8 @@ window.initUploadForm = (selector) => { // Dynamically get min tags requirement from DOM const minTags = parseInt(form.getAttribute('data-min-tags') || '3'); + const commentMaxLenAttr = form.getAttribute('data-comment-max-length'); + const commentMaxLen = (commentMaxLenAttr && commentMaxLenAttr !== 'null') ? parseInt(commentMaxLenAttr) : null; const isShitpost = form.classList.contains('shitpost-mode-active') || !!window.f0ckShitpostMode; let tags = []; @@ -870,9 +872,10 @@ window.initUploadForm = (selector) => { const commentPlaceholder = window.f0ckI18n?.upload_comment_placeholder || 'Comment (optional)...'; + const maxLenHtml = (commentMaxLen !== null && !isNaN(commentMaxLen)) ? ` maxlength="${commentMaxLen}"` : ''; commentUI = `