From fd3fdfa2c3fbf49e86821339be9cce208b7fc31a Mon Sep 17 00:00:00 2001 From: srikaran Date: Wed, 20 Dec 2023 18:26:20 +0100 Subject: [PATCH] OEVE-190 - bugfix for the problem that the "de" language was not loaded for the summernote editor --- assets/out/src/js/ddoesummernote.min.js | 2 +- assets/out/src/js/ddoesummernote.min.js.map | 2 +- assets/out/src/js/lang/summernote-de.min.js | 2 ++ assets/out/src/js/lang/summernote-de.min.js.map | 1 + build/grunt/uglify.js | 13 ++++--------- views/twig/ddoewysiwyg.html.twig | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 assets/out/src/js/lang/summernote-de.min.js create mode 100644 assets/out/src/js/lang/summernote-de.min.js.map diff --git a/assets/out/src/js/ddoesummernote.min.js b/assets/out/src/js/ddoesummernote.min.js index ef33315..9727570 100644 --- a/assets/out/src/js/ddoesummernote.min.js +++ b/assets/out/src/js/ddoesummernote.min.js @@ -3,5 +3,5 @@ this.triggerEvent("destroy",this)}},{key:"code",value:function(a){var b=this.inv this.color=this.wrapCommand(function(a){var b=a.foreColor,c=a.backColor;b&&document.execCommand("foreColor",!1,b),c&&document.execCommand("backColor",!1,c)}),this.foreColor=this.wrapCommand(function(a){document.execCommand("foreColor",!1,a)}),this.insertTable=this.wrapCommand(function(a){var b=a.split("x");c.getLastRange().deleteContents().insertNode(c.table.createTable(b[0],b[1],c.options))}),this.removeMedia=this.wrapCommand(function(){var a=Lc()(c.restoreTarget()).parent();a.closest("figure").length?a.closest("figure").remove():a=Lc()(c.restoreTarget()).detach(),c.context.triggerEvent("media.delete",a,c.$editable)}),this.floatMe=this.wrapCommand(function(a){var b=Lc()(c.restoreTarget());b.toggleClass("note-float-left","left"===a),b.toggleClass("note-float-right","right"===a),b.css("float","none"===a?"":a)}),this.resize=this.wrapCommand(function(a){var b=Lc()(c.restoreTarget());a=parseFloat(a),0===a?b.css("width",""):b.css({width:100*a+"%",height:""})})}return xb(a,[{key:"initialize",value:function(){var a=this;this.$editable.on("keydown",function(b){if(b.keyCode===nd.code.ENTER&&a.context.triggerEvent("enter",b),a.context.triggerEvent("keydown",b),a.snapshot=a.history.makeSnapshot(),a.hasKeyShortCut=!1,b.isDefaultPrevented()||(a.options.shortcuts?a.hasKeyShortCut=a.handleKeyMap(b):a.preventDefaultEditableShortCuts(b)),a.isLimited(1,b)){var c=a.getLastRange();if(c.eo-c.so==0)return!1}a.setLastRange(),a.options.recordEveryKeystroke&&!1===a.hasKeyShortCut&&a.history.recordUndo()}).on("keyup",function(b){a.setLastRange(),a.context.triggerEvent("keyup",b)}).on("focus",function(b){a.setLastRange(),a.context.triggerEvent("focus",b)}).on("blur",function(b){a.context.triggerEvent("blur",b)}).on("mousedown",function(b){a.context.triggerEvent("mousedown",b)}).on("mouseup",function(b){a.setLastRange(),a.history.recordUndo(),a.context.triggerEvent("mouseup",b)}).on("scroll",function(b){a.context.triggerEvent("scroll",b)}).on("paste",function(b){a.setLastRange(),a.context.triggerEvent("paste",b)}).on("input",function(){a.isLimited(0)&&a.snapshot&&a.history.applySnapshot(a.snapshot)}),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(id.html(this.$note)||id.emptyPara),this.$editable.on(Vc.inputEventName,Xc.debounce(function(){a.context.triggerEvent("change",a.$editable.html(),a.$editable)},10)),this.$editable.on("focusin",function(b){a.context.triggerEvent("focusin",b)}).on("focusout",function(b){a.context.triggerEvent("focusout",b)}),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",function(b){return a.context.triggerEvent("contextmenu",b),!1}):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function(){this.$editable.off()}},{key:"handleKeyMap",value:function(a){var b=this.options.keyMap[Vc.isMac?"mac":"pc"],c=[];a.metaKey&&c.push("CMD"),a.ctrlKey&&!a.altKey&&c.push("CTRL"),a.shiftKey&&c.push("SHIFT");var d=nd.nameFromCode[a.keyCode];d&&c.push(d);var e=b[c.join("+")];if("TAB"!==d||this.options.tabDisable)if(e){if(!1!==this.context.invoke(e))return a.preventDefault(),!0}else nd.isEdit(a.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(a){(a.ctrlKey||a.metaKey)&&Yc.contains([66,73,85],a.keyCode)&&a.preventDefault()}},{key:"isLimited",value:function(a,b){return a=a||0,(void 0===b||!(nd.isMove(b.keyCode)||nd.isNavigation(b.keyCode)||b.ctrlKey||b.metaKey||Yc.contains([nd.code.BACKSPACE,nd.code.DELETE],b.keyCode)))&&(this.options.maxTextLength>0&&this.$editable.text().length+a>this.options.maxTextLength)}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"createRangeFromList",value:function(a){var b=ld.createFromNodeBefore(Yc.head(a)),c=b.getStartPoint(),d=ld.createFromNodeAfter(Yc.last(a)),e=d.getEndPoint();return ld.create(c.node,c.offset,e.node,e.offset)}},{key:"setLastRange",value:function(a){a?this.lastRange=a:(this.lastRange=ld.create(this.editable),0===Lc()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=ld.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(a){a&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(a){this.$editable.data("target",a)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var a=ld.create();return a&&(a=a.normalize()),a?this.style.current(a):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(a){return this.style.fromNode(a)}},{key:"undo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function(a){this.normalizeContent(),this.history.recordUndo(),a||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var a=this.getLastRange();if(a.isCollapsed()&&a.isOnCell())this.table.tab(a);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(a,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var a=this.getLastRange();if(a.isCollapsed()&&a.isOnCell())this.table.tab(a,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(a){return function(){this.beforeCommand(),a.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(a,b){var c=this;return fb(a).then(function(a){c.beforeCommand(),"function"==typeof b?b(a):("string"==typeof b&&a.attr("data-filename",b),a.css("width",Math.min(c.$editable.width(),a.width()))),a.show(),c.getLastRange().insertNode(a[0]),c.setLastRange(ld.createFromNodeAfter(a[0]).select()),c.afterCommand()}).fail(function(a){c.context.triggerEvent("image.upload.error",a)})}},{key:"insertImagesAsDataURL",value:function(a){var b=this;Lc.a.each(a,function(a,c){var d=c.name;b.options.maximumImageFileSize&&b.options.maximumImageFileSize":a),b&&b.length&&(b[0].tagName.toUpperCase()!==a.toUpperCase()&&(b=b.find(a)),b&&b.length)){var c=b[0].className||"";if(c){var d=this.createRange();Lc()([d.sc,d.ec]).closest(a).addClass(c)}}}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(a,b){var c=this.getLastRange();if(""!==c){var d=this.style.styleNodes(c);if(this.$editor.find(".note-status-output").html(""),Lc()(d).css(a,b),c.isCollapsed()){var e=Yc.head(d);e&&!id.nodeLength(e)&&(e.innerHTML=id.ZERO_WIDTH_NBSP_CHAR,ld.createFromNode(e.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",e))}else this.setLastRange(this.createRangeFromList(d).select())}else{var f=Lc.a.now();this.$editor.find(".note-status-output").html('
'+this.lang.output.noSelection+"
"),setTimeout(function(){Lc()("#note-status-output-"+f).remove()},5e3)}}},{key:"unlink",value:function(){var a=this.getLastRange();if(a.isOnAnchor()){var b=id.ancestor(a.sc,id.isAnchor);a=ld.createFromNode(b),a.select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}},{key:"getLinkInfo",value:function(){var a=this.getLastRange().expand(id.isAnchor),b=Lc()(Yc.head(a.nodes(id.isAnchor))),c={range:a,text:a.toString(),url:b.length?b.attr("href"):""};return b.length&&(c.isNewWindow="_blank"===b.attr("target")),c}},{key:"addRow",value:function(a){var b=this.getLastRange(this.$editable);b.isCollapsed()&&b.isOnCell()&&(this.beforeCommand(),this.table.addRow(b,a),this.afterCommand())}},{key:"addCol",value:function(a){var b=this.getLastRange(this.$editable);b.isCollapsed()&&b.isOnCell()&&(this.beforeCommand(),this.table.addCol(b,a),this.afterCommand())}},{key:"deleteRow",value:function(){var a=this.getLastRange(this.$editable);a.isCollapsed()&&a.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(a),this.afterCommand())}},{key:"deleteCol",value:function(){var a=this.getLastRange(this.$editable);a.isCollapsed()&&a.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(a),this.afterCommand())}},{key:"deleteTable",value:function(){var a=this.getLastRange(this.$editable);a.isCollapsed()&&a.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(a),this.afterCommand())}},{key:"resizeTo",value:function(a,b,c){var d;if(c){var e=a.y/a.x,f=b.data("ratio");d={width:f>e?a.x:a.y/f,height:f>e?a.x*f:a.y}}else d={width:a.x,height:a.y};b.css(d)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return id.isEmpty(this.$editable[0])||id.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",id.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}]),a}(),vd=function(){function a(b){yb(this,a),this.context=b,this.$editable=b.layoutInfo.editable}return Ab(a,[{key:"initialize",value:function(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function(a){var b=this,c=a.originalEvent.clipboardData;if(c&&c.items&&c.items.length){var d=c.items.length>1?c.items[1]:Yc.head(c.items);"file"===d.kind&&-1!==d.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[d.getAsFile()]),a.preventDefault()):"string"===d.kind&&this.context.invoke("editor.isLimited",c.getData("Text").length)&&a.preventDefault()}else if(window.clipboardData){var e=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",e.length)&&a.preventDefault()}setTimeout(function(){b.context.invoke("editor.afterCommand")},10)}}]),a}(),wd=function(){function a(b){Bb(this,a),this.context=b,this.$eventListener=Lc()(document),this.$editor=b.layoutInfo.editor,this.$editable=b.layoutInfo.editable,this.options=b.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=Lc()(['
','
',"
"].join("")).prependTo(this.$editor)}return Db(a,[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(a){a.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var a=this,b=Lc()(),c=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(d){var e=a.context.invoke("codeview.isActivated"),f=a.$editor.width()>0&&a.$editor.height()>0;e||b.length||!f||(a.$editor.addClass("dragover"),a.$dropzone.width(a.$editor.width()),a.$dropzone.height(a.$editor.height()),c.text(a.lang.image.dragImageHere)),b=b.add(d.target)},this.documentEventHandlers.onDragleave=function(c){b=b.not(c.target),b.length&&"BODY"!==c.target.nodeName||(b=Lc()(),a.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){b=Lc()(),a.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",function(){a.$dropzone.addClass("hover"),c.text(a.lang.image.dropImage)}).on("dragleave",function(){a.$dropzone.removeClass("hover"),c.text(a.lang.image.dragImageHere)}),this.$dropzone.on("drop",function(b){var c=b.originalEvent.dataTransfer;b.preventDefault(),c&&c.files&&c.files.length?(a.$editable.focus(),a.context.invoke("editor.insertImagesOrCallback",c.files)):Lc.a.each(c.types,function(b,d){if(!(d.toLowerCase().indexOf("_moz_")>-1)){var e=c.getData(d);d.toLowerCase().indexOf("text")>-1?a.context.invoke("editor.pasteHTML",e):Lc()(e).each(function(b,c){a.context.invoke("editor.insertNode",c)})}})}).on("dragover",!1)}},{key:"destroy",value:function(){var a=this;Object.keys(this.documentEventHandlers).forEach(function(b){a.$eventListener.off(b.substr(2).toLowerCase(),a.documentEventHandlers[b])}),this.documentEventHandlers={}}}]),a}(),xd=function(){function a(b){Hb(this,a),this.context=b,this.$editor=b.layoutInfo.editor,this.$editable=b.layoutInfo.editable,this.$codable=b.layoutInfo.codable,this.options=b.options,this.CodeMirrorConstructor=window.CodeMirror,this.options.codemirror.CodeMirrorConstructor&&(this.CodeMirrorConstructor=this.options.codemirror.CodeMirrorConstructor)}return Jb(a,[{key:"sync",value:function(a){var b=this.isActivated(),c=this.CodeMirrorConstructor;b&&(a?c?this.$codable.data("cmEditor").getDoc().setValue(a):this.$codable.val(a):c&&this.$codable.data("cmEditor").save())}},{key:"initialize",value:function(){var a=this;this.$codable.on("keyup",function(b){b.keyCode===nd.code.ESCAPE&&a.deactivate()})}},{key:"isActivated",value:function(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function(a){if(this.options.codeviewFilter&&(a=a.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter)){var b=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);a=a.replace(/(.*?(?:<\/iframe>)?)/gi,function(a){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(a))return"";var c,d=Eb(b);try{for(d.s();!(c=d.n()).done;){var e=c.value;if(new RegExp('src="(https?:)?//'+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(a))return a}}catch(a){d.e(a)}finally{d.f()}return""})}return a}},{key:"activate",value:function(){var a=this,b=this.CodeMirrorConstructor;if(this.$codable.val(id.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.context.invoke("airPopover.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),b){var c=b.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){var d=new b.TernServer(this.options.codemirror.tern);c.ternServer=d,c.on("cursorActivity",function(a){d.updateArgHints(a)})}c.on("blur",function(b){a.context.triggerEvent("blur.codeview",c.getValue(),b)}),c.on("change",function(){a.context.triggerEvent("change.codeview",c.getValue(),c)}),c.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",c)}else this.$codable.on("blur",function(b){a.context.triggerEvent("blur.codeview",a.$codable.val(),b)}),this.$codable.on("input",function(){a.context.triggerEvent("change.codeview",a.$codable.val(),a.$codable)})}},{key:"deactivate",value:function(){if(this.CodeMirrorConstructor){var a=this.$codable.data("cmEditor");this.$codable.val(a.getValue()),a.toTextArea()}var b=this.purify(id.value(this.$codable,this.options.prettifyHtml)||id.emptyPara),c=this.$editable.html()!==b;this.$editable.html(b),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),c&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1),this.context.invoke("airPopover.updateCodeview",!1)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}]),a}(),yd=function(){function a(b){Kb(this,a),this.$document=Lc()(document),this.$statusbar=b.layoutInfo.statusbar,this.$editable=b.layoutInfo.editable,this.options=b.options}return Mb(a,[{key:"initialize",value:function(){var a=this;if(this.options.airMode||this.options.disableResizeEditor)return void this.destroy();this.$statusbar.on("mousedown",function(b){b.preventDefault(),b.stopPropagation();var c=a.$editable.offset().top-a.$document.scrollTop(),d=function(b){var d=b.clientY-(c+24);d=a.options.minheight>0?Math.max(d,a.options.minheight):d,d=a.options.maxHeight>0?Math.min(d,a.options.maxHeight):d,a.$editable.height(d)};a.$document.on("mousemove",d).one("mouseup",function(){a.$document.off("mousemove",d)})})}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}]),a}(),zd=function(){function a(b){var c=this;Nb(this,a),this.context=b,this.$editor=b.layoutInfo.editor,this.$toolbar=b.layoutInfo.toolbar,this.$editable=b.layoutInfo.editable,this.$codable=b.layoutInfo.codable,this.$window=Lc()(window),this.$scrollbar=Lc()("html, body"),this.onResize=function(){c.resizeTo({h:c.$window.height()-c.$toolbar.outerHeight()})}}return Pb(a,[{key:"resizeTo",value:function(a){this.$editable.css("height",a.h),this.$codable.css("height",a.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,a.h)}},{key:"toggle",value:function(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function(){return this.$editor.hasClass("fullscreen")}}]),a}(),Ad=function(){function a(b){var c=this;Qb(this,a),this.context=b,this.$document=Lc()(document),this.$editingArea=b.layoutInfo.editingArea,this.options=b.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function(a,b){c.update(b.target,b)&&b.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){c.update()},"summernote.disable summernote.blur":function(){c.hide()},"summernote.codeview.toggled":function(){c.update()}}}return Sb(a,[{key:"initialize",value:function(){var a=this;this.$handle=Lc()(['
','
','
','
','
','
','
',this.options.disableResizeImage?"":'
',"
","
"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",function(b){if(id.isControlSizing(b.target)){b.preventDefault(),b.stopPropagation();var c=a.$handle.find(".note-control-selection").data("target"),d=c.offset(),e=a.$document.scrollTop(),f=function(b){a.context.invoke("editor.resizeTo",{x:b.clientX-d.left,y:b.clientY-(d.top-e)},c,!b.shiftKey),a.update(c[0],b)};a.$document.on("mousemove",f).one("mouseup",function(b){b.preventDefault(),a.$document.off("mousemove",f),a.context.invoke("editor.afterCommand")}),c.data("ratio")||c.data("ratio",c.height()/c.width())}}),this.$handle.on("wheel",function(b){b.preventDefault(),a.update()})}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(a,b){if(this.context.isDisabled())return!1;var c=id.isImg(a),d=this.$handle.find(".note-control-selection");if(this.context.invoke("imagePopover.update",a,b),c){var e=Lc()(a),f=e.position(),g={left:f.left+parseInt(e.css("marginLeft"),10),top:f.top+parseInt(e.css("marginTop"),10)},h={w:e.outerWidth(!1),h:e.outerHeight(!1)};d.css({display:"block",left:g.left,top:g.top,width:h.w,height:h.h}).data("target",e);var i=new Image;i.src=e.attr("src");var j=h.w+"x"+h.h+" ("+this.lang.image.original+": "+i.width+"x"+i.height+")";d.find(".note-control-selection-info").text(j),this.context.invoke("editor.saveTarget",a)}else this.hide();return c}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}]),a}(),Bd=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,Cd=function(){function a(b){var c=this;Tb(this,a),this.context=b,this.options=b.options,this.events={"summernote.keyup":function(a,b){b.isDefaultPrevented()||c.handleKeyup(b)},"summernote.keydown":function(a,b){c.handleKeydown(b)}}}return Vb(a,[{key:"initialize",value:function(){this.lastWordRange=null}},{key:"destroy",value:function(){this.lastWordRange=null}},{key:"replace",value:function(){if(this.lastWordRange){var a=this.lastWordRange.toString(),b=a.match(Bd);if(b&&(b[1]||b[2])){var c=b[1]?a:"http://"+a,d=this.options.showDomainOnlyForAutolink?a.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0]:a,e=Lc()("").html(d).attr("href",c)[0];this.context.options.linkTargetBlank&&Lc()(e).attr("target","_blank"),this.lastWordRange.insertNode(e),this.lastWordRange=null,this.context.invoke("editor.focus")}}}},{key:"handleKeydown",value:function(a){if(Yc.contains([nd.code.ENTER,nd.code.SPACE],a.keyCode)){var b=this.context.invoke("editor.createRange").getWordRange();this.lastWordRange=b}}},{key:"handleKeyup",value:function(a){Yc.contains([nd.code.ENTER,nd.code.SPACE],a.keyCode)&&this.replace()}}]),a}(),Dd=function(){function a(b){var c=this;Wb(this,a),this.$note=b.layoutInfo.note,this.events={"summernote.change":function(){c.$note.val(b.invoke("code"))}}}return Yb(a,[{key:"shouldInitialize",value:function(){return id.isTextarea(this.$note[0])}}]),a}(),Ed=function(){function a(b){var c=this;Zb(this,a),this.context=b,this.options=b.options.replace||{},this.keys=[nd.code.ENTER,nd.code.SPACE,nd.code.PERIOD,nd.code.COMMA,nd.code.SEMICOLON,nd.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function(a,b){b.isDefaultPrevented()||c.handleKeyup(b)},"summernote.keydown":function(a,b){c.handleKeydown(b)}}}return _b(a,[{key:"shouldInitialize",value:function(){return!!this.options.match}},{key:"initialize",value:function(){this.lastWord=null}},{key:"destroy",value:function(){this.lastWord=null}},{key:"replace",value:function(){if(this.lastWord){var a=this,b=this.lastWord.toString();this.options.match(b,function(b){if(b){var c="";if("string"==typeof b?c=id.createText(b):b instanceof jQuery?c=b[0]:b instanceof Node&&(c=b),!c)return;a.lastWord.insertNode(c),a.lastWord=null,a.context.invoke("editor.focus")}})}}},{key:"handleKeydown",value:function(a){if(this.previousKeydownCode&&Yc.contains(this.keys,this.previousKeydownCode))return void(this.previousKeydownCode=a.keyCode);if(Yc.contains(this.keys,a.keyCode)){var b=this.context.invoke("editor.createRange").getWordRange();this.lastWord=b}this.previousKeydownCode=a.keyCode}},{key:"handleKeyup",value:function(a){Yc.contains(this.keys,a.keyCode)&&this.replace()}}]),a}(),Fd=function(){function a(b){var c=this;ac(this,a),this.context=b,this.$editingArea=b.layoutInfo.editingArea,this.options=b.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function(){c.update()},"summernote.codeview.toggled":function(){c.update()}}}return cc(a,[{key:"shouldInitialize",value:function(){return!!this.options.placeholder}},{key:"initialize",value:function(){var a=this;this.$placeholder=Lc()('
'),this.$placeholder.on("click",function(){a.context.invoke("focus")}).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var a=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(a)}}]),a}(),Gd=function(){function a(b){dc(this,a),this.ui=Lc.a.summernote.ui,this.context=b,this.$toolbar=b.layoutInfo.toolbar,this.options=b.options,this.lang=this.options.langInfo,this.invertedKeyMap=Xc.invertObject(this.options.keyMap[Vc.isMac?"mac":"pc"])}return fc(a,[{key:"representShortcut",value:function(a){var b=this.invertedKeyMap[a];return this.options.shortcuts&&b?(Vc.isMac&&(b=b.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(b=b.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function(a){return!this.options.tooltip&&a.tooltip&&delete a.tooltip,a.container=this.options.container,this.ui.button(a)}},{key:"initialize",value:function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function(a){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,a)||(this.fontInstalledMap[a]=Vc.isFontInstalled(a)||Yc.contains(this.options.fontNamesIgnoreCheck,a)),this.fontInstalledMap[a]}},{key:"isFontDeservedToAdd",value:function(a){return""!==(a=a.toLowerCase())&&this.isFontInstalled(a)&&-1===Vc.genericFontFamilies.indexOf(a)}},{key:"colorPalette",value:function(a,b,c,d){var e=this;return this.ui.buttonGroup({className:"note-color "+a,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:b,click:function(a){var b=Lc()(a.currentTarget);c&&d?e.context.invoke("editor.color",{backColor:b.attr("data-backColor"),foreColor:b.attr("data-foreColor")}):c?e.context.invoke("editor.color",{backColor:b.attr("data-backColor")}):d&&e.context.invoke("editor.color",{foreColor:b.attr("data-foreColor")})},callback:function(a){var b=a.find(".note-recent-color");c&&(b.css("background-color",e.options.colorButton.backColor),a.attr("data-backColor",e.options.colorButton.backColor)),d?(b.css("color",e.options.colorButton.foreColor),a.attr("data-foreColor",e.options.colorButton.foreColor)):b.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(c?['
','
'+this.lang.color.background+"
","
",'","
",'
\x3c!-- back colors --\x3e
',"
",'",'',"
",'
',"
"].join(""):"")+(d?['
','
'+this.lang.color.foreground+"
","
",'","
",'
\x3c!-- fore colors --\x3e
',"
",'",'',"
",'
',"
"].join(""):""),callback:function(a){a.find(".note-holder").each(function(a,b){var c=Lc()(b);c.append(e.ui.palette({colors:e.options.colors,colorsName:e.options.colorsName,eventName:c.data("event"),container:e.options.container,tooltip:e.options.tooltip}).render())});var b=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];a.find(".note-holder-custom").each(function(a,c){var d=Lc()(c);d.append(e.ui.palette({colors:b,colorsName:b,eventName:d.data("event"),container:e.options.container,tooltip:e.options.tooltip}).render())}),a.find("input[type=color]").each(function(b,c){Lc()(c).change(function(){var b=a.find("#"+Lc()(this).data("event")).find(".note-color-btn").first(),c=this.value.toUpperCase();b.css("background-color",c).attr("aria-label",c).attr("data-value",c).attr("data-original-title",c),b.click()})})},click:function(b){b.stopPropagation();var c=Lc()("."+a).find(".note-dropdown-menu"),d=Lc()(b.target),f=d.data("event"),g=d.attr("data-value");if("openPalette"===f){var h=c.find("#"+g),i=Lc()(c.find("#"+h.data("event")).find(".note-color-row")[0]),j=i.find(".note-color-btn").last().detach(),k=h.val();j.css("background-color",k).attr("aria-label",k).attr("data-value",k).attr("data-original-title",k),i.prepend(j),h.click()}else{if(Yc.contains(["backColor","foreColor"],f)){var l="backColor"===f?"background-color":"color",m=d.closest(".note-color").find(".note-recent-color"),n=d.closest(".note-color").find(".note-current-color-button");m.css(l,g),n.attr("data-"+f,g)}e.context.invoke("editor."+f,g)}}})]}).render()}},{key:"addToolbarButtons",value:function(){var a=this;this.context.memo("button.style",function(){return a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents(a.ui.icon(a.options.icons.magic),a.options),tooltip:a.lang.style.style,data:{toggle:"dropdown"}}),a.ui.dropdown({className:"dropdown-style",items:a.options.styleTags,title:a.lang.style.style,template:function(b){"string"==typeof b&&(b={tag:b,title:Object.prototype.hasOwnProperty.call(a.lang.style,b)?a.lang.style[b]:b});var c=b.tag,d=b.title;return"<"+c+(b.style?' style="'+b.style+'" ':"")+(b.className?' class="'+b.className+'"':"")+">"+d+""},click:a.context.createInvokeHandler("editor.formatBlock")})]).render()});for(var b=0,c=this.options.styleTags.length;b'+d.toUpperCase()+"
",tooltip:a.lang.style[d],click:a.context.createInvokeHandler("editor.formatBlock")}).render()})}(b);this.context.memo("button.bold",function(){return a.button({className:"note-btn-bold",contents:a.ui.icon(a.options.icons.bold),tooltip:a.lang.font.bold+a.representShortcut("bold"),click:a.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()}),this.context.memo("button.italic",function(){return a.button({className:"note-btn-italic",contents:a.ui.icon(a.options.icons.italic),tooltip:a.lang.font.italic+a.representShortcut("italic"),click:a.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()}),this.context.memo("button.underline",function(){return a.button({className:"note-btn-underline",contents:a.ui.icon(a.options.icons.underline),tooltip:a.lang.font.underline+a.representShortcut("underline"),click:a.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()}),this.context.memo("button.clear",function(){return a.button({contents:a.ui.icon(a.options.icons.eraser),tooltip:a.lang.font.clear+a.representShortcut("removeFormat"),click:a.context.createInvokeHandler("editor.removeFormat")}).render()}),this.context.memo("button.strikethrough",function(){return a.button({className:"note-btn-strikethrough",contents:a.ui.icon(a.options.icons.strikethrough),tooltip:a.lang.font.strikethrough+a.representShortcut("strikethrough"),click:a.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()}),this.context.memo("button.superscript",function(){return a.button({className:"note-btn-superscript",contents:a.ui.icon(a.options.icons.superscript),tooltip:a.lang.font.superscript,click:a.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()}),this.context.memo("button.subscript",function(){return a.button({className:"note-btn-subscript",contents:a.ui.icon(a.options.icons.subscript),tooltip:a.lang.font.subscript,click:a.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()}),this.context.memo("button.fontname",function(){var b=a.context.invoke("editor.currentStyle");return a.options.addDefaultFonts&&Lc.a.each(b["font-family"].split(","),function(b,c){c=c.trim().replace(/['"]+/g,""),a.isFontDeservedToAdd(c)&&-1===a.options.fontNames.indexOf(c)&&a.options.fontNames.push(c)}),a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents('',a.options),tooltip:a.lang.font.name,data:{toggle:"dropdown"}}),a.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:a.options.icons.menuCheck,items:a.options.fontNames.filter(a.isFontInstalled.bind(a)),title:a.lang.font.name,template:function(a){return''+a+""},click:a.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),this.context.memo("button.fontsize",function(){return a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents('',a.options),tooltip:a.lang.font.size,data:{toggle:"dropdown"}}),a.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:a.options.icons.menuCheck,items:a.options.fontSizes,title:a.lang.font.size,click:a.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()}),this.context.memo("button.fontsizeunit",function(){return a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents('',a.options),tooltip:a.lang.font.sizeunit,data:{toggle:"dropdown"}}),a.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:a.options.icons.menuCheck,items:a.options.fontSizeUnits,title:a.lang.font.sizeunit,click:a.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()}),this.context.memo("button.color",function(){return a.colorPalette("note-color-all",a.lang.color.recent,!0,!0)}),this.context.memo("button.forecolor",function(){return a.colorPalette("note-color-fore",a.lang.color.foreground,!1,!0)}),this.context.memo("button.backcolor",function(){return a.colorPalette("note-color-back",a.lang.color.background,!0,!1)}),this.context.memo("button.ul",function(){return a.button({contents:a.ui.icon(a.options.icons.unorderedlist),tooltip:a.lang.lists.unordered+a.representShortcut("insertUnorderedList"),click:a.context.createInvokeHandler("editor.insertUnorderedList")}).render()}),this.context.memo("button.ol",function(){return a.button({contents:a.ui.icon(a.options.icons.orderedlist),tooltip:a.lang.lists.ordered+a.representShortcut("insertOrderedList"),click:a.context.createInvokeHandler("editor.insertOrderedList")}).render()});var d=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),e=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),f=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),g=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),h=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),i=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",Xc.invoke(d,"render")),this.context.memo("button.justifyCenter",Xc.invoke(e,"render")),this.context.memo("button.justifyRight",Xc.invoke(f,"render")),this.context.memo("button.justifyFull",Xc.invoke(g,"render")),this.context.memo("button.outdent",Xc.invoke(h,"render")),this.context.memo("button.indent",Xc.invoke(i,"render")),this.context.memo("button.paragraph",function(){return a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents(a.ui.icon(a.options.icons.alignLeft),a.options),tooltip:a.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),a.ui.dropdown([a.ui.buttonGroup({className:"note-align",children:[d,e,f,g]}),a.ui.buttonGroup({className:"note-list",children:[h,i]})])]).render()}),this.context.memo("button.height",function(){return a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents(a.ui.icon(a.options.icons.textHeight),a.options),tooltip:a.lang.font.height,data:{toggle:"dropdown"}}),a.ui.dropdownCheck({items:a.options.lineHeights,checkClassName:a.options.icons.menuCheck,className:"dropdown-line-height",title:a.lang.font.height,click:a.context.createInvokeHandler("editor.lineHeight")})]).render()}),this.context.memo("button.table",function(){return a.ui.buttonGroup([a.button({className:"dropdown-toggle",contents:a.ui.dropdownButtonContents(a.ui.icon(a.options.icons.table),a.options),tooltip:a.lang.table.table,data:{toggle:"dropdown"}}),a.ui.dropdown({title:a.lang.table.table,className:"note-table",items:['
','
','
','
',"
",'
1 x 1
'].join("")})],{callback:function(b){b.find(".note-dimension-picker-mousecatcher").css({width:a.options.insertTableMaxSize.col+"em",height:a.options.insertTableMaxSize.row+"em"}).mousedown(a.context.createInvokeHandler("editor.insertTable")).on("mousemove",a.tableMoveHandler.bind(a))}}).render()}),this.context.memo("button.link",function(){return a.button({contents:a.ui.icon(a.options.icons.link),tooltip:a.lang.link.link+a.representShortcut("linkDialog.show"),click:a.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.picture",function(){return a.button({contents:a.ui.icon(a.options.icons.picture),tooltip:a.lang.image.image,click:a.context.createInvokeHandler("imageDialog.show")}).render()}),this.context.memo("button.video",function(){return a.button({contents:a.ui.icon(a.options.icons.video),tooltip:a.lang.video.video,click:a.context.createInvokeHandler("videoDialog.show")}).render()}),this.context.memo("button.hr",function(){return a.button({contents:a.ui.icon(a.options.icons.minus),tooltip:a.lang.hr.insert+a.representShortcut("insertHorizontalRule"),click:a.context.createInvokeHandler("editor.insertHorizontalRule")}).render()}),this.context.memo("button.fullscreen",function(){return a.button({className:"btn-fullscreen note-codeview-keep",contents:a.ui.icon(a.options.icons.arrowsAlt),tooltip:a.lang.options.fullscreen,click:a.context.createInvokeHandler("fullscreen.toggle")}).render()}),this.context.memo("button.codeview",function(){return a.button({className:"btn-codeview note-codeview-keep",contents:a.ui.icon(a.options.icons.code),tooltip:a.lang.options.codeview,click:a.context.createInvokeHandler("codeview.toggle")}).render()}),this.context.memo("button.redo",function(){return a.button({contents:a.ui.icon(a.options.icons.redo),tooltip:a.lang.history.redo+a.representShortcut("redo"),click:a.context.createInvokeHandler("editor.redo")}).render()}),this.context.memo("button.undo",function(){return a.button({contents:a.ui.icon(a.options.icons.undo),tooltip:a.lang.history.undo+a.representShortcut("undo"),click:a.context.createInvokeHandler("editor.undo")}).render()}),this.context.memo("button.help",function(){return a.button({contents:a.ui.icon(a.options.icons.question),tooltip:a.lang.options.help,click:a.context.createInvokeHandler("helpDialog.show")}).render()})}},{key:"addImagePopoverButtons",value:function(){var a=this;this.context.memo("button.resizeFull",function(){return a.button({contents:'100%',tooltip:a.lang.image.resizeFull,click:a.context.createInvokeHandler("editor.resize","1")}).render()}),this.context.memo("button.resizeHalf",function(){return a.button({contents:'50%',tooltip:a.lang.image.resizeHalf,click:a.context.createInvokeHandler("editor.resize","0.5")}).render()}),this.context.memo("button.resizeQuarter",function(){return a.button({contents:'25%',tooltip:a.lang.image.resizeQuarter,click:a.context.createInvokeHandler("editor.resize","0.25")}).render()}),this.context.memo("button.resizeNone",function(){return a.button({contents:a.ui.icon(a.options.icons.rollback),tooltip:a.lang.image.resizeNone,click:a.context.createInvokeHandler("editor.resize","0")}).render()}),this.context.memo("button.floatLeft",function(){return a.button({contents:a.ui.icon(a.options.icons.floatLeft),tooltip:a.lang.image.floatLeft,click:a.context.createInvokeHandler("editor.floatMe","left")}).render()}),this.context.memo("button.floatRight",function(){return a.button({contents:a.ui.icon(a.options.icons.floatRight),tooltip:a.lang.image.floatRight,click:a.context.createInvokeHandler("editor.floatMe","right")}).render()}),this.context.memo("button.floatNone",function(){return a.button({contents:a.ui.icon(a.options.icons.rollback),tooltip:a.lang.image.floatNone,click:a.context.createInvokeHandler("editor.floatMe","none")}).render()}),this.context.memo("button.removeMedia",function(){return a.button({contents:a.ui.icon(a.options.icons.trash),tooltip:a.lang.image.remove,click:a.context.createInvokeHandler("editor.removeMedia")}).render()})}},{key:"addLinkPopoverButtons",value:function(){var a=this;this.context.memo("button.linkDialogShow",function(){return a.button({contents:a.ui.icon(a.options.icons.link),tooltip:a.lang.link.edit,click:a.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.unlink",function(){return a.button({contents:a.ui.icon(a.options.icons.unlink),tooltip:a.lang.link.unlink,click:a.context.createInvokeHandler("editor.unlink")}).render()})}},{key:"addTablePopoverButtons",value:function(){var a=this;this.context.memo("button.addRowUp",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.rowAbove),tooltip:a.lang.table.addRowAbove,click:a.context.createInvokeHandler("editor.addRow","top")}).render()}),this.context.memo("button.addRowDown",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.rowBelow),tooltip:a.lang.table.addRowBelow,click:a.context.createInvokeHandler("editor.addRow","bottom")}).render()}),this.context.memo("button.addColLeft",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.colBefore),tooltip:a.lang.table.addColLeft,click:a.context.createInvokeHandler("editor.addCol","left")}).render()}),this.context.memo("button.addColRight",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.colAfter),tooltip:a.lang.table.addColRight,click:a.context.createInvokeHandler("editor.addCol","right")}).render()}),this.context.memo("button.deleteRow",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.rowRemove),tooltip:a.lang.table.delRow,click:a.context.createInvokeHandler("editor.deleteRow")}).render()}),this.context.memo("button.deleteCol",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.colRemove),tooltip:a.lang.table.delCol,click:a.context.createInvokeHandler("editor.deleteCol")}).render()}),this.context.memo("button.deleteTable",function(){return a.button({className:"btn-md",contents:a.ui.icon(a.options.icons.trash),tooltip:a.lang.table.delTable,click:a.context.createInvokeHandler("editor.deleteTable")}).render()})}},{key:"build",value:function(a,b){for(var c=0,d=b.length;c3&&i.c3&&i.ri&&fj)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function(a){a?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function(a){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),a),this.changeContainer(a)}},{key:"updateCodeview",value:function(a){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),a),a?this.deactivate():this.activate()}},{key:"activate",value:function(a){var b=this.$toolbar.find("button");a||(b=b.not(".note-codeview-keep")),this.ui.toggleBtn(b,!0)}},{key:"deactivate",value:function(a){var b=this.$toolbar.find("button");a||(b=b.not(".note-codeview-keep")),this.ui.toggleBtn(b,!1)}}]),a}(),Id=function(){function a(b){jc(this,a),this.context=b,this.ui=Lc.a.summernote.ui,this.$body=Lc()(document.body),this.$editor=b.layoutInfo.editor,this.options=b.options,this.lang=this.options.langInfo,b.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}return lc(a,[{key:"initialize",value:function(){var a=this.options.dialogsInBody?this.$body:this.options.container,b=['
','"),''),"
",'
','"),''),"
",'
'.concat(this.lang.link_extend.or,"
"),'
','"),''),"
",this.options.disableLinkTarget?"":Lc()("
").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),Lc()("
").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),c='');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:b,footer:c}).render().appendTo(a)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(a,b){a.on("keypress",function(a){a.keyCode===nd.code.ENTER&&(a.preventDefault(),b.trigger("click"))})}},{key:"toggleLinkBtn",value:function(a,b,c,d){this.ui.toggleBtn(a,b.val()&&(c.val()||d.val()))}},{key:"showLinkDialog",value:function(a){var b=this;return Lc.a.Deferred(function(c){var d=b.$dialog.find(".note-link-text"),e=b.$dialog.find(".note-link-url"),f=b.$dialog.find(".note-link-cms"),g=b.$dialog.find(".note-link-btn"),h=b.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),i=b.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");b.ui.onDialogShown(b.$dialog,function(){b.context.triggerEvent("dialog.shown"),!a.url&&Xc.isValidUrl(a.text)&&(a.url=a.text),d.on("input paste propertychange",function(){a.text=d.val(),b.toggleLinkBtn(g,d,e,f)}).val(a.text),e.on("input paste propertychange",function(){a.text||d.val(e.val()),b.toggleLinkBtn(g,d,e,f)}).val(a.url),f.on("input paste propertychange",function(){b.toggleLinkBtn(g,d,e,f)}).val(a.cms),Vc.isSupportTouch||e.trigger("focus"),b.toggleLinkBtn(g,d,e,f),b.bindEnterKey(e,g),b.bindEnterKey(d,g),b.bindEnterKey(f,g);var j=void 0!==a.isNewWindow?a.isNewWindow:b.context.options.linkTargetBlank;h.prop("checked",j);var k=!a.url&&b.context.options.useProtocol;i.prop("checked",k),g.one("click",function(g){g.preventDefault(),c.resolve({range:a.range,url:e.val(),text:d.val(),cms:f.val(),isNewWindow:h.is(":checked"),checkProtocol:i.is(":checked")}),b.ui.hideDialog(b.$dialog)})}),b.ui.onDialogHidden(b.$dialog,function(){d.off(),e.off(),f.off(),g.off(),"pending"===c.state()&&c.reject()}),b.ui.showDialog(b.$dialog)}).promise()}},{key:"show",value:function(){var a=this,b=this.context.invoke("editor.getLinkInfo");/^\[{oxgetseourl/.test(b.url)&&(b.cms=/ident="([^"]*)"/g.exec(b.url)[1],b.url=""),/^\{{ seo_url/.test(b.url)&&(b.cms=/ident: '([^']*)'/g.exec(b.url)[1],b.url=""),this.context.invoke("editor.saveRange"),this.showLinkDialog(b).then(function(b){a.context.invoke("editor.restoreRange"),a.context.invoke("editor.createLink",b)}).fail(function(){a.context.invoke("editor.restoreRange")})}}]),a}(),Jd=function(){function a(b){var c=this;mc(this,a),this.context=b,this.ui=Lc.a.summernote.ui,this.options=b.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){c.update()},"summernote.disable summernote.dialog.shown summernote.blur":function(){c.hide()}}}return oc(a,[{key:"shouldInitialize",value:function(){return!Yc.isEmpty(this.options.popover.link)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(a){a.find(".popover-content,.note-popover-content").prepend(' ')}}).render().appendTo(this.options.container);var a=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",a,this.options.popover.link),this.$popover.on("mousedown",function(a){a.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){if(!this.context.invoke("editor.hasFocus"))return void this.hide();var a=this.context.invoke("editor.getLastRange");if(a.isCollapsed()&&a.isOnAnchor()){var b=id.ancestor(a.sc,id.isAnchor),c=Lc()(b).attr("href");this.$popover.find("a").attr("href",c).text(c);var d=id.posFromPlaceholder(b),e=Lc()(this.options.container).offset();d.top-=e.top,d.left-=e.left,this.$popover.css({display:"block",left:d.left,top:d.top})}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}]),a}(),Kd=function(){function a(b){pc(this,a),this.context=b,this.ui=Lc.a.summernote.ui,this.$body=Lc()(document.body),this.$editor=b.layoutInfo.editor,this.options=b.options,this.lang=this.options.langInfo}return rc(a,[{key:"initialize",value:function(){var a="";if(this.options.maximumImageFileSize){var b=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),c=1*(this.options.maximumImageFileSize/Math.pow(1024,b)).toFixed(2)+" "+" KMGTP"[b]+"B";a="".concat(this.lang.image.maximumFileSize+" : "+c,"")}var d=this.options.dialogsInBody?this.$body:this.options.container,e=['
','",'',a,"
",'
','",'',"
"].join(""),f='');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:e,footer:f}).render().appendTo(d)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(a,b){a.on("keypress",function(a){a.keyCode===nd.code.ENTER&&(a.preventDefault(),b.trigger("click"))})}},{key:"show",value:function(){var a=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then(function(b){a.ui.hideDialog(a.$dialog),a.context.invoke("editor.restoreRange"),"string"==typeof b?a.options.callbacks.onImageLinkInsert?a.context.triggerEvent("image.link.insert",b):a.context.invoke("editor.insertImage",b):a.context.invoke("editor.insertImagesOrCallback",b)}).fail(function(){a.context.invoke("editor.restoreRange")})}},{key:"showImageDialog",value:function(){var a=this;return Lc.a.Deferred(function(b){var c=a.$dialog.find(".note-image-input"),d=a.$dialog.find(".note-image-url"),e=a.$dialog.find(".note-image-btn");a.ui.onDialogShown(a.$dialog,function(){a.context.triggerEvent("dialog.shown"),c.replaceWith(c.clone().on("change",function(a){b.resolve(a.target.files||a.target.value)}).val("")),d.on("input paste propertychange",function(){a.ui.toggleBtn(e,d.val())}).val(""),Vc.isSupportTouch||d.trigger("focus"),e.click(function(a){a.preventDefault(),b.resolve(d.val())}),a.bindEnterKey(d,e)}),a.ui.onDialogHidden(a.$dialog,function(){c.off(),d.off(),e.off(),"pending"===b.state()&&b.reject()}),a.ui.showDialog(a.$dialog)})}}]),a}(),Ld=function(){function a(b){var c=this;sc(this,a),this.context=b,this.ui=Lc.a.summernote.ui,this.editable=b.layoutInfo.editable[0],this.options=b.options,this.events={"summernote.disable summernote.blur":function(){c.hide()}}}return uc(a,[{key:"shouldInitialize",value:function(){return!Yc.isEmpty(this.options.popover.image)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var a=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",a,this.options.popover.image),this.$popover.on("mousedown",function(a){a.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(a,b){if(id.isImg(a)){var c=Lc()(a).offset(),d=Lc()(this.options.container).offset(),e={};this.options.popatmouse?(e.left=b.pageX-20,e.top=b.pageY):e=c,e.top-=d.top,e.left-=d.left,this.$popover.css({display:"block",left:e.left,top:e.top})}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}]),a}(),Md=function(){function a(b){var c=this;vc(this,a),this.context=b,this.ui=Lc.a.summernote.ui,this.options=b.options,this.events={"summernote.mousedown":function(a,b){c.update(b.target)},"summernote.keyup summernote.scroll summernote.change":function(){c.update()},"summernote.disable summernote.blur":function(){c.hide()}}}return xc(a,[{key:"shouldInitialize",value:function(){return!Yc.isEmpty(this.options.popover.table)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var a=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",a,this.options.popover.table),Vc.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",function(a){a.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(a){if(this.context.isDisabled())return!1;var b=id.isCell(a);if(b){var c=id.posFromPlaceholder(a),d=Lc()(this.options.container).offset();c.top-=d.top,c.left-=d.left,this.$popover.css({display:"block",left:c.left,top:c.top})}else this.hide();return b}},{key:"hide",value:function(){this.$popover.hide()}}]),a}(),Nd=function(){function a(b){yc(this,a),this.context=b,this.ui=Lc.a.summernote.ui,this.$body=Lc()(document.body),this.$editor=b.layoutInfo.editor,this.options=b.options,this.lang=this.options.langInfo}return Ac(a,[{key:"initialize",value:function(){var a=this.options.dialogsInBody?this.$body:this.options.container,b=['
','"),''),"
"].join(""),c='');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:b,footer:c}).render().appendTo(a)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(a,b){a.on("keypress",function(a){a.keyCode===nd.code.ENTER&&(a.preventDefault(),b.trigger("click"))})}},{key:"createVideoNode",value:function(a){ var b,c=/\/\/(?:(?:www|m)\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/,d=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/,e=a.match(c),f=/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/,g=a.match(f),h=/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/,i=a.match(h),j=/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/,k=a.match(j),l=/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,m=a.match(l),n=/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/,o=a.match(n),p=/\/\/v\.qq\.com.*?vid=(.+)/,q=a.match(p),r=/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/,s=a.match(r),t=/^.+.(mp4|m4v)$/,u=a.match(t),v=/^.+.(ogg|ogv)$/,w=a.match(v),x=/^.+.(webm)$/,y=a.match(x),z=/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/,A=a.match(z);if(e&&11===e[1].length){var B=e[1],C=0;if(void 0!==e[2]){var D=e[2].match(d);if(D)for(var E=[3600,60,1],F=0,G=E.length;F").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+B+(C>0?"?start="+C:"")).attr("width","640").attr("height","360")}else if(g&&g[0].length)b=Lc()("