not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
1.1 KiB

var BaseImageFormat = Quill.import('formats/image');
const ImageFormatAttributesList = [
'alt',
'height',
'width',
'style'
];
class ImageFormat extends BaseImageFormat {
static formats(domNode) {
return ImageFormatAttributesList.reduce(function(formats, attribute) {
if (domNode.hasAttribute(attribute)) {
formats[attribute] = domNode.getAttribute(attribute);
}
return formats;
}, {});
}
format(name, value) {
if (ImageFormatAttributesList.indexOf(name) > -1) {
if (value) {
this.domNode.setAttribute(name, value);
} else {
this.domNode.removeAttribute(name);
}
} else {
super.format(name, value);
}
}
}
Quill.register(ImageFormat, true);
// Register font families
var Font = Quill.import('formats/font');
Font.whitelist = ['comic', 'arial','Verdana'];
Quill.register(Font, true);
// Register Font sizes
var fontSizeStyle = Quill.import('attributors/style/size');
fontSizeStyle.whitelist = ['16px','24px', '32px' ,'40px', '48px' , '56px', '64px' , '72px' , '80px' , '100px'];
Quill.register(fontSizeStyle, true);