suneditor
Advanced tools
Comparing version 1.10.2 to 1.10.3
{ | ||
"name": "suneditor", | ||
"version": "1.10.2", | ||
"version": "1.10.3", | ||
"description": "Pure JavaScript based WYSIWYG web editor", | ||
@@ -5,0 +5,0 @@ "main": "src/suneditor.js", |
{ | ||
"name": "suneditor", | ||
"version": "1.10.2", | ||
"version": "1.10.3", | ||
"description": "Pure JavaScript based WYSIWYG web editor", | ||
@@ -5,0 +5,0 @@ "main": "src/suneditor.js", |
@@ -21,10 +21,10 @@ /* | ||
/** dialog */ | ||
const dialog_div = document.createElement('DIV'); | ||
let dialog_div = document.createElement('DIV'); | ||
dialog_div.className = 'sun-editor-id-dialogBox'; | ||
const dialog_back = document.createElement('DIV'); | ||
let dialog_back = document.createElement('DIV'); | ||
dialog_back.className = 'modal-dialog-background sun-editor-id-dialog-back'; | ||
dialog_back.style.display = 'none'; | ||
const dialog_area = document.createElement('DIV'); | ||
let dialog_area = document.createElement('DIV'); | ||
dialog_area.className = 'modal-dialog sun-editor-id-dialog-modal'; | ||
@@ -41,3 +41,3 @@ dialog_area.style.display = 'none'; | ||
/** resize controller, button */ | ||
const resize_div_container = eval(this.setController_resize()); | ||
let resize_div_container = eval(this.setController_resize()); | ||
context.dialog.resizeContainer = resize_div_container; | ||
@@ -49,6 +49,6 @@ | ||
const resize_button = eval(this.setController_button());; | ||
let resize_button = eval(this.setController_button());; | ||
context.dialog.resizeButton = resize_button; | ||
const resize_handles = resize_div_container.getElementsByClassName('sun-editor-name-resize-handle'); | ||
let resize_handles = resize_div_container.getElementsByClassName('sun-editor-name-resize-handle'); | ||
@@ -71,2 +71,5 @@ /** add event listeners */ | ||
context.element.relative.appendChild(resize_button); | ||
/** empty memory */ | ||
dialog_div = null, dialog_back = null, dialog_area = null, resize_div_container = null, resize_button = null, resize_handles = null; | ||
}, | ||
@@ -148,6 +151,6 @@ | ||
' <button type="button" data-command="25" title="' + lang.dialogBox.resize25 + '"><span class="note-fontsize-10">25%</span></button>' + | ||
' <button type="button" data-command="update" title="' + lang.toolbar.image + '" style="padding: 6px 10px !important;"><div class="ico_modify"></div></button>' + | ||
' <button type="button" data-command="update" title="' + lang.toolbar.image + '"><div class="icon-modify"></div></button>' + | ||
'</div>' + | ||
'<div class="btn-group remove">' + | ||
' <button type="button" data-command="delete" title="' + lang.dialogBox.remove + '"><span class="image_remove">x</span></button>' + | ||
' <button type="button" data-command="delete" title="' + lang.dialogBox.remove + '"><div aria-hidden="true" class="icon-cancel"></div></button>' + | ||
'</div>'; | ||
@@ -154,0 +157,0 @@ |
@@ -31,3 +31,3 @@ /* | ||
/** image dialog */ | ||
const image_dialog = eval(this.setDialog(_this.context.user)); | ||
let image_dialog = eval(this.setDialog(_this.context.user)); | ||
context.image.modal = image_dialog; | ||
@@ -55,2 +55,5 @@ context.image.imgUrlFile = image_dialog.getElementsByClassName('sun-editor-id-image-url')[0]; | ||
context.dialog.modal.appendChild(image_dialog); | ||
/** empty memory */ | ||
image_dialog = null; | ||
}, | ||
@@ -68,3 +71,3 @@ | ||
' <button type="button" data-command="close" class="close" aria-label="Close">' + | ||
' <span aria-hidden="true" data-command="close">x</span>' + | ||
' <div aria-hidden="true" data-command="close" class="icon-cancel"></div>' + | ||
' </button>' + | ||
@@ -105,3 +108,3 @@ ' <h5 class="modal-title">' + lang.dialogBox.imageBox.title + '</h5>' + | ||
' <input type="checkbox" id="suneditor_image_check_proportion" style="margin-left: 20px;" checked disabled/><label for="suneditor_image_check_proportion"> ' + lang.dialogBox.proportion + '</label>' + | ||
' <button type="button" title="' + lang.dialogBox.revertButton + '" class="btn_editor sun-editor-id-image-revert-button" style="float: right;"><div class="ico_revert"></div></button>' + | ||
' <button type="button" title="' + lang.dialogBox.revertButton + '" class="btn_editor sun-editor-id-image-revert-button" style="float: right;"><div class="icon-revert"></div></button>' + | ||
' </div>' + | ||
@@ -108,0 +111,0 @@ ' <div class="form-group-footer">' + |
@@ -14,3 +14,3 @@ /* | ||
/** link dialog */ | ||
const link_dialog = eval(this.setDialog()); | ||
let link_dialog = eval(this.setDialog()); | ||
context.link.modal = link_dialog; | ||
@@ -22,3 +22,3 @@ context.link.focusElement = link_dialog.getElementsByClassName('sun-editor-id-link-url')[0]; | ||
/** link button */ | ||
const link_button = eval(this.setController_LinkBtn()); | ||
let link_button = eval(this.setController_LinkBtn()); | ||
context.link.linkBtn = link_button; | ||
@@ -34,2 +34,5 @@ context.link._linkAnchor = null; | ||
context.element.relative.appendChild(link_button); | ||
/** empty memory */ | ||
link_dialog = null, link_button = null; | ||
}, | ||
@@ -48,3 +51,3 @@ | ||
' <button type="button" data-command="close" class="close" aria-label="Close">' + | ||
' <span aria-hidden="true" data-command="close">×</span>' + | ||
' <div aria-hidden="true" data-command="close" class="icon-cancel"></div>' + | ||
' </button>' + | ||
@@ -82,4 +85,4 @@ ' <h5 class="modal-title">' + lang.dialogBox.linkBox.title + '</h5>' + | ||
' <div class="btn-group">' + | ||
' <button type="button" data-command="update" tabindex="-1" title="' + lang.editLink.edit + '"><div class="ico_url"></div></button>' + | ||
' <button type="button" data-command="delete" tabindex="-1" title="' + lang.editLink.remove + '">x</button>' + | ||
' <button type="button" data-command="update" tabindex="-1" title="' + lang.editLink.edit + '"><div class="icon-link"></div></button>' + | ||
' <button type="button" data-command="delete" tabindex="-1" title="' + lang.editLink.remove + '"><div class="icon-cancel"></div></button>' + | ||
' </div>' + | ||
@@ -86,0 +89,0 @@ '</div>'; |
@@ -34,3 +34,3 @@ /* | ||
/** video dialog */ | ||
const video_dialog = eval(this.setDialog()); | ||
let video_dialog = eval(this.setDialog()); | ||
context.video.modal = video_dialog; | ||
@@ -54,2 +54,5 @@ context.video.focusElement = video_dialog.getElementsByClassName('sun-editor-id-video-url')[0]; | ||
context.dialog.modal.appendChild(video_dialog); | ||
/** empty memory */ | ||
video_dialog = null; | ||
}, | ||
@@ -68,3 +71,3 @@ | ||
' <button type="button" data-command="close" class="close" aria-label="Close">' + | ||
' <span aria-hidden="true" data-command="close">x</span>' + | ||
' <div aria-hidden="true" data-command="close" class="icon-cancel"></div>' + | ||
' </button>' + | ||
@@ -82,3 +85,3 @@ ' <h5 class="modal-title">' + lang.dialogBox.videoBox.title + '</h5>' + | ||
' <input type="checkbox" id="suneditor_video_check_proportion" style="margin-left: 20px;" disabled/><label for="suneditor_video_check_proportion"> ' + lang.dialogBox.proportion + '</label>' + | ||
' <button type="button" title="' + lang.dialogBox.revertButton + '" class="btn_editor sun-editor-id-video-revert-button" style="float: right;"><div class="ico_revert"></div></button>' + | ||
' <button type="button" title="' + lang.dialogBox.revertButton + '" class="btn_editor sun-editor-id-video-revert-button" style="float: right;"><div class="icon-revert"></div></button>' + | ||
' </div>' + | ||
@@ -85,0 +88,0 @@ ' </div>' + |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
let listDiv = eval(this.setSubmenu()); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -31,6 +34,6 @@ | ||
' <ul class="list_editor">' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifyleft" title="' + lang.toolbar.alignLeft + '"><span class="img_editor ico_align_l"></span>' + lang.toolbar.alignLeft + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifycenter" title="' + lang.toolbar.alignCenter + '"><span class="img_editor ico_align_c"></span>' + lang.toolbar.alignCenter + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifyright" title="' + lang.toolbar.alignRight + '"><span class="img_editor ico_align_r"></span>' + lang.toolbar.alignRight + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifyfull" title="' + lang.toolbar.justifyFull + '"><span class="img_editor ico_align_f"></span>' + lang.toolbar.justifyFull + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifyleft" title="' + lang.toolbar.alignLeft + '"><span class="img_editor icon-align-left"></span>' + lang.toolbar.alignLeft + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifycenter" title="' + lang.toolbar.alignCenter + '"><span class="img_editor icon-align-center"></span>' + lang.toolbar.alignCenter + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifyright" title="' + lang.toolbar.alignRight + '"><span class="img_editor icon-align-right"></span>' + lang.toolbar.alignRight + '</button></li>' + | ||
' <li><button type="button" class="btn_edit btn_align" data-command="justifyfull" title="' + lang.toolbar.justifyFull + '"><span class="img_editor icon-align-just"></span>' + lang.toolbar.justifyFull + '</button></li>' + | ||
' </ul>' + | ||
@@ -37,0 +40,0 @@ '</div>'; |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu(_this.context.user)); | ||
let listDiv = eval(this.setSubmenu(_this.context.user)); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -21,0 +24,0 @@ |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu(_this.context.user)); | ||
let listDiv = eval(this.setSubmenu(_this.context.user)); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -21,0 +24,0 @@ |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
let listDiv = eval(this.setSubmenu()); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -21,0 +24,0 @@ |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
let listDiv = eval(this.setSubmenu()); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -33,8 +36,8 @@ | ||
' <li><button type="button" class="btn_edit" data-value="DIV" style="height:24px; border-bottom:1px solid #dedede;"><span style="font-size:13px;">' + lang.toolbar.tag_div + '</span></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="h1" style="height:45px;"><h1>' + lang.toolbar.tag_h + ' 1</h1></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="h2" style="height:34px;"><h2>' + lang.toolbar.tag_h + ' 2</h2></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="h3" style="height:26px;"><h3>' + lang.toolbar.tag_h + ' 3</h3></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="h4" style="height:23px;"><h4>' + lang.toolbar.tag_h + ' 4</h4></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="h5" style="height:19px;"><h5>' + lang.toolbar.tag_h + ' 5</h5></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="h6" style="height:15px;"><h6>' + lang.toolbar.tag_h + ' 6</h6></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="H1" style="height:45px;"><h1>' + lang.toolbar.tag_h + ' 1</h1></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="H2" style="height:34px;"><h2>' + lang.toolbar.tag_h + ' 2</h2></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="H3" style="height:26px;"><h3>' + lang.toolbar.tag_h + ' 3</h3></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="H4" style="height:23px;"><h4>' + lang.toolbar.tag_h + ' 4</h4></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="H5" style="height:19px;"><h5>' + lang.toolbar.tag_h + ' 5</h5></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-value="H6" style="height:15px;"><h6>' + lang.toolbar.tag_h + ' 6</h6></button></li>' + | ||
' </ul>' + | ||
@@ -59,2 +62,3 @@ '</div>'; | ||
this.focus(); | ||
SUNEDITOR.dom.changeTxt(this.commandMap['FORMAT'], value); | ||
this.execCommand('formatBlock', false, value); | ||
@@ -61,0 +65,0 @@ this.submenuOff(); |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
let listDiv = eval(this.setSubmenu()); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -21,0 +24,0 @@ |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
let listDiv = eval(this.setSubmenu()); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -21,0 +24,0 @@ |
@@ -11,3 +11,3 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
let listDiv = eval(this.setSubmenu()); | ||
@@ -19,2 +19,5 @@ /** add event listeners */ | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null; | ||
}, | ||
@@ -31,4 +34,4 @@ | ||
' <ul class="list_editor">' + | ||
' <li><button type="button" class="btn_edit" data-command="insertOrderedList" data-value="DECIMAL" title="' + lang.toolbar.orderList + '"><div class="ico_list_num"></div></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-command="insertUnorderedList" data-value="DISC" title="' + lang.toolbar.unorderList + '"><div class="ico_list_square"></div></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-command="insertOrderedList" data-value="DECIMAL" title="' + lang.toolbar.orderList + '"><div class="icon-list-number"></div></button></li>' + | ||
' <li><button type="button" class="btn_edit" data-command="insertUnorderedList" data-value="DISC" title="' + lang.toolbar.unorderList + '"><div class="icon-list-bullets"></div></button></li>' + | ||
' </ul>' + | ||
@@ -35,0 +38,0 @@ '</div>'; |
@@ -13,4 +13,5 @@ /* | ||
/** set submenu */ | ||
const listDiv = eval(this.setSubmenu()); | ||
const tablePicker = listDiv.getElementsByClassName('sun-editor-id-table-picker')[0]; | ||
let listDiv = eval(this.setSubmenu()); | ||
let tablePicker = listDiv.getElementsByClassName('sun-editor-id-table-picker')[0]; | ||
context.submenu.tableHighlight = listDiv.getElementsByClassName('sun-editor-id-table-highlighted')[0]; | ||
@@ -27,2 +28,5 @@ context.submenu.tableUnHighlight = listDiv.getElementsByClassName('sun-editor-id-table-unhighlighted')[0]; | ||
targetElement.parentNode.appendChild(listDiv); | ||
/** empty memory */ | ||
listDiv = null, tablePicker = null; | ||
}, | ||
@@ -29,0 +33,0 @@ |
@@ -5,64 +5,64 @@ "undefined"===typeof window.SUNEDITOR&&(window.SUNEDITOR={},SUNEDITOR.plugin={}); | ||
url:"Media embed URL, YouTube"},resize100:"resize 100%",resize75:"resize 75%",resize50:"resize 50%",resize25:"resize 25%",remove:"remove",submitButton:"Submit",revertButton:"Revert",proportion:"constrain proportions",width:"Width",height:"Height",basic:"Basic",left:"Left",right:"Right",center:"Center"},editLink:{edit:"Edit",remove:"Remove"}}; | ||
(function(){function z(a){var d="";a=document.createRange().createContextualFragment(a.trim()).childNodes;for(var e=0,b=a.length;e<b;e++){var f=a[e].outerHTML||a[e].textContent;d=/^(?:P|TABLE|H[1-6]|DIV)$/i.test(a[e].tagName)?d+f:d+("<P>"+f+"</p>")}0===d.length&&(d="<p></p>");return d}function B(a){var d='<div class="sun-editor-id-toolbar-cover"></div>',e=null;var b=SUNEDITOR.lang;b={font:["btn_font",b.toolbar.font,"font","submenu","",'<span class="txt sun-editor-font-family">'+b.toolbar.font+ | ||
'</span><span class="ico_more"></span>'],formats:["btn_format",b.toolbar.formats,"formatBlock","submenu","",'<span class="txt">'+b.toolbar.formats+'</span><span class="ico_more"></span>'],fontSize:["btn_size",b.toolbar.fontSize,"fontSize","submenu","",'<span class="txt sun-editor-font-size">'+b.toolbar.fontSize+'</span><span class="ico_more"></span>'],bold:["sun-editor-id-bold",b.toolbar.bold+"(Ctrl+B)","bold","","",'<div class="ico_bold"></div>'],underline:["sun-editor-id-underline",b.toolbar.underline+ | ||
"(Ctrl+U)","underline","","",'<div class="ico_underline"></div>'],italic:["sun-editor-id-italic",b.toolbar.italic+"(Ctrl+I)","italic","","",'<div class="ico_italic"></div>'],strike:["sun-editor-id-strike",b.toolbar.strike+"(Ctrl+SHIFT+S)","strikethrough","","",'<div class="ico_strike"></div>'],subscript:["sun-editor-id-subscript",b.toolbar.subscript,"subscript","","",'<div class="ico_subscript"></div>'],superscript:["sun-editor-id-superscript",b.toolbar.superscript,"superscript","","",'<div class="ico_superscript"></div>'], | ||
removeFormat:["",b.toolbar.removeFormat,"removeFormat","","",'<div class="ico_erase"></div>'],fontColor:["",b.toolbar.fontColor,"foreColor","submenu","",'<div class="ico_foreColor"></div>'],hiliteColor:["",b.toolbar.hiliteColor,"hiliteColor","submenu","",'<div class="ico_hiliteColor"></div>'],indent:["",b.toolbar.indent+"(Ctrl + [)","indent","","",'<div class="ico_indnet"></div>'],outdent:["",b.toolbar.outdent+"(Ctrl + ])","outdent","","",'<div class="ico_outdent"></div>'],align:["btn_align",b.toolbar.align, | ||
"align","submenu","",'<div class="ico_align"></div>'],list:["",b.toolbar.list,"list","submenu","",'<div class="ico_list_num"></div>'],line:["btn_line",b.toolbar.line,"horizontalRules","submenu","",'<hr style="border-width: 1px 0 0; border-style: solid none none; border-color: black; border-image: initial; height: 1px;" /><hr style="border-width: 1px 0 0; border-style: dotted none none; border-color: black; border-image: initial; height: 1px;" /><hr style="border-width: 1px 0 0; border-style: dashed none none; border-color: black; border-image: initial; height: 1px;" />'], | ||
table:["",b.toolbar.table,"table","submenu","",'<div class="ico_table"></div>'],link:["",b.toolbar.link,"link","dialog","",'<div class="ico_url"></div>'],image:["",b.toolbar.image,"image","dialog","",'<div class="ico_picture"></div>'],video:["",b.toolbar.video,"video","dialog","",'<div class="ico_video"></div>'],fullScreen:["",b.toolbar.fullScreen,"fullScreen","","",'<div class="ico_full_screen_e"></div>'],showBlocks:["",b.toolbar.showBlocks,"showBlocks","","",'<div class="ico_showBlocks"></div>'], | ||
codeView:["",b.toolbar.codeView,"codeView","","",'<div class="ico_html"></div>'],undo:["",b.toolbar.undo+" (Ctrl+Z)","undo","","",'<div class="ico_undo"></div>'],redo:["",b.toolbar.redo+" (Ctrl+Y)","redo","","",'<div class="ico_redo"></div>'],preview:["",b.toolbar.preview,"preview","","",'<div class="ico_preview"></div>'],print:["",b.toolbar.print,"print","","",'<div class="ico_print"></div>']};for(var f=0;f<a.length;f++){var c=a[f];if("object"===typeof c){for(var g=0;g<c.length;g++){var p=c[g];p= | ||
"object"===typeof p?[p.className,p.title,p.dataCommand,p.dataDisplay,p.displayOption,p.innerHTML]:b[p];e+='<li> <button type="button" class="btn_editor '+p[0]+'" title="'+p[1]+'" data-command="'+p[2]+'" data-display="'+p[3]+'" data-option="'+p[4]+'">'+p[5]+" </button></li>"}e=e?'<div class="tool_module"><ul class="editor_tool">'+e+"</ul></div>":"";d+=e;e=null}else/^\/$/.test(c)&&(d+='<div class="tool_module_enter"></div>')}return d}function C(a,d){"object"!==typeof d&&(d={});d.addFont=d.addFont|| | ||
null;d.videoX=d.videoX||560;d.videoY=d.videoY||315;d.imageFileInput=void 0===d.imageFileInput?!0:d.imageFileInput;d.imageUrlInput=void 0!==d.imageUrlInput&&d.imageFileInput?d.imageUrlInput:!0;d.imageSize=d.imageSize||350;d.imageUploadUrl=d.imageUploadUrl||null;d.fontList=d.fontList||null;d.fontSizeList=d.fontSizeList||null;d.height=/^\d+/.test(d.height)?/^\d+$/.test(d.height)?d.height+"px":d.height:a.clientHeight+"px";d.buttonList=d.buttonList||[["undo","redo"],["font","fontSize","formats"],"bold underline italic strike subscript superscript".split(" "), | ||
["removeFormat"],"/",["fontColor","hiliteColor"],["indent","outdent"],["align","line","list","table"],["link","image","video"],["fullScreen","showBlocks","codeView"],["preview","print"]];d.width=/^\d+/.test(d.width)?/^\d+$/.test(d.width)?d.width+"px":d.width:/%|auto/.test(a.style.width)?a.style.width:a.clientWidth+"px";d.display=d.display||("none"!==a.style.display&&a.style.display?a.style.display:"block");var e=document,b=e.createElement("DIV");b.className="sun-editor";b.id="suneditor_"+a.id;b.style.width= | ||
d.width;b.style.display=d.display;var f=e.createElement("DIV");f.className="sun-editor-container";var c=e.createElement("DIV");c.className="sun-editor-id-toolbar";c.innerHTML=B(d.buttonList);var g=e.createElement("DIV");g.className="sun-editor-id-editorArea";g.style.height=d.height;var p=e.createElement("IFRAME");p.allowFullscreen=!0;p.frameBorder=0;p.className="input_editor sun-editor-id-wysiwyg";p.style.display="block";var u=e.createElement("TEXTAREA");u.className="input_editor html sun-editor-id-code"; | ||
u.style.display="none";p.addEventListener("load",function(){this.setAttribute("scrolling","auto");this.contentWindow.document.head.innerHTML='<meta charset="utf-8" /><title>SunEditor</title><link rel="stylesheet" type="text/css" href="'+SUNEDITOR.util.getBasePath+'css/suneditor-contents.css">';this.contentWindow.document.body.className="sun-editor-editable";this.contentWindow.document.body.setAttribute("contenteditable",!0);this.contentWindow.document.body.innerHTML=z(a.value)});var n=e.createElement("DIV"); | ||
n.className="sun-editor-id-resizeBar";var r=e.createElement("DIV");r.className="sun-editor-id-loading";r.innerHTML='<div class="ico-loading"></div>';e=e.createElement("DIV");e.className="sun-editor-id-resize-background";g.appendChild(p);g.appendChild(u);f.appendChild(c);f.appendChild(g);f.appendChild(n);f.appendChild(e);f.appendChild(r);b.appendChild(f);return{constructed:{_top:b,_relative:f,_toolBar:c,_editorArea:g,_resizeBar:n,_loading:r,_resizeBack:e},options:d}}SUNEDITOR.util={getXMLHttpRequest:function(){if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(d){return null}}else return window.XMLHttpRequest? | ||
new XMLHttpRequest:null},copyObj:function(a){var d={},e;for(e in a)d[e]=a[e];return d},getBasePath:function(){var a=SUNEDITOR.SUNEDITOR_BASEPATH||"";if(!a)for(var d=document.getElementsByTagName("script"),e=0;e<d.length;e++){var b=d[e].src.match(/(^|.*[\\\/])suneditor(\.min)?\.js(?:\?.*|;.*)?$/i);if(b){a=b[1];break}}-1===a.indexOf(":/")&&"//"!==a.slice(0,2)&&(a=0===a.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+a:location.href.match(/^[^\?]*\/(?:)/)[0]+a);if(!a)throw'[SUNEDITOR.util.getBasePath.fail] The SUNEDITOR installation path could not be automatically detected. Please set the global variable "SUNEDITOR.SUNEDITOR_BASEPATH" before creating editor instances.'; | ||
return a}(),includeFile:function(a,d,e){var b=document.createElement("script");b.type=a;b.src=d;b.onload=e;document.getElementsByTagName("head")[0].appendChild(b)}};SUNEDITOR.dom={getArrayIndex:function(a,d){for(var e=-1,b=0,f=a.length;b<f;b++)if(a[b]===d){e=b;break}return e},nextIdx:function(a,d){var e=this.getArrayIndex(a,d);return-1===e?-1:e+1},prevIdx:function(a,d){var e=this.getArrayIndex(a,d);return-1===e?-1:e-1},isCell:function(a){return a&&/^(?:TD|TH)$/i.test(a.nodeName)},getListChildren:function(a, | ||
d){var e=[];d=d||function(){return!0};(function c(f){a!==f&&d(f)&&e.push(f);for(var g=0,p=f.children.length;g<p;g++)c(f.children[g])})(a);return e},getListChildNodes:function(a,d){var e=[];d=d||function(){return!0};(function c(a){d(a)&&e.push(a);for(var g=0,p=a.childNodes.length;g<p;g++)c(a.childNodes[g])})(a);return e},getParentNode:function(a,d){if(/\./.test(d)){var e="className";d=d.split(".")[1]}else/#/.test(d)?(e="id",d="^"+d.split("#")[1]+"$"):/:/.test(d)?(e="name",d="^"+d.split(":")[1]+"$"): | ||
(e="tagName",d="^"+d+"$");for(var b=new RegExp(d,"i");a&&(3===a.nodeType||!b.test(a[e]));){if(/^BODY$/i.test(a.tagName))return null;a=a.parentNode}return a},changeTxt:function(a,d){a&&d&&(a.textContent=d)},addClass:function(a,d){a&&!(new RegExp("(\\s|^)"+d+"(\\s|$)")).test(a.className)&&(a.className+=" "+d)},removeClass:function(a,d){a&&(a.className=a.className.replace(new RegExp("(\\s|^)"+d+"(\\s|$)")," ").trim())},toggleClass:function(a,d){if(a){var e=new RegExp("(\\s|^)"+d+"(\\s|$)");e.test(a.className)? | ||
a.className=a.className.replace(e," ").trim():a.className+=" "+d}},removeItem:function(a){try{a.remove()}catch(d){a.parentNode.removeChild(a)}}};var E=function(a,d,e){var b={context:a,loadedPlugins:{},dialogForm:null,submenu:null,submenuActiveButton:null,controllerArray:[],commandMap:{FONT:a.tool.font,B:a.tool.bold,U:a.tool.underline,I:a.tool.italic,STRIKE:a.tool.strike,SUB:a.tool.subscript,SUP:a.tool.superscript,SIZE:a.tool.fontSize},_variable:{selectionNode:null,copySelection:null,wysiwygActive:!0, | ||
isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,originCssText:a.element.topArea.style.cssText,editorHeight:a.user.height,isTouchMove:!1},callModule:function(c,a,b,d){var g=e.getBasePath+"plugins/"+c;if("dialog"===c){var p=this._callBack_addModule.bind(this,"dialog","dialog",b,this.callModule.bind(this,c,a,b,d));if(!SUNEDITOR.plugin.dialog){e.includeFile("text/javascript",g+"/dialog.js",p);return}if(!this.loadedPlugins.dialog){p();return}}SUNEDITOR.plugin[a]?this.loadedPlugins[a]? | ||
"function"===typeof d&&d():this._callBack_addModule(c,a,b,d):e.includeFile("text/javascript",g+"/"+a+".js",this._callBack_addModule.bind(this,c,a,b,d))},_callBack_addModule:function(c,a,b,d){this.context[c]||(this.context[c]={});SUNEDITOR.plugin[a].add(this,b);this.loadedPlugins[a]=!0;"function"===typeof d&&d()},submenuOn:function(c){this.submenu=c.nextElementSibling;this.submenu.style.display="block";d.addClass(c,"on");this.submenuActiveButton=c},submenuOff:function(){this.submenu&&(this.submenu.style.display= | ||
"none",this.submenu=null,d.removeClass(this.submenuActiveButton,"on"),this.submenuActiveButton=null);a.image&&!0===a.image._onCaption&&SUNEDITOR.plugin.image.toggle_caption_contenteditable.call(b,!1);this.controllersOff()},controllersOff:function(){var c=this.controllerArray.length;if(0<c){for(var a=0;a<c;a++)this.controllerArray[a].style.display="none";this.controllerArray=[]}},execCommand:function(c,b,d){a.element.wysiwygWindow.document.execCommand(c,b,d)},focus:function(){var c=d.getParentNode(this._variable.selectionNode, | ||
"figcaption");c?c.focus():a.element.wysiwygWindow.document.body.focus()},_setSelectionNode:function(){this._variable.copySelection=e.copyObj(this.getSelection());var c=this.getRange();this._variable.selectionNode=c.startContainer!==c.endContainer?c.startContainer:this.getSelectionNode()},isEdgePoint:function(c,a){return 0===a||a===c.nodeValue.length},createRange:function(){return a.element.wysiwygWindow.document.createRange()},getSelection:function(){return a.element.wysiwygWindow.getSelection()}, | ||
getSelectionNode:function(){return this.getSelection().extentNode||this.getSelection().anchorNode},getRange:function(){var c=this.getSelection();if(0<c.rangeCount)var b=c.getRangeAt(0);else b=this.createRange(),(c=this._variable.copySelection)?(b.setStart(c.anchorNode,c.anchorOffset),b.setEnd(c.focusNode,c.focusOffset)):(c=a.element.wysiwygWindow.document.body.firstChild,b.setStart(c,0),b.setEnd(c,0));return b},setRange:function(c,a,b,d){var g=this.createRange();g.setStart(c,a);g.setEnd(b,d);c=this.getSelection(); | ||
0<c.rangeCount&&c.removeAllRanges();c.addRange(g)},showLoading:function(){a.element.loading.style.display="block"},closeLoading:function(){a.element.loading.style.display="none"},getLineElement:function(c){c=c||this._variable.selectionNode;if(!c||/^(?:HTML|BODY)$/i.test(c.tagName))c=a.element.wysiwygWindow.document.body.firstChild;else for(;!/^BODY$/i.test(c.parentNode.tagName);)c=c.parentNode;return c},appendP:function(c){var a=document.createElement("P");a.innerHTML="";c=this.getLineElement(c); | ||
c.parentNode.insertBefore(a,c.nextElementSibling);return a},insertNode:function(c,a){if(a){var b=a.parentNode;a=a.nextSibling}else{var d=this.getSelection();b=this.getRange();var g=b.startContainer,e=b.startOffset,f=b.endContainer,k=b.endOffset;b=g;3===g.nodeType&&(b=g.parentNode);if(g===f&&e===k)d.focusNode&&3===d.focusNode.nodeType?a=d.focusNode.splitText(k):(null!==b.lastChild&&/^BR$/i.test(b.lastChild.nodeName)&&b.removeChild(b.lastChild),a=null);else if(g===f)d=g,this.isEdgePoint(f,k)||(a=f.splitText(k)), | ||
this.isEdgePoint(g,e)||(d=g.splitText(e)),b.removeChild(d);else for(d.deleteFromDocument?d.deleteFromDocument():this.removeNode(),a=f;1!==a.nodeType;)a=a.parentNode}try{b.insertBefore(c,a)}catch(m){b.appendChild(c)}},removeNode:function(){var c=this.getRange(),a=c.startContainer,b=c.startOffset,e=c.endContainer,f=c.endOffset;c=d.getListChildNodes(c.commonAncestorContainer);var r=d.getArrayIndex(c,a),l=d.getArrayIndex(c,e);var k=r+1;for(var m=a;0<=k;k--)c[k]===m.parentNode&&c[k].firstChild===m&&0=== | ||
b&&(r=k,m=m.parentNode);k=l-1;for(m=e;k>r;k--)c[k]===m.parentNode&&1===c[k].nodeType&&(c.splice(k,1),m=m.parentNode,--l);for(;r<=l;r++)k=c[r],0===k.length||3===k.nodeType&&void 0===k.data?d.removeItem(k):k===a?(k=1===a.nodeType?document.createTextNode(a.textContent):document.createTextNode(a.substringData(0,b)),0<k.length?a.data=k.data:d.removeItem(a)):k===e?(k=1===e.nodeType?document.createTextNode(e.textContent):document.createTextNode(e.substringData(f,e.length-f)),0<k.length?e.data=k.data:d.removeItem(e)): | ||
d.removeItem(k)},wrapRangeToTag:function(c,a){var b=this.getRange(),g=b.startContainer,e=b.startOffset,f=b.endContainer,l=b.endOffset,k=b.commonAncestorContainer;b={};var m={},q;if(a){var h="(?:;|^|\\s)(?:"+a[0];for(q=1;q<a.length;q++)h+="|"+a[q];h+=")\\s*:[^;]*\\s*(?:;|$)";h=new RegExp(h,"gi")}if(g===f){q=c.cloneNode(!1);if(e===l)q.innerHTML=" ",g.parentNode.insertBefore(q,g.nextSibling);else{f=document.createTextNode(g.substringData(0,e));var w=document.createTextNode(g.substringData(l,g.length- | ||
l));q.innerText=g.substringData(e,l-e);g.parentNode.insertBefore(q,g.nextSibling);g.data=0<f.data.length?f.data:g.substringData(0,e);0<w.data.length&&g.parentNode.insertBefore(w,q.nextSibling)}b.container=q;b.offset=0;m.container=q;m.offset=1}else if(w=function(a){if(3===a.nodeType)return!0;var b="";h&&0<a.style.cssText.length&&(b=a.style.cssText.replace(h,"").trim());return a.nodeName!==c.nodeName||0<b.length?(0<a.style.cssText.length&&(a.style.cssText=b),!0):!1},/BODY/i.test(k.nodeName)){m=d.getListChildren(k, | ||
function(a){return/^P$/i.test(a.nodeName)});var y=d.getParentNode(g,"P");k=d.getParentNode(f,"P");b=0;for(q=m.length;b<q;b++)if(y===m[b])y=b;else if(k===m[b]){k=b;break}q=c.cloneNode(!1);b=this._wrapLineNodesStart(m[y],q,w,g,e);for(g=y+1;g<k;g++)q=c.cloneNode(!1),this._wrapLineNodes(m[g],q,w);q=c.cloneNode(!1);m=this._wrapLineNodesEnd(m[k],q,w,f,l)}else q=c.cloneNode(!1),l=this._wrapLineNodesPart(k,q,w,g,e,f,l),b.container=l.startContainer,b.offset=l.startOffset,m.container=l.endContainer,m.offset= | ||
l.endOffset;this.setRange(b.container,b.offset,m.container,m.offset)},_wrapLineNodesPart:function(a,b,e,f,n,r,l){var c=[],g=f,p=n,h=r,u=l,y=!1,A=!1,v,t,x;(function D(f,k){for(var q=f.childNodes,l=0,r=q.length;l<r&&!A;l++){var m=q[l];if(y&&m!==h&&3===m.nodeType){for(v=[];t!==a&&null!==t;)e(t)&&1===t.nodeType&&v.push(t.cloneNode(!1)),t=t.parentNode;if(0<v.length){for(x=t=v.pop();0<v.length;)t=v.pop(),x.appendChild(t);b.appendChild(x);k=t}else k=b;k.appendChild(m.cloneNode(!1));c.push(m)}if(m===g){var n= | ||
document.createTextNode(g.substringData(0,p)),w=document.createTextNode(g.substringData(p,g.length-p));0<n.length?g.data=n.data:c.push(g);t=m;for(v=[];t!==a&&null!==t;)e(t)&&1===t.nodeType&&v.push(t.cloneNode(!1)),t=t.parentNode;for(x=t=v.pop()||m;0<v.length;)t=v.pop(),x.appendChild(t);x!==m?(b.appendChild(x),k=t):k=b;g=w;p=0;k.appendChild(g);y=!0}else{if(m===h){q=document.createTextNode(h.substringData(u,h.length-u));l=document.createTextNode(h.substringData(0,u));r=t=m;for(v=[];t!==a&&null!==t;)e(t)&& | ||
1===t.nodeType&&v.push(t.cloneNode(!1)),r=t,t=t.parentNode;for(x=t=v.pop()||m;0<v.length;)t=v.pop(),x.appendChild(t);x!==m?(b.appendChild(x),k=t):k=b;0<q.length?h.data=q.data:c.push(h);h=l;u=l.length;k.appendChild(h);for(a.insertBefore(b,r);0<c.length;){m=c.pop();for(m.data="";m.parentNode&&0===m.parentNode.innerText.length;)m=m.parentNode;d.removeItem(m)}A=!0;break}D(m)}}})(a);return{startContainer:g,startOffset:p,endContainer:h,endOffset:u}},_wrapLineNodes:function(a,b,d){(function l(a,c){for(var b= | ||
a.childNodes,g=0,e=b.length;g<e;g++){var p=b[g],f=c;if(d(p)){var r=p.cloneNode(!1);c.appendChild(r);1===p.nodeType&&(f=r)}l(p,f)}})(a,b);a.innerHTML="";a.appendChild(b)},_wrapLineNodesStart:function(a,b,e,f,n){var c=document.createElement("P"),g=f,p=n,m=!1,q,h,u;(function t(d,f){for(var k=d.childNodes,l=0,r=k.length;l<r;l++){var n=k[l],v=f;if(m){if(1===n.nodeType){t(n,n);continue}h=n;for(q=[];null!==h.parentNode&&h!==a&&h!==b;)e(h)&&1===h.nodeType&&q.push(h.cloneNode(!1)),h=h.parentNode;if(0<q.length){for(u= | ||
h=q.pop();0<q.length;)h=q.pop(),u.appendChild(h);b.appendChild(u);f=h}else f=b}if(m||n!==g){if(!m||e(n)){var w=n.cloneNode(!1);f.appendChild(w);1===n.nodeType&&(v=w)}t(n,v)}else{n=document.createTextNode(g.substringData(0,p));v=document.createTextNode(g.substringData(p,g.length-p));0<n.data.length&&f.appendChild(n);h=f;for(q=[];h!==c&&null!==h;)e(h)&&1===h.nodeType&&q.push(h.cloneNode(!1)),h=h.parentNode;for(u=h=q.pop()||f;0<q.length;)h=q.pop(),u.appendChild(h);u!==f?(b.appendChild(u),f=h):f=b;c.appendChild(b); | ||
g=v;p=0;m=!0;f.appendChild(g)}}})(a,c);a.parentNode.insertBefore(c,a);d.removeItem(a);return{container:g,offset:p}},_wrapLineNodesEnd:function(a,b,e,f,n){var c=document.createElement("P"),g=f,p=n,m=!1,q,h,u;(function t(d,f){for(var k=d.childNodes,n=k.length-1;0<=n;n--){var l=k[n],r=f;if(m){if(1===l.nodeType){t(l,l);continue}h=l;for(q=[];null!==h.parentNode&&h!==a&&h!==b;)e(h)&&1===h.nodeType&&q.push(h.cloneNode(!1)),h=h.parentNode;if(0<q.length){for(u=h=q.pop();0<q.length;)h=q.pop(),u.insertBefore(h, | ||
u.firstChild);b.insertBefore(u,b.firstChild);f=h}else f=b}if(m||l!==g){if(!m||e(l)){var v=l.cloneNode(!1);f.insertBefore(v,f.firstChild);1===l.nodeType&&(r=v)}t(l,r)}else{l=document.createTextNode(g.substringData(p,g.length-p));r=document.createTextNode(g.substringData(0,p));0<l.data.length&&f.insertBefore(l,f.firstChild);h=f;for(q=[];h!==c&&null!==h;)e(h)&&1===h.nodeType&&q.push(h.cloneNode(!1)),h=h.parentNode;for(u=h=q.pop()||f;0<q.length;)h=q.pop(),u.insertBefore(h,u.firstChild);u!==f?(b.insertBefore(u, | ||
b.firstChild),f=h):f=b;c.insertBefore(b,c.firstChild);g=r;p=r.data.length;m=!0;f.insertBefore(g,f.firstChild)}}})(a,c);a.parentNode.insertBefore(c,a);d.removeItem(a);return{container:g,offset:p}},indent:function(a,b){var c=d.getParentNode(a,"P");if(c){var g=/\d+/.test(c.style.marginLeft)?1*c.style.marginLeft.match(/\d+/)[0]:0;g="indent"===b?g+25:g-25;c.style.marginLeft=(0>g?0:g)+"px"}},toggleDisplayBlocks:function(){SUNEDITOR.dom.toggleClass(a.element.wysiwygWindow.document.body,"sun-editor-show-block")}, | ||
toggleCodeView:function(){if(this._variable.wysiwygActive)a.element.code.value=a.element.wysiwygWindow.document.body.innerHTML.trim().replace(/<\/p>(?=[^\n])/gi,"</p>\n"),a.element.wysiwygElement.style.display="none",a.element.code.style.display="block",this._variable.wysiwygActive=!1;else{var b={"&":"&"," ":"\u00a0","<":"<",">":">"},d=a.element.code.value.replace(/&[a-z]+;/g,function(a){return"string"===typeof b[a]?b[a]:a});a.element.wysiwygWindow.document.body.innerHTML=0<d.trim().length? | ||
d:"<p></p>";a.element.wysiwygWindow.document.body.scrollTop=0;a.element.code.style.display="none";a.element.wysiwygElement.style.display="block";this._variable.wysiwygActive=!0}},toggleFullScreen:function(b){this._variable.isFullScreen?(a.element.topArea.style.cssText=this._variable.originCssText,a.element.editorArea.style.height=this._variable.editorHeight+"px",d.removeClass(b.firstElementChild,"ico_full_screen_i"),d.addClass(b.firstElementChild,"ico_full_screen_e")):(a.element.topArea.style.position= | ||
"fixed",a.element.topArea.style.top="0",a.element.topArea.style.left="0",a.element.topArea.style.width="100%",a.element.topArea.style.height="100%",this._variable.innerHeight_fullScreen=window.innerHeight-a.tool.bar.offsetHeight,a.element.editorArea.style.height=this._variable.innerHeight_fullScreen+"px",d.removeClass(b.firstElementChild,"ico_full_screen_e"),d.addClass(b.firstElementChild,"ico_full_screen_i"));this._variable.isFullScreen=!this._variable.isFullScreen},openPreview:function(){var b= | ||
window.open("","_blank");b.mimeType="text/html";b.document.head.innerHTML='<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1"><title>'+SUNEDITOR.lang.toolbar.preview+'</title><link rel="stylesheet" type="text/css" href="'+e.getBasePath+'css/suneditor-contents.css">';b.document.body.className="sun-editor-editable";b.document.body.innerHTML=a.element.wysiwygWindow.document.body.innerHTML}},f={_shortcutKeyCode:{66:["bold","B"],83:["strikethrough","STRIKE"],85:["underline", | ||
"U"],73:["italic","I"],89:["redo"],90:["undo"],219:["outdent"],221:["indent"]},_directionKeyKeyCode:/^(?:8|13|32|46|33|34|35|36|37|38|39|40|98|100|102|104)$/,_findButtonEffectTag:function(){for(var c=b._variable.selectionNode,g=!0,f=!0,e=!0,n="B|U|I|STRIKE|FONT|SIZE|SUB|SUP|",r=new RegExp(n,"i"),l;!/^(?:P|BODY|HTML|DIV)$/i.test(c.nodeName);){if(3!==c.nodeType){var k=[/^STRONG$/.test(c.nodeName)?"B":/^EM/.test(c.nodeName)?"I":c.nodeName];g&&1===c.nodeType&&(0<c.style.fontFamily.length||c.face&&0<c.face.length)&& | ||
(k.push("FONT"),g=(c.style.fontFamily||c.face||SUNEDITOR.lang.toolbar.font).replace(/["']/g,""),d.changeTxt(b.commandMap.FONT,g),g=!1,n=n.replace("FONT|",""),r=new RegExp(n,"i"));e&&/^A$/i.test(c.nodeName)&&null===c.getAttribute("data-image-link")?(a.link&&b.controllerArray[0]===a.link.linkBtn||b.callModule("dialog","link",null,function(){SUNEDITOR.plugin.link.call_controller_linkButton.call(b,c)}),e=!1):e&&a.link&&b.controllerArray[0]===a.link.linkBtn&&b.controllersOff();f&&0<c.style.fontSize.length&& | ||
(d.changeTxt(b.commandMap.SIZE,c.style.fontSize.match(/\d+/)[0]),f=!1,n=n.replace("SIZE|",""),r=new RegExp(n,"i"));l=c.style.cssText;/:\s*bold(?:;|\s)/.test(l)&&k.push("B");/:\s*underline(?:;|\s)/.test(l)&&k.push("U");/:\s*italic(?:;|\s)/.test(l)&&k.push("I");/:\s*line-through(?:;|\s)/.test(l)&&k.push("STRIKE");for(l=0;l<k.length;l++)r.test(k[l])&&(d.addClass(b.commandMap[k[l]],"on"),n=n.replace(k[l]+"|",""),r=new RegExp(n,"i"))}c=c.parentNode}e&&b.controllersOff();n=n.split("|");f=0;for(e=n.length- | ||
1;f<e;f++)/^FONT/i.test(n[f])?d.changeTxt(b.commandMap[n[f]],SUNEDITOR.lang.toolbar.font):/^SIZE$/i.test(n[f])?d.changeTxt(b.commandMap[n[f]],SUNEDITOR.lang.toolbar.fontSize):d.removeClass(b.commandMap[n[f]],"on")},resize_window:function(){b._variable.isFullScreen&&(b._variable.innerHeight_fullScreen+=window.innerHeight-a.tool.bar.offsetHeight-b._variable.innerHeight_fullScreen,a.element.editorArea.style.height=b._variable.innerHeight_fullScreen+"px")},touchstart_toolbar:function(){b._variable.isTouchMove= | ||
!1},touchmove_toolbar:function(){b._variable.isTouchMove=!0},onClick_toolbar:function(c){if(b._variable.isTouchMove)return!0;for(var g=c.target,f=g.getAttribute("data-display"),e=g.getAttribute("data-command"),n=g.className;!e&&!/editor_tool/.test(n)&&!/sun-editor-id-toolbar/.test(n);)g=g.parentNode,e=g.getAttribute("data-command"),f=g.getAttribute("data-display"),n=g.className;if(!e&&!f)return!0;c.preventDefault();c.stopPropagation();b.submenuOff();b.focus();if(f)c=b.submenu,b.submenuOff(),!/submenu/.test(f)|| | ||
null!==g.nextElementSibling&&g.nextElementSibling===c?/dialog/.test(f)&&b.callModule("dialog",e,null,function(){SUNEDITOR.plugin.dialog.openDialog.call(b,e,g.getAttribute("data-option"),!1)}):b.callModule("submenu",e,g,function(){b.submenuOn(g)});else if(e)switch(e){case "codeView":b.toggleCodeView();d.toggleClass(g,"on");break;case "fullScreen":b.toggleFullScreen(g);d.toggleClass(g,"on");break;case "indent":case "outdent":b.indent(b._variable.selectionNode,e);break;case "redo":case "undo":case "removeFormat":b.execCommand(e, | ||
!1,null);break;case "preview":b.openPreview();break;case "print":a.element.wysiwygWindow.print();break;case "showBlocks":b.toggleDisplayBlocks();d.toggleClass(g,"on");break;default:b.execCommand(e,!1,g.getAttribute("data-value")),d.toggleClass(g,"on"),/^subscript$/.test(e)?SUNEDITOR.dom.removeClass(a.tool.superscript,"on"):/^superscript$/.test(e)&&SUNEDITOR.dom.removeClass(a.tool.subscript,"on")}},onMouseUp_wysiwyg:function(a){a.stopPropagation();var c=a.target;b.submenuOff();/^HTML$/i.test(c.nodeName)? | ||
(a.preventDefault(),b.focus()):/^IMG$/i.test(c.nodeName)?(a.preventDefault(),b.callModule("dialog","image",null,function(){var a=SUNEDITOR.plugin.dialog.call_controller_resize.call(b,c,"image");SUNEDITOR.plugin.image.onModifyMode.call(b,c,a)})):(b._setSelectionNode(),f._findButtonEffectTag())},onKeyDown_wysiwyg:function(c){b._setSelectionNode();var g=c.keyCode,e=c.shiftKey,u=c.ctrlKey||c.metaKey,n=c.altKey;c.stopPropagation();if(u&&!/^(?:16|17|18)$/.test(g)){var r;if(r=!(e&&83!==g))(r=f._shortcutKeyCode[g])? | ||
(b.execCommand(r[0],!1,null),d.toggleClass(b.commandMap[r[1]],"on"),r=!0):r=!1;if(r){c.preventDefault();return}}switch(g){case 8:if(/^P$/i.test(b._variable.selectionNode.tagName)&&null===b._variable.selectionNode.previousSibling)return c.preventDefault(),!1;break;case 9:if(c.preventDefault(),!u&&!n){for(c=b._variable.selectionNode||b.getSelection().anchorNode;!/^TD$/i.test(c.tagName)&&!/^BODY$/i.test(c.tagName);)c=c.parentNode;if(c&&/^TD$/i.test(c.tagName)){g=d.getParentNode(c,"table");g=d.getListChildren(g, | ||
d.isCell);c=e?d.prevIdx(g,c):d.nextIdx(g,c);c!==g.length||e||(c=0);-1===c&&e&&(c=g.length-1);c=g[c];if(!c)return!1;e=b.createRange();e.setStart(c,0);e.setEnd(c,0);c=b.getSelection();0<c.rangeCount&&c.removeAllRanges();c.addRange(e)}else e||(e=a.element.wysiwygWindow.document.createTextNode(Array(b._variable.tabSize+1).join("\u00a0")),b.insertNode(e,null),c=b.getSelection(),g=b.createRange(),g.setStart(e,b._variable.tabSize),g.setEnd(e,b._variable.tabSize),0<c.rangeCount&&c.removeAllRanges(),c.addRange(g))}}}, | ||
onKeyUp_wysiwyg:function(a){b._setSelectionNode();f._directionKeyKeyCode.test(a.keyCode)&&f._findButtonEffectTag()},onScroll_wysiwyg:function(){b.controllersOff()},onDrop_wysiwyg:function(a){var c=a.dataTransfer.files;if(0===c.length)return!0;a.stopPropagation();a.preventDefault();b.focus();b.callModule("dialog","image",null,function(){b.context.image.imgInputFile.files=c;SUNEDITOR.plugin.image.onRender_imgInput.call(b);b.context.image.imgInputFile.files=null})},onMouseDown_resizeBar:function(c){function d(){a.element.resizeBackground.style.display= | ||
"none";document.removeEventListener("mousemove",f.resize_editor);document.removeEventListener("mouseup",d)}c.stopPropagation();b._variable.resizeClientY=c.clientY;a.element.resizeBackground.style.display="block";document.addEventListener("mousemove",f.resize_editor);document.addEventListener("mouseup",d)},resize_editor:function(c){var d=c.clientY-b._variable.resizeClientY;a.element.editorArea.style.height=a.element.editorArea.offsetHeight+d+"px";b._variable.editorHeight=a.element.editorArea.offsetHeight+ | ||
d;b._variable.resizeClientY=c.clientY}};a.tool.bar.addEventListener("touchstart",f.touchstart_toolbar);a.tool.bar.addEventListener("touchmove",f.touchmove_toolbar);a.tool.bar.addEventListener("touchend",f.onClick_toolbar);a.tool.bar.addEventListener("click",f.onClick_toolbar);a.element.wysiwygWindow.addEventListener("mouseup",f.onMouseUp_wysiwyg);a.element.wysiwygWindow.addEventListener("keydown",f.onKeyDown_wysiwyg);a.element.wysiwygWindow.addEventListener("keyup",f.onKeyUp_wysiwyg);a.element.wysiwygWindow.addEventListener("scroll", | ||
f.onScroll_wysiwyg);a.element.wysiwygWindow.addEventListener("drop",f.onDrop_wysiwyg);a.element.resizebar.addEventListener("mousedown",f.onMouseDown_resizeBar);window.addEventListener("resize",f.resize_window);return{save:function(){a.element.textElement.innerHTML=b._variable.wysiwygActive?a.element.wysiwygWindow.document.body.innerHTML:a.element.code.value},getContent:function(){var c="";return 0===a.element.wysiwygWindow.document.body.innerText.trim().length?c:c=b._variable.wysiwygActive?a.element.wysiwygWindow.document.body.innerHTML: | ||
a.element.code.value},setContent:function(c){c=z(c);b._variable.wysiwygActive?a.element.wysiwygWindow.document.body.innerHTML=c:a.element.code.value=c},appendContent:function(c){if(b._variable.wysiwygActive){var d=document.createElement("P");d.innerHTML=c;a.element.wysiwygWindow.document.body.appendChild(d)}else a.element.code.value+=c},disabled:function(){a.tool.cover.style.display="block";a.element.wysiwygWindow.document.body.setAttribute("contenteditable",!1)},enabled:function(){a.tool.cover.style.display= | ||
"none";a.element.wysiwygWindow.document.body.setAttribute("contenteditable",!0)},show:function(){var c=a.element.topArea.style;c.cssText=b._variable.originCssText;"none"===c.display&&(c.display="block")},hide:function(){a.element.topArea.style.display="none"},destroy:function(){a.element.topArea.parentNode.removeChild(a.element.topArea);a.element.textElement.style.display="";this.destroy=this.hide=this.show=this.enabled=this.disabled=this.appendContent=this.setContent=this.getContent=this.save=null}}}; | ||
SUNEDITOR.lang=SUNEDITOR.lang||SUNEDITOR.defaultLang;SUNEDITOR.create=function(a,d){var e=document.getElementById(a);if(null===e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+a+'")');var b=C(e,d);if(document.getElementById(b.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+b.constructed._top.id+'")');e.style.display="none";"object"===typeof e.nextElementSibling?e.parentNode.insertBefore(b.constructed._top, | ||
e.nextElementSibling):e.parentNode.appendChild(b.constructed._top);var f=b.constructed;b=b.options;e={element:{textElement:e,topArea:f._top,relative:f._relative,resizebar:f._resizeBar,editorArea:f._editorArea,wysiwygWindow:f._editorArea.getElementsByClassName("sun-editor-id-wysiwyg")[0].contentWindow,wysiwygElement:f._editorArea.getElementsByClassName("sun-editor-id-wysiwyg")[0],code:f._editorArea.getElementsByClassName("sun-editor-id-code")[0],loading:f._loading,resizeBackground:f._resizeBack},tool:{bar:f._toolBar, | ||
cover:f._toolBar.getElementsByClassName("sun-editor-id-toolbar-cover")[0],bold:f._toolBar.getElementsByClassName("sun-editor-id-bold")[0],underline:f._toolBar.getElementsByClassName("sun-editor-id-underline")[0],italic:f._toolBar.getElementsByClassName("sun-editor-id-italic")[0],strike:f._toolBar.getElementsByClassName("sun-editor-id-strike")[0],subscript:f._toolBar.getElementsByClassName("sun-editor-id-subscript")[0],superscript:f._toolBar.getElementsByClassName("sun-editor-id-superscript")[0],font:f._toolBar.getElementsByClassName("sun-editor-font-family")[0], | ||
fontSize:f._toolBar.getElementsByClassName("sun-editor-font-size")[0]},user:{videoX:b.videoX,videoY:b.videoY,imageFileInput:b.imageFileInput,imageUrlInput:b.imageUrlInput,imageSize:b.imageSize,imageUploadUrl:b.imageUploadUrl,addFont:b.addFont,fontList:b.fontList,fontSizeList:b.fontSizeList,height:b.height.match(/\d+/)[0]}};return E(e,SUNEDITOR.dom,SUNEDITOR.util)};SUNEDITOR.destroy=function(a){var d=document.getElementById("suneditor_"+a);d.parentNode.removeChild(d);document.getElementById(a).style.display= | ||
""}})(); | ||
(function(){function z(a){var d="";a=document.createRange().createContextualFragment(a.trim()).childNodes;for(var e=0,b=a.length;e<b;e++){var g=a[e].outerHTML||a[e].textContent;d=/^(?:P|TABLE|H[1-6]|DIV)$/i.test(a[e].tagName)?d+g:d+("<P>"+g+"</p>")}0===d.length&&(d="<p></p>");return d}function B(a){var d='<div class="sun-editor-id-toolbar-cover"></div>',e=null;var b=SUNEDITOR.lang;b={font:["btn_font",b.toolbar.font,"font","submenu","",'<span class="txt sun-editor-font-family">'+b.toolbar.font+ | ||
'</span><span class="arrow-more-down"></span>'],formats:["btn_format",b.toolbar.formats,"formatBlock","submenu","",'<span class="txt sun-editor-font-format">'+b.toolbar.formats+'</span><span class="arrow-more-down"></span>'],fontSize:["btn_size",b.toolbar.fontSize,"fontSize","submenu","",'<span class="txt sun-editor-font-size">'+b.toolbar.fontSize+'</span><span class="arrow-more-down"></span>'],bold:["sun-editor-id-bold",b.toolbar.bold+"(Ctrl+B)","bold","","",'<div class="icon-bold"></div>'],underline:["sun-editor-id-underline", | ||
b.toolbar.underline+"(Ctrl+U)","underline","","",'<div class="icon-underline"></div>'],italic:["sun-editor-id-italic",b.toolbar.italic+"(Ctrl+I)","italic","","",'<div class="icon-italic"></div>'],strike:["sun-editor-id-strike",b.toolbar.strike+"(Ctrl+SHIFT+S)","strikethrough","","",'<div class="icon-strokethrough"></div>'],subscript:["sun-editor-id-subscript",b.toolbar.subscript,"subscript","","",'<div class="icon-subscript"></div>'],superscript:["sun-editor-id-superscript",b.toolbar.superscript, | ||
"superscript","","",'<div class="icon-superscript"></div>'],removeFormat:["",b.toolbar.removeFormat,"removeFormat","","",'<div class="icon-erase"></div>'],fontColor:["",b.toolbar.fontColor,"foreColor","submenu","",'<div class="icon-foreColor"></div>'],hiliteColor:["",b.toolbar.hiliteColor,"hiliteColor","submenu","",'<div class="icon-hiliteColor"></div>'],indent:["",b.toolbar.indent+"(Ctrl + [)","indent","","",'<div class="icon-indent-right"></div>'],outdent:["",b.toolbar.outdent+"(Ctrl + ])","outdent", | ||
"","",'<div class="icon-indent-left"></div>'],align:["btn_align",b.toolbar.align,"align","submenu","",'<div class="icon-align-left"></div>'],list:["",b.toolbar.list,"list","submenu","",'<div class="icon-list-number"></div>'],line:["btn_line",b.toolbar.line,"horizontalRules","submenu","",'<hr style="border-width: 1px 0 0; border-style: solid none none; border-color: black; border-image: initial; height: 1px;" /><hr style="border-width: 1px 0 0; border-style: dotted none none; border-color: black; border-image: initial; height: 1px;" /><hr style="border-width: 1px 0 0; border-style: dashed none none; border-color: black; border-image: initial; height: 1px;" />'], | ||
table:["",b.toolbar.table,"table","submenu","",'<div class="icon-grid"></div>'],link:["",b.toolbar.link,"link","dialog","",'<div class="icon-link"></div>'],image:["",b.toolbar.image,"image","dialog","",'<div class="icon-image"></div>'],video:["",b.toolbar.video,"video","dialog","",'<div class="icon-video"></div>'],fullScreen:["",b.toolbar.fullScreen,"fullScreen","","",'<div class="icon-expansion"></div>'],showBlocks:["",b.toolbar.showBlocks,"showBlocks","","",'<div class="icon-showBlocks"></div>'], | ||
codeView:["",b.toolbar.codeView,"codeView","","",'<div class="icon-code-view"></div>'],undo:["",b.toolbar.undo+" (Ctrl+Z)","undo","","",'<div class="icon-undo"></div>'],redo:["",b.toolbar.redo+" (Ctrl+Y)","redo","","",'<div class="icon-redo"></div>'],preview:["",b.toolbar.preview,"preview","","",'<div class="icon-preview"></div>'],print:["",b.toolbar.print,"print","","",'<div class="icon-print"></div>']};for(var g=0;g<a.length;g++){var c=a[g];if("object"===typeof c){for(var f=0;f<c.length;f++){var q= | ||
c[f];q="object"===typeof q?[q.className,q.title,q.dataCommand,q.dataDisplay,q.displayOption,q.innerHTML]:b[q];e+='<li> <button type="button" class="btn_editor '+q[0]+'" title="'+q[1]+'" data-command="'+q[2]+'" data-display="'+q[3]+'" data-option="'+q[4]+'">'+q[5]+" </button></li>"}e=e?'<div class="tool_module"><ul class="editor_tool">'+e+"</ul></div>":"";d+=e;e=null}else/^\/$/.test(c)&&(d+='<div class="tool_module_enter"></div>')}return d}function C(a,d){"object"!==typeof d&&(d={});d.addFont= | ||
d.addFont||null;d.videoX=d.videoX||560;d.videoY=d.videoY||315;d.imageFileInput=void 0===d.imageFileInput?!0:d.imageFileInput;d.imageUrlInput=void 0!==d.imageUrlInput&&d.imageFileInput?d.imageUrlInput:!0;d.imageSize=d.imageSize||350;d.imageUploadUrl=d.imageUploadUrl||null;d.fontList=d.fontList||null;d.fontSizeList=d.fontSizeList||null;d.height=/^\d+/.test(d.height)?/^\d+$/.test(d.height)?d.height+"px":d.height:a.clientHeight+"px";d.buttonList=d.buttonList||[["undo","redo"],["font","fontSize","formats"], | ||
"bold underline italic strike subscript superscript".split(" "),["removeFormat"],"/",["fontColor","hiliteColor"],["indent","outdent"],["align","line","list","table"],["link","image","video"],["fullScreen","showBlocks","codeView"],["preview","print"]];d.width=/^\d+/.test(d.width)?/^\d+$/.test(d.width)?d.width+"px":d.width:/%|auto/.test(a.style.width)?a.style.width:a.clientWidth+"px";d.display=d.display||("none"!==a.style.display&&a.style.display?a.style.display:"block");var e=document,b=e.createElement("DIV"); | ||
b.className="sun-editor";b.id="suneditor_"+a.id;b.style.width=d.width;b.style.display=d.display;var g=e.createElement("DIV");g.className="sun-editor-container";var c=e.createElement("DIV");c.className="sun-editor-id-toolbar";c.innerHTML=B(d.buttonList);var f=e.createElement("DIV");f.className="sun-editor-id-editorArea";f.style.height=d.height;var q=e.createElement("IFRAME");q.allowFullscreen=!0;q.frameBorder=0;q.className="input_editor sun-editor-id-wysiwyg";q.style.display="block";var u=e.createElement("TEXTAREA"); | ||
u.className="input_editor html sun-editor-id-code";u.style.display="none";q.addEventListener("load",function(){this.setAttribute("scrolling","auto");this.contentWindow.document.head.innerHTML='<meta charset="utf-8" /><title>SunEditor</title><link rel="stylesheet" type="text/css" href="'+SUNEDITOR.util.getBasePath+'css/suneditor-contents.css">';this.contentWindow.document.body.className="sun-editor-editable";this.contentWindow.document.body.setAttribute("contenteditable",!0);this.contentWindow.document.body.innerHTML= | ||
z(a.value)});var v=e.createElement("DIV");v.className="sun-editor-id-resizeBar";var l=e.createElement("DIV");l.className="sun-editor-id-loading";l.innerHTML='<div class="loading-effect"></div>';e=e.createElement("DIV");e.className="sun-editor-id-resize-background";f.appendChild(q);f.appendChild(u);g.appendChild(c);g.appendChild(f);g.appendChild(v);g.appendChild(e);g.appendChild(l);b.appendChild(g);return{constructed:{_top:b,_relative:g,_toolBar:c,_editorArea:f,_resizeBar:v,_loading:l,_resizeBack:e}, | ||
options:d}}SUNEDITOR.util={getXMLHttpRequest:function(){if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(d){return null}}else return window.XMLHttpRequest?new XMLHttpRequest:null},copyObj:function(a){var d={},e;for(e in a)d[e]=a[e];return d},getBasePath:function(){var a=SUNEDITOR.SUNEDITOR_BASEPATH||"";if(!a)for(var d=document.getElementsByTagName("script"),e=0;e<d.length;e++){var b=d[e].src.match(/(^|.*[\\\/])suneditor(\.min)?\.js(?:\?.*|;.*)?$/i); | ||
if(b){a=b[1];break}}-1===a.indexOf(":/")&&"//"!==a.slice(0,2)&&(a=0===a.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+a:location.href.match(/^[^\?]*\/(?:)/)[0]+a);if(!a)throw'[SUNEDITOR.util.getBasePath.fail] The SUNEDITOR installation path could not be automatically detected. Please set the global variable "SUNEDITOR.SUNEDITOR_BASEPATH" before creating editor instances.';return a}(),includeFile:function(a,d,e){var b=document.createElement("script");b.type=a;b.src=d;b.onload=e;document.getElementsByTagName("head")[0].appendChild(b)}}; | ||
SUNEDITOR.dom={getArrayIndex:function(a,d){for(var e=-1,b=0,g=a.length;b<g;b++)if(a[b]===d){e=b;break}return e},nextIdx:function(a,d){var e=this.getArrayIndex(a,d);return-1===e?-1:e+1},prevIdx:function(a,d){var e=this.getArrayIndex(a,d);return-1===e?-1:e-1},isCell:function(a){return a&&/^(?:TD|TH)$/i.test(a.nodeName)},getListChildren:function(a,d){var e=[];d=d||function(){return!0};(function c(g){a!==g&&d(g)&&e.push(g);for(var f=0,q=g.children.length;f<q;f++)c(g.children[f])})(a);return e},getListChildNodes:function(a, | ||
d){var e=[];d=d||function(){return!0};(function c(a){d(a)&&e.push(a);for(var f=0,q=a.childNodes.length;f<q;f++)c(a.childNodes[f])})(a);return e},getParentNode:function(a,d){if(/\./.test(d)){var e="className";d=d.split(".")[1]}else/#/.test(d)?(e="id",d="^"+d.split("#")[1]+"$"):/:/.test(d)?(e="name",d="^"+d.split(":")[1]+"$"):(e="tagName",d="^"+d+"$");for(var b=new RegExp(d,"i");a&&(3===a.nodeType||!b.test(a[e]));){if(/^BODY$/i.test(a.tagName))return null;a=a.parentNode}return a},changeTxt:function(a, | ||
d){a&&d&&(a.textContent=d)},addClass:function(a,d){a&&!(new RegExp("(\\s|^)"+d+"(\\s|$)")).test(a.className)&&(a.className+=" "+d)},removeClass:function(a,d){a&&(a.className=a.className.replace(new RegExp("(\\s|^)"+d+"(\\s|$)")," ").trim())},toggleClass:function(a,d){if(a){var e=new RegExp("(\\s|^)"+d+"(\\s|$)");e.test(a.className)?a.className=a.className.replace(e," ").trim():a.className+=" "+d}},removeItem:function(a){try{a.remove()}catch(d){a.parentNode.removeChild(a)}}};var E=function(a,d,e){var b= | ||
{context:a,loadedPlugins:{},dialogForm:null,submenu:null,submenuActiveButton:null,controllerArray:[],commandMap:{FONT:a.tool.font,FORMAT:a.tool.format,B:a.tool.bold,U:a.tool.underline,I:a.tool.italic,STRIKE:a.tool.strike,SUB:a.tool.subscript,SUP:a.tool.superscript,SIZE:a.tool.fontSize},_variable:{selectionNode:null,copySelection:null,wysiwygActive:!0,isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,originCssText:a.element.topArea.style.cssText,editorHeight:a.user.height,isTouchMove:!1}, | ||
callModule:function(c,a,b,d){var f=e.getBasePath+"plugins/"+c;if("dialog"===c){var q=this._callBack_addModule.bind(this,"dialog","dialog",b,this.callModule.bind(this,c,a,b,d));if(!SUNEDITOR.plugin.dialog){e.includeFile("text/javascript",f+"/dialog.js",q);return}if(!this.loadedPlugins.dialog){q();return}}SUNEDITOR.plugin[a]?this.loadedPlugins[a]?"function"===typeof d&&d():this._callBack_addModule(c,a,b,d):e.includeFile("text/javascript",f+"/"+a+".js",this._callBack_addModule.bind(this,c,a,b,d))},_callBack_addModule:function(c, | ||
a,b,d){this.context[c]||(this.context[c]={});SUNEDITOR.plugin[a].add(this,b);this.loadedPlugins[a]=!0;"function"===typeof d&&d()},submenuOn:function(c){this.submenu=c.nextElementSibling;this.submenu.style.display="block";d.addClass(c,"on");this.submenuActiveButton=c},submenuOff:function(){this.submenu&&(this.submenu.style.display="none",this.submenu=null,d.removeClass(this.submenuActiveButton,"on"),this.submenuActiveButton=null);a.image&&!0===a.image._onCaption&&SUNEDITOR.plugin.image.toggle_caption_contenteditable.call(b, | ||
!1);this.controllersOff()},controllersOff:function(){var c=this.controllerArray.length;if(0<c){for(var a=0;a<c;a++)this.controllerArray[a].style.display="none";this.controllerArray=[]}},execCommand:function(c,f,b){a.element.wysiwygWindow.document.execCommand(c,f,b)},focus:function(){var c=d.getParentNode(this._variable.selectionNode,"figcaption");c?c.focus():a.element.wysiwygWindow.document.body.focus()},_setSelectionNode:function(){this._variable.copySelection=e.copyObj(this.getSelection());var c= | ||
this.getRange();this._variable.selectionNode=c.startContainer!==c.endContainer?c.startContainer:this.getSelectionNode()},isEdgePoint:function(c,a){return 0===a||a===c.nodeValue.length},createRange:function(){return a.element.wysiwygWindow.document.createRange()},getSelection:function(){return a.element.wysiwygWindow.getSelection()},getSelectionNode:function(){return this.getSelection().extentNode||this.getSelection().anchorNode},getRange:function(){var c=this.getSelection();if(0<c.rangeCount)var b= | ||
c.getRangeAt(0);else b=this.createRange(),(c=this._variable.copySelection)?(b.setStart(c.anchorNode,c.anchorOffset),b.setEnd(c.focusNode,c.focusOffset)):(c=a.element.wysiwygWindow.document.body.firstChild,b.setStart(c,0),b.setEnd(c,0));return b},setRange:function(c,a,b,d){var f=this.createRange();f.setStart(c,a);f.setEnd(b,d);c=this.getSelection();0<c.rangeCount&&c.removeAllRanges();c.addRange(f)},showLoading:function(){a.element.loading.style.display="block"},closeLoading:function(){a.element.loading.style.display= | ||
"none"},getLineElement:function(c){c=c||this._variable.selectionNode;if(!c||/^(?:HTML|BODY)$/i.test(c.tagName))c=a.element.wysiwygWindow.document.body.firstChild;else for(;!/^BODY$/i.test(c.parentNode.tagName);)c=c.parentNode;return c},appendP:function(c){var a=document.createElement("P");a.innerHTML="";c=this.getLineElement(c);c.parentNode.insertBefore(a,c.nextElementSibling);return a},insertNode:function(c,a){if(a){var b=a.parentNode;a=a.nextSibling}else{var d=this.getSelection();b=this.getRange(); | ||
var f=b.startContainer,e=b.startOffset,g=b.endContainer,k=b.endOffset;b=f;3===f.nodeType&&(b=f.parentNode);if(f===g&&e===k)d.focusNode&&3===d.focusNode.nodeType?a=d.focusNode.splitText(k):(null!==b.lastChild&&/^BR$/i.test(b.lastChild.nodeName)&&b.removeChild(b.lastChild),a=null);else if(f===g)d=f,this.isEdgePoint(g,k)||(a=g.splitText(k)),this.isEdgePoint(f,e)||(d=f.splitText(e)),b.removeChild(d);else for(d.deleteFromDocument?d.deleteFromDocument():this.removeNode(),a=g;1!==a.nodeType;)a=a.parentNode}try{b.insertBefore(c, | ||
a)}catch(n){b.appendChild(c)}},removeNode:function(){var c=this.getRange(),a=c.startContainer,b=c.startOffset,e=c.endContainer,g=c.endOffset;c=d.getListChildNodes(c.commonAncestorContainer);var l=d.getArrayIndex(c,a),m=d.getArrayIndex(c,e);var k=l+1;for(var n=a;0<=k;k--)c[k]===n.parentNode&&c[k].firstChild===n&&0===b&&(l=k,n=n.parentNode);k=m-1;for(n=e;k>l;k--)c[k]===n.parentNode&&1===c[k].nodeType&&(c.splice(k,1),n=n.parentNode,--m);for(;l<=m;l++)k=c[l],0===k.length||3===k.nodeType&&void 0===k.data? | ||
d.removeItem(k):k===a?(k=1===a.nodeType?document.createTextNode(a.textContent):document.createTextNode(a.substringData(0,b)),0<k.length?a.data=k.data:d.removeItem(a)):k===e?(k=1===e.nodeType?document.createTextNode(e.textContent):document.createTextNode(e.substringData(g,e.length-g)),0<k.length?e.data=k.data:d.removeItem(e)):d.removeItem(k)},wrapRangeToTag:function(c,a){var b=this.getRange(),f=b.startContainer,e=b.startOffset,g=b.endContainer,m=b.endOffset,k=b.commonAncestorContainer;b={};var n={}, | ||
p;if(a){var h="(?:;|^|\\s)(?:"+a[0];for(p=1;p<a.length;p++)h+="|"+a[p];h+=")\\s*:[^;]*\\s*(?:;|$)";h=new RegExp(h,"gi")}if(f===g){p=c.cloneNode(!1);if(e===m)p.innerHTML=" ",f.parentNode.insertBefore(p,f.nextSibling);else{g=document.createTextNode(f.substringData(0,e));var w=document.createTextNode(f.substringData(m,f.length-m));p.innerText=f.substringData(e,m-e);f.parentNode.insertBefore(p,f.nextSibling);f.data=0<g.data.length?g.data:f.substringData(0,e);0<w.data.length&&f.parentNode.insertBefore(w, | ||
p.nextSibling)}b.container=p;b.offset=0;n.container=p;n.offset=1}else if(w=function(a){if(3===a.nodeType)return!0;var b="";h&&0<a.style.cssText.length&&(b=a.style.cssText.replace(h,"").trim());return a.nodeName!==c.nodeName||0<b.length?(0<a.style.cssText.length&&(a.style.cssText=b),!0):!1},/BODY/i.test(k.nodeName)){n=d.getListChildren(k,function(a){return/^P$/i.test(a.nodeName)});var y=d.getParentNode(f,"P");k=d.getParentNode(g,"P");b=0;for(p=n.length;b<p;b++)if(y===n[b])y=b;else if(k===n[b]){k=b; | ||
break}p=c.cloneNode(!1);b=this._wrapLineNodesStart(n[y],p,w,f,e);for(f=y+1;f<k;f++)p=c.cloneNode(!1),this._wrapLineNodes(n[f],p,w);p=c.cloneNode(!1);n=this._wrapLineNodesEnd(n[k],p,w,g,m)}else p=c.cloneNode(!1),m=this._wrapLineNodesPart(k,p,w,f,e,g,m),b.container=m.startContainer,b.offset=m.startOffset,n.container=m.endContainer,n.offset=m.endOffset;this.setRange(b.container,b.offset,n.container,n.offset)},_wrapLineNodesPart:function(a,b,e,g,v,l,m){var c=[],f=g,q=v,h=l,u=m,y=!1,A=!1,t,r,x;(function D(g, | ||
k){for(var n=g.childNodes,l=0,p=n.length;l<p&&!A;l++){var m=n[l];if(y&&m!==h&&3===m.nodeType){for(t=[];r!==a&&null!==r;)e(r)&&1===r.nodeType&&t.push(r.cloneNode(!1)),r=r.parentNode;if(0<t.length){for(x=r=t.pop();0<t.length;)r=t.pop(),x.appendChild(r);b.appendChild(x);k=r}else k=b;k.appendChild(m.cloneNode(!1));c.push(m)}if(m===f){var w=document.createTextNode(f.substringData(0,q)),v=document.createTextNode(f.substringData(q,f.length-q));0<w.length?f.data=w.data:c.push(f);r=m;for(t=[];r!==a&&null!== | ||
r;)e(r)&&1===r.nodeType&&t.push(r.cloneNode(!1)),r=r.parentNode;for(x=r=t.pop()||m;0<t.length;)r=t.pop(),x.appendChild(r);x!==m?(b.appendChild(x),k=r):k=b;f=v;q=0;k.appendChild(f);y=!0}else{if(m===h){n=document.createTextNode(h.substringData(u,h.length-u));l=document.createTextNode(h.substringData(0,u));p=r=m;for(t=[];r!==a&&null!==r;)e(r)&&1===r.nodeType&&t.push(r.cloneNode(!1)),p=r,r=r.parentNode;for(x=r=t.pop()||m;0<t.length;)r=t.pop(),x.appendChild(r);x!==m?(b.appendChild(x),k=r):k=b;0<n.length? | ||
h.data=n.data:c.push(h);h=l;u=l.length;k.appendChild(h);for(a.insertBefore(b,p);0<c.length;){m=c.pop();for(m.data="";m.parentNode&&0===m.parentNode.innerText.length;)m=m.parentNode;d.removeItem(m)}A=!0;break}D(m)}}})(a);return{startContainer:f,startOffset:q,endContainer:h,endOffset:u}},_wrapLineNodes:function(a,b,d){(function m(a,c){for(var b=a.childNodes,f=0,e=b.length;f<e;f++){var g=b[f],q=c;if(d(g)){var l=g.cloneNode(!1);c.appendChild(l);1===g.nodeType&&(q=l)}m(g,q)}})(a,b);a.innerHTML="";a.appendChild(b)}, | ||
_wrapLineNodesStart:function(a,b,e,g,v){var c=document.createElement("P"),f=g,q=v,n=!1,p,h,u;(function r(d,g){for(var k=d.childNodes,m=0,l=k.length;m<l;m++){var t=k[m],v=g;if(n){if(1===t.nodeType){r(t,t);continue}h=t;for(p=[];null!==h.parentNode&&h!==a&&h!==b;)e(h)&&1===h.nodeType&&p.push(h.cloneNode(!1)),h=h.parentNode;if(0<p.length){for(u=h=p.pop();0<p.length;)h=p.pop(),u.appendChild(h);b.appendChild(u);g=h}else g=b}if(n||t!==f){if(!n||e(t)){var w=t.cloneNode(!1);g.appendChild(w);1===t.nodeType&& | ||
(v=w)}r(t,v)}else{t=document.createTextNode(f.substringData(0,q));v=document.createTextNode(f.substringData(q,f.length-q));0<t.data.length&&g.appendChild(t);h=g;for(p=[];h!==c&&null!==h;)e(h)&&1===h.nodeType&&p.push(h.cloneNode(!1)),h=h.parentNode;for(u=h=p.pop()||g;0<p.length;)h=p.pop(),u.appendChild(h);u!==g?(b.appendChild(u),g=h):g=b;c.appendChild(b);f=v;q=0;n=!0;g.appendChild(f)}}})(a,c);a.parentNode.insertBefore(c,a);d.removeItem(a);return{container:f,offset:q}},_wrapLineNodesEnd:function(a, | ||
b,e,g,v){var c=document.createElement("P"),f=g,q=v,n=!1,p,h,u;(function r(d,g){for(var k=d.childNodes,m=k.length-1;0<=m;m--){var l=k[m],t=g;if(n){if(1===l.nodeType){r(l,l);continue}h=l;for(p=[];null!==h.parentNode&&h!==a&&h!==b;)e(h)&&1===h.nodeType&&p.push(h.cloneNode(!1)),h=h.parentNode;if(0<p.length){for(u=h=p.pop();0<p.length;)h=p.pop(),u.insertBefore(h,u.firstChild);b.insertBefore(u,b.firstChild);g=h}else g=b}if(n||l!==f){if(!n||e(l)){var v=l.cloneNode(!1);g.insertBefore(v,g.firstChild);1=== | ||
l.nodeType&&(t=v)}r(l,t)}else{l=document.createTextNode(f.substringData(q,f.length-q));t=document.createTextNode(f.substringData(0,q));0<l.data.length&&g.insertBefore(l,g.firstChild);h=g;for(p=[];h!==c&&null!==h;)e(h)&&1===h.nodeType&&p.push(h.cloneNode(!1)),h=h.parentNode;for(u=h=p.pop()||g;0<p.length;)h=p.pop(),u.insertBefore(h,u.firstChild);u!==g?(b.insertBefore(u,b.firstChild),g=h):g=b;c.insertBefore(b,c.firstChild);f=t;q=t.data.length;n=!0;g.insertBefore(f,g.firstChild)}}})(a,c);a.parentNode.insertBefore(c, | ||
a);d.removeItem(a);return{container:f,offset:q}},indent:function(a,b){var c=d.getParentNode(a,"P");if(c){var f=/\d+/.test(c.style.marginLeft)?1*c.style.marginLeft.match(/\d+/)[0]:0;f="indent"===b?f+25:f-25;c.style.marginLeft=(0>f?0:f)+"px"}},toggleDisplayBlocks:function(){SUNEDITOR.dom.toggleClass(a.element.wysiwygWindow.document.body,"sun-editor-show-block")},toggleCodeView:function(){if(this._variable.wysiwygActive)a.element.code.value=a.element.wysiwygWindow.document.body.innerHTML.trim().replace(/<\/p>(?=[^\n])/gi, | ||
"</p>\n"),a.element.wysiwygElement.style.display="none",a.element.code.style.display="block",this._variable.wysiwygActive=!1;else{var b={"&":"&"," ":"\u00a0","<":"<",">":">"},d=a.element.code.value.replace(/&[a-z]+;/g,function(a){return"string"===typeof b[a]?b[a]:a});a.element.wysiwygWindow.document.body.innerHTML=0<d.trim().length?d:"<p></p>";a.element.wysiwygWindow.document.body.scrollTop=0;a.element.code.style.display="none";a.element.wysiwygElement.style.display="block"; | ||
this._variable.wysiwygActive=!0}},toggleFullScreen:function(b){this._variable.isFullScreen?(a.element.topArea.style.cssText=this._variable.originCssText,a.element.editorArea.style.height=this._variable.editorHeight+"px",d.removeClass(b.firstElementChild,"icon-reduction"),d.addClass(b.firstElementChild,"icon-expansion")):(a.element.topArea.style.position="fixed",a.element.topArea.style.top="0",a.element.topArea.style.left="0",a.element.topArea.style.width="100%",a.element.topArea.style.height="100%", | ||
this._variable.innerHeight_fullScreen=window.innerHeight-a.tool.bar.offsetHeight,a.element.editorArea.style.height=this._variable.innerHeight_fullScreen+"px",d.removeClass(b.firstElementChild,"icon-expansion"),d.addClass(b.firstElementChild,"icon-reduction"));this._variable.isFullScreen=!this._variable.isFullScreen},openPreview:function(){var b=window.open("","_blank");b.mimeType="text/html";b.document.head.innerHTML='<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1"><title>'+ | ||
SUNEDITOR.lang.toolbar.preview+'</title><link rel="stylesheet" type="text/css" href="'+e.getBasePath+'css/suneditor-contents.css">';b.document.body.className="sun-editor-editable";b.document.body.innerHTML=a.element.wysiwygWindow.document.body.innerHTML}},g={_shortcutKeyCode:{66:["bold","B"],83:["strikethrough","STRIKE"],85:["underline","U"],73:["italic","I"],89:["redo"],90:["undo"],219:["outdent"],221:["indent"]},_directionKeyKeyCode:/^(?:8|13|32|46|33|34|35|36|37|38|39|40|98|100|102|104)$/,_findButtonEffectTag:function(){for(var c= | ||
b._variable.selectionNode,f=!0,g=!0,e=!0,v=!0,l="B|U|I|STRIKE|SUB|SUP|",m=new RegExp(l,"i"),k;!/^(?:BODY|HTML)$/i.test(c.nodeName);){if(3!==c.nodeType){var n=[/^STRONG$/.test(c.nodeName)?"B":/^EM/.test(c.nodeName)?"I":c.nodeName];f&&1===c.nodeType&&/^(?:P|DIV|H\d)$/i.test(c.nodeName)&&(n.push("FORMAT"),d.changeTxt(b.commandMap.FORMAT,c.nodeName.toUpperCase()),f=!1);g&&1===c.nodeType&&(0<c.style.fontFamily.length||c.face&&0<c.face.length)&&(n.push("FONT"),g=(c.style.fontFamily||c.face||SUNEDITOR.lang.toolbar.font).replace(/["']/g, | ||
""),d.changeTxt(b.commandMap.FONT,g),g=!1);v&&/^A$/i.test(c.nodeName)&&null===c.getAttribute("data-image-link")?(a.link&&b.controllerArray[0]===a.link.linkBtn||b.callModule("dialog","link",null,function(){SUNEDITOR.plugin.link.call_controller_linkButton.call(b,c)}),v=!1):v&&a.link&&b.controllerArray[0]===a.link.linkBtn&&b.controllersOff();e&&/^SPAN$/i.test(c.nodeName)&&0<c.style.fontSize.length&&(d.changeTxt(b.commandMap.SIZE,c.style.fontSize.match(/\d+/)[0]),e=!1);k=c.style.cssText;/:\s*bold(?:;|\s)/.test(k)&& | ||
n.push("B");/:\s*underline(?:;|\s)/.test(k)&&n.push("U");/:\s*italic(?:;|\s)/.test(k)&&n.push("I");/:\s*line-through(?:;|\s)/.test(k)&&n.push("STRIKE");for(k=0;k<n.length;k++)m.test(n[k])&&(d.addClass(b.commandMap[n[k]],"on"),l=l.replace(n[k]+"|",""),m=new RegExp(l,"i"))}c=c.parentNode}v&&b.controllersOff();l=l.split("|");f=0;for(e=l.length-1;f<e;f++)/^FONT/i.test(l[f])?d.changeTxt(b.commandMap[l[f]],SUNEDITOR.lang.toolbar.font):/^SIZE$/i.test(l[f])?d.changeTxt(b.commandMap[l[f]],SUNEDITOR.lang.toolbar.fontSize): | ||
d.removeClass(b.commandMap[l[f]],"on")},resize_window:function(){b._variable.isFullScreen&&(b._variable.innerHeight_fullScreen+=window.innerHeight-a.tool.bar.offsetHeight-b._variable.innerHeight_fullScreen,a.element.editorArea.style.height=b._variable.innerHeight_fullScreen+"px")},touchstart_toolbar:function(){b._variable.isTouchMove=!1},touchmove_toolbar:function(){b._variable.isTouchMove=!0},onClick_toolbar:function(c){if(b._variable.isTouchMove)return!0;for(var f=c.target,g=f.getAttribute("data-display"), | ||
e=f.getAttribute("data-command"),v=f.className;!e&&!/editor_tool/.test(v)&&!/sun-editor-id-toolbar/.test(v);)f=f.parentNode,e=f.getAttribute("data-command"),g=f.getAttribute("data-display"),v=f.className;if(!e&&!g)return!0;c.preventDefault();c.stopPropagation();b.submenuOff();b.focus();if(g)!/submenu/.test(g)||null!==f.nextElementSibling&&f.nextElementSibling===b.submenu?/dialog/.test(g)&&b.callModule("dialog",e,null,function(){SUNEDITOR.plugin.dialog.openDialog.call(b,e,f.getAttribute("data-option"), | ||
!1)}):b.callModule("submenu",e,f,function(){b.submenuOn(f)});else if(e)switch(e){case "codeView":b.toggleCodeView();d.toggleClass(f,"on");break;case "fullScreen":b.toggleFullScreen(f);d.toggleClass(f,"on");break;case "indent":case "outdent":b.indent(b._variable.selectionNode,e);break;case "redo":case "undo":case "removeFormat":b.execCommand(e,!1,null);break;case "preview":b.openPreview();break;case "print":a.element.wysiwygWindow.print();break;case "showBlocks":b.toggleDisplayBlocks();d.toggleClass(f, | ||
"on");break;default:b.execCommand(e,!1,f.getAttribute("data-value")),d.toggleClass(f,"on"),/^subscript$/.test(e)?SUNEDITOR.dom.removeClass(a.tool.superscript,"on"):/^superscript$/.test(e)&&SUNEDITOR.dom.removeClass(a.tool.subscript,"on")}},onMouseUp_wysiwyg:function(a){a.stopPropagation();var c=a.target;b.submenuOff();/^HTML$/i.test(c.nodeName)?(a.preventDefault(),b.focus()):/^IMG$/i.test(c.nodeName)?(a.preventDefault(),b.callModule("dialog","image",null,function(){var a=SUNEDITOR.plugin.dialog.call_controller_resize.call(b, | ||
c,"image");SUNEDITOR.plugin.image.onModifyMode.call(b,c,a)})):(b._setSelectionNode(),g._findButtonEffectTag())},onKeyDown_wysiwyg:function(c){b._setSelectionNode();var f=c.keyCode,e=c.shiftKey,u=c.ctrlKey||c.metaKey,v=c.altKey;c.stopPropagation();if(u&&!/^(?:16|17|18)$/.test(f)){var l;if(l=!(e&&83!==f))(l=g._shortcutKeyCode[f])?(b.execCommand(l[0],!1,null),d.toggleClass(b.commandMap[l[1]],"on"),l=!0):l=!1;if(l){c.preventDefault();return}}switch(f){case 8:if(/^P$/i.test(b._variable.selectionNode.tagName)&& | ||
null===b._variable.selectionNode.previousSibling)return c.preventDefault(),!1;break;case 9:if(c.preventDefault(),!u&&!v){for(c=b._variable.selectionNode||b.getSelection().anchorNode;!/^TD$/i.test(c.tagName)&&!/^BODY$/i.test(c.tagName);)c=c.parentNode;if(c&&/^TD$/i.test(c.tagName)){f=d.getParentNode(c,"table");f=d.getListChildren(f,d.isCell);c=e?d.prevIdx(f,c):d.nextIdx(f,c);c!==f.length||e||(c=0);-1===c&&e&&(c=f.length-1);c=f[c];if(!c)return!1;e=b.createRange();e.setStart(c,0);e.setEnd(c,0);c=b.getSelection(); | ||
0<c.rangeCount&&c.removeAllRanges();c.addRange(e)}else e||(e=a.element.wysiwygWindow.document.createTextNode(Array(b._variable.tabSize+1).join("\u00a0")),b.insertNode(e,null),c=b.getSelection(),f=b.createRange(),f.setStart(e,b._variable.tabSize),f.setEnd(e,b._variable.tabSize),0<c.rangeCount&&c.removeAllRanges(),c.addRange(f))}}},onKeyUp_wysiwyg:function(a){b._setSelectionNode();g._directionKeyKeyCode.test(a.keyCode)&&g._findButtonEffectTag()},onScroll_wysiwyg:function(){b.controllersOff()},onDrop_wysiwyg:function(a){var c= | ||
a.dataTransfer.files;if(0===c.length)return!0;a.stopPropagation();a.preventDefault();b.focus();b.callModule("dialog","image",null,function(){b.context.image.imgInputFile.files=c;SUNEDITOR.plugin.image.onRender_imgInput.call(b);b.context.image.imgInputFile.files=null})},onMouseDown_resizeBar:function(c){function d(){a.element.resizeBackground.style.display="none";document.removeEventListener("mousemove",g.resize_editor);document.removeEventListener("mouseup",d)}c.stopPropagation();b._variable.resizeClientY= | ||
c.clientY;a.element.resizeBackground.style.display="block";document.addEventListener("mousemove",g.resize_editor);document.addEventListener("mouseup",d)},resize_editor:function(c){var d=c.clientY-b._variable.resizeClientY;a.element.editorArea.style.height=a.element.editorArea.offsetHeight+d+"px";b._variable.editorHeight=a.element.editorArea.offsetHeight+d;b._variable.resizeClientY=c.clientY}};a.tool.bar.addEventListener("touchstart",g.touchstart_toolbar);a.tool.bar.addEventListener("touchmove",g.touchmove_toolbar); | ||
a.tool.bar.addEventListener("touchend",g.onClick_toolbar);a.tool.bar.addEventListener("click",g.onClick_toolbar);a.element.wysiwygWindow.addEventListener("mouseup",g.onMouseUp_wysiwyg);a.element.wysiwygWindow.addEventListener("keydown",g.onKeyDown_wysiwyg);a.element.wysiwygWindow.addEventListener("keyup",g.onKeyUp_wysiwyg);a.element.wysiwygWindow.addEventListener("scroll",g.onScroll_wysiwyg);a.element.wysiwygWindow.addEventListener("drop",g.onDrop_wysiwyg);a.element.resizebar.addEventListener("mousedown", | ||
g.onMouseDown_resizeBar);window.addEventListener("resize",g.resize_window);return{save:function(){a.element.textElement.innerHTML=b._variable.wysiwygActive?a.element.wysiwygWindow.document.body.innerHTML:a.element.code.value},getContent:function(){var c="";return 0===a.element.wysiwygWindow.document.body.innerText.trim().length?c:c=b._variable.wysiwygActive?a.element.wysiwygWindow.document.body.innerHTML:a.element.code.value},setContent:function(c){c=z(c);b._variable.wysiwygActive?a.element.wysiwygWindow.document.body.innerHTML= | ||
c:a.element.code.value=c},appendContent:function(c){if(b._variable.wysiwygActive){var d=document.createElement("P");d.innerHTML=c;a.element.wysiwygWindow.document.body.appendChild(d)}else a.element.code.value+=c},disabled:function(){a.tool.cover.style.display="block";a.element.wysiwygWindow.document.body.setAttribute("contenteditable",!1)},enabled:function(){a.tool.cover.style.display="none";a.element.wysiwygWindow.document.body.setAttribute("contenteditable",!0)},show:function(){var c=a.element.topArea.style; | ||
c.cssText=b._variable.originCssText;"none"===c.display&&(c.display="block")},hide:function(){a.element.topArea.style.display="none"},destroy:function(){a.element.topArea.parentNode.removeChild(a.element.topArea);a.element.textElement.style.display="";this.destroy=this.hide=this.show=this.enabled=this.disabled=this.appendContent=this.setContent=this.getContent=this.save=null}}};SUNEDITOR.lang=SUNEDITOR.lang||SUNEDITOR.defaultLang;SUNEDITOR.create=function(a,d){var e=document.getElementById(a);if(null=== | ||
e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+a+'")');var b=C(e,d);if(document.getElementById(b.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+b.constructed._top.id+'")');e.style.display="none";"object"===typeof e.nextElementSibling?e.parentNode.insertBefore(b.constructed._top,e.nextElementSibling):e.parentNode.appendChild(b.constructed._top);var g=b.constructed;b=b.options;e={element:{textElement:e, | ||
topArea:g._top,relative:g._relative,resizebar:g._resizeBar,editorArea:g._editorArea,wysiwygWindow:g._editorArea.getElementsByClassName("sun-editor-id-wysiwyg")[0].contentWindow,wysiwygElement:g._editorArea.getElementsByClassName("sun-editor-id-wysiwyg")[0],code:g._editorArea.getElementsByClassName("sun-editor-id-code")[0],loading:g._loading,resizeBackground:g._resizeBack},tool:{bar:g._toolBar,cover:g._toolBar.getElementsByClassName("sun-editor-id-toolbar-cover")[0],bold:g._toolBar.getElementsByClassName("sun-editor-id-bold")[0], | ||
underline:g._toolBar.getElementsByClassName("sun-editor-id-underline")[0],italic:g._toolBar.getElementsByClassName("sun-editor-id-italic")[0],strike:g._toolBar.getElementsByClassName("sun-editor-id-strike")[0],subscript:g._toolBar.getElementsByClassName("sun-editor-id-subscript")[0],superscript:g._toolBar.getElementsByClassName("sun-editor-id-superscript")[0],font:g._toolBar.getElementsByClassName("sun-editor-font-family")[0],format:g._toolBar.getElementsByClassName("sun-editor-font-format")[0],fontSize:g._toolBar.getElementsByClassName("sun-editor-font-size")[0]}, | ||
user:{videoX:b.videoX,videoY:b.videoY,imageFileInput:b.imageFileInput,imageUrlInput:b.imageUrlInput,imageSize:b.imageSize,imageUploadUrl:b.imageUploadUrl,addFont:b.addFont,fontList:b.fontList,fontSizeList:b.fontSizeList,height:b.height.match(/\d+/)[0]}};return E(e,SUNEDITOR.dom,SUNEDITOR.util)};SUNEDITOR.destroy=function(a){var d=document.getElementById("suneditor_"+a);d.parentNode.removeChild(d);document.getElementById(a).style.display=""}})(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
2077600
34647
50