소재지 ₍₍◝(・'ω'・)◟⁾⁾ 🐟️?看XM(^_−)☆哈先看看刚看过卡卡国看过了回来冷藏柜好极过估计
PNG %k25u25%fgd5n!/*!
*
* Super simple wysiwyg editor v0.8.18
* https://summernote.org
*
*
* Copyright 2013- Alan Hong. and other contributors
* summernote may be freely distributed under the MIT license.
*
* Date: 2020-05-20T16:47Z
*
*/
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var n,o="object"==typeof exports?e(require("jquery")):e(t.jQuery);for(n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(window,function(n){return o={0:function(t,e){t.exports=n},1:function(t,e,n){"use strict";var o=n(0),r=n.n(o);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n";function M(t){return E(t)?t.nodeValue.length:t?t.childNodes.length:0}function O(t){var e=M(t);return 0===e||(!E(t)&&1===e&&t.innerHTML===B||!(!d.all(t.childNodes,E)||""!==t.innerHTML))}function j(t){I(t)||M(t)||(t.innerHTML=B)}function U(t,e){for(;t;){if(e(t))return t;if(T(t))break;t=t.parentNode}return null}function W(t,e){e=e||u.fail;var n=[];return U(t,function(t){return T(t)||n.push(t),e(t)}),n}function K(t,e){e=e||u.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.nextSibling;return n}function V(t,e){var n=e.nextSibling,e=e.parentNode;return n?e.insertBefore(t,n):e.appendChild(t),t}function q(n,t){return y.a.each(t,function(t,e){n.appendChild(e)}),n}function _(t){return 0===t.offset}function G(t){return t.offset===M(t.node)}function Y(t){return _(t)||G(t)}function Z(t,e){for(;t&&t!==e;){if(0!==Q(t))return!1;t=t.parentNode}return!0}function X(t,e){if(!e)return!1;for(;t&&t!==e;){if(Q(t)!==M(t.parentNode)-1)return!1;t=t.parentNode}return!0}function Q(t){for(var e=0;t=t.previousSibling;)e+=1;return e}function J(t){return!!(t&&t.childNodes&&t.childNodes.length)}function tt(t,e){var n,o;if(0===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=Q(t.node)}else o=J(t.node)?M(n=t.node.childNodes[t.offset-1]):(n=t.node,e?0:t.offset-1);return{node:n,offset:o}}function et(t,e){var n;if(M(t.node)===t.offset){if(T(t.node))return null;var o=ot(t.node),o=o?(n=o,0):(n=t.node.parentNode,Q(t.node)+1)}else o=J(t.node)?(n=t.node.childNodes[t.offset],0):(n=t.node,e?M(t.node):t.offset+1);return{node:n,offset:o}}function nt(t,e){var n;if(O(t.node))return{node:n=t.node.nextSibling,offset:i=0};if(M(t.node)===t.offset){if(T(t.node))return null;var o=ot(t.node),i=o?(n=o,0):(n=t.node.parentNode,Q(t.node)+1);T(n)&&(n=t.node.nextSibling,i=0)}else if(J(t.node)){if(i=0,O(n=t.node.childNodes[t.offset]))return null}else if(n=t.node,i=e?M(t.node):t.offset+1,O(n))return null;return{node:n,offset:i}}function ot(t){if(t.nextSibling&&t.parent===t.nextSibling.parent)return E(t.nextSibling)?t.nextSibling:ot(t.nextSibling)}function it(t,e){return t.node===e.node&&t.offset===e.offset}function rt(t,e){var n,o=e&&e.isSkipPaddingBlankHTML,i=e&&e.isNotSplitEdgePoint,e=e&&e.isDiscardEmptySplits;if(e&&(o=!0),Y(t)&&(E(t.node)||i)){if(_(t))return t.node;if(G(t))return t.node.nextSibling}return E(t.node)?t.node.splitText(t.offset):(i=t.node.childNodes[t.offset],q(n=V(t.node.cloneNode(!1),t.node),K(i)),o||(j(t.node),j(n)),e&&(O(t.node)&<(t.node),O(n))?(lt(n),t.node.nextSibling):n)}function at(t,n,o){t=W(n.node,u.eq(t));return t.length?1===t.length?rt(n,o):t.reduce(function(t,e){return t===n.node&&(t=rt(n,o)),rt({node:e,offset:t?Q(t):M(e)},o)}):null}function st(t){return document.createElement(t)}function lt(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var n=t.parentNode;if(!e){for(var o=[],i=0,r=t.childNodes.length;i".concat(B,"
"),makePredByNodeName:e,isEditable:T,isControlSizing:function(t){return t&&y()(t).hasClass("note-control-sizing")},isText:E,isElement:function(t){return t&&1===t.nodeType},isVoid:I,isPara:$,isPurePara:function(t){return $(t)&&!N(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:L,isBlock:u.not(L),isBodyInline:function(t){return L(t)&&!U(t,$)},isBody:t,isParaInline:function(t){return L(t)&&!!U(t,$)},isPre:p,isList:A,isTable:P,isData:R,isCell:D,isBlockquote:H,isBodyContainer:z,isAnchor:m,isDiv:e("DIV"),isLi:N,isBR:e("BR"),isSpan:e("SPAN"),isB:e("B"),isU:e("U"),isS:e("S"),isI:e("I"),isImg:e("IMG"),isTextarea:ct,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return O(t)},isEmpty:O,isEmptyAnchor:u.and(m,O),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||u.ok;var n=[];return t.previousSibling&&e(t.previousSibling)&&n.push(t.previousSibling),n.push(t),t.nextSibling&&e(t.nextSibling)&&n.push(t.nextSibling),n},nodeLength:M,isLeftEdgePoint:_,isRightEdgePoint:G,isEdgePoint:Y,isLeftEdgeOf:Z,isRightEdgeOf:X,isLeftEdgePointOf:function(t,e){return _(t)&&Z(t.node,e)},isRightEdgePointOf:function(t,e){return G(t)&&X(t.node,e)},prevPoint:tt,nextPoint:et,nextPointWithEmptyNode:nt,isSamePoint:it,isVisiblePoint:function(t){if(E(t.node)||!J(t.node)||O(t.node))return!0;var e=t.node.childNodes[t.offset-1],t=t.node.childNodes[t.offset];return!(e&&!I(e)||t&&!I(t))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=tt(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=et(t)}return null},isCharPoint:function(t){return!!E(t.node)&&((t=t.node.nodeValue.charAt(t.offset-1))&&" "!==t&&t!==S)},isSpacePoint:function(t){return!!E(t.node)&&(" "===(t=t.node.nodeValue.charAt(t.offset-1))||t===S)},walkPoint:function(t,e,n,o){for(var i=t;i&&(n(i),!it(i,e));)i=nt(i,o&&t.node!==i.node&&e.node!==i.node)},ancestor:U,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===M(t);){if(e(t))return t;if(T(t))break;t=t.parentNode}return null},listAncestor:W,lastAncestor:function(t,e){return t=W(t),d.last(t.filter(e))},listNext:K,listPrev:function(t,e){e=e||u.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.previousSibling;return n},listDescendant:function(i,r){var a=[];return r=r||u.ok,function t(e){i!==e&&r(e)&&a.push(e);for(var n=0,o=e.childNodes.length;n")[0];return n.insertBefore(e,t),e.appendChild(t),e},insertAfter:V,appendChildNodes:q,position:Q,hasChildren:J,makeOffsetPath:function(t,e){return W(e,u.eq(t)).map(Q).reverse()},fromOffsetPath:function(t,e){for(var n=t,o=0,i=e.length;o\s]*)(.*?)(\s*\/?>)/g,function(t,e,n){n=n.toUpperCase();e=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!e,n=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return t+(e||n?"\n":"")})).trim():t},value:ut,posFromPlaceholder:function(t){var e=(t=y()(t)).offset(),t=t.outerHeight(!0);return{left:e.left,top:e.top+t}},attachEvents:function(e,n){Object.keys(n).forEach(function(t){e.on(t,n[t])})},detachEvents:function(e,n){Object.keys(n).forEach(function(t){e.off(t,n[t])})},isCustomStyleTag:function(t){return t&&!E(t)&&d.contains(t.classList,"note-styletag")}};function dt(t,e){for(var n=0;ns.nodeValue.length&&s.nextSibling;)c-=s.nodeValue.length,s=s.nextSibling;s.nodeValue;u&&s.nextSibling&&h.isText(s.nextSibling)&&c===s.nodeValue.length&&(c-=s.nodeValue.length,s=s.nextSibling),n=s,r=c}return{cont:n,offset:r}}function mt(t){function r(t,e){if(h.isText(t)){var n=h.listPrev(t,u.not(h.isText)),o=d.last(n).previousSibling,i=o||t.parentNode;e+=d.sum(d.tail(n),h.nodeLength),n=!o}else{if(i=t.childNodes[e]||t,h.isText(i))return r(i,0);e=0,n=!1}return{node:i,collapseToStart:n,offset:e}}var e=document.body.createTextRange(),t=r(t.node,t.offset);return e.moveToElementText(t.node),e.collapse(t.collapseToStart),e.moveStart("character",t.offset),e}y.a.fn.extend({summernote:function(){var t=y.a.type(d.head(arguments)),e="string"===t,o=y.a.extend({},y.a.summernote.options,"object"===t?d.head(arguments):{}),t=(o.langInfo=y.a.extend(!0,{},y.a.summernote.lang["en-US"],y.a.summernote.lang[o.lang]),o.icons=y.a.extend(!0,{},y.a.summernote.options.icons,o.icons),o.tooltip="auto"===o.tooltip?!c.isSupportTouch:o.tooltip,this.each(function(t,e){var n,e=y()(e);e.data("summernote")||(n=new ht(e,o),e.data("summernote",n),e.data("summernote").triggerEvent("init",n.layoutInfo))}),this.first());if(t.length){t=t.data("summernote");if(e)return t.invoke.apply(t,d.from(arguments));o.focus&&t.invoke("editor.focus")}return this}});var vt=function(){function r(t,e,n,o){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.sc=t,this.so=e,this.ec=n,this.eo=o,this.isOnEditable=this.makeIsOn(h.isEditable),this.isOnList=this.makeIsOn(h.isList),this.isOnAnchor=this.makeIsOn(h.isAnchor),this.isOnCell=this.makeIsOn(h.isCell),this.isOnData=this.makeIsOn(h.isData)}var t,e,n;return t=r,(e=[{key:"nativeRange",value:function(){var t;return c.isW3CRangeSupport?((t=document.createRange()).setStart(this.sc,this.so),t.setEnd(this.ec,this.eo),t):((t=mt({node:this.sc,offset:this.so})).setEndPoint("EndToEnd",mt({node:this.ec,offset:this.eo})),t)}},{key:"getPoints",value:function(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function(){var t,e=this.nativeRange();return c.isW3CRangeSupport?(0<(t=document.getSelection()).rangeCount&&t.removeAllRanges(),t.addRange(e)):e.select(),this}},{key:"scrollIntoView",value:function(t){var e=y()(t).height();return t.scrollTop+e").html(t)[0],t=d.from(t.childNodes),e=this,n=!1;return 0<=e.so&&(t=t.reverse(),n=!0),t=t.map(function(t){return e.insertNode(t)}),t=n?t.reverse():t}},{key:"toString",value:function(){var t=this.nativeRange();return c.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(t){var e=this.getEndPoint();if(!h.isCharPoint(e))return this;var n=h.prevPointUntil(e,function(t){return!h.isCharPoint(t)});return t&&(e=h.nextPointUntil(e,function(t){return!h.isCharPoint(t)})),new r(n.node,n.offset,e.node,e.offset)}},{key:"getWordsRange",value:function(t){function e(t){return!h.isCharPoint(t)&&!h.isSpacePoint(t)}var n=this.getEndPoint();if(e(n))return this;var o=h.prevPointUntil(n,e);return t&&(n=h.nextPointUntil(n,e)),new r(o.node,o.offset,n.node,n.offset)}},{key:"getWordsMatchRange",value:function(e){var n=this.getEndPoint(),t=h.prevPointUntil(n,function(t){if(!h.isCharPoint(t)&&!h.isSpacePoint(t))return!0;t=new r(t.node,t.offset,n.node,n.offset),t=e.exec(t.toString());return t&&0===t.index}),t=new r(t.node,t.offset,n.node,n.offset),o=t.toString(),i=e.exec(o);return i&&i[0].length===o.length?t:null}},{key:"bookmark",value:function(t){return{s:{path:h.makeOffsetPath(t,this.sc),offset:this.so},e:{path:h.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:d.tail(h.makeOffsetPath(d.head(t),this.sc)),offset:this.so},e:{path:d.tail(h.makeOffsetPath(d.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}])&&ft(t.prototype,e),n&&ft(t,n),r}(),s={create:function(t,e,n,o){return 4===arguments.length?new vt(t,e,n,o):2===arguments.length?new vt(n=t,o=e,n,o):(e=this.createFromSelection())||1!==arguments.length?e:(h.isEditable(n=t)&&(n=n.lastChild),this.createFromBodyElement(n,h.emptyPara===t.innerHTML))},createFromBodyElement:function(t){var e=1this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),--this.stackOffset)}}])&&bt(t.prototype,n),o&&bt(t,o),e}();function kt(t,e){for(var n=0;n=n.cellIndex&&n.cellIndex<=e&&!o&&g.colPos++}function e(){for(var t=v.rows,e=0;e"),r=new f(t,f.where.Row,f.requestAction.Add,y()(n).closest("table")[0]).getActionList(),a=0;a"+h.blank+"");break;case f.resultAction.SumSpanCount:if("top"===e)if((s.baseCell.parent?s.baseCell.closest("tr").rowIndex:0)<=n[0].rowIndex){var c=y()("").append(y()(""+h.blank+" | ").removeAttr("rowspan")).html();i.append(c);break}c=parseInt(s.baseCell.rowSpan,10);c++,s.baseCell.setAttribute("rowSpan",c)}}if("top"===e)n.before(i);else{if(1"+h.blank+""):y()(a.baseCell).before(""+h.blank+" | ");break;case f.resultAction.SumSpanCount:"right"===e?(r=parseInt(a.baseCell.colSpan,10),r++,a.baseCell.setAttribute("colSpan",r)):y()(a.baseCell).before(""+h.blank+" | ")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var n=t.attributes||[],o=0;o"+h.blank+"");for(var r=o.join(""),a=[],s=0;s"+r+"");var l=a.join(""),l=y()("");return n&&n.tableClassName&&l.addClass(n.tableClassName),l[0]}},{key:"deleteTable",value:function(t){t=h.ancestor(t.commonAncestor(),h.isCell);y()(t).closest("table").remove()}}])&&Et(e.prototype,n),o&&Et(e,o),t}();function $t(t,e){for(var n=0;n"+e+"")[0]),i.push(r)):i=a.style.styleNodes(t,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0}),y.a.each(i,function(t,e){y()(e).attr("href",n),o?y()(e).attr("target","_blank"):y()(e).removeAttr("target")}),a.setLastRange(a.createRangeFromList(i).select()))}),this.color=this.wrapCommand(function(t){var e=t.foreColor,t=t.backColor;e&&document.execCommand("foreColor",!1,e),t&&document.execCommand("backColor",!1,t)}),this.foreColor=this.wrapCommand(function(t){document.execCommand("foreColor",!1,t)}),this.insertTable=this.wrapCommand(function(t){t=t.split("x");a.getLastRange().deleteContents().insertNode(a.table.createTable(t[0],t[1],a.options))}),this.removeMedia=this.wrapCommand(function(){var t=y()(a.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=y()(a.restoreTarget()).detach(),a.context.triggerEvent("media.delete",t,a.$editable)}),this.floatMe=this.wrapCommand(function(t){var e=y()(a.restoreTarget());e.toggleClass("note-float-left","left"===t),e.toggleClass("note-float-right","right"===t),e.css("float","none"===t?"":t)}),this.resize=this.wrapCommand(function(t){var e=y()(a.restoreTarget());0===(t=parseFloat(t))?e.css("width",""):e.css({width:100*t+"%",height:""})})}var t,e,n;return t=r,(e=[{key:"initialize",value:function(){var e=this;this.$editable.on("keydown",function(t){if(t.keyCode===a.code.ENTER&&e.context.triggerEvent("enter",t),e.context.triggerEvent("keydown",t),e.snapshot=e.history.makeSnapshot(),e.hasKeyShortCut=!1,t.isDefaultPrevented()||(e.options.shortcuts?e.hasKeyShortCut=e.handleKeyMap(t):e.preventDefaultEditableShortCuts(t)),e.isLimited(1,t)){t=e.getLastRange();if(t.eo-t.so==0)return!1}e.setLastRange(),e.options.recordEveryKeystroke&&!1===e.hasKeyShortCut&&e.history.recordUndo()}).on("keyup",function(t){e.setLastRange(),e.context.triggerEvent("keyup",t)}).on("focus",function(t){e.setLastRange(),e.context.triggerEvent("focus",t)}).on("blur",function(t){e.context.triggerEvent("blur",t)}).on("mousedown",function(t){e.context.triggerEvent("mousedown",t)}).on("mouseup",function(t){e.setLastRange(),e.history.recordUndo(),e.context.triggerEvent("mouseup",t)}).on("scroll",function(t){e.context.triggerEvent("scroll",t)}).on("paste",function(t){e.setLastRange(),e.context.triggerEvent("paste",t)}).on("input",function(){e.isLimited(0)&&e.snapshot&&e.history.applySnapshot(e.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(h.html(this.$note)||h.emptyPara),this.$editable.on(c.inputEventName,u.debounce(function(){e.context.triggerEvent("change",e.$editable.html(),e.$editable)},10)),this.$editable.on("focusin",function(t){e.context.triggerEvent("focusin",t)}).on("focusout",function(t){e.context.triggerEvent("focusout",t)}),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",function(t){return e.context.triggerEvent("contextmenu",t),!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(t){var e=this.options.keyMap[c.isMac?"mac":"pc"],n=[],o=(t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT"),a.nameFromCode[t.keyCode]),e=(o&&n.push(o),e[n.join("+")]);if("TAB"!==o||this.options.tabDisable)if(e){if(!1!==this.context.invoke(e))return t.preventDefault(),!0}else a.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&d.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(a.isMove(e.keyCode)||a.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||d.contains([a.code.BACKSPACE,a.code.DELETE],e.keyCode)))&&(0this.options.maxTextLength)}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"createRangeFromList",value:function(t){var e=s.createFromNodeBefore(d.head(t)).getStartPoint(),t=s.createFromNodeAfter(d.last(t)).getEndPoint();return s.create(e.node,e.offset,t.node,t.offset)}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=s.create(this.editable),0===y()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=s.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(t){t&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(t){this.$editable.data("target",t)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var t=s.create();return(t=t&&t.normalize())?this.style.current(t):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(t){return this.style.fromNode(t)}},{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(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(t,e){var n,o=this;return n=t,y.a.Deferred(function(t){var e=y()("
");e.one("load",function(){e.off("error abort"),t.resolve(e)}).one("error abort",function(){e.off("load").detach(),t.reject(e)}).css({display:"none"}).appendTo(document.body).attr("src",n)}).promise().then(function(t){o.beforeCommand(),"function"==typeof e?e(t):("string"==typeof e&&t.attr("data-filename",e),t.css("width",Math.min(o.$editable.width(),t.width()))),t.show(),o.getLastRange().insertNode(t[0]),o.setLastRange(s.createFromNodeAfter(t[0]).select()),o.afterCommand()}).fail(function(t){o.context.triggerEvent("image.upload.error",t)})}},{key:"insertImagesAsDataURL",value:function(t){var i=this;y.a.each(t,function(t,e){var n,o=e.name;i.options.maximumImageFileSize&&i.options.maximumImageFileSize":t),e&&e.length&&(e=e[0].tagName.toUpperCase()!==t.toUpperCase()?e.find(t):e)&&e.length&&((e=e[0].className||"")&&(n=this.createRange(),y()([n.sc,n.ec]).closest(t).addClass(e)))}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,e){var n,o,i=this.getLastRange();""!==i?(n=this.style.styleNodes(i),this.$editor.find(".note-status-output").html(""),y()(n).css(t,e),i.isCollapsed()?(t=d.head(n))&&!h.nodeLength(t)&&(t.innerHTML=h.ZERO_WIDTH_NBSP_CHAR,s.createFromNode(t.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",t)):this.setLastRange(this.createRangeFromList(n).select())):(o=y.a.now(),this.$editor.find(".note-status-output").html(''+this.lang.output.noSelection+"
"),setTimeout(function(){y()("#note-status-output-"+o).remove()},5e3))}},{key:"unlink",value:function(){var t,e=this.getLastRange();e.isOnAnchor()&&(t=h.ancestor(e.sc,h.isAnchor),(e=s.createFromNode(t)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand())}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(h.isAnchor),e=y()(d.head(t.nodes(h.isAnchor))),t={range:t,text:t.toString(),url:e.length?e.attr("href"):""};return e.length&&(t.isNewWindow="_blank"===e.attr("target")),t}},{key:"addRow",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}},{key:"addCol",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}},{key:"deleteRow",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}},{key:"deleteCol",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}},{key:"deleteTable",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}},{key:"resizeTo",value:function(t,e,n){var o;n=n?{width:(n=t.y/t.x)<(o=e.data("ratio"))?t.x:t.y/o,height:n','',""].join("")).prependTo(this.$editor)}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(t){t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var i=this,o=y()(),r=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(t){var e=i.context.invoke("codeview.isActivated"),n=0=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i,r=!0,a=!1;return{s:function(){o=t[Symbol.iterator]()},n:function(){var t=o.next();return r=t.done,t},e:function(t){a=!0,i=t},f:function(){try{r||null==o.return||o.return()}finally{if(a)throw i}}}}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n.*?(?:<\/iframe>)?)/gi,function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var e,n=Lt(i);try{for(n.s();!(e=n.n()).done;){var o=e.value;if(new RegExp('src="(https?:)?//'+o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){n.e(t)}finally{n.f()}return""}))),t}},{key:"activate",value:function(){var e,n,o=this,t=this.CodeMirrorConstructor;this.$codable.val(h.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(),t?(e=t.fromTextArea(this.$codable[0],this.options.codemirror),this.options.codemirror.tern&&(n=new t.TernServer(this.options.codemirror.tern),e.ternServer=n,e.on("cursorActivity",function(t){n.updateArgHints(t)})),e.on("blur",function(t){o.context.triggerEvent("blur.codeview",e.getValue(),t)}),e.on("change",function(){o.context.triggerEvent("change.codeview",e.getValue(),e)}),e.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",e)):(this.$codable.on("blur",function(t){o.context.triggerEvent("blur.codeview",o.$codable.val(),t)}),this.$codable.on("input",function(){o.context.triggerEvent("change.codeview",o.$codable.val(),o.$codable)}))}},{key:"deactivate",value:function(){this.CodeMirrorConstructor&&(t=this.$codable.data("cmEditor"),this.$codable.val(t.getValue()),t.toTextArea());var t=this.purify(h.value(this.$codable,this.options.prettifyHtml)||h.emptyPara),e=this.$editable.html()!==t;this.$editable.html(t),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),e&&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()}}])&&Ft(t.prototype,n),o&&Ft(t,o),e}();function Dt(t,e){for(var n=0;n','','
','
','
','
','
',this.options.disableResizeImage?"":'
',"
",""].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",function(t){var e,n,o,i;h.isControlSizing(t.target)&&(t.preventDefault(),t.stopPropagation(),e=r.$handle.find(".note-control-selection").data("target"),n=e.offset(),o=r.$document.scrollTop(),r.$document.on("mousemove",i=function(t){r.context.invoke("editor.resizeTo",{x:t.clientX-n.left,y:t.clientY-(n.top-o)},e,!t.shiftKey),r.update(e[0],t)}).one("mouseup",function(t){t.preventDefault(),r.$document.off("mousemove",i),r.context.invoke("editor.afterCommand")}),e.data("ratio")||e.data("ratio",e.height()/e.width()))}),this.$handle.on("wheel",function(t){t.preventDefault(),r.update()})}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,e){if(this.context.isDisabled())return!1;var n,o,i=h.isImg(t),r=this.$handle.find(".note-control-selection");return this.context.invoke("imagePopover.update",t,e),i?(o={left:(o=(e=y()(t)).position()).left+parseInt(e.css("marginLeft"),10),top:o.top+parseInt(e.css("marginTop"),10)},n={w:e.outerWidth(!1),h:e.outerHeight(!1)},r.css({display:"block",left:o.left,top:o.top,width:n.w,height:n.h}).data("target",e),(o=new Image).src=e.attr("src"),e=n.w+"x"+n.h+" ("+this.lang.image.original+": "+o.width+"x"+o.height+")",r.find(".note-control-selection-info").text(e),this.context.invoke("editor.saveTarget",t)):this.hide(),i}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}])&&zt(t.prototype,n),o&&zt(t,o),e}();function Bt(t,e){for(var n=0;n").html(e).attr("href",t)[0],this.context.options.linkTargetBlank&&y()(e).attr("target","_blank"),this.lastWordRange.insertNode(e),this.lastWordRange=null,this.context.invoke("editor.focus"))}},{key:"handleKeydown",value:function(t){d.contains([a.code.ENTER,a.code.SPACE],t.keyCode)&&(t=this.context.invoke("editor.createRange").getWordRange(),this.lastWordRange=t)}},{key:"handleKeyup",value:function(t){d.contains([a.code.ENTER,a.code.SPACE],t.keyCode)&&this.replace()}}])&&Bt(t.prototype,n),o&&Bt(t,o),e}();function jt(t,e){for(var n=0;n'),this.$placeholder.on("click",function(){t.context.invoke("focus")}).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}])&&Vt(t.prototype,e),o&&Vt(t,o),n}();function _t(t,e){for(var n=0;n',''+this.lang.color.background+"
","",'","
",'\x3c!-- back colors --\x3e
',"",'",'',"
",'',""].join(""):"")+(o?['','
'+this.lang.color.foreground+"
","
",'","
",'
\x3c!-- fore colors --\x3e
',"
",'",'',"
",'
',"
"].join(""):""),callback:function(n){n.find(".note-holder").each(function(t,e){e=y()(e);e.append(l.ui.palette({colors:l.options.colors,colorsName:l.options.colorsName,eventName:e.data("event"),container:l.options.container,tooltip:l.options.tooltip}).render())});var o=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];n.find(".note-holder-custom").each(function(t,e){e=y()(e);e.append(l.ui.palette({colors:o,colorsName:o,eventName:e.data("event"),container:l.options.container,tooltip:l.options.tooltip}).render())}),n.find("input[type=color]").each(function(t,e){y()(e).change(function(){var t=n.find("#"+y()(this).data("event")).find(".note-color-btn").first(),e=this.value.toUpperCase();t.css("background-color",e).attr("aria-label",e).attr("data-value",e).attr("data-original-title",e),t.click()})})},click:function(t){t.stopPropagation();var e,n,o,i=y()("."+s).find(".note-dropdown-menu"),t=y()(t.target),r=t.data("event"),a=t.attr("data-value");"openPalette"===r?(e=i.find("#"+a),o=(i=y()(i.find("#"+e.data("event")).find(".note-color-row")[0])).find(".note-color-btn").last().detach(),n=e.val(),o.css("background-color",n).attr("aria-label",n).attr("data-value",n).attr("data-original-title",n),i.prepend(o),e.click()):(d.contains(["backColor","foreColor"],r)&&(n="backColor"===r?"background-color":"color",i=t.closest(".note-color").find(".note-recent-color"),o=t.closest(".note-color").find(".note-current-color-button"),i.css(n,a),o.attr("data-"+r,a)),l.context.invoke("editor."+r,a))}})]}).render()}},{key:"addToolbarButtons",value:function(){for(var o=this,t=(this.context.memo("button.style",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.magic),o.options),tooltip:o.lang.style.style,data:{toggle:"dropdown"}}),o.ui.dropdown({className:"dropdown-style",items:o.options.styleTags,title:o.lang.style.style,template:function(t){var e=(t="string"==typeof t?{tag:t,title:Object.prototype.hasOwnProperty.call(o.lang.style,t)?o.lang.style[t]:t}:t).tag,n=t.title;return"<"+e+(t.style?' style="'+t.style+'" ':"")+(t.className?' class="'+t.className+'"':"")+">"+n+""+e+">"},click:o.context.createInvokeHandler("editor.formatBlock")})]).render()}),0),e=this.options.styleTags.length;t'+e.toUpperCase()+"",tooltip:o.lang.style[e],click:o.context.createInvokeHandler("editor.formatBlock")}).render()})}(t);this.context.memo("button.bold",function(){return o.button({className:"note-btn-bold",contents:o.ui.icon(o.options.icons.bold),tooltip:o.lang.font.bold+o.representShortcut("bold"),click:o.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()}),this.context.memo("button.italic",function(){return o.button({className:"note-btn-italic",contents:o.ui.icon(o.options.icons.italic),tooltip:o.lang.font.italic+o.representShortcut("italic"),click:o.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()}),this.context.memo("button.underline",function(){return o.button({className:"note-btn-underline",contents:o.ui.icon(o.options.icons.underline),tooltip:o.lang.font.underline+o.representShortcut("underline"),click:o.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()}),this.context.memo("button.clear",function(){return o.button({contents:o.ui.icon(o.options.icons.eraser),tooltip:o.lang.font.clear+o.representShortcut("removeFormat"),click:o.context.createInvokeHandler("editor.removeFormat")}).render()}),this.context.memo("button.strikethrough",function(){return o.button({className:"note-btn-strikethrough",contents:o.ui.icon(o.options.icons.strikethrough),tooltip:o.lang.font.strikethrough+o.representShortcut("strikethrough"),click:o.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()}),this.context.memo("button.superscript",function(){return o.button({className:"note-btn-superscript",contents:o.ui.icon(o.options.icons.superscript),tooltip:o.lang.font.superscript,click:o.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()}),this.context.memo("button.subscript",function(){return o.button({className:"note-btn-subscript",contents:o.ui.icon(o.options.icons.subscript),tooltip:o.lang.font.subscript,click:o.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()}),this.context.memo("button.fontname",function(){var t=o.context.invoke("editor.currentStyle");return o.options.addDefaultFonts&&y.a.each(t["font-family"].split(","),function(t,e){e=e.trim().replace(/['"]+/g,""),o.isFontDeservedToAdd(e)&&-1===o.options.fontNames.indexOf(e)&&o.options.fontNames.push(e)}),o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents('',o.options),tooltip:o.lang.font.name,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:o.options.icons.menuCheck,items:o.options.fontNames.filter(o.isFontInstalled.bind(o)),title:o.lang.font.name,template:function(t){return''+t+""},click:o.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),this.context.memo("button.fontsize",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents('',o.options),tooltip:o.lang.font.size,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:o.options.icons.menuCheck,items:o.options.fontSizes,title:o.lang.font.size,click:o.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()}),this.context.memo("button.fontsizeunit",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents('',o.options),tooltip:o.lang.font.sizeunit,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:o.options.icons.menuCheck,items:o.options.fontSizeUnits,title:o.lang.font.sizeunit,click:o.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()}),this.context.memo("button.color",function(){return o.colorPalette("note-color-all",o.lang.color.recent,!0,!0)}),this.context.memo("button.forecolor",function(){return o.colorPalette("note-color-fore",o.lang.color.foreground,!1,!0)}),this.context.memo("button.backcolor",function(){return o.colorPalette("note-color-back",o.lang.color.background,!0,!1)}),this.context.memo("button.ul",function(){return o.button({contents:o.ui.icon(o.options.icons.unorderedlist),tooltip:o.lang.lists.unordered+o.representShortcut("insertUnorderedList"),click:o.context.createInvokeHandler("editor.insertUnorderedList")}).render()}),this.context.memo("button.ol",function(){return o.button({contents:o.ui.icon(o.options.icons.orderedlist),tooltip:o.lang.lists.ordered+o.representShortcut("insertOrderedList"),click:o.context.createInvokeHandler("editor.insertOrderedList")}).render()});var n=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),i=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),r=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),a=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),s=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),l=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",u.invoke(n,"render")),this.context.memo("button.justifyCenter",u.invoke(i,"render")),this.context.memo("button.justifyRight",u.invoke(r,"render")),this.context.memo("button.justifyFull",u.invoke(a,"render")),this.context.memo("button.outdent",u.invoke(s,"render")),this.context.memo("button.indent",u.invoke(l,"render")),this.context.memo("button.paragraph",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.alignLeft),o.options),tooltip:o.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),o.ui.dropdown([o.ui.buttonGroup({className:"note-align",children:[n,i,r,a]}),o.ui.buttonGroup({className:"note-list",children:[s,l]})])]).render()}),this.context.memo("button.height",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.textHeight),o.options),tooltip:o.lang.font.height,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({items:o.options.lineHeights,checkClassName:o.options.icons.menuCheck,className:"dropdown-line-height",title:o.lang.font.height,click:o.context.createInvokeHandler("editor.lineHeight")})]).render()}),this.context.memo("button.table",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.table),o.options),tooltip:o.lang.table.table,data:{toggle:"dropdown"}}),o.ui.dropdown({title:o.lang.table.table,className:"note-table",items:['",'1 x 1
'].join("")})],{callback:function(t){t.find(".note-dimension-picker-mousecatcher").css({width:o.options.insertTableMaxSize.col+"em",height:o.options.insertTableMaxSize.row+"em"}).mousedown(o.context.createInvokeHandler("editor.insertTable")).on("mousemove",o.tableMoveHandler.bind(o))}}).render()}),this.context.memo("button.link",function(){return o.button({contents:o.ui.icon(o.options.icons.link),tooltip:o.lang.link.link+o.representShortcut("linkDialog.show"),click:o.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.picture",function(){return o.button({contents:o.ui.icon(o.options.icons.picture),tooltip:o.lang.image.image,click:o.context.createInvokeHandler("imageDialog.show")}).render()}),this.context.memo("button.video",function(){return o.button({contents:o.ui.icon(o.options.icons.video),tooltip:o.lang.video.video,click:o.context.createInvokeHandler("videoDialog.show")}).render()}),this.context.memo("button.hr",function(){return o.button({contents:o.ui.icon(o.options.icons.minus),tooltip:o.lang.hr.insert+o.representShortcut("insertHorizontalRule"),click:o.context.createInvokeHandler("editor.insertHorizontalRule")}).render()}),this.context.memo("button.fullscreen",function(){return o.button({className:"btn-fullscreen note-codeview-keep",contents:o.ui.icon(o.options.icons.arrowsAlt),tooltip:o.lang.options.fullscreen,click:o.context.createInvokeHandler("fullscreen.toggle")}).render()}),this.context.memo("button.codeview",function(){return o.button({className:"btn-codeview note-codeview-keep",contents:o.ui.icon(o.options.icons.code),tooltip:o.lang.options.codeview,click:o.context.createInvokeHandler("codeview.toggle")}).render()}),this.context.memo("button.redo",function(){return o.button({contents:o.ui.icon(o.options.icons.redo),tooltip:o.lang.history.redo+o.representShortcut("redo"),click:o.context.createInvokeHandler("editor.redo")}).render()}),this.context.memo("button.undo",function(){return o.button({contents:o.ui.icon(o.options.icons.undo),tooltip:o.lang.history.undo+o.representShortcut("undo"),click:o.context.createInvokeHandler("editor.undo")}).render()}),this.context.memo("button.help",function(){return o.button({contents:o.ui.icon(o.options.icons.question),tooltip:o.lang.options.help,click:o.context.createInvokeHandler("helpDialog.show")}).render()})}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",function(){return t.button({contents:'100%',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()}),this.context.memo("button.resizeHalf",function(){return t.button({contents:'50%',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()}),this.context.memo("button.resizeQuarter",function(){return t.button({contents:'25%',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()}),this.context.memo("button.resizeNone",function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()}),this.context.memo("button.floatLeft",function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()}),this.context.memo("button.floatRight",function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()}),this.context.memo("button.floatNone",function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()}),this.context.memo("button.removeMedia",function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()})}},{key:"addLinkPopoverButtons",value:function(){var t=this;this.context.memo("button.linkDialogShow",function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.unlink",function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()})}},{key:"addTablePopoverButtons",value:function(){var t=this;this.context.memo("button.addRowUp",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()}),this.context.memo("button.addRowDown",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()}),this.context.memo("button.addColLeft",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()}),this.context.memo("button.addColRight",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()}),this.context.memo("button.deleteRow",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()}),this.context.memo("button.deleteCol",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()}),this.context.memo("button.deleteTable",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()})}},{key:"build",value:function(t,e){for(var n=0,o=e.length;n','"),''),"",'','"),''),"
",this.options.disableLinkTarget?"":y()("").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),y()("").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),n='');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",function(t){t.keyCode===a.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"toggleLinkBtn",value:function(t,e,n){this.ui.toggleBtn(t,e.val()&&n.val())}},{key:"showLinkDialog",value:function(s){var l=this;return y.a.Deferred(function(e){var n=l.$dialog.find(".note-link-text"),o=l.$dialog.find(".note-link-url"),i=l.$dialog.find(".note-link-btn"),r=l.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),a=l.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");l.ui.onDialogShown(l.$dialog,function(){l.context.triggerEvent("dialog.shown"),!s.url&&u.isValidUrl(s.text)&&(s.url=s.text),n.on("input paste propertychange",function(){s.text=n.val(),l.toggleLinkBtn(i,n,o)}).val(s.text),o.on("input paste propertychange",function(){s.text||n.val(o.val()),l.toggleLinkBtn(i,n,o)}).val(s.url),c.isSupportTouch||o.trigger("focus"),l.toggleLinkBtn(i,n,o),l.bindEnterKey(o,i),l.bindEnterKey(n,i);var t=void 0!==s.isNewWindow?s.isNewWindow:l.context.options.linkTargetBlank,t=(r.prop("checked",t),!s.url&&l.context.options.useProtocol);a.prop("checked",t),i.one("click",function(t){t.preventDefault(),e.resolve({range:s.range,url:o.val(),text:n.val(),isNewWindow:r.is(":checked"),checkProtocol:a.is(":checked")}),l.ui.hideDialog(l.$dialog)})}),l.ui.onDialogHidden(l.$dialog,function(){n.off(),o.off(),i.off(),"pending"===e.state()&&e.reject()}),l.ui.showDialog(l.$dialog)}).promise()}},{key:"show",value:function(){var e=this,t=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(t).then(function(t){e.context.invoke("editor.restoreRange"),e.context.invoke("editor.createLink",t)}).fail(function(){e.context.invoke("editor.restoreRange")})}}])&&Xt(t.prototype,n),o&&Xt(t,o),e}();function Jt(t,e){for(var n=0;n ')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){var t,e;this.context.invoke("editor.hasFocus")&&(e=this.context.invoke("editor.getLastRange")).isCollapsed()&&e.isOnAnchor()?(e=h.ancestor(e.sc,h.isAnchor),t=y()(e).attr("href"),this.$popover.find("a").attr("href",t).text(t),t=h.posFromPlaceholder(e),e=y()(this.options.container).offset(),t.top-=e.top,t.left-=e.left,this.$popover.css({display:"block",left:t.left,top:t.top})):this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Jt(t.prototype,e),o&&Jt(t,o),n}();function ee(t,e){for(var n=0;n".concat(this.lang.image.maximumFileSize+" : "+e,"")),this.options.dialogsInBody?this.$body:this.options.container),t=['','",'',t,"
",'','",'',"
"].join(""),n='');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:t,footer:n}).render().appendTo(e)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",function(t){t.keyCode===a.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"show",value:function(){var e=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then(function(t){e.ui.hideDialog(e.$dialog),e.context.invoke("editor.restoreRange"),"string"==typeof t?e.options.callbacks.onImageLinkInsert?e.context.triggerEvent("image.link.insert",t):e.context.invoke("editor.insertImage",t):e.context.invoke("editor.insertImagesOrCallback",t)}).fail(function(){e.context.invoke("editor.restoreRange")})}},{key:"showImageDialog",value:function(){var i=this;return y.a.Deferred(function(e){var t=i.$dialog.find(".note-image-input"),n=i.$dialog.find(".note-image-url"),o=i.$dialog.find(".note-image-btn");i.ui.onDialogShown(i.$dialog,function(){i.context.triggerEvent("dialog.shown"),t.replaceWith(t.clone().on("change",function(t){e.resolve(t.target.files||t.target.value)}).val("")),n.on("input paste propertychange",function(){i.ui.toggleBtn(o,n.val())}).val(""),c.isSupportTouch||n.trigger("focus"),o.click(function(t){t.preventDefault(),e.resolve(n.val())}),i.bindEnterKey(n,o)}),i.ui.onDialogHidden(i.$dialog,function(){t.off(),n.off(),o.off(),"pending"===e.state()&&e.reject()}),i.ui.showDialog(i.$dialog)})}}])&&ee(t.prototype,n),o&&ee(t,o),e}();function oe(t,e){for(var n=0;n','"),''),""].join(""),n='');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",function(t){t.keyCode===a.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"createVideoNode",value:function(t){var e=t.match(/\/\/(?:(?:www|m)\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),n=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),o=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),i=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),r=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),a=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),s=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),u=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),d=t.match(/^.+.(mp4|m4v)$/),h=t.match(/^.+.(ogg|ogv)$/),f=t.match(/^.+.(webm)$/),p=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(e&&11===e[1].length){var l=e[1],m=0;if(void 0!==e[2]){var v=e[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(v)for(var g=[3600,60,1],c=0,b=g.length;c").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+l+(0").attr("frameborder",0).attr("src","https://instagram.com/p/"+n[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(o&&o[0].length)l=y()("