Allows Editor to work off line. Allows images to be resized.
This commit is contained in:
@ -129,20 +129,23 @@ window.interop = {
|
||||
}
|
||||
},
|
||||
createQuill: function (
|
||||
editorElement, toolBar, readOnly,
|
||||
quillElement, toolBar, readOnly,
|
||||
placeholder, theme, debugLevel) {
|
||||
|
||||
Quill.register('modules/blotFormatter', QuillBlotFormatter.default);
|
||||
|
||||
var options = {
|
||||
debug: debugLevel,
|
||||
modules: {
|
||||
toolbar: toolBar
|
||||
toolbar: toolBar,
|
||||
blotFormatter: {}
|
||||
},
|
||||
placeholder: placeholder,
|
||||
readOnly: readOnly,
|
||||
theme: theme
|
||||
};
|
||||
|
||||
new Quill(editorElement, options);
|
||||
new Quill(quillElement, options);
|
||||
},
|
||||
getQuillContent: function (editorElement) {
|
||||
return JSON.stringify(editorElement.__quill.getContents());
|
||||
@ -158,5 +161,19 @@ window.interop = {
|
||||
},
|
||||
enableQuillEditor: function (editorElement, mode) {
|
||||
editorElement.__quill.enable(mode);
|
||||
},
|
||||
insertQuillImage: function (quillElement, imageURL) {
|
||||
var Delta = Quill.import('delta');
|
||||
editorIndex = 0;
|
||||
|
||||
if (quillElement.__quill.getSelection() !== null) {
|
||||
editorIndex = quillElement.__quill.getSelection().index;
|
||||
}
|
||||
|
||||
return quillElement.__quill.updateContents(
|
||||
new Delta()
|
||||
.retain(editorIndex)
|
||||
.insert({ image: imageURL },
|
||||
{ alt: imageURL }));
|
||||
}
|
||||
};
|
||||
|
1
Oqtane.Server/wwwroot/js/quill-blot-formatter.min.js
vendored
Normal file
1
Oqtane.Server/wwwroot/js/quill-blot-formatter.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
Oqtane.Server/wwwroot/js/quill1.3.6.min.js
vendored
Normal file
8
Oqtane.Server/wwwroot/js/quill1.3.6.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user