A plugin for the Summernote WYSIWYG editor.
Adds a button to the image popover to edit title, alt, caption and resize along with managing of Aspect Ratio.
Include the following code after Summernote:
<script src="summernote-image-attributes.js"></script>
<script src="lang/[language-COUNTRY].js"></script>
If you are using npm, run this command
npm i summernote-image-attributes-editor --save
Currently available in:
- English
Contributions are welcomed!
Finally, customize the Summernote image popover.
$(document).ready(function() {
$('#summernote').summernote({
imageAttributes: {
icon: '<i class="note-icon-pencil"/>',
figureClass: 'figureClass',
figcaptionClass: 'captionClass',
captionText: 'Caption Goes Here.',
manageAspectRatio: true // true = Lock the Image Width/Height, Default to true
},
lang: 'en-US',
popover: {
image: [
['image', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],,
['float', ['floatLeft', 'floatRight', 'floatNone']],
['remove', ['removeMedia']],
['custom', ['imageAttributes']],
],
},
});
});
(Thanks to @asiffermann) (Thanks to @DiemenDesign)