feat: add search and replace to tinymce editor (#585)

This commit is contained in:
Adeyemi Adetunji
2025-10-28 11:59:21 +01:00
committed by GitHub
parent 3692046077
commit b9b19d8a2e
12 changed files with 26 additions and 13 deletions
@@ -83,6 +83,7 @@
isSaving = false; isSaving = false;
if (error) { if (error) {
console.error('Error adding comment:', error); console.error('Error adding comment:', error);
snackbar.error($t('course.navItem.lessons.comments.comment_error'));
return; return;
} }
@@ -352,7 +353,7 @@
/> />
</div> </div>
{:else} {:else}
<article class="prose sm:prose-sm max-w-[300px] dark:text-white"> <article class="prose max-w-[300px] sm:prose-sm dark:text-white">
{commentItem.comment} {commentItem.comment}
</article> </article>
{/if} {/if}
@@ -26,7 +26,7 @@
// editor configuration // editor configuration
let conf = { let conf = {
plugins: 'lists, link, emoticons, code, media, eqneditor', plugins: 'lists, link, emoticons, code, media, searchreplace, eqneditor',
toolbar: [ toolbar: [
{ name: 'history', items: ['undo', 'redo'] }, { name: 'history', items: ['undo', 'redo'] },
{ name: 'styles', items: ['styles'] }, { name: 'styles', items: ['styles'] },
@@ -38,6 +38,7 @@
{ name: 'insert', items: ['emoticons'] }, { name: 'insert', items: ['emoticons'] },
{ name: 'code', items: ['code'] }, { name: 'code', items: ['code'] },
{ name: 'media', items: ['media'] }, { name: 'media', items: ['media'] },
{ name: 'search', items: ['searchreplace'] },
{ name: 'eqneditor', items: ['eqneditor'] } { name: 'eqneditor', items: ['eqneditor'] }
], ],
lists_indent_on_tab: false, lists_indent_on_tab: false,
@@ -761,7 +761,8 @@
"placeholder": "Hvad synes du om denne lektion?", "placeholder": "Hvad synes du om denne lektion?",
"comment_btn": "Kommentar", "comment_btn": "Kommentar",
"cancel_btn": "Ophæve", "cancel_btn": "Ophæve",
"load_more_btn": "Indlæs mere" "load_more_btn": "Indlæs mere",
"comment_error": "Kunne ikke skrive kommentar. Prøv venligst igen."
}, },
"exercises": { "exercises": {
"heading": "Alle øvelser", "heading": "Alle øvelser",
@@ -1380,7 +1381,8 @@
"title_highlight": "Titelhøjlight", "title_highlight": "Titelhøjlight",
"subtitle": "Undertekst", "subtitle": "Undertekst",
"phone_number": "Telefonnummer", "phone_number": "Telefonnummer",
"email": "E -mail" "email": "E -mail",
"address": "Adresse"
}, },
"faq": { "faq": {
"heading": "Ofte stillede spørgsmål", "heading": "Ofte stillede spørgsmål",
@@ -584,7 +584,8 @@
"text_area_title": "Hinterlassen Sie einen Kommentar", "text_area_title": "Hinterlassen Sie einen Kommentar",
"comment_btn": "Kommentar", "comment_btn": "Kommentar",
"load_more_btn": "Mehr laden", "load_more_btn": "Mehr laden",
"cancel_btn": "Stornieren" "cancel_btn": "Stornieren",
"comment_error": "Kommentar konnte nicht gepostet werden. Bitte versuchen Sie es erneut."
}, },
"exercises": { "exercises": {
"heading": "Alle Übungen", "heading": "Alle Übungen",
@@ -858,7 +858,8 @@
"placeholder": "What do you think about this lesson?", "placeholder": "What do you think about this lesson?",
"comment_btn": "Comment", "comment_btn": "Comment",
"cancel_btn": "Cancel", "cancel_btn": "Cancel",
"load_more_btn": "Load more" "load_more_btn": "Load more",
"comment_error": "Failed to post comment. Please try again."
}, },
"polls": { "polls": {
@@ -584,7 +584,8 @@
"text_area_title": "Deja un comentario", "text_area_title": "Deja un comentario",
"comment_btn": "Comentario", "comment_btn": "Comentario",
"load_more_btn": "Cargar más", "load_more_btn": "Cargar más",
"cancel_btn": "Cancelar" "cancel_btn": "Cancelar",
"comment_error": "No se pudo publicar el comentario. Por favor inténtalo de nuevo."
}, },
"exercises": { "exercises": {
"heading": "Todos los ejercicios", "heading": "Todos los ejercicios",
@@ -584,7 +584,8 @@
"text_area_title": "Laisser un commentaire", "text_area_title": "Laisser un commentaire",
"comment_btn": "Commentaire", "comment_btn": "Commentaire",
"load_more_btn": "Charger plus", "load_more_btn": "Charger plus",
"cancel_btn": "Annuler" "cancel_btn": "Annuler",
"comment_error": "Échec de la publication du commentaire. Veuillez réessayer."
}, },
"exercises": { "exercises": {
"heading": "Tous les exercices", "heading": "Tous les exercices",
@@ -584,7 +584,8 @@
"text_area_title": "एक टिप्पणी छोड़ें", "text_area_title": "एक टिप्पणी छोड़ें",
"comment_btn": "टिप्पणी", "comment_btn": "टिप्पणी",
"load_more_btn": "और लोड करें", "load_more_btn": "और लोड करें",
"cancel_btn": "रद्द करना" "cancel_btn": "रद्द करना",
"comment_error": "टिप्पणी पोस्ट करने में विफल. कृपया पुन: प्रयास करें।"
}, },
"exercises": { "exercises": {
"heading": "सभी व्यायाम", "heading": "सभी व्यायाम",
@@ -753,7 +753,8 @@
"placeholder": "Co sądzisz o tej lekcji?", "placeholder": "Co sądzisz o tej lekcji?",
"comment_btn": "Komentarz", "comment_btn": "Komentarz",
"cancel_btn": "Anulować", "cancel_btn": "Anulować",
"load_more_btn": "Załaduj więcej" "load_more_btn": "Załaduj więcej",
"comment_error": "Nie udało się opublikować komentarza. Spróbuj ponownie."
}, },
"exercises": { "exercises": {
"heading": "Wszystkie ćwiczenia", "heading": "Wszystkie ćwiczenia",
@@ -584,7 +584,8 @@
"text_area_title": "Deixe um comentário", "text_area_title": "Deixe um comentário",
"comment_btn": "Comentário", "comment_btn": "Comentário",
"load_more_btn": "Carregar mais", "load_more_btn": "Carregar mais",
"cancel_btn": "Cancelar" "cancel_btn": "Cancelar",
"comment_error": "Falha ao postar comentário. Por favor, tente novamente."
}, },
"exercises": { "exercises": {
"heading": "Todos os exercícios", "heading": "Todos os exercícios",
@@ -584,7 +584,8 @@
"text_area_title": "Оставить комментарий", "text_area_title": "Оставить комментарий",
"comment_btn": "Комментарий", "comment_btn": "Комментарий",
"load_more_btn": "Загрузить больше", "load_more_btn": "Загрузить больше",
"cancel_btn": "Отмена" "cancel_btn": "Отмена",
"comment_error": "Не удалось опубликовать комментарий. Пожалуйста, попробуйте еще раз."
}, },
"exercises": { "exercises": {
"heading": "Все упражнения", "heading": "Все упражнения",
@@ -584,7 +584,8 @@
"text_area_title": "Để lại một bình luận", "text_area_title": "Để lại một bình luận",
"comment_btn": "Bình luận", "comment_btn": "Bình luận",
"load_more_btn": "Tải thêm", "load_more_btn": "Tải thêm",
"cancel_btn": "Hủy bỏ" "cancel_btn": "Hủy bỏ",
"comment_error": "Không thể gửi bình luận. Vui lòng thử lại."
}, },
"exercises": { "exercises": {
"heading": "Tất cả các bài tập", "heading": "Tất cả các bài tập",