forked from summernote/summernote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
summernote.min.js
4 lines (4 loc) · 79.6 KB
/
summernote.min.js
1
2
3
4
/*! Summernote v0.7.0 | (c) 2013-2015 Alan Hong and other contributors | MIT license */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){var b=function(){var b=function(a){return function(b){return a===b}},c=function(a,b){return a===b},d=function(a){return function(b,c){return b[a]===c[a]}},e=function(){return!0},f=function(){return!1},g=function(a){return function(){return!a.apply(a,arguments)}},h=function(a,b){return function(c){return a(c)&&b(c)}},i=function(a){return a},j=0,k=function(a){var b=++j+"";return a?a+b:b},l=function(b){var c=a(document);return{top:b.top+c.scrollTop(),left:b.left+c.scrollLeft(),width:b.right-b.left,height:b.bottom-b.top}},m=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b},n=function(a,b){return b=b||"",b+a.split(".").map(function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}).join("")};return{eq:b,eq2:c,peq2:d,ok:e,fail:f,self:i,not:g,and:h,uniqueId:k,rect2bnd:l,invertObject:m,namespaceToCamel:n}}(),c=function(){var c=function(a){return a[0]},d=function(a){return a[a.length-1]},e=function(a){return a.slice(0,a.length-1)},f=function(a){return a.slice(1)},g=function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(b(e))return e}},h=function(a,b){for(var c=0,d=a.length;d>c;c++)if(!b(a[c]))return!1;return!0},i=function(b,c){return a.inArray(c,b)},j=function(a,b){return-1!==i(a,b)},k=function(a,c){return c=c||b.self,a.reduce(function(a,b){return a+c(b)},0)},l=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},m=function(a,b){if(!a.length)return[];var e=f(a);return e.reduce(function(a,c){var e=d(a);return b(d(e),c)?e[e.length]=c:a[a.length]=[c],a},[[c(a)]])},n=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b},o=function(a){for(var b=[],c=0,d=a.length;d>c;c++)j(b,a[c])||b.push(a[c]);return b},p=function(a,b){var c=i(a,b);return-1===c?null:a[c+1]},q=function(a,b){var c=i(a,b);return-1===c?null:a[c-1]};return{head:c,last:d,initial:e,tail:f,prev:q,next:p,find:g,contains:j,all:h,sum:k,from:l,clusterBy:m,compact:n,unique:o}}(),d=function(d,e){var f=this,g=a.summernote.ui;return this.modules={},this.buttons={},this.layoutInfo={},this.options=e,this.initialize=function(){return this.layoutInfo=g.createLayout(d,e),Object.keys(this.options.modules).forEach(function(a){var b=new f.options.modules[a](f);b.initialize&&b.initialize.apply(b),f.addModule(a,b)}),Object.keys(this.options.buttons).forEach(function(a){var b=f.options.buttons[a];f.addButton(a,b)}),d.hide(),this.triggerEvent("init"),this},this.destroy=function(){Object.keys(this.modules).forEach(function(a){f.removeModule(a)}),d.removeData("summernote"),g.removeLayout(d,this.layoutInfo)},this.code=function(a){if(void 0===a){var b=this.invoke("codeview.isActivated");return this.invoke("codeview.sync"),b?this.layoutInfo.codable.val():this.layoutInfo.editable.html()}this.layoutInfo.editable.html(a)},this.triggerEvent=function(){var a=c.head(arguments),e=c.tail(c.from(arguments)),f=this.options.callbacks[b.namespaceToCamel(a,"on")];f&&f.apply(d[0],e),d.trigger("summernote."+a,e)},this.addModule=function(a,b){this.modules[a]=b},this.removeModule=function(a){this.modules[a].destroy&&this.modules[a].destroy(),delete this.modules[a]},this.addButton=function(a,b){this.buttons[a]=b},this.removeButton=function(a){this.buttons[a].destroy&&this.buttons[a].destroy(),delete this.buttons[a]},this.buildButtons=function(a,b){for(var c=0,d=b.length;d>c;c++){for(var e=b[c],f=e[0],h=e[1],i=g.buttonGroup({className:"note-"+f}).render(),j=0,k=h.length;k>j;j++){var l=this.buttons[h[j]];l&&i.append("function"==typeof l?l(this):l)}i.appendTo(a)}},this.createInvokeHandler=function(b,c){return function(d){d.preventDefault(),f.invoke(b,c||a(d.target).data("value")||a(d.currentTarget).data("value"))}},this.invoke=function(){var a=c.head(arguments),b=c.tail(c.from(arguments)),d=a.split("."),e=d.length>1,f=e&&c.head(d),g=e?c.last(d):c.head(d),h=this.modules[f||"editor"];return!f&&this[g]?this[g].apply(this,b):h&&h[g]?h[g].apply(h,b):void 0},this.initialize()};a.summernote=a.summernote||{lang:{}},a.fn.extend({summernote:function(){var b=a.type(c.head(arguments)),e="string"===b,f="object"===b,g=f?c.head(arguments):{};g=a.extend({},a.summernote.options,g),g.langInfo=a.extend(!0,{},a.summernote.lang["en-US"],a.summernote.lang[g.lang]),this.each(function(b,c){var e=a(c);e.data("summernote")||e.data("summernote",new d(e,g))});var h=this.first();if(e&&h.length){var i=h.data("summernote");return i.invoke.apply(i,c.from(arguments))}}});var e,f=function(b,c,d,e){this.render=function(f){var g=a(b);if(d&&d.contents&&g.html(d.contents),d&&d.className&&g.addClass(d.className),d&&d.data&&a.each(d.data,function(a,b){g.attr("data-"+a,b)}),d&&d.click&&g.on("mousedown",d.click),c){var h=g.find(".note-children-container");c.forEach(function(a){a.render(h.length?h:g)})}return e&&e(g,d),d&&d.callback&&d.callback(g),f&&f.append(g),g}},g={create:function(b,c){return function(){var d=a.isArray(arguments[0])?arguments[0]:[],e="object"==typeof arguments[1]?arguments[1]:arguments[0];return e&&e.children&&(d=e.children),new f(b,d,e,c)}}},h=g.create('<div class="note-editor note-frame panel panel-default"/>'),i=g.create('<div class="note-toolbar panel-heading"/>'),j=g.create('<div class="note-editing-area"/>'),k=g.create('<textarea class="note-codable"/>'),l=g.create('<div class="note-editable panel-body" contentEditable="true"/>'),m=g.create(['<div class="note-statusbar">',' <div class="note-resizebar">',' <div class="note-icon-bar"/>',' <div class="note-icon-bar"/>',' <div class="note-icon-bar"/>'," </div>","</div>"].join("")),n=g.create('<div class="note-editor"/>'),o=g.create('<div class="note-editable" contentEditable="true"/>'),p=g.create('<div class="note-btn-group btn-group">'),q=g.create('<button class="note-btn btn btn-default btn-sm">',function(a,b){b&&b.tooltip&&a.attr({title:b.tooltip}).tooltip({container:"body",trigger:"hover",placement:"bottom"})}),r=g.create('<div class="dropdown-menu">',function(b,c){var d=a.isArray(c.items)?c.items.map(function(a){return'<li><a href="#" data-value="'+a+'">'+a+"</a></li>"}).join(""):c.items;b.html(d)}),s=g.create('<div class="dropdown-menu note-check">',function(b,c){var d=a.isArray(c.items)?c.items.map(function(a){return'<li><a href="#" data-value="'+a+'"><i class="fa fa-check" /> '+a+"</a></li>"}).join(""):c.items;b.html(d)}),t=g.create('<div class="note-color-palette"/>',function(a,b){for(var c=[],d=0,e=b.colors.length;e>d;d++){for(var f=b.eventName,g=b.colors[d],h=[],i=0,j=g.length;j>i;i++){var k=g[i];h.push(['<button type="button" class="note-color-btn"','style="background-color:',k,'" ','data-event="',f,'" ','data-value="',k,'" ','title="',k,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}c.push('<div class="note-color-row">'+h.join("")+"</div>")}a.html(c.join("")),a.find(".note-color-btn").tooltip({container:"body",trigger:"hover",placement:"bottom"})}),u=g.create('<div class="modal" aria-hidden="false"/>',function(a,b){a.html(['<div class="modal-dialog">','<div class="modal-content">',b.title?'<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button><h4 class="modal-title">'+b.title+"</h4></div>":"",'<div class="modal-body">'+b.body+"</div>",b.footer?'<div class="modal-footer">'+b.footer+"</div>":"","</div>","</div>"].join(""))}),v=g.create(['<div class="note-popover popover bottom in">',' <div class="arrow"/>',' <div class="popover-content note-children-container"/>',"</div>"].join("")),w={editor:h,toolbar:i,editingArea:j,codable:k,editable:l,statusbar:m,airEditor:n,airEditable:o,buttonGroup:p,button:q,dropdown:r,dropdownCheck:s,palette:t,dialog:u,popover:v,toggleBtn:function(a,b){a.toggleClass("disabled",!b),a.attr("disabled",!b)},toggleBtnActive:function(a,b){a.toggleClass("active",b)},onDialogShown:function(a,b){a.one("shown.bs.modal",b)},onDialogHidden:function(a,b){a.one("hidden.bs.modal",b)},showDialog:function(a){a.modal("show")},hideDialog:function(a){a.modal("hide")},createLayout:function(a,b){var c=(b.airMode?w.airEditor([w.editingArea([w.airEditable()])]):w.editor([w.toolbar(),w.editingArea([w.codable(),w.editable()]),w.statusbar()])).render();return c.insertAfter(a),{note:a,editor:c,toolbar:c.find(".note-toolbar"),editingArea:c.find(".note-editing-area"),editable:c.find(".note-editable"),codable:c.find(".note-codable"),statusbar:c.find(".note-statusbar")}},removeLayout:function(a,b){a.html(b.editable.html()),b.editor.remove(),a.show()}},x="function"==typeof define&&define.amd,y=function(b){var c="Comic Sans MS"===b?"Courier New":"Comic Sans MS",d=a("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),e=d.css("fontFamily",c).width(),f=d.css("fontFamily",b+","+c).width();return d.remove(),e!==f},z=navigator.userAgent,A=/MSIE|Trident/i.test(z);if(A){var B=/MSIE (\d+[.]\d+)/.exec(z);B&&(e=parseFloat(B[1])),B=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(z),B&&(e=parseFloat(B[1]))}var C,D={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:A,isFF:/firefox/i.test(z),isWebkit:/webkit/i.test(z),isSafari:/safari/i.test(z),browserVersion:e,jqueryVersion:parseFloat(a.fn.jquery),isSupportAmd:x,hasCodeMirror:x?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:y,isW3CRangeSupport:!!document.createRange},E=function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221};return{isEdit:function(b){return c.contains([a.BACKSPACE,a.TAB,a.ENTER,a.SPACe],b)},isMove:function(b){return c.contains([a.LEFT,a.UP,a.RIGHT,a.DOWN],b)},nameFromCode:b.invertObject(a),code:a}}(),F=String.fromCharCode(160),G="\ufeff",H=function(){var d=function(b){return b&&a(b).hasClass("note-editable")},e=function(b){return b&&a(b).hasClass("note-control-sizing")},f=function(a){return a=a.toUpperCase(),function(b){return b&&b.nodeName.toUpperCase()===a}},g=function(a){return a&&3===a.nodeType},h=function(a){return a&&1===a.nodeType},i=function(a){return a&&/^BR|^IMG|^HR|^IFRAME|^BUTTON/.test(a.nodeName.toUpperCase())},j=function(a){return d(a)?!1:a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName.toUpperCase())},k=f("LI"),l=function(a){return j(a)&&!k(a)},m=f("TABLE"),n=function(a){return!(s(a)||o(a)||p(a)||j(a)||m(a)||r(a))},o=function(a){return a&&/^UL|^OL/.test(a.nodeName.toUpperCase())},p=f("HR"),q=function(a){return a&&/^TD|^TH/.test(a.nodeName.toUpperCase())},r=f("BLOCKQUOTE"),s=function(a){return q(a)||r(a)||d(a)},t=f("A"),u=function(a){return n(a)&&!!E(a,j)},v=function(a){return n(a)&&!E(a,j)},w=f("BODY"),x=function(a,b){return a.nextSibling===b||a.previousSibling===b},y=function(a,c){c=c||b.ok;var d=[];return a.previousSibling&&c(a.previousSibling)&&d.push(a.previousSibling),d.push(a),a.nextSibling&&c(a.nextSibling)&&d.push(a.nextSibling),d},z=D.isMSIE&&D.browserVersion<11?" ":"<br>",A=function(a){return g(a)?a.nodeValue.length:a.childNodes.length},B=function(a){var b=A(a);return 0===b?!0:g(a)||1!==b||a.innerHTML!==z?c.all(a.childNodes,g)&&""===a.innerHTML?!0:!1:!0},C=function(a){i(a)||A(a)||(a.innerHTML=z)},E=function(a,b){for(;a;){if(b(a))return a;if(d(a))break;a=a.parentNode}return null},I=function(a,b){for(a=a.parentNode;a&&1===A(a);){if(b(a))return a;if(d(a))break;a=a.parentNode}return null},J=function(a,c){c=c||b.fail;var e=[];return E(a,function(a){return d(a)||e.push(a),c(a)}),e},K=function(a,b){var d=J(a);return c.last(d.filter(b))},L=function(b,c){for(var d=J(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},M=function(a,c){c=c||b.fail;for(var d=[];a&&!c(a);)d.push(a),a=a.previousSibling;return d},N=function(a,c){c=c||b.fail;for(var d=[];a&&!c(a);)d.push(a),a=a.nextSibling;return d},O=function(a,c){var d=[];return c=c||b.ok,function e(b){a!==b&&c(b)&&d.push(b);for(var f=0,g=b.childNodes.length;g>f;f++)e(b.childNodes[f])}(a),d},P=function(b,c){var d=b.parentNode,e=a("<"+c+">")[0];return d.insertBefore(e,b),e.appendChild(b),e},Q=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},R=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},S=function(a){return 0===a.offset},T=function(a){return a.offset===A(a.node)},U=function(a){return S(a)||T(a)},V=function(a,b){for(;a&&a!==b;){if(0!==Z(a))return!1;a=a.parentNode}return!0},W=function(a,b){for(;a&&a!==b;){if(Z(a)!==A(a.parentNode)-1)return!1;a=a.parentNode}return!0},X=function(a,b){return S(a)&&V(a.node,b)},Y=function(a,b){return T(a)&&W(a.node,b)},Z=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},$=function(a){return!!(a&&a.childNodes&&a.childNodes.length)},_=function(a,b){var c,e;if(0===a.offset){if(d(a.node))return null;c=a.node.parentNode,e=Z(a.node)}else $(a.node)?(c=a.node.childNodes[a.offset-1],e=A(c)):(c=a.node,e=b?0:a.offset-1);return{node:c,offset:e}},aa=function(a,b){var c,e;if(A(a.node)===a.offset){if(d(a.node))return null;c=a.node.parentNode,e=Z(a.node)+1}else $(a.node)?(c=a.node.childNodes[a.offset],e=0):(c=a.node,e=b?A(a.node):a.offset+1);return{node:c,offset:e}},ba=function(a,b){return a.node===b.node&&a.offset===b.offset},ca=function(a){if(g(a.node)||!$(a.node)||B(a.node))return!0;var b=a.node.childNodes[a.offset-1],c=a.node.childNodes[a.offset];return b&&!i(b)||c&&!i(c)?!1:!0},da=function(a,b){for(;a;){if(b(a))return a;a=_(a)}return null},ea=function(a,b){for(;a;){if(b(a))return a;a=aa(a)}return null},fa=function(a){if(!g(a.node))return!1;var b=a.node.nodeValue.charAt(a.offset-1);return b&&" "!==b&&b!==F},ga=function(a,b,c,d){for(var e=a;e&&(c(e),!ba(e,b));){var f=d&&a.node!==e.node&&b.node!==e.node;e=aa(e,f)}},ha=function(a,c){var d=J(c,b.eq(a));return d.map(Z).reverse()},ia=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes.length<=b[d]?c.childNodes[c.childNodes.length-1]:c.childNodes[b[d]];return c},ja=function(a,b){var c=b&&b.isSkipPaddingBlankHTML,d=b&&b.isNotSplitEdgePoint;if(U(a)&&(g(a.node)||d)){if(S(a))return a.node;if(T(a))return a.node.nextSibling}if(g(a.node))return a.node.splitText(a.offset);var e=a.node.childNodes[a.offset],f=Q(a.node.cloneNode(!1),a.node);return R(f,N(e)),c||(C(a.node),C(f)),f},ka=function(a,c,d){var e=J(c.node,b.eq(a));return e.length?1===e.length?ja(c,d):e.reduce(function(a,b){return a===c.node&&(a=ja(c,d)),ja({node:b,offset:a?H.position(a):A(b)},d)}):null},la=function(a,b){var d,e,f=b?j:s,g=J(a.node,f),h=c.last(g)||a.node;f(h)?(d=g[g.length-2],e=h):(d=h,e=d.parentNode);var i=d&&ka(d,a,{isSkipPaddingBlankHTML:b,isNotSplitEdgePoint:b});return i||e!==a.node||(i=a.node.childNodes[a.offset]),{rightNode:i,container:e}},ma=function(a){return document.createElement(a)},na=function(a){return document.createTextNode(a)},oa=function(a,b){if(a&&a.parentNode){if(a.removeNode)return a.removeNode(b);var c=a.parentNode;if(!b){var d,e,f=[];for(d=0,e=a.childNodes.length;e>d;d++)f.push(a.childNodes[d]);for(d=0,e=f.length;e>d;d++)c.insertBefore(f[d],a)}c.removeChild(a)}},pa=function(a,b){for(;a&&!d(a)&&b(a);){var c=a.parentNode;oa(a),a=c}},qa=function(a,b){if(a.nodeName.toUpperCase()===b.toUpperCase())return a;var d=ma(b);return a.style.cssText&&(d.style.cssText=a.style.cssText),R(d,c.from(a.childNodes)),Q(d,a),oa(a),d},ra=f("TEXTAREA"),sa=function(a,b){var c=ra(a[0])?a.val():a.html();return b?c.replace(/[\n\r]/g,""):c},ta=function(b,c){var d=sa(b);if(c){var e=/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;d=d.replace(e,function(a,b,c){c=c.toUpperCase();var d=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(c)&&!!b,e=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(c);return a+(d||e?"\n":"")}),d=a.trim(d)}return d},ua=function(b){var c=a(b),d=c.position(),e=c.outerHeight(!0);return{left:d.left,top:d.top+e}},va=function(a,b){Object.keys(b).forEach(function(c){a.on(c,b[c])})},wa=function(a,b){Object.keys(b).forEach(function(c){a.off(c,b[c])})};return{NBSP_CHAR:F,ZERO_WIDTH_NBSP_CHAR:G,blank:z,emptyPara:"<p>"+z+"</p>",makePredByNodeName:f,isEditable:d,isControlSizing:e,isText:g,isElement:h,isVoid:i,isPara:j,isPurePara:l,isInline:n,isBlock:b.not(n),isBodyInline:v,isBody:w,isParaInline:u,isList:o,isTable:m,isCell:q,isBlockquote:r,isBodyContainer:s,isAnchor:t,isDiv:f("DIV"),isLi:k,isBR:f("BR"),isSpan:f("SPAN"),isB:f("B"),isU:f("U"),isS:f("S"),isI:f("I"),isImg:f("IMG"),isTextarea:ra,isEmpty:B,isEmptyAnchor:b.and(t,B),isClosestSibling:x,withClosestSiblings:y,nodeLength:A,isLeftEdgePoint:S,isRightEdgePoint:T,isEdgePoint:U,isLeftEdgeOf:V,isRightEdgeOf:W,isLeftEdgePointOf:X,isRightEdgePointOf:Y,prevPoint:_,nextPoint:aa,isSamePoint:ba,isVisiblePoint:ca,prevPointUntil:da,nextPointUntil:ea,isCharPoint:fa,walkPoint:ga,ancestor:E,singleChildAncestor:I,listAncestor:J,lastAncestor:K,listNext:N,listPrev:M,listDescendant:O,commonAncestor:L,wrap:P,insertAfter:Q,appendChildNodes:R,position:Z,hasChildren:$,makeOffsetPath:ha,fromOffsetPath:ia,splitTree:ka,splitPoint:la,create:ma,createText:na,remove:oa,removeWhile:pa,replace:qa,html:ta,value:sa,posFromPlaceholder:ua,attachEvents:va,detachEvents:wa}}(),I=function(){var d=function(a,b){var d,e,f=a.parentElement(),g=document.body.createTextRange(),h=c.from(f.childNodes);for(d=0;d<h.length;d++)if(!H.isText(h[d])){if(g.moveToElementText(h[d]),g.compareEndPoints("StartToStart",a)>=0)break;e=h[d]}if(0!==d&&H.isText(h[d-1])){var i=document.body.createTextRange(),j=null;i.moveToElementText(e||f),i.collapse(!e),j=e?e.nextSibling:f.firstChild;var k=a.duplicate();k.setEndPoint("StartToStart",i);for(var l=k.text.replace(/[\r\n]/g,"").length;l>j.nodeValue.length&&j.nextSibling;)l-=j.nodeValue.length,j=j.nextSibling;j.nodeValue;b&&j.nextSibling&&H.isText(j.nextSibling)&&l===j.nodeValue.length&&(l-=j.nodeValue.length,j=j.nextSibling),f=j,d=l}return{cont:f,offset:d}},e=function(a){var d=function(a,e){var f,g;if(H.isText(a)){var h=H.listPrev(a,b.not(H.isText)),i=c.last(h).previousSibling;f=i||a.parentNode,e+=c.sum(c.tail(h),H.nodeLength),g=!i}else{if(f=a.childNodes[e]||a,H.isText(f))return d(f,0);e=0,g=!1}return{node:f,collapseToStart:g,offset:e}},e=document.body.createTextRange(),f=d(a.node,a.offset);return e.moveToElementText(f.node),e.collapse(f.collapseToStart),e.moveStart("character",f.offset),e},f=function(d,g,h,i){this.sc=d,this.so=g,this.ec=h,this.eo=i;var j=function(){if(D.isW3CRangeSupport){var a=document.createRange();return a.setStart(d,g),a.setEnd(h,i),a}var b=e({node:d,offset:g});return b.setEndPoint("EndToEnd",e({node:h,offset:i})),b};this.getPoints=function(){return{sc:d,so:g,ec:h,eo:i}},this.getStartPoint=function(){return{node:d,offset:g}},this.getEndPoint=function(){return{node:h,offset:i}},this.select=function(){var a=j();if(D.isW3CRangeSupport){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select();return this},this.normalize=function(){var a=function(a,b){if(H.isVisiblePoint(a)&&!H.isEdgePoint(a)||H.isVisiblePoint(a)&&H.isRightEdgePoint(a)&&!b||H.isVisiblePoint(a)&&H.isLeftEdgePoint(a)&&b||H.isVisiblePoint(a)&&H.isBlock(a.node)&&H.isEmpty(a.node))return a;var c=H.ancestor(a.node,H.isBlock);if((H.isLeftEdgePointOf(a,c)||H.isVoid(H.prevPoint(a).node))&&!b||(H.isRightEdgePointOf(a,c)||H.isVoid(H.nextPoint(a).node))&&b){if(H.isVisiblePoint(a))return a;b=!b}var d=b?H.nextPointUntil(H.nextPoint(a),H.isVisiblePoint):H.prevPointUntil(H.prevPoint(a),H.isVisiblePoint);return d||a},b=a(this.getEndPoint(),!1),c=this.isCollapsed()?b:a(this.getStartPoint(),!0);return new f(c.node,c.offset,b.node,b.offset)},this.nodes=function(a,d){a=a||b.ok;var e=d&&d.includeAncestor,f=d&&d.fullyContains,g=this.getStartPoint(),h=this.getEndPoint(),i=[],j=[];return H.walkPoint(g,h,function(b){if(!H.isEditable(b.node)){var d;f?(H.isLeftEdgePoint(b)&&j.push(b.node),H.isRightEdgePoint(b)&&c.contains(j,b.node)&&(d=b.node)):d=e?H.ancestor(b.node,a):b.node,d&&a(d)&&i.push(d)}},!0),c.unique(i)},this.commonAncestor=function(){return H.commonAncestor(d,h)},this.expand=function(a){var b=H.ancestor(d,a),c=H.ancestor(h,a);if(!b&&!c)return new f(d,g,h,i);var e=this.getPoints();return b&&(e.sc=b,e.so=0),c&&(e.ec=c,e.eo=H.nodeLength(c)),new f(e.sc,e.so,e.ec,e.eo)},this.collapse=function(a){return a?new f(d,g,d,g):new f(h,i,h,i)},this.splitText=function(){var a=d===h,b=this.getPoints();return H.isText(h)&&!H.isEdgePoint(this.getEndPoint())&&h.splitText(i),H.isText(d)&&!H.isEdgePoint(this.getStartPoint())&&(b.sc=d.splitText(g),b.so=0,a&&(b.ec=b.sc,b.eo=i-g)),new f(b.sc,b.so,b.ec,b.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var b=this.splitText(),d=b.nodes(null,{fullyContains:!0}),e=H.prevPointUntil(b.getStartPoint(),function(a){return!c.contains(d,a.node)}),g=[];return a.each(d,function(a,b){var c=b.parentNode;e.node!==c&&1===H.nodeLength(c)&&g.push(c),H.remove(b,!1)}),a.each(g,function(a,b){H.remove(b,!1)}),new f(e.node,e.offset,e.node,e.offset).normalize()};var k=function(a){return function(){var b=H.ancestor(d,a);return!!b&&b===H.ancestor(h,a)}};this.isOnEditable=k(H.isEditable),this.isOnList=k(H.isList),this.isOnAnchor=k(H.isAnchor),this.isOnCell=k(H.isCell),this.isLeftEdgeOf=function(a){if(!H.isLeftEdgePoint(this.getStartPoint()))return!1;var b=H.ancestor(this.sc,a);return b&&H.isLeftEdgeOf(this.sc,b)},this.isCollapsed=function(){return d===h&&g===i},this.wrapBodyInlineWithPara=function(){if(H.isBodyContainer(d)&&H.isEmpty(d))return d.innerHTML=H.emptyPara,new f(d.firstChild,0,d.firstChild,0);var a=this.normalize();if(H.isParaInline(d)||H.isPara(d))return a;var e;if(H.isInline(a.sc)){var g=H.listAncestor(a.sc,b.not(H.isInline));e=c.last(g),H.isInline(e)||(e=g[g.length-2]||a.sc.childNodes[a.so])}else e=a.sc.childNodes[a.so>0?a.so-1:0];var h=H.listPrev(e,H.isParaInline).reverse();if(h=h.concat(H.listNext(e.nextSibling,H.isParaInline)),h.length){var i=H.wrap(c.head(h),"p");H.appendChildNodes(i,c.tail(h))}return this.normalize()},this.insertNode=function(a){var b=this.wrapBodyInlineWithPara().deleteContents(),c=H.splitPoint(b.getStartPoint(),H.isInline(a));return c.rightNode?c.rightNode.parentNode.insertBefore(a,c.rightNode):c.container.appendChild(a),a},this.pasteHTML=function(b){var d=a("<div></div>").html(b)[0],e=c.from(d.childNodes),f=this.wrapBodyInlineWithPara().deleteContents();return e.reverse().map(function(a){return f.insertNode(a)}).reverse()},this.toString=function(){var a=j();return D.isW3CRangeSupport?a.toString():a.text},this.getWordRange=function(a){var b=this.getEndPoint();if(!H.isCharPoint(b))return this;var c=H.prevPointUntil(b,function(a){return!H.isCharPoint(a)});return a&&(b=H.nextPointUntil(b,function(a){return!H.isCharPoint(a)})),new f(c.node,c.offset,b.node,b.offset)},this.bookmark=function(a){return{s:{path:H.makeOffsetPath(a,d),offset:g},e:{path:H.makeOffsetPath(a,h),offset:i}}},this.paraBookmark=function(a){return{s:{path:c.tail(H.makeOffsetPath(c.head(a),d)),offset:g},e:{path:c.tail(H.makeOffsetPath(c.last(a),h)),offset:i}}},this.getClientRects=function(){var a=j();return a.getClientRects()}};return{create:function(a,b,c,e){if(arguments.length)2===arguments.length&&(c=a,e=b);else if(D.isW3CRangeSupport){var g=document.getSelection();if(!g||0===g.rangeCount)return null;if(H.isBody(g.anchorNode))return null;var h=g.getRangeAt(0);a=h.startContainer,b=h.startOffset,c=h.endContainer,e=h.endOffset}else{var i=document.selection.createRange(),j=i.duplicate();j.collapse(!1);var k=i;k.collapse(!0);var l=d(k,!0),m=d(j,!1);H.isText(l.node)&&H.isLeftEdgePoint(l)&&H.isTextNode(m.node)&&H.isRightEdgePoint(m)&&m.node.nextSibling===l.node&&(l=m),a=l.cont,b=l.offset,c=m.cont,e=m.offset}return new f(a,b,c,e)},createFromNode:function(a){var b=a,c=0,d=a,e=H.nodeLength(d);return H.isVoid(b)&&(c=H.listPrev(b).length-1,b=b.parentNode),H.isBR(d)?(e=H.listPrev(d).length-1,d=d.parentNode):H.isVoid(d)&&(e=H.listPrev(d).length,d=d.parentNode),this.create(b,c,d,e)},createFromNodeBefore:function(a){return this.createFromNode(a).collapse(!0)},createFromNodeAfter:function(a){return this.createFromNode(a).collapse()},createFromBookmark:function(a,b){var c=H.fromOffsetPath(a,b.s.path),d=b.s.offset,e=H.fromOffsetPath(a,b.e.path),g=b.e.offset;return new f(c,d,e,g)},createFromParaBookmark:function(a,b){var d=a.s.offset,e=a.e.offset,g=H.fromOffsetPath(c.head(b),a.s.path),h=H.fromOffsetPath(c.last(b),a.e.path);return new f(g,d,h,e)}}}(),J=function(){var b=function(b){return a.Deferred(function(c){a.extend(new FileReader,{onload:function(a){var b=a.target.result;c.resolve(b)},onerror:function(){c.reject(this)}}).readAsDataURL(b)}).promise()},c=function(b,c){return a.Deferred(function(d){var e=a("<img>");e.one("load",function(){e.off("error abort"),d.resolve(e)}).one("error abort",function(){e.off("load").detach(),d.reject(e)}).css({display:"none"}).appendTo(document.body).attr({src:b,"data-filename":c})}).promise()};return{readFileAsDataURL:b,createImage:c}}(),K=function(a){var b=[],c=-1,d=a[0],e=function(){var b=I.create(),c={s:{path:[],offset:0},e:{path:[],offset:0}};return{contents:a.html(),bookmark:b?b.bookmark(d):c}},f=function(b){null!==b.contents&&a.html(b.contents),null!==b.bookmark&&I.createFromBookmark(d,b.bookmark).select()};this.undo=function(){a.html()!==b[c].contents&&this.recordUndo(),c>0&&(c--,f(b[c]))},this.redo=function(){b.length-1>c&&(c++,f(b[c]))},this.recordUndo=function(){c++,b.length>c&&(b=b.slice(0,c)),b.push(e())}},L=function(){var d=function(b,c){if(D.jqueryVersion<1.9){var d={};return a.each(c,function(a,c){d[c]=b.css(c)}),d}return b.css.call(b,c)};this.fromNode=function(a){var b=["font-family","font-size","text-align","list-style-type","line-height"],c=d(a,b)||{};return c["font-size"]=parseInt(c["font-size"],10),c},this.stylePara=function(b,c){a.each(b.nodes(H.isPara,{includeAncestor:!0}),function(b,d){a(d).css(c)})},this.styleNodes=function(d,e){d=d.splitText();var f=e&&e.nodeName||"SPAN",g=!(!e||!e.expandClosestSibling),h=!(!e||!e.onlyPartialContains);if(d.isCollapsed())return[d.insertNode(H.create(f))];var i=H.makePredByNodeName(f),j=d.nodes(H.isText,{fullyContains:!0}).map(function(a){return H.singleChildAncestor(a,i)||H.wrap(a,f)});if(g){if(h){var k=d.nodes();i=b.and(i,function(a){return c.contains(k,a)})}return j.map(function(b){var d=H.withClosestSiblings(b,i),e=c.head(d),f=c.tail(d);return a.each(f,function(a,b){H.appendChildNodes(e,b.childNodes),H.remove(b)}),c.head(d)})}return j},this.current=function(b){var c=a(H.isElement(b.sc)?b.sc:b.sc.parentNode),d=this.fromNode(c);try{d=a.extend(d,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikeThrough")?"strikethrough":"normal"})}catch(e){}if(b.isOnList()){var f=["circle","disc","disc-leading-zero","square"],g=a.inArray(d["list-style-type"],f)>-1;d["list-style"]=g?"unordered":"ordered"}else d["list-style"]="none";var h=H.ancestor(b.sc,H.isPara);if(h&&h.style["line-height"])d["line-height"]=h.style.lineHeight;else{var i=parseInt(d["line-height"],10)/parseInt(d["font-size"],10);d["line-height"]=i.toFixed(1)}return d.anchor=b.isOnAnchor()&&H.ancestor(b.sc,H.isAnchor),d.ancestors=H.listAncestor(b.sc,H.isEditable),d.range=b,d}},M=function(){this.insertOrderedList=function(){this.toggleList("OL")},this.insertUnorderedList=function(){this.toggleList("UL")},this.indent=function(){var d=this,e=I.create().wrapBodyInlineWithPara(),f=e.nodes(H.isPara,{includeAncestor:!0}),g=c.clusterBy(f,b.peq2("parentNode"));a.each(g,function(b,e){var f=c.head(e);H.isLi(f)?d.wrapList(e,f.parentNode.nodeName):a.each(e,function(b,c){a(c).css("marginLeft",function(a,b){return(parseInt(b,10)||0)+25})})}),e.select()},this.outdent=function(){var d=this,e=I.create().wrapBodyInlineWithPara(),f=e.nodes(H.isPara,{includeAncestor:!0}),g=c.clusterBy(f,b.peq2("parentNode"));a.each(g,function(b,e){var f=c.head(e);H.isLi(f)?d.releaseList([e]):a.each(e,function(b,c){a(c).css("marginLeft",function(a,b){return b=parseInt(b,10)||0,b>25?b-25:""})})}),e.select()},this.toggleList=function(d){var e=this,f=I.create().wrapBodyInlineWithPara(),g=f.nodes(H.isPara,{includeAncestor:!0}),h=f.paraBookmark(g),i=c.clusterBy(g,b.peq2("parentNode"));if(c.find(g,H.isPurePara)){var j=[];a.each(i,function(a,b){j=j.concat(e.wrapList(b,d))}),g=j}else{var k=f.nodes(H.isList,{includeAncestor:!0}).filter(function(b){return!a.nodeName(b,d)});k.length?a.each(k,function(a,b){H.replace(b,d)}):g=this.releaseList(i,!0)}I.createFromParaBookmark(h,g).select()},this.wrapList=function(a,b){var d=c.head(a),e=c.last(a),f=H.isList(d.previousSibling)&&d.previousSibling,g=H.isList(e.nextSibling)&&e.nextSibling,h=f||H.insertAfter(H.create(b||"UL"),e);return a=a.map(function(a){return H.isPurePara(a)?H.replace(a,"LI"):a}),H.appendChildNodes(h,a),g&&(H.appendChildNodes(h,c.from(g.childNodes)),H.remove(g)),a},this.releaseList=function(b,d){var e=[];return a.each(b,function(b,f){var g=c.head(f),h=c.last(f),i=d?H.lastAncestor(g,H.isList):g.parentNode,j=i.childNodes.length>1?H.splitTree(i,{node:h.parentNode,offset:H.position(h)+1},{isSkipPaddingBlankHTML:!0}):null,k=H.splitTree(i,{node:g.parentNode,offset:H.position(g)},{isSkipPaddingBlankHTML:!0});f=d?H.listDescendant(k,H.isLi):c.from(k.childNodes).filter(H.isLi),(d||!H.isList(i.parentNode))&&(f=f.map(function(a){return H.replace(a,"P")})),a.each(c.from(f).reverse(),function(a,b){H.insertAfter(b,i)});var l=c.compact([i,k,j]);a.each(l,function(b,c){var d=[c].concat(H.listDescendant(c,H.isList));a.each(d.reverse(),function(a,b){H.nodeLength(b)||H.remove(b,!0)})}),e=e.concat(f)}),e}},N=function(){var b=new M;this.insertTab=function(a,b,c){var d=H.createText(new Array(c+1).join(H.NBSP_CHAR));b=b.deleteContents(),b.insertNode(d,!0),b=I.create(d,c),b.select()},this.insertParagraph=function(){var c=I.create();c=c.deleteContents(),c=c.wrapBodyInlineWithPara();var d,e=H.ancestor(c.sc,H.isPara);if(e){if(H.isEmpty(e)&&H.isLi(e))return void b.toggleList(e.parentNode.nodeName);d=H.splitTree(e,c.getStartPoint());var f=H.listDescendant(e,H.isEmptyAnchor);f=f.concat(H.listDescendant(d,H.isEmptyAnchor)),a.each(f,function(a,b){H.remove(b)})}else{var g=c.sc.childNodes[c.so];d=a(H.emptyPara)[0],g?c.sc.insertBefore(d,g):c.sc.appendChild(d)}I.create(d,0).normalize().select()}},O=function(){this.tab=function(a,b){var d=H.ancestor(a.commonAncestor(),H.isCell),e=H.ancestor(d,H.isTable),f=H.listDescendant(e,H.isCell),g=c[b?"prev":"next"](f,d);g&&I.create(g,0).select()},this.createTable=function(b,c,d){for(var e,f=[],g=0;b>g;g++)f.push("<td>"+H.blank+"</td>");e=f.join("");for(var h,i=[],j=0;c>j;j++)i.push("<tr>"+e+"</tr>");h=i.join("");var k=a("<table>"+h+"</table>");return d&&d.tableClassName&&k.addClass(d.tableClassName),k[0]}},P="bogus",Q=function(b){var d=this,e=b.layoutInfo.note,f=b.layoutInfo.editor,g=b.layoutInfo.editable,h=b.options,i=new L,j=new O,k=new N,l=new M,m=new K(g);this.initialize=function(){h.shortcuts&&this.bindKeyMap(),g.on("keydown",function(a){a.keyCode===E.code.ENTER&&b.triggerEvent("enter",a),b.triggerEvent("keydown",a)}).on("keyup",function(a){b.triggerEvent("keyup",a)}).on("focus",function(a){b.triggerEvent("focus",a)}).on("blur",function(a){b.triggerEvent("blur",a)}).on("mousedown",function(a){b.triggerEvent("mousedown",a)}).on("mouseup",function(a){b.triggerEvent("mouseup",a)}).on("input",function(a){b.triggerEvent("change",a)}).on("scroll",function(a){b.triggerEvent("scroll",a)}).on("paste",function(a){b.triggerEvent("paste",a)}),f.on("focusin",function(a){b.triggerEvent("focusin",a)}).on("focusout",function(a){b.triggerEvent("focusout",a)}),!h.airMode&&h.height&&g.outerHeight(h.height),
g.html(e.html()),m.recordUndo()},this.destroy=function(){g.off()},this.bindKeyMap=function(){var a=h.keyMap[D.isMac?"mac":"pc"];g.on("keydown",function(c){var e=[];c.metaKey&&e.push("CMD"),c.ctrlKey&&!c.altKey&&e.push("CTRL"),c.shiftKey&&e.push("SHIFT");var f=E.nameFromCode[c.keyCode];f&&e.push(f);var g=a[e.join("+")];g?(c.preventDefault(),b.invoke(g)):E.isEdit(c.keyCode)&&d.afterCommand()})},this.createRange=function(){return this.focus(),I.create()},this.saveRange=function(a){this.focus(),g.data("range",I.create()),a&&I.create().collapse().select()},this.restoreRange=function(){var a=g.data("range");a&&(a.select(),this.focus())},this.saveTarget=function(a){g.data("target",a)},this.clearTarget=function(){g.removeData("target")},this.restoreTarget=function(){return g.data("target")},this.currentStyle=function(){var a=I.create();return a&&(a=a.normalize()),a?i.current(a):i.fromNode(g)},this.styleFromNode=function(a){return i.fromNode(a)},this.undo=function(){b.triggerEvent("before.command",g.html()),m.undo(),b.triggerEvent("change",g.html())},this.redo=function(){b.triggerEvent("before.command",g.html()),m.redo(),b.triggerEvent("change",g.html())};for(var n=this.beforeCommand=function(){b.triggerEvent("before.command",g.html()),d.focus()},o=this.afterCommand=function(a){m.recordUndo(),a||b.triggerEvent("change",g.html())},p=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","fontName"],q=0,r=p.length;r>q;q++)this[p[q]]=function(a){return function(b){n(),document.execCommand(a,!1,b),o(!0)}}(p[q]);this.tab=function(){var a=this.createRange();a.isCollapsed()&&a.isOnCell()?j.tab(a):(n(),k.insertTab(g,a,h.tabSize),o())},this.untab=function(){var a=this.createRange();a.isCollapsed()&&a.isOnCell()&&j.tab(a,!0)},this.wrapCommand=function(a){return function(){n(),a.apply(d,arguments),o()}},this.insertParagraph=this.wrapCommand(function(){k.insertParagraph(g)}),this.insertOrderedList=this.wrapCommand(function(){l.insertOrderedList(g)}),this.insertUnorderedList=this.wrapCommand(function(){l.insertUnorderedList(g)}),this.indent=this.wrapCommand(function(){l.indent(g)}),this.outdent=this.wrapCommand(function(){l.outdent(g)}),this.insertImage=function(a,c){J.createImage(a,c).then(function(a){n(),a.css({display:"",width:Math.min(g.width(),a.width())}),I.create().insertNode(a[0]),I.createFromNodeAfter(a[0]).select(),o()}).fail(function(){b.triggerEvent("image.upload.error")})},this.insertNode=this.wrapCommand(function(a){I.create().insertNode(a),I.createFromNodeAfter(a).select()}),this.insertText=this.wrapCommand(function(a){var b=I.create().insertNode(H.createText(a));I.create(b,H.nodeLength(b)).select()}),this.pasteHTML=this.wrapCommand(function(a){var b=I.create().pasteHTML(a);I.createFromNodeAfter(c.last(b)).select()}),this.formatBlock=this.wrapCommand(function(a){a=D.isMSIE?"<"+a+">":a,document.execCommand("FormatBlock",!1,a)}),this.formatPara=function(){this.formatBlock("P")};for(var q=1;6>=q;q++)this["formatH"+q]=function(a){return function(){this.formatBlock("H"+a)}}(q);this.fontSize=function(b){var d=I.create();if(d.isCollapsed()){var e=i.styleNodes(d),f=c.head(e);a(e).css({"font-size":b+"px"}),f&&!H.nodeLength(f)&&(f.innerHTML=H.ZERO_WIDTH_NBSP_CHAR,I.createFromNodeAfter(f.firstChild).select(),g.data(P,f))}else n(),a(i.styleNodes(d)).css({"font-size":b+"px"}),o()},this.insertHorizontalRule=this.wrapCommand(function(){var b=I.create(),c=b.insertNode(a("<HR/>")[0]);c.nextSibling&&I.create(c.nextSibling,0).normalize().select()}),this.removeBogus=function(){var a=g.data(P);if(a){var b=c.find(c.from(a.childNodes),H.isText),d=b.nodeValue.indexOf(H.ZERO_WIDTH_NBSP_CHAR);-1!==d&&b.deleteData(d,1),H.isEmpty(a)&&H.remove(a),g.removeData(P)}},this.lineHeight=this.wrapCommand(function(a){i.stylePara(I.create(),{lineHeight:a})}),this.unlink=function(){var a=this.createRange();if(a.isOnAnchor()){var b=H.ancestor(a.sc,H.isAnchor);a=I.createFromNode(b),a.select(),n(),document.execCommand("unlink"),o()}},this.createLink=this.wrapCommand(function(b){var d=b.url,e=b.text,f=b.isNewWindow,g=b.range||this.createRange(),j=g.toString()!==e;h.onCreateLink&&(d=h.onCreateLink(d));var k=[];if(j){var l=g.insertNode(a("<A>"+e+"</A>")[0]);k.push(l)}else k=i.styleNodes(g,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});a.each(k,function(b,c){a(c).attr("href",d),f?a(c).attr("target","_blank"):a(c).removeAttr("target")});var m=I.createFromNodeBefore(c.head(k)),n=m.getStartPoint(),o=I.createFromNodeAfter(c.last(k)),p=o.getEndPoint();I.create(n.node,n.offset,p.node,p.offset).select()}),this.getLinkInfo=function(){this.focus();var b=I.create().expand(H.isAnchor),d=a(c.head(b.nodes(H.isAnchor)));return{range:b,text:b.toString(),isNewWindow:d.length?"_blank"===d.attr("target"):!1,url:d.length?d.attr("href"):""}},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.insertTable=this.wrapCommand(function(a){var b=a.split("x"),c=I.create().deleteContents();c.insertNode(j.createTable(b[0],b[1],h))}),this.floatMe=this.wrapCommand(function(b){var c=a(this.restoreTarget());c.css("float",b)}),this.resize=this.wrapCommand(function(b){var c=a(this.restoreTarget());c.css({width:100*b+"%",height:""})}),this.resizeTo=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)},this.removeMedia=this.wrapCommand(function(){var c=a(this.restoreTarget()).detach();b.triggerEvent("media.delete",c,g)}),this.focus=function(){if(g.focus(),D.isFF){var a=I.create();if(!a||a.isOnEditable())return;I.createFromNode(g[0]).normalize().collapse().select()}},this.isEmpty=function(){return H.isEmpty(g[0])||H.emptyPara===g.html()}},R=function(b){var d,e=this,f=b.layoutInfo.editable;this.initialize=function(){D.isMSIE&&D.browserVersion>10||D.isFF?(d=a("<div />").attr("contenteditable",!0).css({position:"absolute",left:-1e5,opacity:0}),f.on("keydown",function(a){a.ctrlKey&&a.keyCode===E.code.V&&(b.invoke("editor.saveRange"),d.focus(),setTimeout(function(){e.pasteByHook()},0))}),f.before(d)):f.on("paste",this.pasteByEvent)},this.pasteByHook=function(){var c=d[0].firstChild;if(H.isImg(c)){for(var e=c.src,f=atob(e.split(",")[1]),g=new Uint8Array(f.length),h=0;h<f.length;h++)g[h]=f.charCodeAt(h);var i=new Blob([g],{type:"image/png"});i.name="clipboard.png",b.invoke("editor.restoreRange"),b.invoke("editor.focus"),b.invoke("imageDialog.insertImages",[i])}else{var j=a("<div />").html(d.html()).html();b.invoke("editor.restoreRange"),b.invoke("editor.focus"),j&&b.invoke("editor.pasteHTML",j)}d.empty()},this.pasteByEvent=function(a){var d=a.originalEvent.clipboardData;if(d&&d.items&&d.items.length){var e=c.head(d.items);"file"===e.kind&&-1!==e.type.indexOf("image/")&&b.invoke("imageDialog.insertImages",[e.getAsFile()]),b.invoke("editor.afterCommand")}}},S=function(b){var c=a(document),d=b.layoutInfo.editor,e=b.layoutInfo.editable,f=b.options,g=f.langInfo,h=a(['<div class="note-dropzone">',' <div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(d);this.initialize=function(){f.disableDragAndDrop?c.on("drop",function(a){a.preventDefault()}):this.attachDragAndDropEvent()},this.attachDragAndDropEvent=function(){var f=a(),i=h.find(".note-dropzone-message");c.on("dragenter",function(a){var c=b.invoke("codeview.isActivated"),e=d.width()>0&&d.height()>0;c||f.length||!e||(d.addClass("dragover"),h.width(d.width()),h.height(d.height()),i.text(g.image.dragImageHere)),f=f.add(a.target)}).on("dragleave",function(a){f=f.not(a.target),f.length||d.removeClass("dragover")}).on("drop",function(){f=a(),d.removeClass("dragover")}),h.on("dragenter",function(){h.addClass("hover"),i.text(g.image.dropImage)}).on("dragleave",function(){h.removeClass("hover"),i.text(g.image.dragImageHere)}),h.on("drop",function(c){var d=c.originalEvent.dataTransfer;d&&d.files&&d.files.length?(c.preventDefault(),e.focus(),b.invoke("imageDialog.insertImages",d.files)):a.each(d.types,function(c,e){var f=d.getData(e);e.toLowerCase().indexOf("text")>-1?b.invoke("editor.pasteHTML",f):a(f).each(function(){b.invoke("editor.insertNode",this)})})}).on("dragover",!1)}};D.hasCodeMirror&&(D.isSupportAmd?require(["CodeMirror"],function(a){C=a}):C=window.CodeMirror);var T=function(a){var b=a.layoutInfo.editor,c=a.layoutInfo.editable,d=a.layoutInfo.codable,e=a.options;this.sync=function(){var a=this.isActivated();a&&D.hasCodeMirror&&d.data("cmEditor").save()},this.isActivated=function(){return b.hasClass("codeview")},this.toggle=function(){this.isActivated()?this.deactivate():this.activate()},this.activate=function(){if(d.val(H.html(c,e.prettifyHtml)),d.height(c.height()),a.invoke("toolbar.updateCodeview",!0),b.addClass("codeview"),d.focus(),D.hasCodeMirror){var f=C.fromTextArea(d[0],e.codemirror);if(e.codemirror.tern){var g=new C.TernServer(e.codemirror.tern);f.ternServer=g,f.on("cursorActivity",function(a){g.updateArgHints(a)})}f.setSize(null,c.outerHeight()),d.data("cmEditor",f)}},this.deactivate=function(){if(D.hasCodeMirror){var f=d.data("cmEditor");d.val(f.getValue()),f.toTextArea()}var g=H.value(d,e.prettifyHtml)||H.emptyPara,h=c.html()!==g;c.html(g),c.height(e.height?d.height():"auto"),b.removeClass("codeview"),h&&a.triggerEvent("change",c.html(),c),c.focus(),a.invoke("toolbar.updateCodeview",!1)}},U=24,V=function(b){var c=a(document),d=b.layoutInfo.statusbar,e=b.layoutInfo.editable,f=b.options;this.initialize=function(){f.airMode||f.disableResizeEditor||d.on("mousedown",function(a){a.preventDefault(),a.stopPropagation();var b=e.offset().top-c.scrollTop();c.on("mousemove",function(a){var c=a.clientY-(b+U);c=f.minheight>0?Math.max(c,f.minheight):c,c=f.maxHeight>0?Math.min(c,f.maxHeight):c,e.height(c)}).one("mouseup",function(){c.off("mousemove")})})},this.destroy=function(){d.off()}},W=function(b){var c=b.layoutInfo.editor,d=b.layoutInfo.toolbar,e=b.layoutInfo.editable,f=b.layoutInfo.codable,g=a(window),h=a("html, body");this.toggle=function(){var a=function(a){e.css("height",a.h),f.css("height",a.h),f.data("cmeditor")&&f.data("cmeditor").setsize(null,a.h)};c.toggleClass("fullscreen");var i=c.hasClass("fullscreen");i?(e.data("orgHeight",e.css("height")),g.on("resize",function(){a({h:g.height()-d.outerHeight()})}).trigger("resize"),h.css("overflow","hidden")):(g.off("resize"),a({h:e.data("orgHeight")}),h.css("overflow","visible")),b.invoke("toolbar.updateFullscreen",i)}},X=function(b){var c=this,d=a(document),e=b.layoutInfo.note,f=b.layoutInfo.editingArea,g=b.options;this.events={"summernote.mousedown":function(a,b){c.update(b.target)},"summernote.keyup summernote.scroll summernote.change":function(){c.hide()}},this.initialize=function(){this.$handle=a(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',g.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',g.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(f),H.attachEvents(e,this.events),this.$handle.on("mousedown",function(a){if(H.isControlSizing(a.target)){a.preventDefault(),a.stopPropagation();var e=c.$handle.find(".note-control-selection").data("target"),f=e.offset(),g=d.scrollTop();d.on("mousemove",function(a){b.invoke("editor.resizeTo",{x:a.clientX-f.left,y:a.clientY-(f.top-g)},e,!a.shiftKey),c.update(e[0])}).one("mouseup",function(a){a.preventDefault(),d.off("mousemove"),b.invoke("editor.afterCommand")}),e.data("ratio")||e.data("ratio",e.height()/e.width())}})},this.destroy=function(){this.$handle.remove(),H.detachEvents(e,this.events)},this.update=function(c){b.invoke("imagePopover.update",c);var d=this.$handle.find(".note-control-selection");if(H.isImg(c)){var e=a(c),f=e.position(),g={w:e.outerWidth(!0),h:e.outerHeight(!0)};d.css({display:"block",left:f.left,top:f.top,width:g.w,height:g.h}).data("target",e);var h=g.w+"x"+g.h;d.find(".note-control-selection-info").text(h),b.invoke("editor.saveTarget",c)}else this.hide()},this.hide=function(){b.invoke("editor.clearTarget"),this.$handle.children().hide()}},Y=function(d){var e=this,f=a.summernote.ui,g=d.layoutInfo.toolbar,h=d.options,i=h.langInfo,j=b.invertObject(h.keyMap[D.isMac?"mac":"pc"]),k=this.representShortcut=function(a){var b=j[a];return D.isMac&&(b=b.replace("CMD","⌘").replace("SHIFT","⇧")),b=b.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]")," ("+b+")"};this.initialize=function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons()},this.addToolbarButtons=function(){d.addButton("style",function(){return f.buttonGroup([f.button({className:"dropdown-toggle",contents:'<i class="fa fa-magic"/> <span class="caret"/>',tooltip:i.style.style,data:{toggle:"dropdown"}}),f.dropdown({className:"dropdown-style",items:d.options.styleTags,click:d.createInvokeHandler("editor.formatBlock")})]).render()}),d.addButton("bold",function(){return f.button({className:"note-btn-bold",contents:'<i class="fa fa-bold"/>',tooltip:i.font.bold+k("bold"),click:d.createInvokeHandler("editor.bold")}).render()}),d.addButton("italic",function(){return f.button({className:"note-btn-italic",contents:'<i class="fa fa-italic"/>',tooltip:i.font.italic+k("italic"),click:d.createInvokeHandler("editor.italic")}).render()}),d.addButton("underline",function(){return f.button({className:"note-btn-underline",contents:'<i class="fa fa-underline"/>',tooltip:i.font.underline+k("underline"),click:d.createInvokeHandler("editor.underline")}).render()}),d.addButton("clear",function(){return f.button({contents:'<i class="fa fa-eraser"/>',tooltip:i.font.clear+k("removeFormat"),click:d.createInvokeHandler("editor.removeFormat")}).render()}),d.addButton("fontname",function(){return f.buttonGroup([f.button({className:"dropdown-toggle",contents:'<span class="note-current-fontname"/> <span class="caret"/>',tooltip:i.font.name,data:{toggle:"dropdown"}}),f.dropdownCheck({className:"dropdown-fontname",items:h.fontNames.filter(function(a){return D.isFontInstalled(a)||c.contains(h.fontNamesIgnoreCheck,a)}),click:d.createInvokeHandler("editor.fontName")})]).render()}),d.addButton("fontsize",function(){return f.buttonGroup([f.button({className:"dropdown-toggle",contents:'<span class="note-current-fontsize"/> <span class="caret"/>',tooltip:i.font.size,data:{toggle:"dropdown"}}),f.dropdownCheck({className:"dropdown-fontsize",items:h.fontSizes,click:d.createInvokeHandler("editor.fontSize")})]).render()}),d.addButton("color",function(){return f.buttonGroup({className:"note-color",children:[f.button({className:"note-current-color-button",contents:'<i class="fa fa-font note-recent-color"/>',tooltip:i.color.recent,click:d.createInvokeHandler("editor.color"),callback:function(a){var b=a.find(".note-recent-color");b.css({"background-color":"yellow"}),a.data("value",{backColor:"yellow"})}}),f.button({className:"dropdown-toggle",contents:'<span class="caret"/>',tooltip:i.color.more,data:{toggle:"dropdown"}}),f.dropdown({items:["<li>",'<div class="btn-group">',' <div class="note-palette-title">'+i.color.background+"</div>",' <div class="note-color-reset" data-event="backColor" data-value="inherit">'+i.color.transparent+"</div>",' <div class="note-holder" data-event="backColor"/>',"</div>",'<div class="btn-group">',' <div class="note-palette-title">'+i.color.foreground+"</div>",' <div class="note-color-reset" data-event="foreColor" data-value="inherit">'+i.color.resetToDefault+"</div>",' <div class="note-holder" data-event="foreColor"/>',"</div>","</li>"].join(""),callback:function(b){b.find(".note-holder").each(function(){var b=a(this);b.append(f.palette({colors:h.colors,eventName:b.data("event")}).render())})},click:function(b){var c=a(b.target),e=c.data("event"),f=c.data("value");if(e&&f){var g="backColor"===e?"background-color":"color",h=c.closest(".note-color").find(".note-recent-color"),i=c.closest(".note-color").find(".note-current-color-button"),j=i.data("value");j[e]=f,h.css(g,f),i.data("value",j),d.invoke("editor."+e,f)}}})]}).render()}),d.addButton("ol",function(){return f.button({contents:'<i class="fa fa-list-ul"/>',tooltip:i.lists.unordered+k("insertUnorderedList"),click:d.createInvokeHandler("editor.insertUnorderedList")}).render()}),d.addButton("ul",function(){return f.button({contents:'<i class="fa fa-list-ol"/>',tooltip:i.lists.ordered+k("insertOrderedList"),click:d.createInvokeHandler("editor.insertOrderedList")}).render()}),d.addButton("paragraph",function(){return f.buttonGroup([f.button({className:"dropdown-toggle",contents:'<i class="fa fa-align-left"/> <span class="caret"/>',tooltip:i.paragraph.paragraph,data:{toggle:"dropdown"}}),f.dropdown([f.buttonGroup({className:"note-align",children:[f.button({contents:'<i class="fa fa-align-left"/>',tooltip:i.paragraph.left+k("justifyLeft"),click:d.createInvokeHandler("editor.justifyLeft")}),f.button({contents:'<i class="fa fa-align-center"/>',tooltip:i.paragraph.center+k("justifyCenter"),click:d.createInvokeHandler("editor.justifyCenter")}),f.button({contents:'<i class="fa fa-align-right"/>',tooltip:i.paragraph.right+k("justifyRight"),click:d.createInvokeHandler("editor.justifyRight")}),f.button({contents:'<i class="fa fa-align-justify"/>',tooltip:i.paragraph.justify+k("justifyFull"),click:d.createInvokeHandler("editor.justifyFull")})]}),f.buttonGroup({className:"note-list",children:[f.button({contents:'<i class="fa fa-outdent"/>',tooltip:i.paragraph.outdent+k("outdent"),click:d.createInvokeHandler("editor.outdent")}),f.button({contents:'<i class="fa fa-indent"/>',tooltip:i.paragraph.indent+k("indent"),click:d.createInvokeHandler("editor.indent")})]})])]).render()}),d.addButton("height",function(){return f.buttonGroup([f.button({className:"dropdown-toggle",contents:'<i class="fa fa-text-height"/> <span class="caret"/>',tooltip:i.font.height,data:{toggle:"dropdown"}}),f.dropdownCheck({items:h.lineHeights,className:"dropdown-line-height",click:d.createInvokeHandler("editor.lineHeight")})]).render()}),d.addButton("table",function(){return f.buttonGroup([f.button({className:"dropdown-toggle",contents:'<i class="fa fa-table"/> <span class="caret"/>',tooltip:i.table.table,data:{toggle:"dropdown"}}),f.dropdown({className:"note-table",items:['<div class="note-dimension-picker">',' <div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>',' <div class="note-dimension-picker-highlighted"/>',' <div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(a){var b=a.find(".note-dimension-picker-mousecatcher");b.css({width:h.insertTableMaxSize.col+"em",height:h.insertTableMaxSize.row+"em"}).click(d.createInvokeHandler("editor.insertTable")).on("mousemove",e.tableMoveHandler)}}).render()}),d.addButton("link",function(){return f.button({contents:'<i class="fa fa-link"/>',tooltip:i.link.link,click:d.createInvokeHandler("linkDialog.show")}).render()}),d.addButton("picture",function(){return f.button({contents:'<i class="fa fa-picture-o"/>',tooltip:i.image.image,click:d.createInvokeHandler("imageDialog.show")}).render()}),d.addButton("video",function(){return f.button({contents:'<i class="fa fa-youtube-play"/>',tooltip:i.video.video,click:d.createInvokeHandler("videoDialog.show")}).render()}),d.addButton("hr",function(){return f.button({contents:'<i class="fa fa-minus"/>',tooltip:i.hr.insert+k("insertHorizontalRule"),click:d.createInvokeHandler("editor.insertHorizontalRule")}).render()}),d.addButton("fullscreen",function(){return f.button({className:"btn-fullscreen",contents:'<i class="fa fa-arrows-alt"/>',tooltip:i.options.fullscreen,click:d.createInvokeHandler("fullscreen.toggle")}).render()}),d.addButton("codeview",function(){return f.button({className:"btn-codeview",contents:'<i class="fa fa-code"/>',tooltip:i.options.codeview,click:d.createInvokeHandler("codeview.toggle")}).render()}),d.addButton("help",function(){return f.button({contents:'<i class="fa fa-question"/>',tooltip:i.options.help,click:d.createInvokeHandler("helpDialog.show")}).render()}),d.addButton("specialchar",function(){return f.button({contents:'<i class="fa fa-font fa-flip-vertical"/>',tooltip:i.specialChar.specialChar,click:d.createInvokeHandler("specialCharDialog.show")}).render()})},this.addImagePopoverButtons=function(){d.addButton("imageSize100",function(a){return f.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:i.image.resizeFull,click:a.createInvokeHandler("editor.resize","1")}).render()}),d.addButton("imageSize50",function(a){return f.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:i.image.resizeHalf,click:a.createInvokeHandler("editor.resize","0.5")}).render()}),d.addButton("imageSize25",function(a){return f.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:i.image.resizeQuarter,click:a.createInvokeHandler("editor.resize","0.25")}).render()}),d.addButton("floatLeft",function(a){return f.button({contents:'<i class="fa fa-align-left"/>',tooltip:i.image.floatLeft,click:a.createInvokeHandler("editor.floatMe","left")}).render()}),d.addButton("floatRight",function(a){return f.button({contents:'<i class="fa fa-align-right"/>',tooltip:i.image.floatRight,click:a.createInvokeHandler("editor.floatMe","right")}).render()}),d.addButton("floatNone",function(a){return f.button({contents:'<i class="fa fa-align-justify"/>',tooltip:i.image.floatNone,click:a.createInvokeHandler("editor.floatMe","none")}).render()}),d.addButton("removeMedia",function(a){return f.button({contents:'<i class="fa fa-trash-o"/>',tooltip:i.image.remove,click:a.createInvokeHandler("editor.removeMedia")}).render()})},this.addLinkPopoverButtons=function(){d.addButton("linkDialogShow",function(a){return f.button({contents:'<i class="fa fa-link"/>',tooltip:i.link.edit,click:a.createInvokeHandler("linkDialog.show")}).render()}),d.addButton("unlink",function(a){return f.button({contents:'<i class="fa fa-unlink"/>',tooltip:i.link.unlink,click:a.createInvokeHandler("editor.unlink")}).render()})},this.updateCurrentStyle=function(){var b=d.invoke("editor.currentStyle");if(this.updateBtnStates({".note-btn-bold":function(){return"bold"===b["font-bold"]},".note-btn-italic":function(){return"italic"===b["font-italic"]},".note-btn-underline":function(){return"underline"===b["font-underline"]}}),b["font-family"]){var e=b["font-family"].split(",").map(function(a){return a.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")}),f=c.find(e,function(a){return D.isFontInstalled(a)||c.contains(h.fontNamesIgnoreCheck,a)});g.find(".dropdown-fontname li a").each(function(){var b=a(this).data("value")+""==f+"";this.className=b?"checked":""}),g.find(".note-current-fontname").text(f)}if(b["font-size"]){var i=b["font-size"];g.find(".dropdown-fontsize li a").each(function(){var b=a(this).data("value")+""==i+"";this.className=b?"checked":""}),g.find(".note-current-fontsize").text(i)}if(b["line-height"]){var j=b["line-height"];g.find(".dropdown-line-height li a").each(function(){var b=a(this).data("value")+""==j+"";this.className=b?"checked":""})}},this.updateBtnStates=function(b){a.each(b,function(a,b){f.toggleBtnActive(g.find(a),b())})},this.tableMoveHandler=function(b){var c,d=18,e=a(b.target.parentNode),f=e.next(),g=e.find(".note-dimension-picker-mousecatcher"),i=e.find(".note-dimension-picker-highlighted"),j=e.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var k=a(b.target).offset();c={x:b.pageX-k.left,y:b.pageY-k.top}}else c={x:b.offsetX,y:b.offsetY};var l={c:Math.ceil(c.x/d)||1,r:Math.ceil(c.y/d)||1};i.css({width:l.c+"em",height:l.r+"em"}),g.data("value",l.c+"x"+l.r),3<l.c&&l.c<h.insertTableMaxSize.col&&j.css({width:l.c+1+"em"}),3<l.r&&l.r<h.insertTableMaxSize.row&&j.css({height:l.r+1+"em"}),f.html(l.c+" x "+l.r)}},Z=function(b){var c=a.summernote.ui,d=b.layoutInfo.note,e=b.layoutInfo.toolbar,f=b.options;this.initialize=function(){f.airMode||(f.toolbar=f.toolbar||[],f.toolbar.length?b.buildButtons(e,f.toolbar):e.hide(),d.on("summernote.keyup summernote.mouseup summernote.change",function(){b.invoke("button.updateCurrentStyle")}),b.invoke("button.updateCurrentStyle"))},this.destroy=function(){e.children().remove()},this.updateFullscreen=function(a){c.toggleBtnActive(e.find(".btn-fullscreen"),a)},this.updateCodeview=function(a){c.toggleBtnActive(e.find(".btn-codeview"),a),a?this.deactivate():this.activate()},this.activate=function(){var a=e.find("button").not(".btn-codeview");c.toggleBtn(a,!0)},this.deactivate=function(){var a=e.find("button").not(".btn-codeview");c.toggleBtn(a,!1)}},$=function(b){var c=this,d=a.summernote.ui,e=b.layoutInfo.editor,f=b.options,g=f.langInfo;this.initialize=function(){var b=f.dialogsInBody?a(document.body):e,c='<div class="form-group"><label>'+g.link.textToDisplay+'</label><input class="note-link-text form-control" type="text" /></div><div class="form-group"><label>'+g.link.url+'</label><input class="note-link-url form-control" type="text" value="http://" /></div>'+(f.disableLinkTarget?"":'<div class="checkbox"><label><input type="checkbox" checked> '+g.link.openInNewWindow+"</label></div>"),h='<button href="#" class="btn btn-primary note-link-btn disabled" disabled>'+g.link.insert+"</button>";this.$dialog=d.dialog({className:"link-dialog",title:g.link.insert,body:c,footer:h}).render().appendTo(b)},this.bindEnterKey=function(a,b){a.on("keypress",function(a){a.keyCode===E.code.ENTER&&b.trigger("click")})},this.showLinkDialog=function(b){return a.Deferred(function(a){var e=c.$dialog.find(".note-link-text"),f=c.$dialog.find(".note-link-url"),g=c.$dialog.find(".note-link-btn"),h=c.$dialog.find("input[type=checkbox]");d.onDialogShown(c.$dialog,function(){e.val(b.text),e.on("input",function(){d.toggleBtn(g,e.val()&&f.val()),b.text=e.val()}),b.url||(b.url=b.text||"http://",d.toggleBtn(g,b.text)),f.on("input",function(){d.toggleBtn(g,e.val()&&f.val()),b.text||e.val(f.val())}).val(b.url).trigger("focus"),c.bindEnterKey(f,g),c.bindEnterKey(e,g),h.prop("checked",b.isNewWindow),g.one("click",function(d){d.preventDefault(),a.resolve({range:b.range,url:f.val(),text:e.val(),isNewWindow:h.is(":checked")}),c.$dialog.modal("hide")})}),d.onDialogHidden(c.$dialog,function(){e.off("input keypress"),f.off("input keypress"),g.off("click"),"pending"===a.state()&&a.reject()}),d.showDialog(c.$dialog)}).promise()},this.show=function(){var a=b.invoke("editor.getLinkInfo");b.invoke("editor.saveRange"),this.showLinkDialog(a).then(function(a){b.invoke("editor.restoreRange"),b.invoke("editor.createLink",a)}).fail(function(){b.invoke("editor.restoreRange")})}},_=function(b){var c=this,d=a.summernote.ui,e=b.layoutInfo.note,f=b.layoutInfo.editingArea,g=b.options;this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){c.update()}},this.initialize=function(){this.$popover=d.popover({className:"note-link-popover",callback:function(a){var b=a.find(".popover-content");b.prepend('<span><a target="_blank"></a> </span>')}}).render().appendTo(f),b.buildButtons(this.$popover.find(".popover-content"),g.popover.link),H.attachEvents(e,this.events)},this.destroy=function(){this.$popover.remove(),H.detachEvents(e,this.events)},this.update=function(){var c=b.invoke("editor.createRange");if(c.isCollapsed()&&c.isOnAnchor()){var d=H.ancestor(c.sc,H.isAnchor),e=a(d).attr("href");this.$popover.find("a").attr("href",e).html(e);var f=H.posFromPlaceholder(d);this.$popover.css({display:"block",left:f.left,top:f.top})}else this.hide()},this.hide=function(){this.$popover.hide()}},aa=function(b){var c=this,d=a.summernote.ui,e=b.layoutInfo.editor,f=b.options,g=f.langInfo;this.initialize=function(){var b=f.dialogsInBody?a(document.body):e,c="";if(f.maximumImageFileSize){var h=Math.floor(Math.log(f.maximumImageFileSize)/Math.log(1024)),i=1*(f.maximumImageFileSize/Math.pow(1024,h)).toFixed(2)+" "+" KMGTP"[h]+"B";c="<small>"+g.image.maximumFileSize+" : "+i+"</small>"}var j='<div class="form-group note-group-select-from-files"><label>'+g.image.selectFromFiles+'</label><input class="note-image-input form-control" type="file" name="files" accept="image/*" multiple="multiple" />'+c+'</div><div class="form-group" style="overflow:auto;"><label>'+g.image.url+'</label><input class="note-image-url form-control col-md-12" type="text" /></div>',k='<button href="#" class="btn btn-primary note-image-btn disabled" disabled>'+g.image.insert+"</button>";this.$dialog=d.dialog({title:g.image.insert,body:j,footer:k}).render().appendTo(b)},this.bindEnterKey=function(a,b){a.on("keypress",function(a){a.keyCode===E.code.ENTER&&b.trigger("click")})},this.insertImages=function(c){var d=f.callbacks;d.onImageUpload?b.triggerEvent("image.upload",c):a.each(c,function(a,c){var d=c.name;f.maximumImageFileSize&&f.maximumImageFileSize<c.size?b.triggerEvent("image.upload.error",g.image.maximumFileSizeError):J.readFileAsDataURL(c).then(function(a){b.invoke("editor.insertImage",a,d)}).fail(function(){b.triggerEvent("image.upload.error")})})},this.show=function(){b.invoke("editor.saveRange"),this.showImageDialog().then(function(a){b.invoke("editor.restoreRange"),"string"==typeof a?b.invoke("editor.insertImage",a):c.insertImages(a)}).fail(function(){b.invoke("editor.restoreRange")})},this.showImageDialog=function(){return a.Deferred(function(a){var b=c.$dialog.find(".note-image-input"),e=c.$dialog.find(".note-image-url"),f=c.$dialog.find(".note-image-btn");d.onDialogShown(c.$dialog,function(){b.replaceWith(b.clone().on("change",function(){a.resolve(this.files||this.value),d.hideDialog(c.$dialog)}).val("")),f.click(function(b){b.preventDefault(),a.resolve(e.val()),d.hideDialog(c.$dialog)}),e.on("keyup paste",function(a){var b;b="paste"===a.type?a.originalEvent.clipboardData.getData("text"):e.val(),d.toggleBtn(f,b)}).val("").trigger("focus"),c.bindEnterKey(e,f)}),d.onDialogHidden(c.$dialog,function(){b.off("change"),e.off("keyup paste keypress"),f.off("click"),"pending"===a.state()&&a.reject()}),d.showDialog(c.$dialog)})}},ba=function(b){var c=this,d=a.summernote.ui,e=b.layoutInfo.editor,f=b.options,g=f.langInfo;this.getTextOnRange=function(){var a=b.invoke("editor.createRange");if(a.isOnAnchor()){var c=H.ancestor(a.sc,H.isAnchor);a=I.createFromNode(c)}return a.toString()},this.initialize=function(){var b=f.dialogsInBody?a(document.body):e,c='<div class="form-group row-fluid"><label>'+g.video.url+' <small class="text-muted">'+g.video.providers+'</small></label><input class="note-video-url form-control span12" type="text" /></div>',h='<button href="#" class="btn btn-primary note-video-btn disabled" disabled>'+g.video.insert+"</button>";this.$dialog=d.dialog({title:g.video.insert,body:c,footer:h}).render().appendTo(b)},this.bindEnterKey=function(a,b){a.on("keypress",function(a){a.keyCode===E.code.ENTER&&b.trigger("click")})},this.createVideoNode=function(b){var c,d=/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,e=b.match(d),f=/\/\/instagram.com\/p\/(.[a-zA-Z0-9_-]*)/,g=b.match(f),h=/\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/,i=b.match(h),j=/\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/,k=b.match(j),l=/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,m=b.match(l),n=/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/,o=b.match(n),p=/^.+.(mp4|m4v)$/,q=b.match(p),r=/^.+.(ogg|ogv)$/,s=b.match(r),t=/^.+.(webm)$/,u=b.match(t);if(e&&11===e[1].length){var v=e[1];c=a("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+v).attr("width","640").attr("height","360")}else if(g&&g[0].length)c=a("<iframe>").attr("frameborder",0).attr("src",g[0]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(i&&i[0].length)c=a("<iframe>").attr("frameborder",0).attr("src",i[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(k&&k[3].length)c=a("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+k[3]).attr("width","640").attr("height","360");else if(m&&m[2].length)c=a("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+m[2]).attr("width","640").attr("height","360");else if(o&&o[1].length)c=a("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+o[1]);else{
if(!(q||s||u))return!1;c=a("<video controls>").attr("src",b).attr("width","640").attr("height","360")}return c.addClass("note-video-clip"),c[0]},this.show=function(){var a=this.getTextOnRange();b.invoke("editor.saveRange"),this.showVideoDialog(a).then(function(a){b.invoke("editor.restoreRange");var d=c.createVideoNode(a);d&&b.invoke("editor.insertNode",d)}).fail(function(){b.invoke("editor.restoreRange")})},this.showVideoDialog=function(b){return a.Deferred(function(a){var e=c.$dialog.find(".note-video-url"),f=c.$dialog.find(".note-video-btn");d.onDialogShown(c.$dialog,function(){e.val(b).on("input",function(){d.toggleBtn(f,e.val())}).trigger("focus"),f.click(function(b){b.preventDefault(),a.resolve(e.val()),d.hideDialog(c.$dialog)}),c.bindEnterKey(e,f)}),d.onDialogHidden(c.$dialog,function(){e.off("input"),f.off("click"),"pending"===a.state()&&a.reject()}),d.showDialog(c.$dialog)})}},ca=function(b){var c=this,d=a.summernote.ui,e=b.layoutInfo.note,f=b.layoutInfo.editingArea,g=b.options;this.events={"summernote.keyup summernote.mouseup summernote.change":function(){c.update()},"summernote.scroll":function(){c.update()}},this.initialize=function(){this.$popover=d.popover({className:"note-image-popover"}).render().appendTo(f),b.buildButtons(this.$popover.find(".popover-content"),g.popover.image),H.attachEvents(e,this.events)},this.destroy=function(){this.$popover.remove(),H.detachEvents(e,this.events)},this.update=function(a){if(H.isImg(a)){var b=H.posFromPlaceholder(a);this.$popover.css({display:"block",left:b.left,top:b.top})}else this.hide()},this.hide=function(){this.$popover.hide()}},da=function(b){var c=this,d=a.summernote.ui,e=b.layoutInfo.editor,f=b.options,g=f.langInfo;this.initialize=function(){var b=f.dialogsInBody?a(document.body):e,c=['<p class="text-center">','<a href="//summernote.org/" target="_blank">Summernote 0.7.0</a> · ','<a href="//github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="//github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=d.dialog({title:g.options.help,body:c}).render().appendTo(b)},this.showHelpDialog=function(){return a.Deferred(function(a){d.onDialogHidden(c.$dialog,function(){a.resolve()}),d.showDialog(c.$dialog)}).promise()},this.show=function(){b.invoke("editor.saveRange"),this.showHelpDialog().then(function(){b.invoke("editor.restoreRange")})}},ea=function(d){var e=this,f=a.summernote.ui,g=d.layoutInfo.note,h=d.layoutInfo.editingArea,i=d.options,j=20;this.events={"summernote.keyup summernote.mouseup summernote.scroll":function(){e.update()},"summernote.change":function(){e.hide()},"summernote.focusout":function(a,c){c.relatedTarget&&H.ancestor(c.relatedTarget,b.eq(h[0]))||e.hide()}},this.initialize=function(){i.airMode&&(this.$popover=f.popover({className:"note-air-popover"}).render().appendTo(h),d.buildButtons(this.$popover.find(".popover-content"),i.popover.air),H.attachEvents(g,this.events))},this.destroy=function(){i.airMode&&(this.$popover.remove(),H.detachEvents(g,this.events))},this.update=function(){var a=d.invoke("editor.currentStyle");if(a.range&&!a.range.isCollapsed()){var e=c.last(a.range.getClientRects());if(e){var f=b.rect2bnd(e),g=h.offset();this.$popover.css({display:"block",left:Math.max(f.left+f.width/2,0)-g.left-j,top:f.top+f.height-g.top})}}else this.hide()},this.hide=function(){this.$popover.hide()}},fa=function(d){var e=this,f=a.summernote.ui,g=d.layoutInfo.note,h=d.options.hint||[],i=h instanceof Array?h:[h];this.events={"summernote.keyup":function(a,b){e.handleKeyup(b)},"summernote.keydown":function(a,b){e.handleKeydown(b)}},this.initialize=function(){i.length&&(this.lastWordRange=null,this.$popover=f.popover({className:"note-hint-popover"}).render().appendTo("body"),this.$content=this.$popover.find(".popover-content"),H.attachEvents(g,this.events),this.$content.on("click",".note-hint-item",function(){e.$content.find(".active").removeClass("active"),a(this).addClass("active"),e.replace()}))},this.destroy=function(){i.length&&(this.$popover.remove(),H.detachEvents(g,this.events))},this.selectItem=function(a){this.$content.find(".active").removeClass("active"),a.addClass("active"),this.$content[0].scrollTop=a[0].offsetTop-this.$content.innerHeight()/2},this.moveDown=function(){var a=this.$content.find(".note-hint-item.active"),b=a.next();if(b.length)this.selectItem(b);else{var c=a.parent().next();c.length||(c=this.$content.find(".note-hint-group").first()),this.selectItem(c.find(".note-hint-item").first())}},this.moveUp=function(){var a=this.$content.find(".note-hint-item.active"),b=a.prev();if(b.length)this.selectItem(b);else{var c=a.parent().prev();c.length||(c=this.$content.find(".note-hint-group").last()),this.selectItem(c.find(".note-hint-item").last())}},this.replace=function(){var a=this.$content.find(".note-hint-item.active"),b=this.nodeFromItem(a);this.lastWordRange.insertNode(b),I.createFromNode(b).collapse().select(),this.lastWordRange=null,this.hide(),d.invoke("editor.focus")},this.nodeFromItem=function(a){var b=i[a.data("index")],c=a.data("item"),d=b.content?b.content(c):c;return"string"==typeof d&&(d=H.createText(d)),d},this.createItemTemplates=function(b,c){var d=i[b];return c.map(function(c,e){var f=a('<div class="note-hint-item"/>');return f.append(d.template?d.template(c):c+""),f.data({index:b,item:c}),0===b&&0===e&&f.addClass("active"),f})},this.handleKeydown=function(a){this.$popover.is(":visible")&&(a.keyCode===E.code.ENTER?(a.preventDefault(),this.replace()):a.keyCode===E.code.UP?(a.preventDefault(),this.moveUp()):a.keyCode===E.code.DOWN&&(a.preventDefault(),this.moveDown()))},this.searchKeyword=function(a,b,c){var d=i[a];if(d&&d.match.test(b)&&d.search){var e=d.match.exec(b);d.search(e[1],c)}else c()},this.createGroup=function(b,c){var d=a('<div class="note-hint-group note-hint-group-'+b+'"/>');return this.searchKeyword(b,c,function(a){a=a||[],a.length&&(d.html(e.createItemTemplates(b,a)),e.show())}),d},this.handleKeyup=function(a){if(c.contains([E.code.ENTER,E.code.UP,E.code.DOWN],a.keyCode)){if(a.keyCode===E.code.ENTER&&this.$popover.is(":visible"))return!1}else{var f=d.invoke("editor.createRange").getWordRange(),g=f.toString();if(i.length&&g){this.$content.empty().data("count",0);var h=b.rect2bnd(c.last(f.getClientRects()));h&&(this.$popover.css({left:h.left,top:h.top+h.height}).hide(),this.lastWordRange=f,i.forEach(function(a,b){a.match.test(g)&&e.createGroup(b,g).appendTo(e.$content)}))}else this.hide()}},this.show=function(){this.$popover.show()},this.hide=function(){this.$popover.hide()}},ga=function(b){var c,d,e,f=this,g=a.summernote.ui,h=b.layoutInfo.editor,i=b.options,j=i.langInfo,k={UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13},l=15,m=35,n=0,o=[""","&","<",">","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","×","÷","ƒ","ˆ","˜","–","—","‘","’","‚","“","”","„","†","‡","•","…","‰","′","″","‹","›","‾","⁄","€","ℑ","℘","ℜ","™","ℵ","←","↑","→","↓","↔","↵","⇐","⇑","⇒","⇓","⇔","∀","∂","∃","∅","∇","∈","∉","∋","∏","∑","−","∗","√","∝","∞","∠","∧","∨","∩","∪","∫","∴","∼","≅","≈","≠","≡","≤","≥","⊂","⊃","⊄","⊆","⊇","⊕","⊗","⊥","⋅","⌈","⌉","⌊","⌋","◊","♠","♣","♥","♦"];this.getTextOnRange=function(){var a=b.invoke("editor.createRange");if(a.isOnAnchor()){var c=H.ancestor(a.sc,H.isAnchor);a=I.createFromNode(c)}return a.toString()},this.makeSpecialCharSetTable=function(){var b=a("<table/>");return a.each(o,function(c,d){var e=a("<td/>").addClass("note-specialchar-node"),f=c%l===0?a("<tr/>"):b.find("tr").last(),h=g.button({callback:function(a){a.html(d),a.attr("title",d),a.attr("data-value",encodeURIComponent(d)),a.css({width:m,"margin-right":"2px","margin-bottom":"2px"})}}).render();e.append(h),f.append(e),c%l===0&&b.append(f)}),n=b.find("tr").length,e=l,b},this.initialize=function(){var b=i.dialogsInBody?a(document.body):h,c='<div class="form-group row-fluid">'+this.makeSpecialCharSetTable()[0].outerHTML+"</div>";this.$dialog=g.dialog({title:j.specialChar.select,body:c}).render().appendTo(b)},this.show=function(){var c=this.getTextOnRange();b.invoke("editor.saveRange"),this.showSpecialCharDialog(c).then(function(c){b.invoke("editor.restoreRange");var d=a("<span></span>").html(c)[0];d&&b.invoke("editor.insertNode",d)}).fail(function(){b.invoke("editor.restoreRange")})},this.showSpecialCharDialog=function(b){return a.Deferred(function(h){function i(a){a&&(a.find("button").addClass("active"),t=a)}function j(a){a.find("button").removeClass("active"),t=null}function m(b,c){var d=null;return a.each(s,function(a,e){var f=Math.ceil((a+1)/l),g=(a+1)%l===0?l:(a+1)%l;return f===b&&g===c?(d=e,!1):void 0}),a(d)}function o(a){var b,f=s.length%e;k.LEFT===a?c>1?c-=1:1===d&&1===c?(c=f,d=n):(c=e,d-=1):k.RIGHT===a?d===n&&f===c?(c=1,d=1):e>c?c+=1:(c=1,d+=1):k.UP===a?1===d&&c>f?d=n-1:d-=1:k.DOWN===a&&(d+=1),d===n&&c>f?d=1:d>n?d=1:1>d&&(d=n),b=m(d,c),b&&(j(t),i(b))}function p(){t&&(h.resolve(decodeURIComponent(t.find("button").data("value"))),r.modal("hide"))}function q(a){a.preventDefault();var b=a.keyCode;if(void 0!==b&&null!==b){if(u.indexOf(b)>-1){if(null===t)return i(s.eq(0)),c=1,void(d=1);o(b)}else b===v&&p();return!1}}var r=f.$dialog,s=r.find(".note-specialchar-node"),t=null,u=[k.UP,k.DOWN,k.LEFT,k.RIGHT],v=k.ENTER;if(j(s),b)for(var w=0;w<s.length;w++){var x=a(s[w]);x.text()===b&&(i(x),d=Math.ceil((w+1)/l),c=(w+1)%l)}g.onDialogShown(f.$dialog,function(){a(document).on("keydown",q),f.$dialog.find("button").tooltip(),s.on("click",function(b){b.preventDefault(),h.resolve(decodeURIComponent(a(b.currentTarget).find("button").data("value"))),g.hideDialog(f.$dialog)})}),g.onDialogHidden(f.$dialog,function(){s.off("click"),f.$dialog.find("button").tooltip("destroy"),a(document).off("keydown",q),"pending"===h.state()&&h.reject()}),g.showDialog(f.$dialog)})}};a.summernote=a.extend(a.summernote,{version:"0.7.0",ui:w,lang:{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize Full",resizeHalf:"Resize Half",resizeQuarter:"Resize Quarter",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Float None",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL?",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",normal:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Foreground Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}},options:{modules:{editor:Q,clipboard:R,dropzone:S,codeview:T,statusbar:V,fullscreen:W,handle:X,button:Y,toolbar:Z,linkDialog:$,linkPopover:_,imageDialog:aa,videoDialog:ba,imagePopover:ca,helpDialog:da,airPopover:ea,hintPopover:fa,specialCharDialog:ga},buttons:{},lang:"en-US",toolbar:[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontname",["fontname"]],["fontsize",["fontsize"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","video","hr","specialchar"]],["view",["fullscreen","codeview"]],["help",["help"]]],popover:{image:[["imagesize",["imageSize100","imageSize50","imageSize25"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture","video"]]]},airMode:!1,width:null,height:null,focus:!1,tabSize:4,styleWithSpan:!0,shortcuts:!0,textareaAutoSync:!0,direction:null,styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontSizes:["8","9","10","11","12","14","18","24","36"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,maximumImageFileSize:null,callbacks:{onInit:null,onFocus:null,onBlur:null,onEnter:null,onKeyup:null,onKeydown:null,onSubmit:null,onImageUpload:null,onImageUploadError:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}}}})});