1let ckeditor_content; 2 3export function get_ckeditor_content(){ 4 let tmp_content = ckeditor_content.getData(); 5 if (/<script/i.test(tmp_content)) { 6 tmp_content = tmp_content.replace(/<script\b[^>]*>/gi, '<p>').replace(/<\/script>/gi, '</p>'); 7 } 8 return tmp_content; 9} 10 11window.get_ckeditor_content = get_ckeditor_content; 12 13$(document).ready(function () { 14 $('oembed').each(function() { 15 var url = $(this).attr('url'); 16 var oembedhtml = $(this); 17 if (url) { 18 $.ajax({ 19 url: '/board/boardEmbed', 20 type: 'GET', 21 data: { 22 url: url 23 }, 24 success: function(data) { 25 data = JSON.parse(data); 26 if(!data.result){ 27 let url2 = data.url; 28 $.ajax({ 29 url: url2, 30 type: 'GET', 31 success: function(data2) { 32 oembedhtml.html(data2.html); 33 }, 34 error: function() { 35 oembedhtml.html('<p style="text-align:center;">미ëì´ ë¶ë¬ì¤ê¸°ì ì¤í¨íììµëë¤.</p>'); 36 } 37 }); 38 }else{ 39 oembedhtml.html(data.html); 40 } 41 }, 42 error: function() { 43 oembedhtml.html('<p style="text-align:center;">미ëì´ ë¶ë¬ì¤ê¸°ì ì¤í¨íììµëë¤.</p>'); 44 } 45 }); 46 } 47 }); 48}) 49 50import { 51 ClassicEditor,Essentials,Bold,Italic,Font,Paragraph,FindAndReplace,SelectAll,Heading,Strikethrough, 52 Underline,RemoveFormat,TodoList,Indent,Undo,FontSize,FontFamily,FontColor,FontBackgroundColor,Highlight, 53 Alignment,Link,List,ImageUpload,BlockQuote,MediaEmbed,Code,CodeBlock,SpecialCharacters,HorizontalLine, 54 PageBreak,HtmlEmbed,SourceEditing,ImageInsertUI,SimpleUploadAdapter,Image,Table,TableCaption,TableCellProperties, 55 TableColumnResize,TableProperties,TableToolbar,ImageResizeEditing, ImageResizeHandles,ImageBlock,ImageCaption, 56 ImageInline,ImageInsert,ImageInsertViaUrl,ImageResize,ImageStyle,ImageTextAlternative,ImageToolbar,Markdown, 57 PasteFromMarkdownExperimental,Autoformat,GeneralHtmlSupport 58} from '/static/js/ckeditor/ckeditor5.js'; 59var locale = getLocale().toString().replace('/', ''); 60var lang = 'ko'; 61if (locale == 'en') { 62 lang = 'en'; 63} 64 65ClassicEditor 66 .create( document.querySelector( '#contents' ), { 67 plugins: [ 68 Essentials, Bold, Italic, Font, Paragraph, FindAndReplace, SelectAll, Heading, Strikethrough, 69 Underline, RemoveFormat, TodoList, Indent, Undo, FontSize, FontFamily, FontColor, FontBackgroundColor, 70 Highlight, Alignment, Link, ImageUpload, BlockQuote, MediaEmbed, Code, CodeBlock, SpecialCharacters, 71 HorizontalLine, PageBreak, HtmlEmbed, SourceEditing,ImageInsertUI , SimpleUploadAdapter,Image,Table, 72 TableCaption,TableCellProperties,TableColumnResize,TableProperties,TableToolbar ,ImageResizeEditing, 73 ImageResizeHandles,ImageBlock,ImageCaption,ImageInline,ImageInsert,ImageInsertViaUrl,ImageResize, 74 ImageStyle,ImageTextAlternative,ImageToolbar,List,PasteFromMarkdownExperimental,Autoformat,GeneralHtmlSupport 75 76 ], 77 toolbar: { 78 items: [ 79 'findAndReplace', 'selectAll', '|', 'heading', '|', 80 'bold', 'italic', 'strikethrough', 'underline', 'removeFormat', '|', 81 'bulletedList', 'numberedList', 'todoList', '|','outdent', 'indent', '|','undo', 'redo', 82 '-', 83 'fontSize', 'fontFamily', 'fontColor', 'fontBackgroun
83dColor', 'highlight', '|', 84 'alignment', '|', 'link', 'uploadImage', 'blockQuote', 'insertTable', 'mediaEmbed', 'code', 'codeBlock', '|', 85 'specialCharacters', 'horizontalLine', 'pageBreak', '|','htmlEmbed', '|', 'sourceEditing' 86 ], 87 shouldNotGroupWhenFull: true 88 }, 89 image: { 90 toolbar: [ 91 'toggleImageCaption', 92 'imageTextAlternative', 93 '|', 94 'imageStyle:inline', 95 'imageStyle:wrapText', 96 'imageStyle:breakText', 97 '|', 98 'resizeImage' 99 ] 100 }, 101 simpleUpload: { 102 uploadUrl: '/summernote/upload', 103 headers: { 104 'X-CSRF-TOKEN': $("[name='csrf_field']").val() 105 } 106 }, 107 table: { 108 contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties'] 109 }, 110 language: lang, 111 list: { 112 properties: { 113 styles: true, 114 startIndex: true, 115 reversed: true 116 } 117 }, 118 heading: { 119 options: [ 120 { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, 121 { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, 122 { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, 123 { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, 124 { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' }, 125 { model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' }, 126 { model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' } 127 ] 128 }, 129 fontFamily: { 130 options: [ 131 'default', 132 'Arial, Helvetica, sans-serif', 133 'Courier New, Courier, monospace', 134 'Georgia, serif', 135 'Lucida Sans Unicode, Lucida Grande, sans-serif', 136 'Tahoma, Geneva, sans-serif', 137 'Times New Roman, Times, serif', 138 'Trebuchet MS, Helvetica, sans-serif', 139 'Verdana, Geneva, sans-serif', 140 'Noto Sans KR, sans-serif', 141 'Noto Serif KR, serif', 142 'Nanum Gothic, sans-serif', 143 'Nanum Myeongjo, serif', 144 'Nanum Pen Script, cursive', 145 'Nanum Brush Script, cursive', 146 'Gothic A1, sans-serif', 147 'Do Hyeon, sans-serif', 148 'Jua, sans-serif', 149 'Yeon Sung, cursive', 150 'Black Han Sans, sans-serif', 151 'Sunflower, sans-serif', 152 'Dokdo, cursive', 153 'Gaegu, cursive', 154 'Hi Melody, cursive', 155 'Gamja Flower, cursive', 156 'Song Myung, serif', 157 'Stylish, sans-serif', 158 'Poor Story, cursive', 159 'Cute Font, cursive', 160 'East Sea Dokdo, cursive', 161 'Roboto, sans-serif', 162 'Lato, sans-serif', 163 'Montserrat, sans-serif', 164 'Oswald, sans-serif', 165 'Raleway, sans-serif', 166 'Sorkin Type, sans-serif', 167 'Open Sans, sans-serif', 168 'Source Sans Pro, sans-serif', 169 'PT Sans, sans-serif', 170 'Merriweather, serif', 171 'Ubuntu, sans-serif', 172 'Playfair, serif', 173 'Nunito, sans-serif', 174 'Mukta, sans-serif', 175 'Lora, serif', 176 'Dancing Script, cursive', 177 'Abril Fatface, serif', 178 'Caveat, cursive', 179 'Kaushan Script, cursive', 180 'Great Vibes, cursive', 181 'Cookie, cursive' 182 ], 183 supportAllValues: true 184 }, 185 fontSize: { 186 options: [ 10, 12, 14, 'default', 18, 20, 22 ], 187 supportAllValues: true 188 }, 189 htmlSupport: { 190 allow: [ 191 { 192 name: /.*/, 193 attributes: true, 194 classes: true, 195 styles: true 196 }, 197 { 198 name: 'iframe', 199 attributes: true, 200 classes: true, 201 styles: true 202 } 203 ], 204 disallow:[ 205 { 206 name: 'script', 207 } 208 ] 209 }, 210 htmlEmbed: { 211 showPreviews: false, 212 }, 213 link: { 214 decorators: { 215 addTargetToExternalLinks: true, 216 defaultProtocol: 'https://', 217 toggleDownloadable: { 218 mode: 'manual', 219 label: 'Downloadable', 220 attributes: { 221 download: 'file' 222 } 223 } 224 } 225 }, 226 } ) 227 .then( editor => { 228 ckeditor_content = editor; 229 $("#contents").html(ckeditor_content.getData()); 230 } );
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.