1(function () { 2 window.QuillFunctions = { 3 createQuill: function ( 4 quillElement, toolBar, readOnly, 5 placeholder, theme, debugLevel, customFonts) { 6 7 Quill.register('modules/blotFormatter', QuillBlotFormatter.default); 8 9 var options = { 10 debug: debugLevel, 11 modules: { 12 toolbar: toolBar, 13 blotFormatter: {} 14 }, 15 placeholder: placeholder, 16 readOnly: readOnly, 17 theme: theme 18 }; 19 20 if (customFonts != null) { 21 var fontAttributor = Quill.import('formats/font'); 22 fontAttributor.whitelist = customFonts; 23 Quill.register(fontAttributor, true); 24 25 } 26 new Quill(quillElement, options); 27 }, 28 getQuillContent: function (quillElement) { 29 return JSON.stringify(quillElement.__quill.getContents()); 30 }, 31 getQuillText: function (quillElement) { 32 return quillElement.__quill.getText(); 33 }, 34 getQuillHTML: function (quillElement, isresponse_index) { 35 editorIndex = 0; 36 var editorSelection = quillElement.__quill.getSelection() 37 if (editorSelection != null) { 38 editorIndex = editorSelection.index 39 } 40 //console.log(editorIndex) 41 //console.log('isresponse_index', isresponse_index) 42 43 if (isresponse_index == 1) { 44 45 return quillElement.__quill.root.innerHTML + '@99@' + editorIndex; 46 } else { 47 return quillElement.__quill.root.innerHTML; 48 } 49 }, 50 loadQuillContent: function (quillElement, quillContent) { 51 content = JSON.parse(quillContent); 52 return quillElement.__quill.setContents(content, 'api'); 53 }, 54 loadQuillHTMLContent: function (quillElement, quillHTMLContent) { 55 return quillElement.__quill.root.innerHTML = quillHTMLContent; 56 }, 57 enableQuillEditor: function (quillElement, mode) { 58 quillElement.__quill.enable(mode); 59 }, 60 insertQuillImage: function (quillElement, imageURL, index_cursor) { 61 var Delta = Quill.import('delta'); 62 editorIndex = 0; 63 if (index_cursor != null && index_cursor != 0) { 64 editorIndex = index_cursor; 65 } 66 if (quillElement.__quill.getSelection() !== null) { 67 editorIndex = quillElement.__quill.getSelection().index; 68 } 69 70 return quillElement.__quill.updateContents( 71 new Delta() 72 .retain(editorIndex) 73 .insert({ image: imageURL }, 74 { alt: imageURL })); 75 }, 76 getIndexHTML: function (quillElement) { 77 var editorIndex = quillElement.__quill.getSelection() 78 //console.log(editorIndex) 79 if (editorIndex != null) { 80 return editorIndex.index; 81 } 82 return 0; 83 }, 84 setCursorIndex: function (quillElement, index_cursor) { 85 //console.log("setCursorIndex",index_cursor) 86 quillElement.__quill.setSelection(index_cursor); 87 }, 88 cursorCurrentAdd: function (quillElement, cursor_add) { 89 var currentIndex = 0; 90 var getSelectionIndex = quillElement.__quill.getSelection() 91 //console.log(editorIndex) 92 if (getSelectionIndex != null) { 93 currentIndex = getSelectionIndex.index; 94 } 95 quillElement.__quill.setSelection(currentIndex + cursor_add); 96 }, 97 }; 98})();
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.