Spaces:
Sleeping
Sleeping
Update templates/home.html
Browse files- templates/home.html +27 -5
templates/home.html
CHANGED
|
@@ -302,6 +302,14 @@
|
|
| 302 |
#description-editor-container .ql-snow .ql-fill {
|
| 303 |
fill: rgba(255, 255, 255, 0.7);
|
| 304 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
.modal-buttons {
|
| 306 |
display: flex;
|
| 307 |
gap: 0.75rem;
|
|
@@ -572,6 +580,7 @@
|
|
| 572 |
<label class="form-label" for="description">Description</label>
|
| 573 |
<textarea id="description" class="form-textarea" placeholder="Enter payment description" required></textarea>
|
| 574 |
<div id="description-editor-container"></div>
|
|
|
|
| 575 |
</div>
|
| 576 |
|
| 577 |
<div class="form-group">
|
|
@@ -698,11 +707,7 @@
|
|
| 698 |
modules: {
|
| 699 |
toolbar: [
|
| 700 |
[{ 'header': [1, 2, 3, false] }],
|
| 701 |
-
['bold', 'italic', 'underline'
|
| 702 |
-
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
|
| 703 |
-
['blockquote', 'code-block'],
|
| 704 |
-
['link', 'image'],
|
| 705 |
-
['clean']
|
| 706 |
]
|
| 707 |
}
|
| 708 |
});
|
|
@@ -712,6 +717,19 @@
|
|
| 712 |
quillContainer.style.backgroundColor = 'rgba(255, 255, 255, 0.05)';
|
| 713 |
quillContainer.style.borderColor = 'rgba(255, 255, 255, 0.1)';
|
| 714 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 715 |
}
|
| 716 |
|
| 717 |
function getQuillMarkdown() {
|
|
@@ -826,6 +844,10 @@
|
|
| 826 |
container.innerHTML = '';
|
| 827 |
descriptionEditor = null;
|
| 828 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 829 |
const textarea = document.getElementById('description');
|
| 830 |
textarea.value = '';
|
| 831 |
textarea.style.display = 'block';
|
|
|
|
| 302 |
#description-editor-container .ql-snow .ql-fill {
|
| 303 |
fill: rgba(255, 255, 255, 0.7);
|
| 304 |
}
|
| 305 |
+
|
| 306 |
+
.word-counter {
|
| 307 |
+
margin-top: 0.25rem;
|
| 308 |
+
font-size: 0.75rem;
|
| 309 |
+
color: rgba(255, 255, 255, 0.6);
|
| 310 |
+
text-align: right;
|
| 311 |
+
font-weight: 400;
|
| 312 |
+
}
|
| 313 |
.modal-buttons {
|
| 314 |
display: flex;
|
| 315 |
gap: 0.75rem;
|
|
|
|
| 580 |
<label class="form-label" for="description">Description</label>
|
| 581 |
<textarea id="description" class="form-textarea" placeholder="Enter payment description" required></textarea>
|
| 582 |
<div id="description-editor-container"></div>
|
| 583 |
+
<div id="word-counter" class="word-counter">0 words</div>
|
| 584 |
</div>
|
| 585 |
|
| 586 |
<div class="form-group">
|
|
|
|
| 707 |
modules: {
|
| 708 |
toolbar: [
|
| 709 |
[{ 'header': [1, 2, 3, false] }],
|
| 710 |
+
['bold', 'italic', 'underline']
|
|
|
|
|
|
|
|
|
|
|
|
|
| 711 |
]
|
| 712 |
}
|
| 713 |
});
|
|
|
|
| 717 |
quillContainer.style.backgroundColor = 'rgba(255, 255, 255, 0.05)';
|
| 718 |
quillContainer.style.borderColor = 'rgba(255, 255, 255, 0.1)';
|
| 719 |
}
|
| 720 |
+
|
| 721 |
+
function updateWordCount() {
|
| 722 |
+
if (!descriptionEditor) return;
|
| 723 |
+
const text = descriptionEditor.getText();
|
| 724 |
+
const words = text.trim() === '' ? 0 : text.trim().split(/\s+/).length;
|
| 725 |
+
const counter = document.getElementById('word-counter');
|
| 726 |
+
if (counter) {
|
| 727 |
+
counter.textContent = words + ' word' + (words !== 1 ? 's' : '');
|
| 728 |
+
}
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
descriptionEditor.on('text-change', updateWordCount);
|
| 732 |
+
updateWordCount();
|
| 733 |
}
|
| 734 |
|
| 735 |
function getQuillMarkdown() {
|
|
|
|
| 844 |
container.innerHTML = '';
|
| 845 |
descriptionEditor = null;
|
| 846 |
}
|
| 847 |
+
const counter = document.getElementById('word-counter');
|
| 848 |
+
if (counter) {
|
| 849 |
+
counter.textContent = '0 words';
|
| 850 |
+
}
|
| 851 |
const textarea = document.getElementById('description');
|
| 852 |
textarea.value = '';
|
| 853 |
textarea.style.display = 'block';
|