New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

suneditor

Package Overview
Dependencies
Maintainers
1
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suneditor - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

2

bower.json
{
"name": "suneditor",
"version": "1.8.1",
"version": "1.8.2",
"description": "Pure JavaScript based WYSIWYG web editor",

@@ -5,0 +5,0 @@ "main": "src/suneditor.js",

{
"name": "suneditor",
"version": "1.8.1",
"version": "1.8.2",
"description": "Pure JavaScript based WYSIWYG web editor",

@@ -5,0 +5,0 @@ "main": "src/suneditor.js",

@@ -45,23 +45,23 @@ "undefined"===typeof window.SUNEDITOR&&(window.SUNEDITOR={},SUNEDITOR.plugin={});

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},preview:function(){var b=window.open("","_blank");b.mimeType="text/html";b.document.head.innerHTML='<meta charset="utf-8" /><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.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.toggleFrame();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.preview();break;case "print":a.element.wysiwygWindow.print();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")}b.submenuOff()}},onMouseUp_wysiwyg:function(a){a.stopPropagation();b._setSelectionNode();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(){SUNEDITOR.plugin.image.call_controller_imageResize.call(b,c)})):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=
""}})();
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},preview: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.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.toggleFrame();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.preview();break;case "print":a.element.wysiwygWindow.print();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")}b.submenuOff()}},onMouseUp_wysiwyg:function(a){a.stopPropagation();b._setSelectionNode();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(){SUNEDITOR.plugin.image.call_controller_imageResize.call(b,c)})):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=""}})();

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc