NOW MANAGED ON CODEBERG
Enhance changelog input to textarea with character counter
Shresth Kapoor3617ab154084
diff --git a/resources/js/components/page-editor.js b/resources/js/components/page-editor.jsindex 81378e944..2a155f37f 100644--- a/resources/js/components/page-editor.js+++ b/resources/js/components/page-editor.js@@ -75,7 +75,12 @@ export class PageEditor extends Component {// Changelog controlsconst updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false);- this.changelogInput.addEventListener('input', updateChangelogDebounced);+ this.changelogInput.addEventListener('input', () => {+ const count = this.changelogInput.value.length;+ const counterEl = document.getElementById('changelog-count');+ if (counterEl) counterEl.innerText = `${count} / 250`;+ updateChangelogDebounced();+ });// Draft ControlsonSelect(this.saveDraftButton, this.saveDraft.bind(this));diff --git a/resources/views/pages/parts/editor-toolbar.blade.php b/resources/views/pages/parts/editor-toolbar.blade.phpindex 341fbf67d..deddc3cd3 100644--- a/resources/views/pages/parts/editor-toolbar.blade.php+++ b/resources/views/pages/parts/editor-toolbar.blade.php@@ -106,11 +106,15 @@<ul refs="dropdown@menu" class="wide dropdown-menu"><li class="px-l py-m"><p class="text-muted pb-s">{{ trans('entities.pages_edit_enter_changelog_desc') }}</p>- <input refs="page-editor@changelogInput"- name="summary"- id="summary-input"- type="text"- placeholder="{{ trans('entities.pages_edit_enter_changelog') }}" />+ <textarea+ refs="page-editor@changelogInput"+ name="summary"+ id="summary-input"+ rows="2"+ maxlength="250"+ placeholder="{{ trans('entities.pages_edit_enter_changelog') }}"+ ></textarea>+ <small class="text-muted mt-xs" id="changelog-count">0 / 250</small></li></ul><span>{{-- Prevents button jumping on menu show --}}</span>