1(function () { 2 window.QuillFunctions = { 3 createQuill: function ( 4 quillElement, toolBar, readOnly, 5 placeholder, theme, formats, debugLevel, syntax) { 6 7 Quill.register('modules/blotFormatter', QuillBlotFormatter.default); 8 9 var options = { 10 debug: debugLevel, 11 modules: { 12 syntax: syntax, 13 toolbar: toolBar, 14 blotFormatter: {} 15 }, 16 placeholder: placeholder, 17 readOnly: readOnly, 18 theme: theme 19 }; 20 21 if (formats) { 22 options.formats = formats; 23 } 24 25 quillElement.__quill = new Quill(quillElement, options); 26 }, 27 getQuillContent: function(quillElement) { 28 return JSON.stringify(quillElement.__quill.getContents()); 29 }, 30 getQuillText: function(quillElement) { 31 return quillElement.__quill.getText(); 32 }, 33 getQuillHTML: function(quillElement) { 34 return quillElement.__quill.root.innerHTML; 35 }, 36 getQuillEncodedHTML: function(quillElement) { 37 return new TextEncoder().encode(quillElement.__quill.root.innerHTML); 38 }, 39 loadQuillContent: function(quillElement, quillContent) { 40 content = JSON.parse(quillContent); 41 return quillElement.__quill.setContents(content, 'api'); 42 }, 43 loadQuillHTMLContent: function (quillElement, quillHTMLContent) { 44 return quillElement.__quill.root.innerHTML = quillHTMLContent; 45 }, 46 enableQuillEditor: function (quillElement, mode) { 47 quillElement.__quill.enable(mode); 48 }, 49 insertQuillImage: function (quillElement, imageURL) { 50 var Delta = Quill.import('delta'); 51 editorIndex = 0; 52 53 if (quillElement.__quill.getSelection() !== null) { 54 editorIndex = quillElement.__quill.getSelection().index; 55 } 56 57 return quillElement.__quill.updateContents( 58 new Delta() 59 .retain(editorIndex) 60 .insert({ image: imageURL }, 61 { alt: imageURL })); 62 }, 63 insertQuillText: function (quillElement, text) { 64 editorIndex = 0; 65 selectionLength = 0; 66 67 if (quillElement.__quill.getSelection() !== null) { 68 selection = quillElement.__quill.getSelection(); 69 editorIndex = selection.index; 70 selectionLength = selection.length; 71 } 72 73 return quillElement.__quill.deleteText(editorIndex, selectionLength) 74 .concat(quillElement.__quill.insertText(editorIndex, text)); 75 } 76 }; 77})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.