From 866eaec7e6b1e2f1099fe95a2aef5739ad04c487 Mon Sep 17 00:00:00 2001 From: "jihong.lee" <0125ses@hanmail.net> Date: Tue, 6 Nov 2018 04:55:40 +0900 Subject: [PATCH] version up: 2.7.1 - align image rotate --- bower.json | 2 +- dist/suneditor.min.js | 2 +- package-lock.json | 2 +- package.json | 2 +- src/plugins/dialog/image.js | 6 ++++-- src/plugins/dialog/video.js | 4 +++- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 158d0dc7b..74d04c3ac 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "suneditor", - "version": "2.7.0", + "version": "2.7.1", "description": "Pure JavaScript based WYSIWYG web editor", "main": "src/suneditor.js", "keywords": [ diff --git a/dist/suneditor.min.js b/dist/suneditor.min.js index ce5915cd9..0e1ff173f 100644 --- a/dist/suneditor.min.js +++ b/dist/suneditor.min.js @@ -1 +1 @@ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="XJR1")}({"0A7J":function(module,__webpack_exports__,__webpack_require__){"use strict";var _modules_colorPicker__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("EjF6");__webpack_exports__.a={name:"fontColor",add:function(core,targetElement){core.addModule([_modules_colorPicker__WEBPACK_IMPORTED_MODULE_0__.a]);const context=core.context;context.fontColor={previewEl:null,colorInput:null};let listDiv=eval(this.setSubmenu(context.colorPicker.colorListHTML));context.fontColor.colorInput=listDiv.getElementsByClassName("sun-editor-id-submenu-color-input")[0],context.fontColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(core)),listDiv.getElementsByClassName("sun-editor-id-submenu-color-submit")[0].addEventListener("click",this.submit.bind(core)),listDiv.getElementsByTagName("UL")[0].addEventListener("click",this.pickup.bind(core)),targetElement.parentNode.appendChild(listDiv),listDiv=null},setSubmenu:function(e){const t=document.createElement("DIV");return t.className="layer_editor",t.style.display="none",t.innerHTML=e,t},on:function(){const e=this.context.colorPicker;e._colorInput=this.context.fontColor.colorInput,e._defaultColor="#000000",e._styleProperty="color",this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,"#"+e.target.value)},submit:function(){this.plugins.fontColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){if(e.preventDefault(),e.stopPropagation(),!/^BUTTON$/i.test(e.target.tagName))return!1;this.plugins.fontColor.applyColor.call(this,e.target.getAttribute("data-value"))},applyColor:function(e){const t=document.createElement("SPAN");t.style.color=e,this.wrapRangeToTag(t,["color"]),this.submenuOff(),this.focus()}}},"1kvd":function(e,t,i){"use strict";t.a={name:"dialog",add:function(e){const t=e.context;t.dialog={};let i=document.createElement("DIV");i.className="sun-editor-id-dialogBox sun-editor-common";let n=document.createElement("DIV");n.className="modal-dialog-background sun-editor-id-dialog-back",n.style.display="none";let o=document.createElement("DIV");o.className="modal-dialog sun-editor-id-dialog-modal",o.style.display="none",i.appendChild(n),i.appendChild(o),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=o,t.dialog.modal.addEventListener("click",this.onClick_dialog.bind(e)),t.element.topArea.getElementsByClassName("sun-editor-container")[0].appendChild(i),i=null,n=null,o=null},onClick_dialog:function(e){e.stopPropagation(),(/modal-dialog/.test(e.target.className)||/close/.test(e.target.getAttribute("data-command")))&&this.plugins.dialog.closeDialog.call(this)},openDialog:function(e,t,i){if(this.modalForm)return!1;this.context.dialog.updateModal=i,this.context.dialog.modalArea.style.position="full"===t?"fixed":"absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const n=this.context[e].focusElement;this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",n&&n.focus()},closeDialog:function(){this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.modalForm=null,this.context.dialog.updateModal=!1,this.plugins[this.context.dialog.kind].init.call(this)}}},"3FqI":function(e,t,i){},"50IV":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={name:"font",add:function(core,targetElement){let listDiv=eval(this.setSubmenu(core.context.user));listDiv.getElementsByClassName("list_family")[0].addEventListener("click",this.pickup.bind(core)),targetElement.parentNode.appendChild(listDiv),listDiv=null},setSubmenu:function(e){const t=document.createElement("DIV");let i,n,o,l;t.className="layer_editor",t.style.display="none";let s=e.font?e.font:["Arial","Comic Sans MS","Courier New,Courier","Impact,Charcoal,sans-serif","Georgia","tahoma","Trebuchet MS,Helvetica","Verdana"],a='
"+t+"
")}else n+=i;const o={"&":"&"," ":" ","'":""","<":"<",">":">"};return e=e.replace(/&|\u00A0|'|<|>/g,function(e){return"string"==typeof o[e]?o[e]:e}),0===n.length&&(n=""+(e.length>0?e:"")+"
"),n},convertHTMLForCodeView:function(e){return e.replace(/\s*<(?:li|td)\s*(?:[a-z\-]+)?\s*(?:="?[^>]*"?)?\s*>/gi,this._insertIndent).replace(/<\/?(?:blockquote|hr|ol|ul|table|tbody|thead|th|tr)\s*(?:[a-z\-]+)?\s*(?:="?[^>]*"?)?\s*>(?=[^\n])/gi,this._insertLineBreak).replace(/<\/(?:p|div|h[1-6]|li|td|pre)>(?=[^\n])/gi,this._insertLineBreak)},_insertIndent:function(e){return" "+e.trim()},_insertLineBreak:function(e){return e+"\n"},isWysiwygDiv:function(e){return!(!e||1!==e.nodeType||!this.hasClass(e,"sun-editor-id-wysiwyg"))},isFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(?:P|DIV|H[1-6]|LI)$/i.test(e.nodeName)||/sun-editor-id-comp/.test(e.className))},isRangeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(?:BLOCKQUOTE|TH|TD|OL|UL|PRE)$/i.test(e.nodeName))},getFormatElement:function(e){if(!e)return null;for(;!this.isFormatElement(e)&&!this.isWysiwygDiv(e.parentNode);)e=e.parentNode;if(this.isWysiwygDiv(e)||this.isRangeFormatElement(e)){return this.getListChildren(e,function(e){return this.isFormatElement(e)}.bind(this))[0]}return e},getRangeFormatElement:function(e){if(!e)return null;for(;!this.isRangeFormatElement(e)&&!this.isWysiwygDiv(e);)e=e.parentNode;return this.isWysiwygDiv(e)?null:e},getArrayIndex:function(e,t){let i=-1;for(let n=0,o=e.length;n0){const e=r.pop();for(c=d=e;r.length>0;)d=r.pop(),c.appendChild(d),c=d;i.appendChild(e),l=d}else l=i}if(g||p!==u){if((!g||n(p))&&(p.textContent.length>0&&""!==p.textContent||t.isBreak(p))){const e=p.cloneNode(!1);l.appendChild(e),1===p.nodeType&&(_=e)}e(p,_)}else{const e=document.createTextNode(u.substringData(0,m)),t=document.createTextNode(u.substringData(m,u.length-m));for(e.data.length>0&&l.appendChild(e),d=l,r=[];d!==a&&null!==d;)1===d.nodeType&&n(d)&&r.push(d.cloneNode(!1)),d=d.parentNode;const o=r.pop()||l;for(c=d=o;r.length>0;)d=r.pop(),c.appendChild(d),c=d;o!==l?(i.appendChild(o),l=d):l=i,a.appendChild(i),u=t,m=0,g=!0,l.appendChild(u)}}}(e,a),e.parentNode.insertBefore(a,e),t.removeItem(e),{container:u,offset:m}},_wrapLineNodesEnd:function(e,i,n,o,l){const s=e,a=e.cloneNode(!1);let r,d,c,u=o,m=l,g=!1;return function e(o,l){const h=o.childNodes;for(let o=h.length-1;0<=o;o--){const p=h[o];let _=l;if(g&&!t.isBreak(p)){if(1===p.nodeType){e(p,p);continue}for(d=p,r=[];null!==d.parentNode&&d!==s&&d!==i;)n(d)&&1===d.nodeType&&r.push(d.cloneNode(!1)),d=d.parentNode;if(r.length>0){const e=r.pop();for(c=d=e;r.length>0;)d=r.pop(),c.appendChild(d),c=d;i.insertBefore(e,i.firstChild),l=d}else l=i}if(g||p!==u){if((!g||n(p))&&(p.textContent.length>0&&""!==p.textContent||t.isBreak(p))){const e=p.cloneNode(!1);l.insertBefore(e,l.firstChild),1===p.nodeType&&(_=e)}e(p,_)}else{const e=document.createTextNode(u.substringData(m,u.length-m)),t=document.createTextNode(u.substringData(0,m));for(e.data.length>0&&l.insertBefore(e,l.firstChild),d=l,r=[];d!==a&&null!==d;)n(d)&&1===d.nodeType&&r.push(d.cloneNode(!1)),d=d.parentNode;const o=r.pop()||l;for(c=d=o;r.length>0;)d=r.pop(),c.appendChild(d),c=d;o!==l?(i.insertBefore(o,i.firstChild),l=d):l=i,a.insertBefore(i,a.firstChild),u=t,m=t.data.length,g=!0,l.insertBefore(u,l.firstChild)}}}(e,a),e.parentNode.insertBefore(a,e),t.removeItem(e),{container:u,offset:m}},commandHandler:function(i,n){switch(n){case"codeView":this.controllersOff(),this.toggleCodeView(),t.toggleClass(i,"on");break;case"fullScreen":this.controllersOff(),this.toggleFullScreen(i),t.toggleClass(i,"on");break;case"indent":case"outdent":this.indent(n);break;case"redo":case"undo":case"removeFormat":this.execCommand(n,!1,null);break;case"preview":case"print":this.openWindowContents(n);break;case"showBlocks":this.toggleDisplayBlocks(),t.toggleClass(i,"on");break;case"subscript":t.hasClass(e.tool.superscript,"on")&&(this.execCommand("superscript",!1,null),t.removeClass(e.tool.superscript,"on")),this.execCommand(n,!1,null),t.toggleClass(i,"on");break;case"superscript":t.hasClass(e.tool.subscript,"on")&&(this.execCommand("subscript",!1,null),t.removeClass(e.tool.subscript,"on")),this.execCommand(n,!1,null),t.toggleClass(i,"on");break;default:this.execCommand(n,!1,i.getAttribute("data-value")),t.toggleClass(i,"on")}},indent:function(e){const t=this.getSelectedFormatElements();let i,n;for(let o=0,l=t.length;o