Correction for edit tools
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user