Added support for module resource management
This commit is contained in:
		| @ -0,0 +1 @@ | ||||
| /* HtmlText Module Custom Styles */ | ||||
| @ -264,53 +264,5 @@ window.interop = { | ||||
|                 request.send(data); | ||||
|             } | ||||
|         } | ||||
|     }, | ||||
|     createQuill: function ( | ||||
|         quillElement, toolBar, readOnly, | ||||
|         placeholder, theme, debugLevel) { | ||||
|  | ||||
|         Quill.register('modules/blotFormatter', QuillBlotFormatter.default); | ||||
|  | ||||
|         var options = { | ||||
|             debug: debugLevel, | ||||
|             modules: { | ||||
|                 toolbar: toolBar, | ||||
|                 blotFormatter: {} | ||||
|             }, | ||||
|             placeholder: placeholder, | ||||
|             readOnly: readOnly, | ||||
|             theme: theme | ||||
|         }; | ||||
|  | ||||
|         new Quill(quillElement, options); | ||||
|     }, | ||||
|     getQuillContent: function (editorElement) { | ||||
|         return JSON.stringify(editorElement.__quill.getContents()); | ||||
|     }, | ||||
|     getQuillText: function (editorElement) { | ||||
|         return editorElement.__quill.getText(); | ||||
|     }, | ||||
|     getQuillHTML: function (editorElement) { | ||||
|         return editorElement.__quill.root.innerHTML; | ||||
|     }, | ||||
|     loadQuillContent: function (editorElement, editorContent) { | ||||
|         return editorElement.__quill.root.innerHTML = editorContent; | ||||
|     }, | ||||
|     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 })); | ||||
|     } | ||||
| }; | ||||
|  | ||||
							
								
								
									
										50
									
								
								Oqtane.Server/wwwroot/js/quill-interop.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								Oqtane.Server/wwwroot/js/quill-interop.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,50 @@ | ||||
| window.interop = { | ||||
|     createQuill: function ( | ||||
|         quillElement, toolBar, readOnly, | ||||
|         placeholder, theme, debugLevel) { | ||||
|  | ||||
|         Quill.register('modules/blotFormatter', QuillBlotFormatter.default); | ||||
|  | ||||
|         var options = { | ||||
|             debug: debugLevel, | ||||
|             modules: { | ||||
|                 toolbar: toolBar, | ||||
|                 blotFormatter: {} | ||||
|             }, | ||||
|             placeholder: placeholder, | ||||
|             readOnly: readOnly, | ||||
|             theme: theme | ||||
|         }; | ||||
|  | ||||
|         new Quill(quillElement, options); | ||||
|     }, | ||||
|     getQuillContent: function (editorElement) { | ||||
|         return JSON.stringify(editorElement.__quill.getContents()); | ||||
|     }, | ||||
|     getQuillText: function (editorElement) { | ||||
|         return editorElement.__quill.getText(); | ||||
|     }, | ||||
|     getQuillHTML: function (editorElement) { | ||||
|         return editorElement.__quill.root.innerHTML; | ||||
|     }, | ||||
|     loadQuillContent: function (editorElement, editorContent) { | ||||
|         return editorElement.__quill.root.innerHTML = editorContent; | ||||
|     }, | ||||
|     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 +0,0 @@ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker