Correction for edit tools

This commit is contained in:
2026-07-23 04:33:21 +02:00
committed by kitoy
parent fb9388a0de
commit 2da8aad1a9
2 changed files with 39 additions and 7 deletions

View File

@@ -7,7 +7,6 @@
<!-- Initialize Quill editor -->
<script>
var toolbarOptions = [
@@ -30,12 +29,41 @@
['clean'] // remove formatting button
];
var quill = new Quill('#editor', {
modules: {
var quill = new Quill('#editor', {
theme: 'snow',
modules: {
syntax: true, // Include syntax module
toolbar: toolbarOptions // Include button in toolbar
toolbar: toolbarOptions, // Include button in toolbar
resize: {
// embed tags to capture resize
embedTags: ["VIDEO", "IFRAME"],
// custom toolbar
tools: [
"left",
"center",
"right",
"full",
"edit",
{
text: "Alt",
attrs: {
title: "Set image alt",
class: "btn-alt",
},
verify(activeEle) {
return activeEle && activeEle.tagName === "IMG";
},
handler(evt, button, activeEle) {
let alt = activeEle.alt || "";
alt = window.prompt("Description de l'image", alt);
if (alt == null) return;
activeEle.setAttribute("alt", alt);
},
},
],
}
},
theme: 'snow'
});
</script>