Socket
Socket
Sign inDemoInstall

summernote

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

summernote - npm Package Compare versions

Comparing version 0.5.9 to 0.6.0-ga

examples/plugin-fontstyle.html

2

bower.json
{
"name": "summernote",
"version": "0.5.9",
"version": "0.6.0",
"main": [

@@ -5,0 +5,0 @@ "./dist/summernote.js",

@@ -1,2 +0,2 @@

!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(a,b){var c,d,e=this.length>>>0,f=!1;for(1<arguments.length&&(d=b,f=!0),c=0;e>c;++c)this.hasOwnProperty(c)&&(f?d=a(d,this[c],c,this):(d=this[c],f=!0));if(!f)throw new TypeError("Reduce of empty array with no initial value");return d}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d});var b,c="function"==typeof define&&define.amd,d=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},e={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:navigator.userAgent.indexOf("MSIE")>-1||navigator.userAgent.indexOf("Trident")>-1,isFF:navigator.userAgent.indexOf("Firefox")>-1,jqueryVersion:parseFloat(a.fn.jquery),isSupportAmd:c,hasCodeMirror:c?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:d,isW3CRangeSupport:!!document.createRange},f=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};return{eq:b,eq2:c,peq2:d,ok:e,fail:f,self:i,not:g,and:h,uniqueId:k,rect2bnd:l,invertObject:m}}(),g=function(){var a=function(a){return a[0]},b=function(a){return a[a.length-1]},c=function(a){return a.slice(0,a.length-1)},d=function(a){return a.slice(1)},e=function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(b(e))return e}},g=function(a,b){for(var c=0,d=a.length;d>c;c++)if(!b(a[c]))return!1;return!0},h=function(a,b){return-1!==a.indexOf(b)},i=function(a,b){return b=b||f.self,a.reduce(function(a,c){return a+b(c)},0)},j=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},k=function(c,e){if(!c.length)return[];var f=d(c);return f.reduce(function(a,c){var d=b(a);return e(b(d),c)?d[d.length]=c:a[a.length]=[c],a},[[a(c)]])},l=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b},m=function(a){for(var b=[],c=0,d=a.length;d>c;c++)-1===b.indexOf(a[c])&&b.push(a[c]);return b};return{head:a,last:b,initial:c,tail:d,find:e,contains:h,all:g,sum:i,from:j,clusterBy:k,compact:l,unique:m}}(),h=String.fromCharCode(160),i="",j=function(){var b=function(b){return b&&a(b).hasClass("note-editable")},c=function(b){return b&&a(b).hasClass("note-control-sizing")},d=function(b){var c;if(b.hasClass("note-air-editor")){var d=g.last(b.attr("id").split("-"));return c=function(b){return function(){return a(b+d)}},{editor:function(){return b},editable:function(){return b},popover:c("#note-popover-"),handle:c("#note-handle-"),dialog:c("#note-dialog-")}}return c=function(a){return function(){return b.find(a)}},{editor:function(){return b},dropzone:c(".note-dropzone"),toolbar:c(".note-toolbar"),editable:c(".note-editable"),codable:c(".note-codable"),statusbar:c(".note-statusbar"),popover:c(".note-popover"),handle:c(".note-handle"),dialog:c(".note-dialog")}},k=function(a){return a=a.toUpperCase(),function(b){return b&&b.nodeName.toUpperCase()===a}},l=function(a){return a&&3===a.nodeType},m=function(a){return a&&/^BR|^IMG|^HR/.test(a.nodeName.toUpperCase())},n=function(a){return b(a)?!1:a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName.toUpperCase())},o=k("LI"),p=function(a){return n(a)&&!o(a)},q=function(a){return!u(a)&&!r(a)&&!n(a)},r=function(a){return a&&/^UL|^OL/.test(a.nodeName.toUpperCase())},s=function(a){return a&&/^TD|^TH/.test(a.nodeName.toUpperCase())},t=k("BLOCKQUOTE"),u=function(a){return s(a)||t(a)||b(a)},v=k("A"),w=function(a){return q(a)&&!!D(a,n)},x=function(a){return q(a)&&!D(a,n)},y=k("BODY"),z=e.isMSIE?"&nbsp;":"<br>",A=function(a){return l(a)?a.nodeValue.length:a.childNodes.length},B=function(a){var b=A(a);return 0===b?!0:j.isText(a)||1!==b||a.innerHTML!==z?!1:!0},C=function(a){m(a)||A(a)||(a.innerHTML=z)},D=function(a,c){for(;a;){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},E=function(a,c){c=c||f.fail;var d=[];return D(a,function(a){return b(a)||d.push(a),c(a)}),d},F=function(a,b){var c=E(a);return g.last(c.filter(b))},G=function(b,c){for(var d=E(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},H=function(a,b){b=b||f.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.previousSibling;return c},I=function(a,b){b=b||f.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.nextSibling;return c},J=function(a,b){var c=[];return b=b||f.ok,function d(e){a!==e&&b(e)&&c.push(e);for(var f=0,g=e.childNodes.length;g>f;f++)d(e.childNodes[f])}(a),c},K=function(b,c){var d=b.parentNode,e=a("<"+c+">")[0];return d.insertBefore(e,b),e.appendChild(b),e},L=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},M=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},N=function(a){return 0===a.offset},O=function(a){return a.offset===A(a.node)},P=function(a){return N(a)||O(a)},Q=function(a,b){for(;a&&a!==b;){if(0!==S(a))return!1;a=a.parentNode}return!0},R=function(a,b){for(;a&&a!==b;){if(S(a)!==A(a.parentNode)-1)return!1;a=a.parentNode}return!0},S=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},T=function(a){return!!(a&&a.childNodes&&a.childNodes.length)},U=function(a,c){var d,e;if(0===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=S(a.node)}else T(a.node)?(d=a.node.childNodes[a.offset-1],e=A(d)):(d=a.node,e=c?0:a.offset-1);return{node:d,offset:e}},V=function(a,c){var d,e;if(A(a.node)===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=S(a.node)+1}else T(a.node)?(d=a.node.childNodes[a.offset],e=0):(d=a.node,e=c?A(a.node):a.offset+1);return{node:d,offset:e}},W=function(a,b){return a.node===b.node&&a.offset===b.offset},X=function(a){if(l(a.node)||!T(a.node)||B(a.node))return!0;var b=a.node.childNodes[a.offset-1],c=a.node.childNodes[a.offset];return b&&!m(b)||c&&!m(c)?!1:!0},Y=function(a,b){for(;a;){if(b(a))return a;a=U(a)}return null},Z=function(a,b){for(;a;){if(b(a))return a;a=V(a)}return null},$=function(a,b,c,d){for(var e=a;e&&(c(e),!W(e,b));){var f=d&&a.node!==e.node&&b.node!==e.node;e=V(e,f)}},_=function(b,c){var d=E(c,f.eq(b));return a.map(d,S).reverse()},ab=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},bb=function(a,b){if(l(a.node))return N(a)?a.node:O(a)?a.node.nextSibling:a.node.splitText(a.offset);var c=a.node.childNodes[a.offset],d=L(a.node.cloneNode(!1),a.node);return M(d,I(c)),b||(C(a.node),C(d)),d},cb=function(a,b,c){var d=E(b.node,f.eq(a));return d.length?1===d.length?bb(b,c):d.reduce(function(a,d){var e=L(d.cloneNode(!1),d);return a===b.node&&(a=bb(b,c)),M(e,I(a)),c||(C(d),C(e)),e}):null},db=function(a){return document.createElement(a)},eb=function(a){return document.createTextNode(a)},fb=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)}},gb=function(a,c){for(;a&&!b(a)&&c(a);){var d=a.parentNode;fb(a),a=d}},hb=function(a,b){if(a.nodeName.toUpperCase()===b.toUpperCase())return a;var c=db(b);return a.style.cssText&&(c.style.cssText=a.style.cssText),M(c,g.from(a.childNodes)),L(c,a),fb(a),c},ib=k("TEXTAREA"),jb=function(b,c){var d=ib(b[0])?b.val():b.html();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},kb=function(a){var b=a.val();return b.replace(/[\n\r]/g,"")};return{NBSP_CHAR:h,ZERO_WIDTH_NBSP_CHAR:i,blank:z,emptyPara:"<p>"+z+"</p>",isEditable:b,isControlSizing:c,buildLayoutInfo:d,isText:l,isPara:n,isPurePara:p,isInline:q,isBodyInline:x,isBody:y,isParaInline:w,isList:r,isTable:k("TABLE"),isCell:s,isBlockquote:t,isBodyContainer:u,isAnchor:v,isDiv:k("DIV"),isLi:o,isSpan:k("SPAN"),isB:k("B"),isU:k("U"),isS:k("S"),isI:k("I"),isImg:k("IMG"),isTextarea:ib,isEmpty:B,isEmptyAnchor:f.and(v,B),nodeLength:A,isLeftEdgePoint:N,isRightEdgePoint:O,isEdgePoint:P,isLeftEdgeOf:Q,isRightEdgeOf:R,prevPoint:U,nextPoint:V,isSamePoint:W,isVisiblePoint:X,prevPointUntil:Y,nextPointUntil:Z,walkPoint:$,ancestor:D,listAncestor:E,lastAncestor:F,listNext:I,listPrev:H,listDescendant:J,commonAncestor:G,wrap:K,insertAfter:L,appendChildNodes:M,position:S,hasChildren:T,makeOffsetPath:_,fromOffsetPath:ab,splitTree:cb,create:db,createText:eb,remove:fb,removeWhile:gb,replace:hb,html:jb,value:kb}}(),k={version:"0.5.9",options:{width:null,height:null,minHeight:null,maxHeight:null,focus:!1,tabsize:4,styleWithSpan:!0,disableLinkTarget:!1,disableDragAndDrop:!1,disableResizeEditor:!1,codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},lang:"en-US",direction:null,toolbar:[["style",["style"]],["font",["bold","italic","underline","superscript","subscript","strikethrough","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","video","hr"]],["view",["fullscreen","codeview"]],["help",["help"]]],airMode:!1,airPopover:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]],styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],defaultFontName:"Helvetica Neue",fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],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"]],fontSizes:["8","9","10","11","12","14","18","24","36"],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],insertTableMaxSize:{col:10,row:10},oninit:null,onfocus:null,onblur:null,onenter:null,onkeyup:null,onkeydown:null,onImageUpload:null,onImageUploadError:null,onToolbarClick:null,onCreateLink:function(a){return-1!==a.indexOf("@")&&-1===a.indexOf(":")?a="mailto:"+a:-1===a.indexOf("://")&&(a="http://"+a),a},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":"showLinkDialog"},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":"showLinkDialog"}}},lang:{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",clear:"Remove Font Style",height:"Line Height",name:"Font Family",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",dragImageHere:"Drag an image here",selectFromFiles:"Select from files",url:"Image URL",remove:"Remove Image"},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"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL?",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},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"},history:{undo:"Undo",redo:"Redo"}}}},l=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){a("<img>").one("load",function(){d.resolve(a(this))}).one("error abort",function(){d.reject(a(this))}).css({display:"none"}).appendTo(document.body).attr("src",b).attr("data-filename",c)}).promise()};return{readFileAsDataURL:b,createImage:c}}(),m={isEdit:function(a){return-1!==[8,9,13,32].indexOf(a)},nameFromCode:{8:"BACKSPACE",9:"TAB",13:"ENTER",32:"SPACE",48:"NUM0",49:"NUM1",50:"NUM2",51:"NUM3",52:"NUM4",53:"NUM5",54:"NUM6",55:"NUM7",56:"NUM8",66:"B",69:"E",73:"I",74:"J",75:"K",76:"L",82:"R",83:"S",85:"U",89:"Y",90:"Z",191:"SLASH",219:"LEFTBRACKET",220:"BACKSLASH",221:"RIGHTBRACKET"}},n=function(){var b=function(b,c){if(e.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.stylePara=function(b,c){a.each(b.nodes(j.isPara,{includeAncestor:!0}),function(b,d){a(d).css(c)})},this.current=function(c,d){var e=a(j.isText(c.sc)?c.sc.parentNode:c.sc),f=["font-family","font-size","text-align","list-style-type","line-height"],g=b(e,f)||{};if(g["font-size"]=parseInt(g["font-size"],10),g["font-bold"]=document.queryCommandState("bold")?"bold":"normal",g["font-italic"]=document.queryCommandState("italic")?"italic":"normal",g["font-underline"]=document.queryCommandState("underline")?"underline":"normal",g["font-strikethrough"]=document.queryCommandState("strikeThrough")?"strikethrough":"normal",g["font-superscript"]=document.queryCommandState("superscript")?"superscript":"normal",g["font-subscript"]=document.queryCommandState("subscript")?"subscript":"normal",c.isOnList()){var h=["circle","disc","disc-leading-zero","square"],i=a.inArray(g["list-style-type"],h)>-1;g["list-style"]=i?"unordered":"ordered"}else g["list-style"]="none";var k=j.ancestor(c.sc,j.isPara);if(k&&k.style["line-height"])g["line-height"]=k.style.lineHeight;else{var l=parseInt(g["line-height"],10)/parseInt(g["font-size"],10);g["line-height"]=l.toFixed(1)}return g.image=j.isImg(d)&&d,g.anchor=c.isOnAnchor()&&j.ancestor(c.sc,j.isAnchor),g.ancestors=j.listAncestor(c.sc,j.isEditable),g.range=c,g}},o=function(){var b=function(a,b){var c,d,e=a.parentElement(),f=document.body.createTextRange(),h=g.from(e.childNodes);for(c=0;c<h.length;c++)if(!j.isText(h[c])){if(f.moveToElementText(h[c]),f.compareEndPoints("StartToStart",a)>=0)break;d=h[c]}if(0!==c&&j.isText(h[c-1])){var i=document.body.createTextRange(),k=null;i.moveToElementText(d||e),i.collapse(!d),k=d?d.nextSibling:e.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",i);for(var m=l.text.replace(/[\r\n]/g,"").length;m>k.nodeValue.length&&k.nextSibling;)m-=k.nodeValue.length,k=k.nextSibling;{k.nodeValue}b&&k.nextSibling&&j.isText(k.nextSibling)&&m===k.nodeValue.length&&(m-=k.nodeValue.length,k=k.nextSibling),e=k,c=m}return{cont:e,offset:c}},c=function(a){var b=function(a,c){var d,e;if(j.isText(a)){var h=j.listPrev(a,f.not(j.isText)),i=g.last(h).previousSibling;d=i||a.parentNode,c+=g.sum(g.tail(h),j.nodeLength),e=!i}else{if(d=a.childNodes[c]||a,j.isText(d))return b(d,0);c=0,e=!1}return{node:d,collapseToStart:e,offset:c}},c=document.body.createTextRange(),d=b(a.node,a.offset);return c.moveToElementText(d.node),c.collapse(d.collapseToStart),c.moveStart("character",d.offset),c},d=function(b,h,i,k){this.sc=b,this.so=h,this.ec=i,this.eo=k;var l=function(){if(e.isW3CRangeSupport){var a=document.createRange();return a.setStart(b,h),a.setEnd(i,k),a}var d=c({node:b,offset:h});return d.setEndPoint("EndToEnd",c({node:i,offset:k})),d};this.getPoints=function(){return{sc:b,so:h,ec:i,eo:k}},this.getStartPoint=function(){return{node:b,offset:h}},this.getEndPoint=function(){return{node:i,offset:k}},this.select=function(){var a=l();if(e.isW3CRangeSupport){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select()},this.normalize=function(){var a=function(a){return j.isVisiblePoint(a)||(j.isLeftEdgePoint(a)?a=j.nextPointUntil(a,j.isVisiblePoint):j.isRightEdgePoint(a)&&(a=j.prevPointUntil(a,j.isVisiblePoint))),a},b=a(this.getStartPoint()),c=a(this.getStartPoint());return new d(b.node,b.offset,c.node,c.offset)},this.nodes=function(a,b){a=a||f.ok;var c=b&&b.includeAncestor,d=b&&b.fullyContains,e=this.getStartPoint(),h=this.getEndPoint(),i=[],k=[];return j.walkPoint(e,h,function(b){if(!j.isEditable(b.node)){var e;d?(j.isLeftEdgePoint(b)&&k.push(b.node),j.isRightEdgePoint(b)&&g.contains(k,b.node)&&(e=b.node)):e=c?j.ancestor(b.node,a):b.node,e&&a(e)&&i.push(e)}},!0),g.unique(i)},this.commonAncestor=function(){return j.commonAncestor(b,i)},this.expand=function(a){var c=j.ancestor(b,a),e=j.ancestor(i,a);if(!c&&!e)return new d(b,h,i,k);var f=this.getPoints();return c&&(f.sc=c,f.so=0),e&&(f.ec=e,f.eo=j.nodeLength(e)),new d(f.sc,f.so,f.ec,f.eo)},this.collapse=function(a){return a?new d(b,h,b,h):new d(i,k,i,k)},this.splitText=function(){var a=b===i,c=this.getPoints();return j.isText(i)&&!j.isEdgePoint(this.getEndPoint())&&i.splitText(k),j.isText(b)&&!j.isEdgePoint(this.getStartPoint())&&(c.sc=b.splitText(h),c.so=0,a&&(c.ec=c.sc,c.eo=k-h)),new d(c.sc,c.so,c.ec,c.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var b=this.splitText(),c=b.nodes(null,{fullyContains:!0}),e=j.prevPointUntil(b.getStartPoint(),function(a){return!g.contains(c,a.node)}),f=[];return a.each(c,function(a,b){var c=b.parentNode;e.node!==c&&1===j.nodeLength(c)&&f.push(c),j.remove(b,!1)}),a.each(f,function(a,b){j.remove(b,!1)}),new d(e.node,e.offset,e.node,e.offset)};var m=function(a){return function(){var c=j.ancestor(b,a);return!!c&&c===j.ancestor(i,a)}};this.isOnEditable=m(j.isEditable),this.isOnList=m(j.isList),this.isOnAnchor=m(j.isAnchor),this.isOnCell=m(j.isCell),this.isLeftEdgeOf=function(a){if(!j.isLeftEdgePoint(this.getStartPoint()))return!1;var b=j.ancestor(this.sc,a);return b&&j.isLeftEdgeOf(this.sc,b)},this.isCollapsed=function(){return b===i&&h===k},this.wrapBodyInlineWithPara=function(){if(j.isEditable(b)&&!b.childNodes[h])return new d(b.appendChild(a(j.emptyPara)[0]),0);if(!j.isInline(b)||j.isParaInline(b))return this;var c=j.listAncestor(b,f.not(j.isInline)),e=g.last(c);j.isInline(e)||(e=c[c.length-2]||b.childNodes[h]);var i=j.listPrev(e,j.isParaInline).reverse();if(i=i.concat(j.listNext(e.nextSibling,j.isParaInline)),i.length){var k=j.wrap(g.head(i),"p");j.appendChildNodes(k,g.tail(i))}return this},this.insertNode=function(a,b){var c,d,e,f=this.wrapBodyInlineWithPara(),h=f.getStartPoint();if(b)d=j.isPara(h.node)?h.node:h.node.parentNode,e=j.isPara(h.node)?h.node.childNodes[h.offset]:j.splitTree(h.node,h);else{var i=j.listAncestor(h.node,j.isBodyContainer),k=g.last(i)||h.node;j.isBodyContainer(k)?(c=i[i.length-2],d=k):(c=k,d=c.parentNode),e=c&&j.splitTree(c,h)}return e?e.parentNode.insertBefore(a,e):d.appendChild(a),a},this.toString=function(){var a=l();return e.isW3CRangeSupport?a.toString():a.text},this.bookmark=function(a){return{s:{path:j.makeOffsetPath(a,b),offset:h},e:{path:j.makeOffsetPath(a,i),offset:k}}},this.getClientRects=function(){var a=l();return a.getClientRects()}};return{create:function(a,c,f,g){if(arguments.length)2===arguments.length&&(f=a,g=c);else if(e.isW3CRangeSupport){var h=document.getSelection();if(0===h.rangeCount)return null;if(j.isBody(h.anchorNode))return null;var i=h.getRangeAt(0);a=i.startContainer,c=i.startOffset,f=i.endContainer,g=i.endOffset}else{var k=document.selection.createRange(),l=k.duplicate();l.collapse(!1);var m=k;m.collapse(!0);var n=b(m,!0),o=b(l,!1);a=n.cont,c=n.offset,f=o.cont,g=o.offset}return new d(a,c,f,g)},createFromNode:function(a){return this.create(a,0,a,1)},createFromBookmark:function(a,b){var c=j.fromOffsetPath(a,b.s.path),e=b.s.offset,f=j.fromOffsetPath(a,b.e.path),g=b.e.offset;return new d(c,e,f,g)}}}(),p=function(){this.insertTab=function(a,b,c){var d=j.createText(new Array(c+1).join(j.NBSP_CHAR));b=b.deleteContents(),b.insertNode(d,!0),b=o.create(d,c),b.select()},this.insertParagraph=function(){var b=o.create();b=b.deleteContents(),b=b.wrapBodyInlineWithPara();var c=j.ancestor(b.sc,j.isPara),d=j.splitTree(c,b.getStartPoint()),e=j.listDescendant(c,j.isEmptyAnchor);e=e.concat(j.listDescendant(d,j.isEmptyAnchor)),a.each(e,function(a,b){j.remove(b)}),o.create(d,0).normalize().select()}},q=function(){this.tab=function(a,b){var c=j.ancestor(a.commonAncestor(),j.isCell),d=j.ancestor(c,j.isTable),e=j.listDescendant(d,j.isCell),f=g[b?"prev":"next"](e,c);f&&o.create(f,0).select()},this.createTable=function(b,c){for(var d,e=[],f=0;b>f;f++)e.push("<td>"+j.blank+"</td>");d=e.join("");for(var g,h=[],i=0;c>i;i++)h.push("<tr>"+d+"</tr>");return g=h.join(""),a('<table class="table table-bordered">'+g+"</table>")[0]}},r=function(){this.insertOrderedList=function(){this.toggleList("OL")},this.insertUnorderedList=function(){this.toggleList("UL")},this.indent=function(){var b=this,c=o.create().wrapBodyInlineWithPara(),d=c.nodes(j.isPara,{includeAncestor:!0}),e=g.clusterBy(d,f.peq2("parentNode"));a.each(e,function(c,d){var e=g.head(d);j.isLi(e)?b.wrapList(d,e.parentNode.nodeName):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return(parseInt(b,10)||0)+25})})}),c.select()},this.outdent=function(){var b=this,c=o.create().wrapBodyInlineWithPara(),d=c.nodes(j.isPara,{includeAncestor:!0}),e=g.clusterBy(d,f.peq2("parentNode"));a.each(e,function(c,d){var e=g.head(d);j.isLi(e)?b.releaseList([d]):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return b=parseInt(b,10)||0,b>25?b-25:""})})}),c.select()},this.toggleList=function(b){var c=this,d=o.create().wrapBodyInlineWithPara(),e=d.nodes(j.isPara,{includeAncestor:!0}),h=g.clusterBy(e,f.peq2("parentNode"));if(g.find(e,j.isPurePara))a.each(h,function(a,d){c.wrapList(d,b)});else{var i=d.nodes(j.isList,{includeAncestor:!0}).filter(function(c){return!a.nodeName(c,b)});i.length?a.each(i,function(a,c){j.replace(c,b)}):this.releaseList(h,!0)}d.select()},this.wrapList=function(b,c){var d=g.head(b),e=g.last(b),f=j.isList(d.previousSibling)&&d.previousSibling,h=j.isList(e.nextSibling)&&e.nextSibling,i=f||j.insertAfter(j.create(c||"UL"),e);b=a.map(b,function(a){return j.isPurePara(a)?j.replace(a,"LI"):a}),j.appendChildNodes(i,b),h&&(j.appendChildNodes(i,g.from(h.childNodes)),j.remove(h))},this.releaseList=function(b,c){var d=[];return a.each(b,function(b,e){var f=g.head(e),h=g.last(e),i=c?j.lastAncestor(f,j.isList):f.parentNode,k=i.childNodes.length>1?j.splitTree(i,{node:h.parentNode,offset:j.position(h)+1},!0):null,l=j.splitTree(i,{node:f.parentNode,offset:j.position(f)},!0);e=c?j.listDescendant(l,j.isLi):g.from(l.childNodes).filter(j.isLi),(c||!j.isList(i.parentNode))&&(e=a.map(e,function(a){return j.replace(a,"P")})),a.each(g.from(e).reverse(),function(a,b){j.insertAfter(b,i)});var m=g.compact([i,l,k]);a.each(m,function(b,c){var d=[c].concat(j.listDescendant(c,j.isList));a.each(d.reverse(),function(a,b){j.nodeLength(b)||j.remove(b,!0)})}),d=d.concat(e)}),d}},s=function(){var b=new n,c=new q,d=new p,f=new r;this.saveRange=function(a,b){a.focus(),a.data("range",o.create()),b&&o.create().collapse().select()},this.restoreRange=function(a){var b=a.data("range");b&&(b.select(),a.focus())},this.currentStyle=function(a){var c=o.create();return c?c.isOnEditable()&&b.current(c,a):!1};var h=this.triggerOnChange=function(a){var b=a.data("callbacks").onChange;b&&b(a.html(),a)};this.undo=function(a){a.data("NoteHistory").undo(),h(a)},this.redo=function(a){a.data("NoteHistory").redo(),h(a)};for(var i=this.afterCommand=function(a){a.data("NoteHistory").recordUndo(),h(a)},k=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule","fontName"],m=0,s=k.length;s>m;m++)this[k[m]]=function(a){return function(b,c){document.execCommand(a,!1,c),i(b)}}(k[m]);this.tab=function(a,b){var e=o.create();e.isCollapsed()&&e.isOnCell()?c.tab(e):(d.insertTab(a,e,b.tabsize),i(a))},this.untab=function(){var a=o.create();a.isCollapsed()&&a.isOnCell()&&c.tab(a,!0)},this.insertParagraph=function(a){d.insertParagraph(a),i(a)},this.insertOrderedList=function(a){f.insertOrderedList(a),i(a)},this.insertUnorderedList=function(a){f.insertUnorderedList(a),i(a)},this.indent=function(a){f.indent(a),i(a)},this.outdent=function(a){f.outdent(a),i(a)},this.insertImage=function(a,b,c){l.createImage(b,c).then(function(b){b.css({display:"",width:Math.min(a.width(),b.width())}),o.create().insertNode(b[0]),i(a)}).fail(function(){var b=a.data("callbacks");b.onImageUploadError&&b.onImageUploadError()})},this.insertVideo=function(b,c){var d,e=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,f=c.match(e),g=/\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/,h=c.match(g),j=/\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/,k=c.match(j),l=/\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/,m=c.match(l),n=/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,p=c.match(n),q=/\/\/v\.youku\.com\/v_show\/id_(\w+)\.html/,r=c.match(q);if(f&&11===f[2].length){var s=f[2];d=a("<iframe>").attr("src","//www.youtube.com/embed/"+s).attr("width","640").attr("height","360")}else h&&h[0].length?d=a("<iframe>").attr("src",h[0]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true"):k&&k[0].length?d=a("<iframe>").attr("src",k[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed"):m&&m[3].length?d=a("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("src","//player.vimeo.com/video/"+m[3]).attr("width","640").attr("height","360"):p&&p[2].length?d=a("<iframe>").attr("src","//www.dailymotion.com/embed/video/"+p[2]).attr("width","640").attr("height","360"):r&&r[1].length&&(d=a("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+r[1]));d&&(d.attr("frameborder",0),o.create().insertNode(d[0]),i(b))},this.formatBlock=function(a,b){b=e.isMSIE?"<"+b+">":b,document.execCommand("FormatBlock",!1,b),i(a)},this.formatPara=function(a){this.formatBlock(a,"P"),i(a)};for(var m=1;6>=m;m++)this["formatH"+m]=function(a){return function(b){this.formatBlock(b,"H"+a)}}(m);this.fontSize=function(a,b){document.execCommand("fontSize",!1,3),e.isFF?a.find("font[size=3]").removeAttr("size").css("font-size",b+"px"):a.find("span").filter(function(){return"medium"===this.style.fontSize}).css("font-size",b+"px"),i(a)},this.lineHeight=function(a,c){b.stylePara(o.create(),{lineHeight:c}),i(a)},this.unlink=function(a){var b=o.create();if(b.isOnAnchor()){var c=j.ancestor(b.sc,j.isAnchor);b=o.createFromNode(c),b.select(),document.execCommand("unlink"),i(a)}},this.createLink=function(b,c,d){var e=c.url,f=c.text,g=c.newWindow,h=c.range;d.onCreateLink&&(e=d.onCreateLink(e)),h=h.deleteContents();var j=h.insertNode(a("<A>"+f+"</A>")[0],!0);a(j).attr({href:e,target:g?"_blank":""}),o.createFromNode(j).select(),i(b)},this.getLinkInfo=function(b){b.focus();var c=o.create().expand(j.isAnchor),d=a(g.head(c.nodes(j.isAnchor)));return{range:c,text:c.toString(),isNewWindow:d.length?"_blank"===d.attr("target"):!0,url:d.length?d.attr("href"):""}},this.getVideoInfo=function(a){a.focus();var b=o.create();if(b.isOnAnchor()){var c=j.ancestor(b.sc,j.isAnchor);b=o.createFromNode(c)}return{text:b.toString()}},this.color=function(a,b){var c=JSON.parse(b),d=c.foreColor,e=c.backColor;d&&document.execCommand("foreColor",!1,d),e&&document.execCommand("backColor",!1,e),i(a)},this.insertTable=function(a,b){var d=b.split("x"),e=o.create();e=e.deleteContents(),e.insertNode(c.createTable(d[0],d[1])),i(a)},this.floatMe=function(a,b,c){c.css("float",b),i(a)},this.resize=function(a,b,c){c.css({width:a.width()*b+"px",height:""}),i(a)},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=function(a,b,c){c.detach(),i(a)}},t=function(a){var b=[],c=0,d=a[0],e=function(){var b=o.create(),c={s:{path:[0],offset:0},e:{path:[0],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&&o.createFromBookmark(d,b.bookmark).select()};this.undo=function(){c>0&&(c--,f(b[c]))},this.redo=function(){b.length-1>c&&(c++,f(b[c]))},this.recordUndo=function(){b.length>c&&(b=b.slice(0,c)),b.push(e()),c++},this.recordUndo()},u=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).data("value")+""==c+"";this.className=b?"checked":""})},e=function(a,c){var d=b.find(a);d.toggleClass("active",c())},f=b.find(".note-fontname");if(f.length){var h=c["font-family"];h&&(h=g.head(h.split(",")),h=h.replace(/\'/g,""),f.find(".note-current-fontname").text(h),d(f,h))}var i=b.find(".note-fontsize");i.find(".note-current-fontsize").text(c["font-size"]),d(i,parseFloat(c["font-size"]));var j=b.find(".note-height");d(j,parseFloat(c["line-height"])),e('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),e('button[data-event="italic"]',function(){return"italic"===c["font-italic"]
}),e('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),e('button[data-event="strikethrough"]',function(){return"strikethrough"===c["font-strikethrough"]}),e('button[data-event="superscript"]',function(){return"superscript"===c["font-superscript"]}),e('button[data-event="subscript"]',function(){return"subscript"===c["font-subscript"]}),e('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),e('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),e('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),e('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),e('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),e('button[data-event="insertOrderedList"]',function(){return"ordered"===c["list-style"]})},this.updateRecentColor=function(b,c,d){var e=a(b).closest(".note-color"),f=e.find(".note-recent-color"),g=JSON.parse(f.attr("data-value"));g[c]=d,f.attr("data-value",JSON.stringify(g));var h="backColor"===c?"background-color":"color";f.find("i").css(h,d)}},v=function(){var a=new u;this.update=function(b,c){a.update(b,c)},this.updateRecentColor=function(b,c,d){a.updateRecentColor(b,c,d)},this.activate=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.deactivate=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")},this.updateFullscreen=function(a,b){var c=a.find('button[data-event="fullscreen"]');c.toggleClass("active",b)},this.updateCodeview=function(a,b){var c=a.find('button[data-event="codeview"]');c.toggleClass("active",b)}},w=function(){var b=new u,c=function(b,c){var d=a(b),e=c?d.offset():d.position(),f=d.outerHeight(!0);return{left:e.left,top:e.top+f}},d=function(a,b){a.css({display:"block",left:b.left,top:b.top})},e=20;this.update=function(h,i,j){b.update(h,i);var k=h.find(".note-link-popover");if(i.anchor){var l=k.find("a"),m=a(i.anchor).attr("href");l.attr("href",m).html(m),d(k,c(i.anchor,j))}else k.hide();var n=h.find(".note-image-popover");i.image?d(n,c(i.image,j)):n.hide();var o=h.find(".note-air-popover");if(j&&!i.range.isCollapsed()){var p=f.rect2bnd(g.last(i.range.getClientRects()));d(o,{left:Math.max(p.left+p.width/2-e,0),top:p.top+p.height})}else o.hide()},this.updateRecentColor=function(a,b,c){a.updateRecentColor(a,b,c)},this.hide=function(a){a.children().hide()}},x=function(){this.update=function(b,c,d){var e=b.find(".note-control-selection");if(c.image){var f=a(c.image),g=d?f.offset():f.position(),h={w:f.outerWidth(!0),h:f.outerHeight(!0)};e.css({display:"block",left:g.left,top:g.top,width:h.w,height:h.h}).data("target",c.image);var i=h.w+"x"+h.h;e.find(".note-control-selection-info").text(i)}else e.hide()},this.hide=function(a){a.children().hide()}},y=function(){var b=function(a,b){a.toggleClass("disabled",!b),a.attr("disabled",!b)};this.showImageDialog=function(c,d){return a.Deferred(function(a){var c=d.find(".note-image-dialog"),e=d.find(".note-image-input"),f=d.find(".note-image-url"),g=d.find(".note-image-btn");c.one("shown.bs.modal",function(){e.replaceWith(e.clone().on("change",function(){a.resolve(this.files),c.modal("hide")}).val("")),g.click(function(b){b.preventDefault(),a.resolve(f.val()),c.modal("hide")}),f.on("keyup paste",function(a){var c;c="paste"===a.type?a.originalEvent.clipboardData.getData("text"):f.val(),b(g,c)}).val("").trigger("focus")}).one("hidden.bs.modal",function(){e.off("change"),f.off("keyup paste"),g.off("click"),"pending"===a.state()&&a.reject()}).modal("show")})},this.showVideoDialog=function(c,d,e){return a.Deferred(function(a){var c=d.find(".note-video-dialog"),f=c.find(".note-video-url"),g=c.find(".note-video-btn");c.one("shown.bs.modal",function(){f.val(e.text).keyup(function(){b(g,f.val())}).trigger("keyup").trigger("focus"),g.click(function(b){b.preventDefault(),a.resolve(f.val()),c.modal("hide")})}).one("hidden.bs.modal",function(){f.off("keyup"),g.off("click"),"pending"===a.state()&&a.reject()}).modal("show")})},this.showLinkDialog=function(c,d,e){return a.Deferred(function(a){var c=d.find(".note-link-dialog"),f=c.find(".note-link-text"),g=c.find(".note-link-url"),h=c.find(".note-link-btn"),i=c.find("input[type=checkbox]");c.one("shown.bs.modal",function(){f.val(e.text),f.keyup(function(){e.text=f.val()}),e.url||(e.url=e.text,b(h,e.text)),g.keyup(function(){b(h,g.val()),e.text||f.val(g.val())}).val(e.url).trigger("focus").trigger("select"),i.prop("checked",e.newWindow),h.one("click",function(b){b.preventDefault(),a.resolve({range:e.range,url:g.val(),text:f.val(),newWindow:i.is(":checked")}),c.modal("hide")})}).one("hidden.bs.modal",function(){f.off("keyup"),g.off("keyup"),h.off("click"),"pending"===a.state()&&a.reject()}).modal("show")}).promise()},this.showHelpDialog=function(b,c){return a.Deferred(function(a){var b=c.find(".note-help-dialog");b.one("hidden.bs.modal",function(){a.resolve()}).modal("show")}).promise()}};e.hasCodeMirror&&(e.isSupportAmd?require(["CodeMirror"],function(a){b=a}):b=window.CodeMirror);var z=function(){var c=a(window),d=a(document),f=a("html, body"),h=new s,i=new v,k=new w,n=new x,o=new y,p=function(b){var c=a(b).closest(".note-editor, .note-air-editor, .note-air-layout");if(!c.length)return null;var d;return d=c.is(".note-editor, .note-air-editor")?c:a("#note-editor-"+g.last(c.attr("id").split("-"))),j.buildLayoutInfo(d)},q=function(b,c){h.restoreRange(b);var d=b.data("callbacks");d.onImageUpload?d.onImageUpload(c,h,b):a.each(c,function(a,c){var e=c.name;l.readFileAsDataURL(c).then(function(a){h.insertImage(b,a,e)}).fail(function(){d.onImageUploadError&&d.onImageUploadError()})})},r={showLinkDialog:function(a){var b=a.editor(),c=a.dialog(),d=a.editable(),e=h.getLinkInfo(d),f=b.data("options");h.saveRange(d),o.showLinkDialog(d,c,e).then(function(b){h.restoreRange(d),h.createLink(d,b,f),k.hide(a.popover())}).fail(function(){h.restoreRange(d)})},showImageDialog:function(a){var b=a.dialog(),c=a.editable();h.saveRange(c),o.showImageDialog(c,b).then(function(a){h.restoreRange(c),"string"==typeof a?h.insertImage(c,a):q(c,a)}).fail(function(){h.restoreRange(c)})},showVideoDialog:function(a){var b=a.dialog(),c=a.editable(),d=h.getVideoInfo(c);h.saveRange(c),o.showVideoDialog(c,b,d).then(function(a){h.restoreRange(c),h.insertVideo(c,a)}).fail(function(){h.restoreRange(c)})},showHelpDialog:function(a){var b=a.dialog(),c=a.editable();h.saveRange(c,!0),o.showHelpDialog(c,b).then(function(){h.restoreRange(c)})},fullscreen:function(a){var b=a.editor(),d=a.toolbar(),e=a.editable(),g=a.codable(),h=b.data("options"),j=function(a){b.css("width",a.w),e.css("height",a.h),g.css("height",a.h),g.data("cmeditor")&&g.data("cmeditor").setsize(null,a.h)};b.toggleClass("fullscreen");var k=b.hasClass("fullscreen");k?(e.data("orgheight",e.css("height")),c.on("resize",function(){j({w:c.width(),h:c.height()-d.outerHeight()})}).trigger("resize"),f.css("overflow","hidden")):(c.off("resize"),j({w:h.width||"",h:e.data("orgheight")}),f.css("overflow","visible")),i.updateFullscreen(d,k)},codeview:function(a){var c,d,f=a.editor(),g=a.toolbar(),h=a.editable(),l=a.codable(),m=a.popover(),n=f.data("options");f.toggleClass("codeview");var o=f.hasClass("codeview");o?(l.val(j.html(h,!0)),l.height(h.height()),i.deactivate(g),k.hide(m),l.focus(),e.hasCodeMirror&&(c=b.fromTextArea(l[0],n.codemirror),n.codemirror.tern&&(d=new b.TernServer(n.codemirror.tern),c.ternServer=d,c.on("cursorActivity",function(a){d.updateArgHints(a)})),c.setSize(null,h.outerHeight()),l.data("cmEditor",c))):(e.hasCodeMirror&&(c=l.data("cmEditor"),l.val(c.getValue()),c.toTextArea()),h.html(j.value(l)||j.emptyPara),h.height(n.height?l.height():"auto"),i.activate(g),h.focus()),i.updateCodeview(a.toolbar(),o)}},u=function(a){j.isImg(a.target)&&a.preventDefault()},z=function(a){setTimeout(function(){var b=p(a.currentTarget||a.target),c=h.currentStyle(a.target);if(c){var d=b.editor().data("options").airMode;d||i.update(b.toolbar(),c),k.update(b.popover(),c,d),n.update(b.handle(),c,d)}},0)},A=function(a){var b=p(a.currentTarget||a.target);k.hide(b.popover()),n.hide(b.handle())},B=function(a){var b=a.originalEvent.clipboardData;if(b&&b.items&&b.items.length){var c=p(a.currentTarget||a.target),d=g.head(b.items),e="file"===d.kind&&-1!==d.type.indexOf("image/");e&&q(c.editable(),[d.getAsFile()])}},C=function(b){if(j.isControlSizing(b.target)){b.preventDefault(),b.stopPropagation();var c=p(b.target),e=c.handle(),f=c.popover(),g=c.editable(),i=c.editor(),l=e.find(".note-control-selection").data("target"),m=a(l),o=m.offset(),q=d.scrollTop(),r=i.data("options").airMode;d.on("mousemove",function(a){h.resizeTo({x:a.clientX-o.left,y:a.clientY-(o.top-q)},m,!a.shiftKey),n.update(e,{image:l},r),k.update(f,{image:l},r)}).one("mouseup",function(){d.off("mousemove")}),m.data("ratio")||m.data("ratio",m.height()/m.width()),h.afterCommand(g)}},D=function(b){var c=a(b.target).closest("[data-event]");c.length&&b.preventDefault()},E=function(b){var c=a(b.target).closest("[data-event]");if(c.length){var d=c.attr("data-event"),e=c.attr("data-value"),f=c.attr("data-hide"),j=p(b.target);b.preventDefault();var l;if(-1!==a.inArray(d,["resize","floatMe","removeMedia"])){var m=j.handle().find(".note-control-selection");l=a(m.data("target"))}if(f&&c.parents(".popover").hide(),h[d]){var n=j.editable();n.trigger("focus"),h[d](n,e,l)}else r[d]&&r[d].call(this,j);if(-1!==a.inArray(d,["backColor","foreColor"])){var o=j.editor().data("options",o),q=o.airMode?k:i;q.updateRecentColor(g.head(c),d,e)}z(b)}},F=24,G=function(a){a.preventDefault(),a.stopPropagation();var b=p(a.target).editable(),c=b.offset().top-d.scrollTop(),e=p(a.currentTarget||a.target),f=e.editor().data("options");d.on("mousemove",function(a){var d=a.clientY-(c+F);d=f.minHeight>0?Math.max(d,f.minHeight):d,d=f.maxHeight>0?Math.min(d,f.maxHeight):d,b.height(d)}).one("mouseup",function(){d.off("mousemove")})},H=18,I=function(b,c){var d,e=a(b.target.parentNode),f=e.next(),g=e.find(".note-dimension-picker-mousecatcher"),h=e.find(".note-dimension-picker-highlighted"),i=e.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var j=a(b.target).offset();d={x:b.pageX-j.left,y:b.pageY-j.top}}else d={x:b.offsetX,y:b.offsetY};var k={c:Math.ceil(d.x/H)||1,r:Math.ceil(d.y/H)||1};h.css({width:k.c+"em",height:k.r+"em"}),g.attr("data-value",k.c+"x"+k.r),3<k.c&&k.c<c.insertTableMaxSize.col&&i.css({width:k.c+1+"em"}),3<k.r&&k.r<c.insertTableMaxSize.row&&i.css({height:k.r+1+"em"}),f.html(k.c+" x "+k.r)},J=function(a,b){b?d.on("drop",function(a){a.preventDefault()}):K(a)},K=function(b){var c=a(),e=b.dropzone,f=b.dropzone.find(".note-dropzone-message");d.on("dragenter",function(a){var d=b.editor.hasClass("codeview");d||c.length||(b.editor.addClass("dragover"),e.width(b.editor.width()),e.height(b.editor.height()),f.text("Drag Image Here")),c=c.add(a.target)}).on("dragleave",function(a){c=c.not(a.target),c.length||b.editor.removeClass("dragover")}).on("drop",function(){c=a(),b.editor.removeClass("dragover")}),e.on("dragenter",function(){e.addClass("hover"),f.text("Drop Image")}).on("dragleave",function(){e.removeClass("hover"),f.text("Drag Image Here")}),e.on("drop",function(a){a.preventDefault();var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=p(a.currentTarget||a.target);c.editable().focus(),q(c.editable(),b.files)}}).on("dragover",!1)};this.bindKeyMap=function(a,b){var c=a.editor,d=a.editable;a=p(d),d.on("keydown",function(e){var f=[];e.metaKey&&f.push("CMD"),e.ctrlKey&&!e.altKey&&f.push("CTRL"),e.shiftKey&&f.push("SHIFT");var g=m.nameFromCode[e.keyCode];g&&f.push(g);var i=b[f.join("+")];i?(e.preventDefault(),h[i]?h[i](d,c.data("options")):r[i]&&r[i].call(this,a)):m.isEdit(e.keyCode)&&h.afterCommand(d)})},this.attach=function(a,b){this.bindKeyMap(a,b.keyMap[e.isMac?"mac":"pc"]),a.editable.on("mousedown",u),a.editable.on("keyup mouseup",z),a.editable.on("scroll",A),a.editable.on("paste",B),a.handle.on("mousedown",C),a.popover.on("click",E),a.popover.on("mousedown",D),b.airMode||(J(a,b.disableDragAndDrop),a.toolbar.on("click",E),a.toolbar.on("mousedown",D),b.disableResizeEditor||a.statusbar.on("mousedown",G));var c=b.airMode?a.popover:a.toolbar,d=c.find(".note-dimension-picker-mousecatcher");d.css({width:b.insertTableMaxSize.col+"em",height:b.insertTableMaxSize.row+"em"}).on("mousemove",function(a){I(a,b)}),a.editor.data("options",b),b.styleWithSpan&&!e.isMSIE&&setTimeout(function(){document.execCommand("styleWithCSS",0,!0)},0);var f=new t(a.editable);if(a.editable.data("NoteHistory",f),b.onenter&&a.editable.keypress(function(a){a.keyCode===m.ENTER&&b.onenter(a)}),b.onfocus&&a.editable.focus(b.onfocus),b.onblur&&a.editable.blur(b.onblur),b.onkeyup&&a.editable.keyup(b.onkeyup),b.onkeydown&&a.editable.keydown(b.onkeydown),b.onpaste&&a.editable.on("paste",b.onpaste),b.onToolbarClick&&a.toolbar.click(b.onToolbarClick),b.onChange){var g=function(){h.triggerOnChange(a.editable)};if(e.isMSIE){var i="DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted";a.editable.on(i,g)}else a.editable.on("input",g)}a.editable.data("callbacks",{onChange:b.onChange,onAutoSave:b.onAutoSave,onImageUpload:b.onImageUpload,onImageUploadError:b.onImageUploadError,onFileUpload:b.onFileUpload,onFileUploadError:b.onFileUpload})},this.dettach=function(a,b){a.editable.off(),a.popover.off(),a.handle.off(),a.dialog.off(),b.airMode||(a.dropzone.off(),a.toolbar.off(),a.statusbar.off())}},A=function(){var b=function(a,b){var c=b.event,d=b.value,e=b.title,f=b.className,g=b.dropdown,h=b.hide;return'<button type="button" class="btn btn-default btn-sm btn-small'+(f?" "+f:"")+(g?" dropdown-toggle":"")+'"'+(g?' data-toggle="dropdown"':"")+(e?' title="'+e+'"':"")+(c?' data-event="'+c+'"':"")+(d?" data-value='"+d+"'":"")+(h?" data-hide='"+h+"'":"")+' tabindex="-1">'+a+(g?' <span class="caret"></span>':"")+"</button>"+(g||"")},c=function(a,c){var d='<i class="'+a+'"></i>';return b(d,c)},d=function(a,b){return'<div class="'+a+' popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content">'+b+"</div></div>"},g=function(a,b,c,d){return'<div class="'+a+' modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content">'+(b?'<div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">&times;</button><h4 class="modal-title">'+b+"</h4></div>":"")+'<form class="note-modal-form"><div class="modal-body"><div class="row-fluid">'+c+"</div></div>"+(d?'<div class="modal-footer">'+d+"</div>":"")+"</form></div></div></div>"},h={picture:function(a){return c("fa fa-picture-o icon-picture",{event:"showImageDialog",title:a.image.image,hide:!0})},link:function(a){return c("fa fa-link icon-link",{event:"showLinkDialog",title:a.link.link,hide:!0})},video:function(a){return c("fa fa-youtube-play icon-play",{event:"showVideoDialog",title:a.video.video,hide:!0})},table:function(a){var b='<ul class="note-table dropdown-menu"><div class="note-dimension-picker"><div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div><div class="note-dimension-picker-highlighted"></div><div class="note-dimension-picker-unhighlighted"></div></div><div class="note-dimension-display"> 1 x 1 </div></ul>';return c("fa fa-table icon-table",{title:a.table.table,dropdown:b})},style:function(a,b){var d=b.styleTags.reduce(function(b,c){var d=a.style["p"===c?"normal":c];return b+'<li><a data-event="formatBlock" href="#" data-value="'+c+'">'+("p"===c||"pre"===c?d:"<"+c+">"+d+"</"+c+">")+"</a></li>"},"");return c("fa fa-magic icon-magic",{title:a.style.style,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},fontname:function(a,c){var d=c.fontNames.reduce(function(a,b){return e.isFontInstalled(b)?a+'<li><a data-event="fontName" href="#" data-value="'+b+'"><i class="fa fa-check icon-ok"></i> '+b+"</a></li>":a},""),f='<span class="note-current-fontname">'+c.defaultFontName+"</span>";return b(f,{title:a.font.name,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},fontsize:function(a,c){var d=c.fontSizes.reduce(function(a,b){return a+'<li><a data-event="fontSize" href="#" data-value="'+b+'"><i class="fa fa-check icon-ok"></i> '+b+"</a></li>"},""),e='<span class="note-current-fontsize">11</span>';return b(e,{title:a.font.size,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},color:function(a){var c='<i class="fa fa-font icon-font" style="color:black;background-color:yellow;"></i>',d=b(c,{className:"note-recent-color",title:a.color.recent,event:"color",value:'{"backColor":"yellow"}'}),e='<ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">'+a.color.background+'</div><div class="note-color-reset" data-event="backColor" data-value="inherit" title="'+a.color.transparent+'">'+a.color.setTransparent+'</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">'+a.color.foreground+'</div><div class="note-color-reset" data-event="foreColor" data-value="inherit" title="'+a.color.reset+'">'+a.color.resetToDefault+'</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>',f=b("",{title:a.color.more,dropdown:e});return d+f},bold:function(a){return c("fa fa-bold icon-bold",{event:"bold",title:a.font.bold})},italic:function(a){return c("fa fa-italic icon-italic",{event:"italic",title:a.font.italic})},underline:function(a){return c("fa fa-underline icon-underline",{event:"underline",title:a.font.underline})},strikethrough:function(a){return c("fa fa-strikethrough icon-strikethrough",{event:"strikethrough",title:a.font.strikethrough})},superscript:function(a){return c("fa fa-superscript icon-superscript",{event:"superscript",title:a.font.superscript})},subscript:function(a){return c("fa fa-subscript icon-subscript",{event:"subscript",title:a.font.subscript})},clear:function(a){return c("fa fa-eraser icon-eraser",{event:"removeFormat",title:a.font.clear})},ul:function(a){return c("fa fa-list-ul icon-list-ul",{event:"insertUnorderedList",title:a.lists.unordered})},ol:function(a){return c("fa fa-list-ol icon-list-ol",{event:"insertOrderedList",title:a.lists.ordered})},paragraph:function(a){var b=c("fa fa-align-left icon-align-left",{title:a.paragraph.left,event:"justifyLeft"}),d=c("fa fa-align-center icon-align-center",{title:a.paragraph.center,event:"justifyCenter"}),e=c("fa fa-align-right icon-align-right",{title:a.paragraph.right,event:"justifyRight"}),f=c("fa fa-align-justify icon-align-justify",{title:a.paragraph.justify,event:"justifyFull"}),g=c("fa fa-outdent icon-indent-left",{title:a.paragraph.outdent,event:"outdent"}),h=c("fa fa-indent icon-indent-right",{title:a.paragraph.indent,event:"indent"}),i='<div class="dropdown-menu"><div class="note-align btn-group">'+b+d+e+f+'</div><div class="note-list btn-group">'+h+g+"</div></div>";return c("fa fa-align-left icon-align-left",{title:a.paragraph.paragraph,dropdown:i})},height:function(a,b){var d=b.lineHeights.reduce(function(a,b){return a+'<li><a data-event="lineHeight" href="#" data-value="'+parseFloat(b)+'"><i class="fa fa-check icon-ok"></i> '+b+"</a></li>"},"");return c("fa fa-text-height icon-text-height",{title:a.font.height,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},help:function(a){return c("fa fa-question icon-question",{event:"showHelpDialog",title:a.options.help,hide:!0})},fullscreen:function(a){return c("fa fa-arrows-alt icon-fullscreen",{event:"fullscreen",title:a.options.fullscreen})},codeview:function(a){return c("fa fa-code icon-code",{event:"codeview",title:a.options.codeview})},undo:function(a){return c("fa fa-undo icon-undo",{event:"undo",title:a.history.undo})},redo:function(a){return c("fa fa-repeat icon-repeat",{event:"redo",title:a.history.redo})},hr:function(a){return c("fa fa-minus icon-hr",{event:"insertHorizontalRule",title:a.hr.insert})}},i=function(a,e){var f=function(){var b=c("fa fa-edit icon-edit",{title:a.link.edit,event:"showLinkDialog",hide:!0}),e=c("fa fa-unlink icon-unlink",{title:a.link.unlink,event:"unlink"}),f='<a href="http://www.google.com" target="_blank">www.google.com</a>&nbsp;&nbsp;<div class="note-insert btn-group">'+b+e+"</div>";return d("note-link-popover",f)},g=function(){var e=b('<span class="note-fontsize-10">100%</span>',{title:a.image.resizeFull,event:"resize",value:"1"}),f=b('<span class="note-fontsize-10">50%</span>',{title:a.image.resizeHalf,event:"resize",value:"0.5"}),g=b('<span class="note-fontsize-10">25%</span>',{title:a.image.resizeQuarter,event:"resize",value:"0.25"}),h=c("fa fa-align-left icon-align-left",{title:a.image.floatLeft,event:"floatMe",value:"left"}),i=c("fa fa-align-right icon-align-right",{title:a.image.floatRight,event:"floatMe",value:"right"}),j=c("fa fa-align-justify icon-align-justify",{title:a.image.floatNone,event:"floatMe",value:"none"}),k=c("fa fa-trash-o icon-trash",{title:a.image.remove,event:"removeMedia",value:"none"}),l='<div class="btn-group">'+e+f+g+'</div><div class="btn-group">'+h+i+j+'</div><div class="btn-group">'+k+"</div>";return d("note-image-popover",l)},i=function(){for(var b="",c=0,f=e.airPopover.length;f>c;c++){var g=e.airPopover[c];b+='<div class="note-'+g[0]+' btn-group">';for(var i=0,j=g[1].length;j>i;i++)b+=h[g[1][i]](a,e);b+="</div>"}return d("note-air-popover",b)};return'<div class="note-popover">'+f()+g()+(e.airMode?i():"")+"</div>"},k=function(){return'<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="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div>'},l=function(a,b){return'<table class="note-shortcut"><thead><tr><th></th><th>'+a+"</th></tr></thead><tbody>"+b+"</tbody></table>"},m=function(a){var b="<tr><td>⌘ + B</td><td>"+a.font.bold+"</td></tr><tr><td>⌘ + I</td><td>"+a.font.italic+"</td></tr><tr><td>⌘ + U</td><td>"+a.font.underline+"</td></tr><tr><td>⌘ + ⇧ + S</td><td>"+a.font.strikethrough+"</td></tr><tr><td>⌘ + \\</td><td>"+a.font.clear+"</td></tr>";return l(a.shortcut.textFormatting,b)},n=function(a){var b="<tr><td>⌘ + Z</td><td>"+a.history.undo+"</td></tr><tr><td>⌘ + ⇧ + Z</td><td>"+a.history.redo+"</td></tr><tr><td>⌘ + ]</td><td>"+a.paragraph.indent+"</td></tr><tr><td>⌘ + [</td><td>"+a.paragraph.outdent+"</td></tr><tr><td>⌘ + ENTER</td><td>"+a.hr.insert+"</td></tr>";return l(a.shortcut.action,b)},o=function(a){var b="<tr><td>⌘ + ⇧ + L</td><td>"+a.paragraph.left+"</td></tr><tr><td>⌘ + ⇧ + E</td><td>"+a.paragraph.center+"</td></tr><tr><td>⌘ + ⇧ + R</td><td>"+a.paragraph.right+"</td></tr><tr><td>⌘ + ⇧ + J</td><td>"+a.paragraph.justify+"</td></tr><tr><td>⌘ + ⇧ + NUM7</td><td>"+a.lists.ordered+"</td></tr><tr><td>⌘ + ⇧ + NUM8</td><td>"+a.lists.unordered+"</td></tr>";return l(a.shortcut.paragraphFormatting,b)},p=function(a){var b="<tr><td>⌘ + NUM0</td><td>"+a.style.normal+"</td></tr><tr><td>⌘ + NUM1</td><td>"+a.style.h1+"</td></tr><tr><td>⌘ + NUM2</td><td>"+a.style.h2+"</td></tr><tr><td>⌘ + NUM3</td><td>"+a.style.h3+"</td></tr><tr><td>⌘ + NUM4</td><td>"+a.style.h4+"</td></tr><tr><td>⌘ + NUM5</td><td>"+a.style.h5+"</td></tr><tr><td>⌘ + NUM6</td><td>"+a.style.h6+"</td></tr>";return l(a.shortcut.documentStyle,b)},q=function(a,b){var c=b.extraKeys,d="";for(var e in c)c.hasOwnProperty(e)&&(d+="<tr><td>"+e+"</td><td>"+c[e]+"</td></tr>");return l(a.shortcut.extraKeys,d)},r=function(a,b){var c='<table class="note-shortcut-layout"><tbody><tr><td>'+n(a,b)+"</td><td>"+m(a,b)+"</td></tr><tr><td>"+p(a,b)+"</td><td>"+o(a,b)+"</td></tr>";return b.extraKeys&&(c+='<tr><td colspan="2">'+q(a,b)+"</td></tr>"),c+="</tbody></table>"},s=function(a){return a.replace(/⌘/g,"Ctrl").replace(/⇧/g,"Shift")},t=function(a,b){var c=function(){var b='<div class="note-group-select-from-files"><h5>'+a.image.selectFromFiles+'</h5><input class="note-image-input" type="file" name="files" accept="image/*" /></div><h5>'+a.image.url+'</h5><input class="note-image-url form-control span12" type="text" />',c='<button href="#" class="btn btn-primary note-image-btn disabled" disabled>'+a.image.insert+"</button>";return g("note-image-dialog",a.image.insert,b,c)},d=function(){var c='<div class="form-group"><label>'+a.link.textToDisplay+'</label><input class="note-link-text form-control span12" type="text" /></div><div class="form-group"><label>'+a.link.url+'</label><input class="note-link-url form-control span12" type="text" /></div>'+(b.disableLinkTarget?"":'<div class="checkbox"><label><input type="checkbox" checked> '+a.link.openInNewWindow+"</label></div>"),d='<button href="#" class="btn btn-primary note-link-btn disabled" disabled>'+a.link.insert+"</button>";return g("note-link-dialog",a.link.insert,c,d)},f=function(){var b='<div class="form-group"><label>'+a.video.url+'</label>&nbsp;<small class="text-muted">'+a.video.providers+'</small><input class="note-video-url form-control span12" type="text" /></div>',c='<button href="#" class="btn btn-primary note-video-btn disabled" disabled>'+a.video.insert+"</button>";return g("note-video-dialog",a.video.insert,b,c)},h=function(){var c='<a class="modal-close pull-right" aria-hidden="true" tabindex="-1">'+a.shortcut.close+'</a><div class="title">'+a.shortcut.shortcuts+"</div>"+(e.isMac?r(a,b):s(r(a,b)))+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote 0.5.9</a> · <a href="//github.com/HackerWins/summernote" target="_blank">Project</a> · <a href="//github.com/HackerWins/summernote/issues" target="_blank">Issues</a></p>';return g("note-help-dialog","",c,"")};return'<div class="note-dialog">'+c()+d()+f()+h()+"</div>"},u=function(){return'<div class="note-resizebar"><div class="note-icon-bar"></div><div class="note-icon-bar"></div><div class="note-icon-bar"></div></div>'},v=function(a){return e.isMac&&(a=a.replace("CMD","⌘").replace("SHIFT","⇧")),a.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]")},w=function(b,c,d){var e=f.invertObject(c),g=b.find("button");g.each(function(b,c){var d=a(c),f=e[d.data("event")];f&&d.attr("title",function(a,b){return b+" ("+v(f)+")"})}).tooltip({container:"body",trigger:"hover",placement:d||"top"}).on("click",function(){a(this).tooltip("hide")})},x=function(b,c){var d=c.colors;b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),e=[],f=0,g=d.length;g>f;f++){for(var h=d[f],i=[],j=0,k=h.length;k>j;j++){var l=h[j];i.push(['<button type="button" class="note-color-btn" style="background-color:',l,';" data-event="',c,'" data-value="',l,'" title="',l,'" data-toggle="button" tabindex="-1"></button>'].join(""))}e.push('<div class="note-color-row">'+i.join("")+"</div>")}b.html(e.join(""))})};this.createLayoutByAirMode=function(b,c){var d=c.keyMap[e.isMac?"mac":"pc"],g=a.summernote.lang[c.lang],h=f.uniqueId();b.addClass("note-air-editor note-editable"),b.attr({id:"note-editor-"+h,contentEditable:!0});var j=document.body,l=a(i(g,c));l.addClass("note-air-layout"),l.attr("id","note-popover-"+h),l.appendTo(j),w(l,d),x(l,c);var m=a(k());m.addClass("note-air-layout"),m.attr("id","note-handle-"+h),m.appendTo(j);var n=a(t(g,c));n.addClass("note-air-layout"),n.attr("id","note-dialog-"+h),n.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),n.appendTo(j)},this.createLayoutByFrame=function(b,c){var d=a('<div class="note-editor"></div>');c.width&&d.width(c.width),c.height>0&&a('<div class="note-statusbar">'+(c.disableResizeEditor?"":u())+"</div>").prependTo(d);var f=!b.is(":disabled"),g=a('<div class="note-editable" contentEditable="'+f+'"></div>').prependTo(d);c.height&&g.height(c.height),c.direction&&g.attr("dir",c.direction),g.html(j.html(b)||j.emptyPara),a('<textarea class="note-codable"></textarea>').prependTo(d);for(var l=a.summernote.lang[c.lang],m="",n=0,o=c.toolbar.length;o>n;n++){var p=c.toolbar[n][0],q=c.toolbar[n][1];m+='<div class="note-'+p+' btn-group">';for(var r=0,s=q.length;s>r;r++)a.isFunction(h[q[r]])&&(m+=h[q[r]](l,c));m+="</div>"}m='<div class="note-toolbar btn-toolbar">'+m+"</div>";var v=a(m).prependTo(d),y=c.keyMap[e.isMac?"mac":"pc"];x(v,c),w(v,y,"bottom");var z=a(i(l,c)).prependTo(d);x(z,c),w(z,y),a(k()).prependTo(d);var A=a(t(l,c)).prependTo(d);A.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),a('<div class="note-dropzone"><div class="note-dropzone-message"></div></div>').prependTo(d),d.insertAfter(b),b.hide()},this.noteEditorFromHolder=function(b){return b.hasClass("note-air-editor")?b:b.next().hasClass("note-editor")?b.next():a()},this.createLayout=function(a,b){this.noteEditorFromHolder(a).length||(b.airMode?this.createLayoutByAirMode(a,b):this.createLayoutByFrame(a,b))},this.layoutInfoFromHolder=function(a){var b=this.noteEditorFromHolder(a);if(b.length){var c=j.buildLayoutInfo(b);for(var d in c)c.hasOwnProperty(d)&&(c[d]=c[d].call());return c}},this.removeLayout=function(a,b,c){c.airMode?(a.removeClass("note-air-editor note-editable").removeAttr("id contentEditable"),b.popover.remove(),b.handle.remove(),b.dialog.remove()):(a.html(b.editable.html()),b.editor.remove(),a.show())}};a.summernote=a.summernote||{},a.extend(a.summernote,k);var B=new A,C=new z;a.fn.extend({summernote:function(b){if(b=a.extend({},a.summernote.options,b),this.each(function(c,d){var e=a(d);B.createLayout(e,b);var f=B.layoutInfoFromHolder(e);C.attach(f,b),j.isTextarea(e[0])&&e.closest("form").submit(function(){e.val(e.code())})}),this.first().length&&b.focus){var c=B.layoutInfoFromHolder(this.first());c.editable.focus()}return this.length&&b.oninit&&b.oninit(),this},code:function(b){if(void 0===b){var c=this.first();if(!c.length)return;var d=B.layoutInfoFromHolder(c);if(d&&d.editable){var f=d.editor.hasClass("codeview");return f&&e.hasCodeMirror&&d.codable.data("cmEditor").save(),f?d.codable.val():d.editable.html()}return j.isTextarea(c[0])?c.val():c.html()}return this.each(function(c,d){var e=B.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)}),this},destroy:function(){return this.each(function(b,c){var d=a(c),e=B.layoutInfoFromHolder(d);if(e&&e.editable){var f=e.editor.data("options");C.dettach(e,f),B.removeLayout(d,e,f)}}),this}})});
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(a,b){var c,d,e=this.length>>>0,f=!1;for(1<arguments.length&&(d=b,f=!0),c=0;e>c;++c)this.hasOwnProperty(c)&&(f?d=a(d,this[c],c,this):(d=this[c],f=!0));if(!f)throw new TypeError("Reduce of empty array with no initial value");return d}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d});var b,c="function"==typeof define&&define.amd,d=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},e={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:navigator.userAgent.indexOf("MSIE")>-1||navigator.userAgent.indexOf("Trident")>-1,isFF:navigator.userAgent.indexOf("Firefox")>-1,jqueryVersion:parseFloat(a.fn.jquery),isSupportAmd:c,hasCodeMirror:c?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:d,isW3CRangeSupport:!!document.createRange},f=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};return{eq:b,eq2:c,peq2:d,ok:e,fail:f,self:i,not:g,and:h,uniqueId:k,rect2bnd:l,invertObject:m}}(),g=function(){var b=function(a){return a[0]},c=function(a){return a[a.length-1]},d=function(a){return a.slice(0,a.length-1)},e=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-1!==a.inArray(c,b)},j=function(a,b){return b=b||f.self,a.reduce(function(a,c){return a+b(c)},0)},k=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},l=function(a,d){if(!a.length)return[];var f=e(a);return f.reduce(function(a,b){var e=c(a);return d(c(e),b)?e[e.length]=b:a[a.length]=[b],a},[[b(a)]])},m=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b},n=function(a){for(var b=[],c=0,d=a.length;d>c;c++)i(b,a[c])||b.push(a[c]);return b},o=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c+1]},p=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c-1]};return{head:b,last:c,initial:d,tail:e,prev:p,next:o,find:g,contains:i,all:h,sum:j,from:k,clusterBy:l,compact:m,unique:n}}(),h=String.fromCharCode(160),i="",j=function(){var b=function(b){return b&&a(b).hasClass("note-editable")},c=function(b){return b&&a(b).hasClass("note-control-sizing")},d=function(b){var c;if(b.hasClass("note-air-editor")){var d=g.last(b.attr("id").split("-"));return c=function(b){return function(){return a(b+d)}},{editor:function(){return b},editable:function(){return b},popover:c("#note-popover-"),handle:c("#note-handle-"),dialog:c("#note-dialog-")}}return c=function(a){return function(){return b.find(a)}},{editor:function(){return b},dropzone:c(".note-dropzone"),toolbar:c(".note-toolbar"),editable:c(".note-editable"),codable:c(".note-codable"),statusbar:c(".note-statusbar"),popover:c(".note-popover"),handle:c(".note-handle"),dialog:c(".note-dialog")}},k=function(a){return a=a.toUpperCase(),function(b){return b&&b.nodeName.toUpperCase()===a}},l=function(a){return a&&3===a.nodeType},m=function(a){return a&&/^BR|^IMG|^HR/.test(a.nodeName.toUpperCase())},n=function(a){return b(a)?!1:a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName.toUpperCase())},o=k("LI"),p=function(a){return n(a)&&!o(a)},q=function(a){return!u(a)&&!r(a)&&!n(a)},r=function(a){return a&&/^UL|^OL/.test(a.nodeName.toUpperCase())},s=function(a){return a&&/^TD|^TH/.test(a.nodeName.toUpperCase())},t=k("BLOCKQUOTE"),u=function(a){return s(a)||t(a)||b(a)},v=k("A"),w=function(a){return q(a)&&!!D(a,n)},x=function(a){return q(a)&&!D(a,n)},y=k("BODY"),z=e.isMSIE?"&nbsp;":"<br>",A=function(a){return l(a)?a.nodeValue.length:a.childNodes.length},B=function(a){var b=A(a);return 0===b?!0:j.isText(a)||1!==b||a.innerHTML!==z?!1:!0},C=function(a){m(a)||A(a)||(a.innerHTML=z)},D=function(a,c){for(;a;){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},E=function(a,c){c=c||f.fail;var d=[];return D(a,function(a){return b(a)||d.push(a),c(a)}),d},F=function(a,b){var c=E(a);return g.last(c.filter(b))},G=function(b,c){for(var d=E(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},H=function(a,b){b=b||f.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.previousSibling;return c},I=function(a,b){b=b||f.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.nextSibling;return c},J=function(a,b){var c=[];return b=b||f.ok,function d(e){a!==e&&b(e)&&c.push(e);for(var f=0,g=e.childNodes.length;g>f;f++)d(e.childNodes[f])}(a),c},K=function(b,c){var d=b.parentNode,e=a("<"+c+">")[0];return d.insertBefore(e,b),e.appendChild(b),e},L=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},M=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},N=function(a){return 0===a.offset},O=function(a){return a.offset===A(a.node)},P=function(a){return N(a)||O(a)},Q=function(a,b){for(;a&&a!==b;){if(0!==S(a))return!1;a=a.parentNode}return!0},R=function(a,b){for(;a&&a!==b;){if(S(a)!==A(a.parentNode)-1)return!1;a=a.parentNode}return!0},S=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},T=function(a){return!!(a&&a.childNodes&&a.childNodes.length)},U=function(a,c){var d,e;if(0===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=S(a.node)}else T(a.node)?(d=a.node.childNodes[a.offset-1],e=A(d)):(d=a.node,e=c?0:a.offset-1);return{node:d,offset:e}},V=function(a,c){var d,e;if(A(a.node)===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=S(a.node)+1}else T(a.node)?(d=a.node.childNodes[a.offset],e=0):(d=a.node,e=c?A(a.node):a.offset+1);return{node:d,offset:e}},W=function(a,b){return a.node===b.node&&a.offset===b.offset},X=function(a){if(l(a.node)||!T(a.node)||B(a.node))return!0;var b=a.node.childNodes[a.offset-1],c=a.node.childNodes[a.offset];return b&&!m(b)||c&&!m(c)?!1:!0},Y=function(a,b){for(;a;){if(b(a))return a;a=U(a)}return null},Z=function(a,b){for(;a;){if(b(a))return a;a=V(a)}return null},$=function(a,b,c,d){for(var e=a;e&&(c(e),!W(e,b));){var f=d&&a.node!==e.node&&b.node!==e.node;e=V(e,f)}},_=function(b,c){var d=E(c,f.eq(b));return a.map(d,S).reverse()},ab=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},bb=function(a,b){if(l(a.node))return N(a)?a.node:O(a)?a.node.nextSibling:a.node.splitText(a.offset);var c=a.node.childNodes[a.offset],d=L(a.node.cloneNode(!1),a.node);return M(d,I(c)),b||(C(a.node),C(d)),d},cb=function(a,b,c){var d=E(b.node,f.eq(a));return d.length?1===d.length?bb(b,c):d.reduce(function(a,d){var e=L(d.cloneNode(!1),d);return a===b.node&&(a=bb(b,c)),M(e,I(a)),c||(C(d),C(e)),e}):null},db=function(a){return document.createElement(a)},eb=function(a){return document.createTextNode(a)},fb=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)}},gb=function(a,c){for(;a&&!b(a)&&c(a);){var d=a.parentNode;fb(a),a=d}},hb=function(a,b){if(a.nodeName.toUpperCase()===b.toUpperCase())return a;var c=db(b);return a.style.cssText&&(c.style.cssText=a.style.cssText),M(c,g.from(a.childNodes)),L(c,a),fb(a),c},ib=k("TEXTAREA"),jb=function(b,c){var d=ib(b[0])?b.val():b.html();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},kb=function(a){var b=a.val();return b.replace(/[\n\r]/g,"")};return{NBSP_CHAR:h,ZERO_WIDTH_NBSP_CHAR:i,blank:z,emptyPara:"<p>"+z+"</p>",isEditable:b,isControlSizing:c,buildLayoutInfo:d,isText:l,isPara:n,isPurePara:p,isInline:q,isBodyInline:x,isBody:y,isParaInline:w,isList:r,isTable:k("TABLE"),isCell:s,isBlockquote:t,isBodyContainer:u,isAnchor:v,isDiv:k("DIV"),isLi:o,isSpan:k("SPAN"),isB:k("B"),isU:k("U"),isS:k("S"),isI:k("I"),isImg:k("IMG"),isTextarea:ib,isEmpty:B,isEmptyAnchor:f.and(v,B),nodeLength:A,isLeftEdgePoint:N,isRightEdgePoint:O,isEdgePoint:P,isLeftEdgeOf:Q,isRightEdgeOf:R,prevPoint:U,nextPoint:V,isSamePoint:W,isVisiblePoint:X,prevPointUntil:Y,nextPointUntil:Z,walkPoint:$,ancestor:D,listAncestor:E,lastAncestor:F,listNext:I,listPrev:H,listDescendant:J,commonAncestor:G,wrap:K,insertAfter:L,appendChildNodes:M,position:S,hasChildren:T,makeOffsetPath:_,fromOffsetPath:ab,splitTree:cb,create:db,createText:eb,remove:fb,removeWhile:gb,replace:hb,html:jb,value:kb}}(),k=function(){var b=function(a,b){var c,d,e=a.parentElement(),f=document.body.createTextRange(),h=g.from(e.childNodes);for(c=0;c<h.length;c++)if(!j.isText(h[c])){if(f.moveToElementText(h[c]),f.compareEndPoints("StartToStart",a)>=0)break;d=h[c]}if(0!==c&&j.isText(h[c-1])){var i=document.body.createTextRange(),k=null;i.moveToElementText(d||e),i.collapse(!d),k=d?d.nextSibling:e.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",i);for(var m=l.text.replace(/[\r\n]/g,"").length;m>k.nodeValue.length&&k.nextSibling;)m-=k.nodeValue.length,k=k.nextSibling;{k.nodeValue}b&&k.nextSibling&&j.isText(k.nextSibling)&&m===k.nodeValue.length&&(m-=k.nodeValue.length,k=k.nextSibling),e=k,c=m}return{cont:e,offset:c}},c=function(a){var b=function(a,c){var d,e;if(j.isText(a)){var h=j.listPrev(a,f.not(j.isText)),i=g.last(h).previousSibling;d=i||a.parentNode,c+=g.sum(g.tail(h),j.nodeLength),e=!i}else{if(d=a.childNodes[c]||a,j.isText(d))return b(d,0);c=0,e=!1}return{node:d,collapseToStart:e,offset:c}},c=document.body.createTextRange(),d=b(a.node,a.offset);return c.moveToElementText(d.node),c.collapse(d.collapseToStart),c.moveStart("character",d.offset),c},d=function(b,h,i,k){this.sc=b,this.so=h,this.ec=i,this.eo=k;var l=function(){if(e.isW3CRangeSupport){var a=document.createRange();return a.setStart(b,h),a.setEnd(i,k),a}var d=c({node:b,offset:h});return d.setEndPoint("EndToEnd",c({node:i,offset:k})),d};this.getPoints=function(){return{sc:b,so:h,ec:i,eo:k}},this.getStartPoint=function(){return{node:b,offset:h}},this.getEndPoint=function(){return{node:i,offset:k}},this.select=function(){var a=l();if(e.isW3CRangeSupport){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select()},this.normalize=function(){var a=function(a){return j.isVisiblePoint(a)||(j.isLeftEdgePoint(a)?a=j.nextPointUntil(a,j.isVisiblePoint):j.isRightEdgePoint(a)&&(a=j.prevPointUntil(a,j.isVisiblePoint))),a},b=a(this.getStartPoint()),c=a(this.getStartPoint());return new d(b.node,b.offset,c.node,c.offset)},this.nodes=function(a,b){a=a||f.ok;var c=b&&b.includeAncestor,d=b&&b.fullyContains,e=this.getStartPoint(),h=this.getEndPoint(),i=[],k=[];return j.walkPoint(e,h,function(b){if(!j.isEditable(b.node)){var e;d?(j.isLeftEdgePoint(b)&&k.push(b.node),j.isRightEdgePoint(b)&&g.contains(k,b.node)&&(e=b.node)):e=c?j.ancestor(b.node,a):b.node,e&&a(e)&&i.push(e)}},!0),g.unique(i)},this.commonAncestor=function(){return j.commonAncestor(b,i)},this.expand=function(a){var c=j.ancestor(b,a),e=j.ancestor(i,a);if(!c&&!e)return new d(b,h,i,k);var f=this.getPoints();return c&&(f.sc=c,f.so=0),e&&(f.ec=e,f.eo=j.nodeLength(e)),new d(f.sc,f.so,f.ec,f.eo)},this.collapse=function(a){return a?new d(b,h,b,h):new d(i,k,i,k)},this.splitText=function(){var a=b===i,c=this.getPoints();return j.isText(i)&&!j.isEdgePoint(this.getEndPoint())&&i.splitText(k),j.isText(b)&&!j.isEdgePoint(this.getStartPoint())&&(c.sc=b.splitText(h),c.so=0,a&&(c.ec=c.sc,c.eo=k-h)),new d(c.sc,c.so,c.ec,c.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var b=this.splitText(),c=b.nodes(null,{fullyContains:!0}),e=j.prevPointUntil(b.getStartPoint(),function(a){return!g.contains(c,a.node)}),f=[];return a.each(c,function(a,b){var c=b.parentNode;e.node!==c&&1===j.nodeLength(c)&&f.push(c),j.remove(b,!1)}),a.each(f,function(a,b){j.remove(b,!1)}),new d(e.node,e.offset,e.node,e.offset)};var m=function(a){return function(){var c=j.ancestor(b,a);return!!c&&c===j.ancestor(i,a)}};this.isOnEditable=m(j.isEditable),this.isOnList=m(j.isList),this.isOnAnchor=m(j.isAnchor),this.isOnCell=m(j.isCell),this.isLeftEdgeOf=function(a){if(!j.isLeftEdgePoint(this.getStartPoint()))return!1;var b=j.ancestor(this.sc,a);return b&&j.isLeftEdgeOf(this.sc,b)},this.isCollapsed=function(){return b===i&&h===k},this.wrapBodyInlineWithPara=function(){if(j.isBodyContainer(b)&&j.isEmpty(b))return b.innerHTML=j.emptyPara,new d(b.firstChild,0);if(j.isParaInline(b)||j.isPara(b))return this.normalize();var a;if(j.isInline(b)){var c=j.listAncestor(b,f.not(j.isInline));a=g.last(c),j.isInline(a)||(a=c[c.length-2]||b.childNodes[h])}else a=b.childNodes[h-1];var e=j.listPrev(a,j.isParaInline).reverse();if(e=e.concat(j.listNext(a.nextSibling,j.isParaInline)),e.length){var i=j.wrap(g.head(e),"p");j.appendChildNodes(i,g.tail(e))}return this.normalize()},this.insertNode=function(a,b){var c,d,e,f=this.wrapBodyInlineWithPara(),h=f.getStartPoint();if(b)d=j.isPara(h.node)?h.node:h.node.parentNode,e=j.isPara(h.node)?h.node.childNodes[h.offset]:j.splitTree(h.node,h);else{var i=j.listAncestor(h.node,j.isBodyContainer),k=g.last(i)||h.node;j.isBodyContainer(k)?(c=i[i.length-2],d=k):(c=k,d=c.parentNode),e=c&&j.splitTree(c,h)}return e?e.parentNode.insertBefore(a,e):d.appendChild(a),a},this.toString=function(){var a=l();return e.isW3CRangeSupport?a.toString():a.text},this.bookmark=function(a){return{s:{path:j.makeOffsetPath(a,b),offset:h},e:{path:j.makeOffsetPath(a,i),offset:k}}},this.getClientRects=function(){var a=l();return a.getClientRects()}};return{create:function(a,c,f,g){if(arguments.length)2===arguments.length&&(f=a,g=c);else if(e.isW3CRangeSupport){var h=document.getSelection();if(0===h.rangeCount)return null;if(j.isBody(h.anchorNode))return null;var i=h.getRangeAt(0);a=i.startContainer,c=i.startOffset,f=i.endContainer,g=i.endOffset}else{var k=document.selection.createRange(),l=k.duplicate();l.collapse(!1);var m=k;m.collapse(!0);var n=b(m,!0),o=b(l,!1);j.isText(n.node)&&j.isLeftEdgePoint(n)&&j.isTextNode(o.node)&&j.isRightEdgePoint(o)&&o.node.nextSibling===n.node&&(n=o),a=n.cont,c=n.offset,f=o.cont,g=o.offset}return new d(a,c,f,g)},createFromNode:function(a){return this.create(a,0,a,1)},createFromBookmark:function(a,b){var c=j.fromOffsetPath(a,b.s.path),e=b.s.offset,f=j.fromOffsetPath(a,b.e.path),g=b.e.offset;return new d(c,e,f,g)}}}(),l={version:"0.6.0",options:{width:null,height:null,minHeight:null,maxHeight:null,focus:!1,tabsize:4,styleWithSpan:!0,disableLinkTarget:!1,disableDragAndDrop:!1,disableResizeEditor:!1,shortcuts:!0,placeholder:!1,codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},lang:"en-US",direction:null,toolbar:[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","hr"]],["view",["fullscreen","codeview"]],["help",["help"]]],airMode:!1,airPopover:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]],styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],defaultFontName:"Helvetica Neue",fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],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"],insertTableMaxSize:{col:10,row:10},maximumImageFileSize:null,oninit:null,onfocus:null,onblur:null,onenter:null,onkeyup:null,onkeydown:null,onImageUpload:null,onImageUploadError:null,onToolbarClick:null,onsubmit:null,onCreateLink:function(a){return-1!==a.indexOf("@")&&-1===a.indexOf(":")?a="mailto:"+a:-1===a.indexOf("://")&&(a="http://"+a),a},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":"showLinkDialog"},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":"showLinkDialog"}}},lang:{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family"},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 here",dropImage:"Drop image",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image"},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"},history:{undo:"Undo",redo:"Redo"}}}},m=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){a("<img>").one("load",function(){d.resolve(a(this))}).one("error abort",function(){d.reject(a(this).detach())}).css({display:"none"}).appendTo(document.body).attr("src",b).attr("data-filename",c)}).promise()};return{readFileAsDataURL:b,createImage:c}}(),n={isEdit:function(a){return g.contains([8,9,13,32],a)},nameFromCode:{8:"BACKSPACE",9:"TAB",13:"ENTER",32:"SPACE",48:"NUM0",49:"NUM1",50:"NUM2",51:"NUM3",52:"NUM4",53:"NUM5",54:"NUM6",55:"NUM7",56:"NUM8",66:"B",69:"E",73:"I",74:"J",75:"K",76:"L",82:"R",83:"S",85:"U",89:"Y",90:"Z",191:"SLASH",219:"LEFTBRACKET",220:"BACKSLASH",221:"RIGHTBRACKET"}},o=function(){var b=function(b,c){if(e.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.stylePara=function(b,c){a.each(b.nodes(j.isPara,{includeAncestor:!0}),function(b,d){a(d).css(c)})},this.current=function(c,d){var e=a(j.isText(c.sc)?c.sc.parentNode:c.sc),f=["font-family","font-size","text-align","list-style-type","line-height"],g=b(e,f)||{};if(g["font-size"]=parseInt(g["font-size"],10),g["font-bold"]=document.queryCommandState("bold")?"bold":"normal",g["font-italic"]=document.queryCommandState("italic")?"italic":"normal",g["font-underline"]=document.queryCommandState("underline")?"underline":"normal",g["font-strikethrough"]=document.queryCommandState("strikeThrough")?"strikethrough":"normal",g["font-superscript"]=document.queryCommandState("superscript")?"superscript":"normal",g["font-subscript"]=document.queryCommandState("subscript")?"subscript":"normal",c.isOnList()){var h=["circle","disc","disc-leading-zero","square"],i=a.inArray(g["list-style-type"],h)>-1;g["list-style"]=i?"unordered":"ordered"}else g["list-style"]="none";var k=j.ancestor(c.sc,j.isPara);if(k&&k.style["line-height"])g["line-height"]=k.style.lineHeight;else{var l=parseInt(g["line-height"],10)/parseInt(g["font-size"],10);g["line-height"]=l.toFixed(1)}return g.image=j.isImg(d)&&d,g.anchor=c.isOnAnchor()&&j.ancestor(c.sc,j.isAnchor),g.ancestors=j.listAncestor(c.sc,j.isEditable),g.range=c,g}},p=function(){this.insertTab=function(a,b,c){var d=j.createText(new Array(c+1).join(j.NBSP_CHAR));b=b.deleteContents(),b.insertNode(d,!0),b=k.create(d,c),b.select()},this.insertParagraph=function(){var b=k.create();b=b.deleteContents(),b=b.wrapBodyInlineWithPara();var c,d=j.ancestor(b.sc,j.isPara);if(d){c=j.splitTree(d,b.getStartPoint());var e=j.listDescendant(d,j.isEmptyAnchor);e=e.concat(j.listDescendant(c,j.isEmptyAnchor)),a.each(e,function(a,b){j.remove(b)})}else{var f=b.sc.childNodes[b.so];c=a(j.emptyPara)[0],f?b.sc.insertBefore(c,f):b.sc.appendChild(c)}k.create(c,0).normalize().select()}},q=function(){this.tab=function(a,b){var c=j.ancestor(a.commonAncestor(),j.isCell),d=j.ancestor(c,j.isTable),e=j.listDescendant(d,j.isCell),f=g[b?"prev":"next"](e,c);f&&k.create(f,0).select()},this.createTable=function(b,c){for(var d,e=[],f=0;b>f;f++)e.push("<td>"+j.blank+"</td>");d=e.join("");for(var g,h=[],i=0;c>i;i++)h.push("<tr>"+d+"</tr>");return g=h.join(""),a('<table class="table table-bordered">'+g+"</table>")[0]}},r=function(){this.insertOrderedList=function(){this.toggleList("OL")},this.insertUnorderedList=function(){this.toggleList("UL")},this.indent=function(){var b=this,c=k.create().wrapBodyInlineWithPara(),d=c.nodes(j.isPara,{includeAncestor:!0}),e=g.clusterBy(d,f.peq2("parentNode"));a.each(e,function(c,d){var e=g.head(d);j.isLi(e)?b.wrapList(d,e.parentNode.nodeName):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return(parseInt(b,10)||0)+25})})}),c.select()},this.outdent=function(){var b=this,c=k.create().wrapBodyInlineWithPara(),d=c.nodes(j.isPara,{includeAncestor:!0}),e=g.clusterBy(d,f.peq2("parentNode"));a.each(e,function(c,d){var e=g.head(d);j.isLi(e)?b.releaseList([d]):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return b=parseInt(b,10)||0,b>25?b-25:""})})}),c.select()},this.toggleList=function(b){var c=this,d=k.create().wrapBodyInlineWithPara(),e=d.nodes(j.isPara,{includeAncestor:!0}),h=g.clusterBy(e,f.peq2("parentNode"));if(g.find(e,j.isPurePara))a.each(h,function(a,d){c.wrapList(d,b)});else{var i=d.nodes(j.isList,{includeAncestor:!0}).filter(function(c){return!a.nodeName(c,b)});i.length?a.each(i,function(a,c){j.replace(c,b)}):this.releaseList(h,!0)}d.select()},this.wrapList=function(b,c){var d=g.head(b),e=g.last(b),f=j.isList(d.previousSibling)&&d.previousSibling,h=j.isList(e.nextSibling)&&e.nextSibling,i=f||j.insertAfter(j.create(c||"UL"),e);b=a.map(b,function(a){return j.isPurePara(a)?j.replace(a,"LI"):a}),j.appendChildNodes(i,b),h&&(j.appendChildNodes(i,g.from(h.childNodes)),j.remove(h))},this.releaseList=function(b,c){var d=[];return a.each(b,function(b,e){var f=g.head(e),h=g.last(e),i=c?j.lastAncestor(f,j.isList):f.parentNode,k=i.childNodes.length>1?j.splitTree(i,{node:h.parentNode,offset:j.position(h)+1},!0):null,l=j.splitTree(i,{node:f.parentNode,offset:j.position(f)},!0);e=c?j.listDescendant(l,j.isLi):g.from(l.childNodes).filter(j.isLi),(c||!j.isList(i.parentNode))&&(e=a.map(e,function(a){return j.replace(a,"P")})),a.each(g.from(e).reverse(),function(a,b){j.insertAfter(b,i)});var m=g.compact([i,l,k]);a.each(m,function(b,c){var d=[c].concat(j.listDescendant(c,j.isList));a.each(d.reverse(),function(a,b){j.nodeLength(b)||j.remove(b,!0)})}),d=d.concat(e)}),d}},s=function(){var b=new o,c=new q,d=new p,f=new r;this.createRange=function(a){return a.focus(),k.create()},this.saveRange=function(a,b){a.focus(),a.data("range",k.create()),b&&k.create().collapse().select()},this.restoreRange=function(a){var b=a.data("range");b&&(b.select(),a.focus())},this.currentStyle=function(a){var c=k.create();return c?c.isOnEditable()&&b.current(c,a):!1};var h=this.triggerOnChange=function(a){var b=a.data("callbacks").onChange;b&&b(a.html(),a)};this.undo=function(a){a.data("NoteHistory").undo(),h(a)},this.redo=function(a){a.data("NoteHistory").redo(),h(a)};for(var i=this.afterCommand=function(a){a.data("NoteHistory").recordUndo(),h(a)},l=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule","fontName"],n=0,s=l.length;s>n;n++)this[l[n]]=function(a){return function(b,c){document.execCommand(a,!1,c),i(b)}}(l[n]);this.tab=function(a,b){var e=k.create();e.isCollapsed()&&e.isOnCell()?c.tab(e):(d.insertTab(a,e,b.tabsize),i(a))},this.untab=function(){var a=k.create();a.isCollapsed()&&a.isOnCell()&&c.tab(a,!0)},this.insertParagraph=function(a){d.insertParagraph(a),i(a)},this.insertOrderedList=function(a){f.insertOrderedList(a),i(a)},this.insertUnorderedList=function(a){f.insertUnorderedList(a),i(a)},this.indent=function(a){f.indent(a),i(a)},this.outdent=function(a){f.outdent(a),i(a)},this.insertImage=function(a,b,c){m.createImage(b,c).then(function(b){b.css({display:"",width:Math.min(a.width(),b.width())}),k.create().insertNode(b[0]),i(a)}).fail(function(){var b=a.data("callbacks");b.onImageUploadError&&b.onImageUploadError()})},this.insertNode=function(a,b,c){k.create().insertNode(b,c),i(a)},this.insertText=function(a,b){var c=this.createRange(a).insertNode(j.createText(b),!0);k.create(c,j.nodeLength(c)).select(),i(a)},this.formatBlock=function(a,b){b=e.isMSIE?"<"+b+">":b,document.execCommand("FormatBlock",!1,b),i(a)},this.formatPara=function(a){this.formatBlock(a,"P"),i(a)};for(var n=1;6>=n;n++)this["formatH"+n]=function(a){return function(b){this.formatBlock(b,"H"+a)}}(n);this.fontSize=function(a,b){document.execCommand("fontSize",!1,3),e.isFF?a.find("font[size=3]").removeAttr("size").css("font-size",b+"px"):a.find("span").filter(function(){return"medium"===this.style.fontSize}).css("font-size",b+"px"),i(a)},this.lineHeight=function(a,c){b.stylePara(k.create(),{lineHeight:c}),i(a)},this.unlink=function(a){var b=k.create();if(b.isOnAnchor()){var c=j.ancestor(b.sc,j.isAnchor);b=k.createFromNode(c),b.select(),document.execCommand("unlink"),i(a)}},this.createLink=function(b,c,d){var e=c.url,f=c.text,g=c.newWindow,h=c.range;d.onCreateLink&&(e=d.onCreateLink(e)),h=h.deleteContents();var j=h.insertNode(a("<A>"+f+"</A>")[0],!0);a(j).attr({href:e,target:g?"_blank":""}),k.createFromNode(j).select(),i(b)},this.getLinkInfo=function(b){b.focus();var c=k.create().expand(j.isAnchor),d=a(g.head(c.nodes(j.isAnchor)));return{range:c,text:c.toString(),isNewWindow:d.length?"_blank"===d.attr("target"):!0,url:d.length?d.attr("href"):""}},this.color=function(a,b){var c=JSON.parse(b),d=c.foreColor,e=c.backColor;d&&document.execCommand("foreColor",!1,d),e&&document.execCommand("backColor",!1,e),i(a)},this.insertTable=function(a,b){var d=b.split("x"),e=k.create();e=e.deleteContents(),e.insertNode(c.createTable(d[0],d[1])),i(a)},this.floatMe=function(a,b,c){c.css("float",b),i(a)},this.imageShape=function(a,b,c){c.removeClass("img-rounded img-circle img-thumbnail"),b&&c.addClass(b),i(a)},this.resize=function(a,b,c){c.css({width:100*b+"%",height:""}),i(a)},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=function(a,b,c){c.detach(),i(a)}},t=function(a){var b=[],c=-1,d=a[0],e=function(){var b=k.create(),c={s:{path:[0],offset:0},e:{path:[0],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&&k.createFromBookmark(d,b.bookmark).select()};this.undo=function(){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())},this.recordUndo()},u=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).data("value")+""==c+"";this.className=b?"checked":""})},e=function(a,c){var d=b.find(a);d.toggleClass("active",c())},f=b.find(".note-fontname");if(f.length){var h=c["font-family"];h&&(h=g.head(h.split(",")),h=h.replace(/\'/g,""),f.find(".note-current-fontname").text(h),d(f,h))}var i=b.find(".note-fontsize");i.find(".note-current-fontsize").text(c["font-size"]),d(i,parseFloat(c["font-size"]));var j=b.find(".note-height");d(j,parseFloat(c["line-height"])),e('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),e('button[data-event="italic"]',function(){return"italic"===c["font-italic"]}),e('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),e('button[data-event="strikethrough"]',function(){return"strikethrough"===c["font-strikethrough"]}),e('button[data-event="superscript"]',function(){return"superscript"===c["font-superscript"]}),e('button[data-event="subscript"]',function(){return"subscript"===c["font-subscript"]}),e('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),e('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),e('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),e('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),e('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]
}),e('button[data-event="insertOrderedList"]',function(){return"ordered"===c["list-style"]})},this.updateRecentColor=function(b,c,d){var e=a(b).closest(".note-color"),f=e.find(".note-recent-color"),g=JSON.parse(f.attr("data-value"));g[c]=d,f.attr("data-value",JSON.stringify(g));var h="backColor"===c?"background-color":"color";f.find("i").css(h,d)}},v=function(){var a=new u;this.update=function(b,c){a.update(b,c)},this.updateRecentColor=function(b,c,d){a.updateRecentColor(b,c,d)},this.activate=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.deactivate=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")},this.updateFullscreen=function(a,b){var c=a.find('button[data-event="fullscreen"]');c.toggleClass("active",b)},this.updateCodeview=function(a,b){var c=a.find('button[data-event="codeview"]');c.toggleClass("active",b)}},w=function(){var b=new u,c=function(b,c){var d=a(b),e=c?d.offset():d.position(),f=d.outerHeight(!0);return{left:e.left,top:e.top+f}},d=function(a,b){a.css({display:"block",left:b.left,top:b.top})},e=20;this.update=function(h,i,j){b.update(h,i);var k=h.find(".note-link-popover");if(i.anchor){var l=k.find("a"),m=a(i.anchor).attr("href");l.attr("href",m).html(m),d(k,c(i.anchor,j))}else k.hide();var n=h.find(".note-image-popover");i.image?d(n,c(i.image,j)):n.hide();var o=h.find(".note-air-popover");if(j&&!i.range.isCollapsed()){var p=f.rect2bnd(g.last(i.range.getClientRects()));d(o,{left:Math.max(p.left+p.width/2-e,0),top:p.top+p.height})}else o.hide()},this.updateRecentColor=function(a,b,c){a.updateRecentColor(a,b,c)},this.hide=function(a){a.children().hide()}},x=function(){this.update=function(b,c,d){var e=b.find(".note-control-selection");if(c.image){var f=a(c.image),g=d?f.offset():f.position(),h={w:f.outerWidth(!0),h:f.outerHeight(!0)};e.css({display:"block",left:g.left,top:g.top,width:h.w,height:h.h}).data("target",c.image);var i=h.w+"x"+h.h;e.find(".note-control-selection-info").text(i)}else e.hide()},this.hide=function(a){a.children().hide()}},y=function(){var b=function(a,b){a.toggleClass("disabled",!b),a.attr("disabled",!b)};this.showImageDialog=function(c,d){return a.Deferred(function(a){var c=d.find(".note-image-dialog"),e=d.find(".note-image-input"),f=d.find(".note-image-url"),g=d.find(".note-image-btn");c.one("shown.bs.modal",function(){e.replaceWith(e.clone().on("change",function(){a.resolve(this.files),c.modal("hide")}).val("")),g.click(function(b){b.preventDefault(),a.resolve(f.val()),c.modal("hide")}),f.on("keyup paste",function(a){var c;c="paste"===a.type?a.originalEvent.clipboardData.getData("text"):f.val(),b(g,c)}).val("").trigger("focus")}).one("hidden.bs.modal",function(){e.off("change"),f.off("keyup paste"),g.off("click"),"pending"===a.state()&&a.reject()}).modal("show")})},this.showLinkDialog=function(c,d,e){return a.Deferred(function(a){var c=d.find(".note-link-dialog"),f=c.find(".note-link-text"),g=c.find(".note-link-url"),h=c.find(".note-link-btn"),i=c.find("input[type=checkbox]");c.one("shown.bs.modal",function(){f.val(e.text),f.on("input",function(){e.text=f.val()}),e.url||(e.url=e.text,b(h,e.text)),g.on("input",function(){b(h,g.val()),e.text||f.val(g.val())}).val(e.url).trigger("focus").trigger("select"),i.prop("checked",e.newWindow),h.one("click",function(b){b.preventDefault(),a.resolve({range:e.range,url:g.val(),text:f.val(),newWindow:i.is(":checked")}),c.modal("hide")})}).one("hidden.bs.modal",function(){f.off("input"),g.off("input"),h.off("click"),"pending"===a.state()&&a.reject()}).modal("show")}).promise()},this.showHelpDialog=function(b,c){return a.Deferred(function(a){var b=c.find(".note-help-dialog");b.one("hidden.bs.modal",function(){a.resolve()}).modal("show")}).promise()}};e.hasCodeMirror&&(e.isSupportAmd?require(["CodeMirror"],function(a){b=a}):b=window.CodeMirror);var z=function(){var c=a(window),d=a(document),f=a("html, body"),h=new s,i=new v,k=new w,l=new x,o=new y;this.getEditor=function(){return h};var p=function(b){var c=a(b).closest(".note-editor, .note-air-editor, .note-air-layout");if(!c.length)return null;var d;return d=c.is(".note-editor, .note-air-editor")?c:a("#note-editor-"+g.last(c.attr("id").split("-"))),j.buildLayoutInfo(d)},q=function(b,c){var d=b.editor(),e=b.editable(),f=e.data("callbacks"),g=d.data("options");f.onImageUpload?f.onImageUpload(c,h,e):a.each(c,function(a,b){var c=b.name;g.maximumImageFileSize&&g.maximumImageFileSize<b.size?f.onImageUploadError?f.onImageUploadError(g.langInfo.image.maximumFileSizeError):alert(g.langInfo.image.maximumFileSizeError):m.readFileAsDataURL(b).then(function(a){h.insertImage(e,a,c)}).fail(function(){f.onImageUploadError&&f.onImageUploadError()})})},r={showLinkDialog:function(a){var b=a.editor(),c=a.dialog(),d=a.editable(),e=h.getLinkInfo(d),f=b.data("options");h.saveRange(d),o.showLinkDialog(d,c,e).then(function(b){h.restoreRange(d),h.createLink(d,b,f),k.hide(a.popover())}).fail(function(){h.restoreRange(d)})},showImageDialog:function(a){var b=a.dialog(),c=a.editable();h.saveRange(c),o.showImageDialog(c,b).then(function(b){h.restoreRange(c),"string"==typeof b?h.insertImage(c,b):q(a,b)}).fail(function(){h.restoreRange(c)})},showHelpDialog:function(a){var b=a.dialog(),c=a.editable();h.saveRange(c,!0),o.showHelpDialog(c,b).then(function(){h.restoreRange(c)})},fullscreen:function(a){var b=a.editor(),d=a.toolbar(),e=a.editable(),g=a.codable(),h=function(a){e.css("height",a.h),g.css("height",a.h),g.data("cmeditor")&&g.data("cmeditor").setsize(null,a.h)};b.toggleClass("fullscreen");var j=b.hasClass("fullscreen");j?(e.data("orgheight",e.css("height")),c.on("resize",function(){h({h:c.height()-d.outerHeight()})}).trigger("resize"),f.css("overflow","hidden")):(c.off("resize"),h({h:e.data("orgheight")}),f.css("overflow","visible")),i.updateFullscreen(d,j)},codeview:function(a){var c,d,f=a.editor(),g=a.toolbar(),h=a.editable(),m=a.codable(),n=a.popover(),o=a.handle(),p=f.data("options");f.toggleClass("codeview");var q=f.hasClass("codeview");q?(m.val(j.html(h,!0)),m.height(h.height()),i.deactivate(g),k.hide(n),l.hide(o),m.focus(),e.hasCodeMirror&&(c=b.fromTextArea(m[0],p.codemirror),p.codemirror.tern&&(d=new b.TernServer(p.codemirror.tern),c.ternServer=d,c.on("cursorActivity",function(a){d.updateArgHints(a)})),c.setSize(null,h.outerHeight()),m.data("cmEditor",c))):(e.hasCodeMirror&&(c=m.data("cmEditor"),m.val(c.getValue()),c.toTextArea()),h.html(j.value(m)||j.emptyPara),h.height(p.height?m.height():"auto"),i.activate(g),h.focus()),i.updateCodeview(a.toolbar(),q)}},u=function(a){j.isImg(a.target)&&a.preventDefault()},z=function(a){setTimeout(function(){var b=p(a.currentTarget||a.target),c=h.currentStyle(a.target);if(c){var d=b.editor().data("options").airMode;d||i.update(b.toolbar(),c),k.update(b.popover(),c,d),l.update(b.handle(),c,d)}},0)},A=function(a){var b=p(a.currentTarget||a.target);k.hide(b.popover()),l.hide(b.handle())},B=function(a){var b=a.originalEvent.clipboardData;if(b&&b.items&&b.items.length){var c=p(a.currentTarget||a.target),d=c.editable(),e=g.head(b.items),f="file"===e.kind&&-1!==e.type.indexOf("image/");f&&q(c,[e.getAsFile()]),h.afterCommand(d)}},C=function(b){if(j.isControlSizing(b.target)){b.preventDefault(),b.stopPropagation();var c=p(b.target),e=c.handle(),f=c.popover(),g=c.editable(),i=c.editor(),m=e.find(".note-control-selection").data("target"),n=a(m),o=n.offset(),q=d.scrollTop(),r=i.data("options").airMode;d.on("mousemove",function(a){h.resizeTo({x:a.clientX-o.left,y:a.clientY-(o.top-q)},n,!a.shiftKey),l.update(e,{image:m},r),k.update(f,{image:m},r)}).one("mouseup",function(){d.off("mousemove"),h.afterCommand(g)}),n.data("ratio")||n.data("ratio",n.height()/n.width())}},D=function(b){var c=a(b.target).closest("[data-event]");c.length&&b.preventDefault()},E=function(b){var c=a(b.target).closest("[data-event]");if(c.length){var d=c.attr("data-event"),e=c.attr("data-value"),f=c.attr("data-hide"),j=p(b.target);b.preventDefault();var l;if(-1!==a.inArray(d,["resize","floatMe","removeMedia","imageShape"])){var m=j.handle().find(".note-control-selection");l=a(m.data("target"))}if(f&&c.parents(".popover").hide(),h[d]){var n=j.editable();n.trigger("focus"),h[d](n,e,l)}else r[d]?r[d].call(this,j):a.isFunction(a.summernote.pluginEvents[d])&&a.summernote.pluginEvents[d](j,e,l);if(-1!==a.inArray(d,["backColor","foreColor"])){var o=j.editor().data("options",o),q=o.airMode?k:i;q.updateRecentColor(g.head(c),d,e)}z(b)}},F=24,G=function(a){a.preventDefault(),a.stopPropagation();var b=p(a.target).editable(),c=b.offset().top-d.scrollTop(),e=p(a.currentTarget||a.target),f=e.editor().data("options");d.on("mousemove",function(a){var d=a.clientY-(c+F);d=f.minHeight>0?Math.max(d,f.minHeight):d,d=f.maxHeight>0?Math.min(d,f.maxHeight):d,b.height(d)}).one("mouseup",function(){d.off("mousemove")})},H=18,I=function(b,c){var d,e=a(b.target.parentNode),f=e.next(),g=e.find(".note-dimension-picker-mousecatcher"),h=e.find(".note-dimension-picker-highlighted"),i=e.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var j=a(b.target).offset();d={x:b.pageX-j.left,y:b.pageY-j.top}}else d={x:b.offsetX,y:b.offsetY};var k={c:Math.ceil(d.x/H)||1,r:Math.ceil(d.y/H)||1};h.css({width:k.c+"em",height:k.r+"em"}),g.attr("data-value",k.c+"x"+k.r),3<k.c&&k.c<c.insertTableMaxSize.col&&i.css({width:k.c+1+"em"}),3<k.r&&k.r<c.insertTableMaxSize.row&&i.css({height:k.r+1+"em"}),f.html(k.c+" x "+k.r)},J=function(a,b){b.disableDragAndDrop?d.on("drop",function(a){a.preventDefault()}):K(a,b)},K=function(b,c){var e=a(),f=b.dropzone,g=b.dropzone.find(".note-dropzone-message");d.on("dragenter",function(a){var d=b.editor.hasClass("codeview");d||e.length||(b.editor.addClass("dragover"),f.width(b.editor.width()),f.height(b.editor.height()),g.text(c.langInfo.image.dragImageHere)),e=e.add(a.target)}).on("dragleave",function(a){e=e.not(a.target),e.length||b.editor.removeClass("dragover")}).on("drop",function(){e=a(),b.editor.removeClass("dragover")}),f.on("dragenter",function(){f.addClass("hover"),g.text(c.langInfo.image.dropImage)}).on("dragleave",function(){f.removeClass("hover"),g.text(c.langInfo.image.dragImageHere)}),f.on("drop",function(a){a.preventDefault();var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=p(a.currentTarget||a.target);c.editable().focus(),q(c,b.files)}}).on("dragover",!1)};this.bindKeyMap=function(b,c){var d=b.editor,e=b.editable;b=p(e),e.on("keydown",function(f){var g=[];f.metaKey&&g.push("CMD"),f.ctrlKey&&!f.altKey&&g.push("CTRL"),f.shiftKey&&g.push("SHIFT");var i=n.nameFromCode[f.keyCode];i&&g.push(i);var j=c[g.join("+")];if(j){if(f.preventDefault(),h[j])h[j](e,d.data("options"));else if(r[j])r[j].call(this,b);else if(a.summernote.plugins[j]){var k=a.summernote.plugins[j];a.isFunction(k.event)&&k.event(f,h,b)}}else n.isEdit(f.keyCode)&&h.afterCommand(e)})},this.attach=function(a,b){b.shortcuts&&this.bindKeyMap(a,b.keyMap[e.isMac?"mac":"pc"]),a.editable.on("mousedown",u),a.editable.on("keyup mouseup",z),a.editable.on("scroll",A),a.editable.on("paste",B),a.handle.on("mousedown",C),a.popover.on("click",E),a.popover.on("mousedown",D),b.airMode||(J(a,b),a.toolbar.on("click",E),a.toolbar.on("mousedown",D),b.disableResizeEditor||a.statusbar.on("mousedown",G));var c=b.airMode?a.popover:a.toolbar,d=c.find(".note-dimension-picker-mousecatcher");d.css({width:b.insertTableMaxSize.col+"em",height:b.insertTableMaxSize.row+"em"}).on("mousemove",function(a){I(a,b)}),a.editor.data("options",b),e.isMSIE||setTimeout(function(){document.execCommand("styleWithCSS",0,b.styleWithSpan)},0);var f=new t(a.editable);if(a.editable.data("NoteHistory",f),b.onenter&&a.editable.keypress(function(a){a.keyCode===n.ENTER&&b.onenter(a)}),b.onfocus&&a.editable.focus(b.onfocus),b.onblur&&a.editable.blur(b.onblur),b.onkeyup&&a.editable.keyup(b.onkeyup),b.onkeydown&&a.editable.keydown(b.onkeydown),b.onpaste&&a.editable.on("paste",b.onpaste),b.onToolbarClick&&a.toolbar.click(b.onToolbarClick),b.onChange){var g=function(){h.triggerOnChange(a.editable)};if(e.isMSIE){var i="DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted";a.editable.on(i,g)}else a.editable.on("input",g)}a.editable.data("callbacks",{onChange:b.onChange,onAutoSave:b.onAutoSave,onImageUpload:b.onImageUpload,onImageUploadError:b.onImageUploadError,onFileUpload:b.onFileUpload,onFileUploadError:b.onFileUpload})},this.detach=function(a,b){a.editable.off(),a.popover.off(),a.handle.off(),a.dialog.off(),b.airMode||(a.dropzone.off(),a.toolbar.off(),a.statusbar.off())}},A=function(){var b=function(a,b){var c=b.event,d=b.value,e=b.title,f=b.className,g=b.dropdown,h=b.hide;return'<button type="button" class="btn btn-default btn-sm btn-small'+(f?" "+f:"")+(g?" dropdown-toggle":"")+'"'+(g?' data-toggle="dropdown"':"")+(e?' title="'+e+'"':"")+(c?' data-event="'+c+'"':"")+(d?" data-value='"+d+"'":"")+(h?" data-hide='"+h+"'":"")+' tabindex="-1">'+a+(g?' <span class="caret"></span>':"")+"</button>"+(g||"")},c=function(a,c){var d='<i class="'+a+'"></i>';return b(d,c)},d=function(a,b){return'<div class="'+a+' popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content">'+b+"</div></div>"},g=function(a,b,c,d){return'<div class="'+a+' modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content">'+(b?'<div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">&times;</button><h4 class="modal-title">'+b+"</h4></div>":"")+'<form class="note-modal-form"><div class="modal-body">'+c+"</div>"+(d?'<div class="modal-footer">'+d+"</div>":"")+"</form></div></div></div>"},h={picture:function(a){return c("fa fa-picture-o",{event:"showImageDialog",title:a.image.image,hide:!0})},link:function(a){return c("fa fa-link",{event:"showLinkDialog",title:a.link.link,hide:!0})},table:function(a){var b='<ul class="note-table dropdown-menu"><div class="note-dimension-picker"><div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div><div class="note-dimension-picker-highlighted"></div><div class="note-dimension-picker-unhighlighted"></div></div><div class="note-dimension-display"> 1 x 1 </div></ul>';return c("fa fa-table",{title:a.table.table,dropdown:b})},style:function(a,b){var d=b.styleTags.reduce(function(b,c){var d=a.style["p"===c?"normal":c];return b+'<li><a data-event="formatBlock" href="#" data-value="'+c+'">'+("p"===c||"pre"===c?d:"<"+c+">"+d+"</"+c+">")+"</a></li>"},"");return c("fa fa-magic",{title:a.style.style,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},fontname:function(a,c){var d=c.fontNames.reduce(function(a,b){return e.isFontInstalled(b)?a+'<li><a data-event="fontName" href="#" data-value="'+b+'"><i class="fa fa-check"></i> '+b+"</a></li>":a},""),f='<span class="note-current-fontname">'+c.defaultFontName+"</span>";return b(f,{title:a.font.name,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},color:function(a){var c='<i class="fa fa-font" style="color:black;background-color:yellow;"></i>',d=b(c,{className:"note-recent-color",title:a.color.recent,event:"color",value:'{"backColor":"yellow"}'}),e='<ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">'+a.color.background+'</div><div class="note-color-reset" data-event="backColor" data-value="inherit" title="'+a.color.transparent+'">'+a.color.setTransparent+'</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">'+a.color.foreground+'</div><div class="note-color-reset" data-event="foreColor" data-value="inherit" title="'+a.color.reset+'">'+a.color.resetToDefault+'</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>',f=b("",{title:a.color.more,dropdown:e});return d+f},bold:function(a){return c("fa fa-bold",{event:"bold",title:a.font.bold})},italic:function(a){return c("fa fa-italic",{event:"italic",title:a.font.italic})},underline:function(a){return c("fa fa-underline",{event:"underline",title:a.font.underline})},clear:function(a){return c("fa fa-eraser",{event:"removeFormat",title:a.font.clear})},ul:function(a){return c("fa fa-list-ul",{event:"insertUnorderedList",title:a.lists.unordered})},ol:function(a){return c("fa fa-list-ol",{event:"insertOrderedList",title:a.lists.ordered})},paragraph:function(a){var b=c("fa fa-align-left",{title:a.paragraph.left,event:"justifyLeft"}),d=c("fa fa-align-center",{title:a.paragraph.center,event:"justifyCenter"}),e=c("fa fa-align-right",{title:a.paragraph.right,event:"justifyRight"}),f=c("fa fa-align-justify",{title:a.paragraph.justify,event:"justifyFull"}),g=c("fa fa-outdent",{title:a.paragraph.outdent,event:"outdent"}),h=c("fa fa-indent",{title:a.paragraph.indent,event:"indent"}),i='<div class="dropdown-menu"><div class="note-align btn-group">'+b+d+e+f+'</div><div class="note-list btn-group">'+h+g+"</div></div>";return c("fa fa-align-left",{title:a.paragraph.paragraph,dropdown:i})},height:function(a,b){var d=b.lineHeights.reduce(function(a,b){return a+'<li><a data-event="lineHeight" href="#" data-value="'+parseFloat(b)+'"><i class="fa fa-check"></i> '+b+"</a></li>"},"");return c("fa fa-text-height",{title:a.font.height,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},help:function(a){return c("fa fa-question",{event:"showHelpDialog",title:a.options.help,hide:!0})},fullscreen:function(a){return c("fa fa-arrows-alt",{event:"fullscreen",title:a.options.fullscreen})},codeview:function(a){return c("fa fa-code",{event:"codeview",title:a.options.codeview})},undo:function(a){return c("fa fa-undo",{event:"undo",title:a.history.undo})},redo:function(a){return c("fa fa-repeat",{event:"redo",title:a.history.redo})},hr:function(a){return c("fa fa-minus",{event:"insertHorizontalRule",title:a.hr.insert})}},i=function(a,e){var f=function(){var b=c("fa fa-edit",{title:a.link.edit,event:"showLinkDialog",hide:!0}),e=c("fa fa-unlink",{title:a.link.unlink,event:"unlink"}),f='<a href="http://www.google.com" target="_blank">www.google.com</a>&nbsp;&nbsp;<div class="note-insert btn-group">'+b+e+"</div>";return d("note-link-popover",f)},g=function(){var e=b('<span class="note-fontsize-10">100%</span>',{title:a.image.resizeFull,event:"resize",value:"1"}),f=b('<span class="note-fontsize-10">50%</span>',{title:a.image.resizeHalf,event:"resize",value:"0.5"}),g=b('<span class="note-fontsize-10">25%</span>',{title:a.image.resizeQuarter,event:"resize",value:"0.25"}),h=c("fa fa-align-left",{title:a.image.floatLeft,event:"floatMe",value:"left"}),i=c("fa fa-align-right",{title:a.image.floatRight,event:"floatMe",value:"right"}),j=c("fa fa-align-justify",{title:a.image.floatNone,event:"floatMe",value:"none"}),k=c("fa fa-square",{title:a.image.shapeRounded,event:"imageShape",value:"img-rounded"}),l=c("fa fa-circle-o",{title:a.image.shapeCircle,event:"imageShape",value:"img-circle"}),m=c("fa fa-picture-o",{title:a.image.shapeThumbnail,event:"imageShape",value:"img-thumbnail"}),n=c("fa fa-times",{title:a.image.shapeNone,event:"imageShape",value:""}),o=c("fa fa-trash-o",{title:a.image.remove,event:"removeMedia",value:"none"}),p='<div class="btn-group">'+e+f+g+'</div><div class="btn-group">'+h+i+j+'</div><div class="btn-group">'+k+l+m+n+'</div><div class="btn-group">'+o+"</div>";return d("note-image-popover",p)},i=function(){for(var b="",c=0,f=e.airPopover.length;f>c;c++){var g=e.airPopover[c];b+='<div class="note-'+g[0]+' btn-group">';for(var i=0,j=g[1].length;j>i;i++)b+=h[g[1][i]](a,e);b+="</div>"}return d("note-air-popover",b)};return'<div class="note-popover">'+f()+g()+(e.airMode?i():"")+"</div>"},k=function(){return'<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="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div>'},l=function(a,b){var c="note-shortcut-col col-xs-6 note-shortcut-",d=[];for(var e in b)d.push('<div class="'+c+'key">'+b[e].kbd+'</div><div class="'+c+'name">'+b[e].text+"</div>");return'<div class="note-shortcut-row row"><div class="'+c+'title col-xs-offset-6">'+a+'</div></div><div class="note-shortcut-row row">'+d.join('</div><div class="note-shortcut-row row">')+"</div>"},m=function(a){var b=[{kbd:"⌘ + B",text:a.font.bold},{kbd:"⌘ + I",text:a.font.italic},{kbd:"⌘ + U",text:a.font.underline},{kbd:"⌘ + ⇧ + S",text:a.font.sdivikethrough},{kbd:"⌘ + \\",text:a.font.clear}];return l(a.shortcut.textFormatting,b)},n=function(a){var b=[{kbd:"⌘ + Z",text:a.history.undo},{kbd:"⌘ + ⇧ + Z",text:a.history.redo},{kbd:"⌘ + ]",text:a.paragraph.indent},{kbd:"⌘ + [",text:a.paragraph.oudivent},{kbd:"⌘ + ENTER",text:a.hr.insert}];return l(a.shortcut.action,b)},o=function(a){var b=[{kbd:"⌘ + ⇧ + L",text:a.paragraph.left},{kbd:"⌘ + ⇧ + E",text:a.paragraph.center},{kbd:"⌘ + ⇧ + R",text:a.paragraph.right},{kbd:"⌘ + ⇧ + J",text:a.paragraph.justify},{kbd:"⌘ + ⇧ + NUM7",text:a.lists.ordered},{kbd:"⌘ + ⇧ + NUM8",text:a.lists.unordered}];return l(a.shortcut.paragraphFormatting,b)},p=function(a){var b=[{kbd:"⌘ + NUM0",text:a.style.normal},{kbd:"⌘ + NUM1",text:a.style.h1},{kbd:"⌘ + NUM2",text:a.style.h2},{kbd:"⌘ + NUM3",text:a.style.h3},{kbd:"⌘ + NUM4",text:a.style.h4},{kbd:"⌘ + NUM5",text:a.style.h5},{kbd:"⌘ + NUM6",text:a.style.h6}];return l(a.shortcut.documentStyle,b)},q=function(a,b){var c=b.extraKeys,d=[];for(var e in c)c.hasOwnProperty(e)&&d.push({kbd:e,text:c[e]});return l(a.shortcut.extraKeys,d)},r=function(a,b){var c='class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"',d=["<div "+c+">"+n(a,b)+"</div><div "+c+">"+m(a,b)+"</div>","<div "+c+">"+p(a,b)+"</div><div "+c+">"+o(a,b)+"</div>"];return b.extraKeys&&d.push("<div "+c+">"+q(a,b)+"</div>"),'<div class="note-shortcut-row row">'+d.join('</div><div class="note-shortcut-row row">')+"</div>"},s=function(a){return a.replace(/⌘/g,"Ctrl").replace(/⇧/g,"Shift")},t={image:function(a,b){var c="";if(b.maximumImageFileSize){var d=Math.floor(Math.log(b.maximumImageFileSize)/Math.log(1024)),e=1*(b.maximumImageFileSize/Math.pow(1024,d)).toFixed(2)+" "+" KMGTP"[d]+"B";c="<small>"+a.image.maximumFileSize+" : "+e+"</small>"}var f='<div class="form-group row-fluid note-group-select-from-files"><label>'+a.image.selectFromFiles+'</label><input class="note-image-input" type="file" name="files" accept="image/*" />'+c+'</div><div class="form-group row-fluid"><label>'+a.image.url+'</label><input class="note-image-url form-control span12" type="text" /></div>',h='<button href="#" class="btn btn-primary note-image-btn disabled" disabled>'+a.image.insert+"</button>";return g("note-image-dialog",a.image.insert,f,h)},link:function(a,b){var c='<div class="form-group row-fluid"><label>'+a.link.textToDisplay+'</label><input class="note-link-text form-control span12" type="text" /></div><div class="form-group row-fluid"><label>'+a.link.url+'</label><input class="note-link-url form-control span12" type="text" /></div>'+(b.disableLinkTarget?"":'<div class="checkbox"><label><input type="checkbox" checked> '+a.link.openInNewWindow+"</label></div>"),d='<button href="#" class="btn btn-primary note-link-btn disabled" disabled>'+a.link.insert+"</button>";return g("note-link-dialog",a.link.insert,c,d)},help:function(a,b){var c='<a class="modal-close pull-right" aria-hidden="true" tabindex="-1">'+a.shortcut.close+'</a><div class="title">'+a.shortcut.shortcuts+"</div>"+(e.isMac?r(a,b):s(r(a,b)))+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote 0.6.0</a> · <a href="//github.com/HackerWins/summernote" target="_blank">Project</a> · <a href="//github.com/HackerWins/summernote/issues" target="_blank">Issues</a></p>';return g("note-help-dialog","",c,"")}},u=function(b,c){var d="";return a.each(t,function(a,e){d+=e(b,c)}),'<div class="note-dialog">'+d+"</div>"},v=function(){return'<div class="note-resizebar"><div class="note-icon-bar"></div><div class="note-icon-bar"></div><div class="note-icon-bar"></div></div>'},w=function(a){return e.isMac&&(a=a.replace("CMD","⌘").replace("SHIFT","⇧")),a.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]")},x=function(b,c,d){var e=f.invertObject(c),g=b.find("button");g.each(function(b,c){var d=a(c),f=e[d.data("event")];f&&d.attr("title",function(a,b){return b+" ("+w(f)+")"})}).tooltip({container:"body",trigger:"hover",placement:d||"top"}).on("click",function(){a(this).tooltip("hide")})},y=function(b,c){var d=c.colors;b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),e=[],f=0,g=d.length;g>f;f++){for(var h=d[f],i=[],j=0,k=h.length;k>j;j++){var l=h[j];i.push(['<button type="button" class="note-color-btn" style="background-color:',l,';" data-event="',c,'" data-value="',l,'" title="',l,'" data-toggle="button" tabindex="-1"></button>'].join(""))}e.push('<div class="note-color-row">'+i.join("")+"</div>")}b.html(e.join(""))})};this.createLayoutByAirMode=function(b,c){var d=c.langInfo,g=c.keyMap[e.isMac?"mac":"pc"],h=f.uniqueId();b.addClass("note-air-editor note-editable"),b.attr({id:"note-editor-"+h,contentEditable:!0});var j=document.body,l=a(i(d,c));l.addClass("note-air-layout"),l.attr("id","note-popover-"+h),l.appendTo(j),x(l,g),y(l,c);var m=a(k());m.addClass("note-air-layout"),m.attr("id","note-handle-"+h),m.appendTo(j);var n=a(u(d,c));n.addClass("note-air-layout"),n.attr("id","note-dialog-"+h),n.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),n.appendTo(j)},this.createLayoutByFrame=function(b,c){var d=c.langInfo,f=a('<div class="note-editor"></div>');c.width&&f.width(c.width),c.height>0&&a('<div class="note-statusbar">'+(c.disableResizeEditor?"":v())+"</div>").prependTo(f);var g=!b.is(":disabled"),l=a('<div class="note-editable" contentEditable="'+g+'"></div>').prependTo(f);c.height&&l.height(c.height),c.direction&&l.attr("dir",c.direction),c.placeholder&&l.attr("data-placeholder",c.placeholder),l.html(j.html(b)),a('<textarea class="note-codable"></textarea>').prependTo(f);for(var m="",n=0,o=c.toolbar.length;o>n;n++){var p=c.toolbar[n][0],q=c.toolbar[n][1];m+='<div class="note-'+p+' btn-group">';for(var r=0,s=q.length;s>r;r++){var t=h[q[r]];a.isFunction(t)&&(m+=t(d,c))}m+="</div>"}m='<div class="note-toolbar btn-toolbar">'+m+"</div>";var w=a(m).prependTo(f),z=c.keyMap[e.isMac?"mac":"pc"];y(w,c),x(w,z,"bottom");var A=a(i(d,c)).prependTo(f);y(A,c),x(A,z),a(k()).prependTo(f);var B=a(u(d,c)).prependTo(f);B.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),a('<div class="note-dropzone"><div class="note-dropzone-message"></div></div>').prependTo(f),f.insertAfter(b),b.hide()},this.noteEditorFromHolder=function(b){return b.hasClass("note-air-editor")?b:b.next().hasClass("note-editor")?b.next():a()},this.createLayout=function(a,b){this.noteEditorFromHolder(a).length||(b.airMode?this.createLayoutByAirMode(a,b):this.createLayoutByFrame(a,b))},this.layoutInfoFromHolder=function(a){var b=this.noteEditorFromHolder(a);if(b.length){var c=j.buildLayoutInfo(b);for(var d in c)c.hasOwnProperty(d)&&(c[d]=c[d].call());return c}},this.removeLayout=function(a,b,c){c.airMode?(a.removeClass("note-air-editor note-editable").removeAttr("id contentEditable"),b.popover.remove(),b.handle.remove(),b.dialog.remove()):(a.html(b.editable.html()),b.editor.remove(),a.show())},this.getTemplate=function(){return{button:b,iconButton:c,dialog:g}},this.addButtonInfo=function(a,b){h[a]=b},this.addDialogInfo=function(a,b){t[a]=b}};a.summernote=a.summernote||{},a.extend(a.summernote,l);var B=new A,C=new z;a.extend(a.summernote,{renderer:B,eventHandler:C,core:{agent:e,dom:j,range:k},pluginEvents:{}}),a.summernote.addPlugin=function(b){b.buttons&&a.each(b.buttons,function(a,b){B.addButtonInfo(a,b)}),b.dialogs&&a.each(b.dialogs,function(a,b){B.addDialogInfo(a,b)}),b.events&&a.each(b.events,function(b,c){a.summernote.pluginEvents[b]=c}),b.langs&&a.each(b.langs,function(b,c){a.summernote.lang[b]&&a.extend(a.summernote.lang[b],c)}),b.options&&a.extend(a.summernote.options,b.options)},a.fn.extend({summernote:function(b){if(b=a.extend({},a.summernote.options,b),b.langInfo=a.extend(!0,{},a.summernote.lang["en-US"],a.summernote.lang[b.lang]),this.each(function(c,d){var e=a(d);B.createLayout(e,b);var f=B.layoutInfoFromHolder(e);C.attach(f,b),j.isTextarea(e[0])&&e.closest("form").submit(function(){var a=e.code();e.val(a),b.onsubmit&&b.onsubmit(a)})}),this.first().length&&b.focus){var c=B.layoutInfoFromHolder(this.first());c.editable.focus()}return this.length&&b.oninit&&b.oninit(),this},code:function(b){if(void 0===b){var c=this.first();if(!c.length)return;var d=B.layoutInfoFromHolder(c);if(d&&d.editable){var f=d.editor.hasClass("codeview");return f&&e.hasCodeMirror&&d.codable.data("cmEditor").save(),f?d.codable.val():d.editable.html()}return j.isTextarea(c[0])?c.val():c.html()}return this.each(function(c,d){var e=B.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)}),this},destroy:function(){return this.each(function(b,c){var d=a(c),e=B.layoutInfoFromHolder(d);if(e&&e.editable){var f=e.editor.data("options");C.detach(e,f),B.removeLayout(d,e,f)}}),this}})});

@@ -38,3 +38,8 @@ module.exports = function (grunt) {

src: [
'src/**/*.js', 'Gruntfile.js', 'test/**/*.js', 'build/*.js'
'src/**/*.js',
'plugin/**/*.js',
'lang/**/*.js',
'Gruntfile.js',
'test/**/*.js',
'build/*.js'
],

@@ -102,6 +107,22 @@ options: {

}
},
// Meteor commands to test and publish package
shell: {
'meteor-test': {
command: 'meteor/runtests.sh',
options: {
execOptions: {
killSignal: 'SIGKILL'
}
}
},
'meteor-publish': {
command: 'meteor/publish.sh'
}
}
});
// load grunt tasks on package.json.
// load all tasks from the grunt plugins used in this file
require('load-grunt-tasks')(grunt);

@@ -123,2 +144,11 @@

grunt.registerTask('default', ['dist']);
// Meteor tasks
grunt.registerTask('meteor-test', 'shell:meteor-test');
grunt.registerTask('meteor-publish', 'shell:meteor-publish');
// Ideally we'd run tests before publishing, but the chances of tests breaking (given that
// Meteor is orthogonal to the library) are so small that it's not worth the maintainer's time
// grunt.regsterTask('meteor', ['shell:meteor-test', 'shell:meteor-publish']);
grunt.registerTask('meteor', 'shell:meteor-publish');
};

@@ -8,7 +8,5 @@ (function ($) {

underline: 'تحته خط',
strikethrough: 'فى وسطه خط',
clear: 'مسح التنسيق',
height: 'إرتفاع السطر',
name: 'الخط',
size: 'الحجم'
name: 'الخط'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'فيديو',
videoLink: 'رابط الفيديو',
insert: 'إدراج الفيديو',
url: 'رابط الفيديو',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ou Youku)'
},
table: {

@@ -101,4 +92,4 @@ table: 'جدول'

history: {
undo: 'Undo',
redo: 'Redo'
undo: 'تراجع',
redo: 'إعادة'
}

@@ -105,0 +96,0 @@ }

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Subratllat',
strikethrough: 'Ratllat',
clear: 'Treure estil de lletra',
height: 'Alçada de línia',
size: 'Mida de lletra'
height: 'Alçada de línia'
},

@@ -29,3 +27,3 @@ image: {

link: 'Enllaç',
insert: 'Inserir enllaç',
insert: 'Inserir enllaç',
unlink: 'Treure enllaç',

@@ -37,9 +35,2 @@ edit: 'Editar',

},
video: {
video: 'Video',
videoLink: 'Enllaç del video',
insert: 'Inserir video',
url: 'URL del video?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, o Youku)'
},
table: {

@@ -84,3 +75,3 @@ table: 'Taula'

more: 'Més colors',
background: 'Color de fons',
background: 'Color de fons',
foreground: 'Color de lletra',

@@ -87,0 +78,0 @@ transparent: 'Transparent',

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Podtržené',
strikethrough: 'Přeškrtnuté',
clear: 'Odstranit styl písma',
height: 'Výška řádku',
size: 'Velikost písma'
height: 'Výška řádku'
},

@@ -36,9 +34,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Odkaz videa',
insert: 'Vložit video',
url: 'URL videa?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion nebo Youku)'
},
table: {

@@ -45,0 +36,0 @@ table: 'Tabulka'

@@ -8,6 +8,5 @@ (function ($) {

underline: 'Understreget',
strikethrough: 'Genemstreget',
clear: 'Fjern formatering',
height: 'Højde',
size: 'Skriftstørrelse'
name: 'Skrifttype'
},

@@ -23,6 +22,13 @@ image: {

floatNone: 'Fjern formatering',
shapeRounded: 'Form: Runde kanter',
shapeCircle: 'Form: Cirkel',
shapeThumbnail: 'Form: Miniature',
shapeNone: 'Form: Ingen',
dragImageHere: 'Træk billede hertil',
dropImage: 'Slip billede',
selectFromFiles: 'Vælg billed-fil',
maximumFileSize: 'Maks fil størrelse',
maximumFileSizeError: 'Filen er større end maks tilladte fil størrelse!',
url: 'Billede URL',
remove: 'Fjern billede'
remove: 'Fjern billede'
},

@@ -38,9 +44,2 @@ link: {

},
video: {
video: 'Video',
videoLink: 'Video Link',
insert: 'Indsæt Video',
url: 'Video URL?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, or Youku)'
},
table: {

@@ -87,3 +86,3 @@ table: 'Tabel'

foreground: 'Forgrund',
transparent: 'Transparetn',
transparent: 'Transparent',
setTransparent: 'Sæt transparent',

@@ -103,3 +102,3 @@ reset: 'Nulstil',

undo: 'Fortryd',
redo: 'Anuller fortryd'
redo: 'Annuller fortryd'
}

@@ -106,0 +105,0 @@

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Unterstreichen',
strikethrough: 'Durchgestrichen',
clear: 'Zurücksetzen',
height: 'Zeilenhöhe',
size: 'Schriftgröße'
height: 'Zeilenhöhe'
},

@@ -26,3 +24,3 @@ image: {

url: 'Grafik URL',
remove: 'Grafik entfernen'
remove: 'Grafik entfernen'
},

@@ -38,9 +36,2 @@ link: {

},
video: {
video: 'Video',
videoLink: 'Video Link',
insert: 'Video einfügen',
url: 'Video URL?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, oder Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Tabelle'

@@ -5,12 +5,8 @@ (function ($) {

font: {
name:'Fuente',
bold: 'Negrita',
italic: 'Cursiva',
underline: 'Subrayado',
superscript: 'Superíndice',
subscript: 'Subíndice',
strikethrough: 'Tachado',
clear: 'Quitar estilo de fuente',
height: 'Altura de línea',
size: 'Tamaño de la fuente'
name: 'Fuente'
},

@@ -39,9 +35,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Link del video',
insert: 'Insertar video',
url: '¿URL del video?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, o Youku)'
},
table: {

@@ -48,0 +37,0 @@ table: 'Tabla'

@@ -5,40 +5,31 @@ (function ($) {

font: {
name:'Tipografia',
bold: 'Lodia',
italic: 'Etzana',
underline: 'Azpimarratua',
strikethrough: 'Marratua',
clear: 'Estiloa kendu',
height: 'Lerro altuera',
size: 'Letren neurria'
name: 'Tipografia'
},
image: {
image: 'Irudia',
insert: 'Irudi bat txertatu',
resizeFull: 'Jatorrizko neurrira aldatu',
resizeHalf: 'Neurria erdira aldatu',
image: 'Irudia',
insert: 'Irudi bat txertatu',
resizeFull: 'Jatorrizko neurrira aldatu',
resizeHalf: 'Neurria erdira aldatu',
resizeQuarter: 'Neurria laurdenera aldatu',
floatLeft: 'Ezkerrean kokatu',
floatRight: 'Eskuinean kokatu',
floatRight: 'Eskuinean kokatu',
floatNone: 'Kokapenik ez ezarri',
dragImageHere: 'Irudi bat ezarri hemen',
dragImageHere: 'Irudi bat ezarri hemen',
selectFromFiles: 'Zure fitxategi bat aukeratu',
url: 'Irudiaren URL helbidea'
url: 'Irudiaren URL helbidea'
},
link: {
link: 'Esteka',
insert: 'Esteka bat txertatu',
unlink: 'Esteka ezabatu',
insert: 'Esteka bat txertatu',
unlink: 'Esteka ezabatu',
edit: 'Editatu',
textToDisplay: 'Estekaren testua',
textToDisplay: 'Estekaren testua',
url: 'Estekaren URL helbidea',
openInNewWindow: 'Leiho berri batean ireki'
openInNewWindow: 'Leiho berri batean ireki'
},
video: {
video: 'Bideoa',
videoLink: 'Bideorako esteka',
insert: 'Bideo berri bat txertatu',
url: 'Bideoaren URL helbidea',
providers: '(YouTube, Vimeo, Vine, Instagram, edo DailyMotion)'
},
table: {

@@ -45,0 +36,0 @@ table: 'Taula' //Tabla

(function ($) {
$.extend($.summernote.lang, {
'fa-IR': {
font: {
bold: 'درشت',
italic: 'خمیده',
underline: 'میان خط',
strikethrough: 'Strike',
clear: 'پاک کردن فرمت فونت',
height: 'فاصله ی خطی',
name: 'اسم فونت',
size: 'اندازه ی فونت'
},
image: {
image: 'تصویر',
insert: 'وارد کردن تصویر',
resizeFull: 'تغییر به اندازه ی کامل',
resizeHalf: 'تغییر به اندازه نصف',
resizeQuarter: 'تغییر به اندازه یک چهارم',
floatLeft: 'چسباندن به چپ',
floatRight: 'چسباندن به راست',
floatNone: 'بدون چسبندگی',
dragImageHere: 'یک تصویر را اینجا بکشید',
selectFromFiles: 'فایل ها را انتخاب کنید',
url: 'آدرس تصویر',
remove: 'حذف تصویر'
},
link: {
link: 'لینک',
insert: 'اضافه کردن لینک',
unlink: 'حذف لینک',
edit: 'ویرایش',
textToDisplay: 'متن جهت نمایش',
url: 'این لینک به چه آدرسی باید برود ؟',
openInNewWindow: 'در یک پنجره ی جدید باز شود'
},
video: {
video: 'ویدیو',
videoLink: 'لینک ویدیو',
insert: 'افزودن ویدیو',
url: 'آدرس ویدیو ؟',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, یا Youku)'
},
table: {
table: 'جدول'
},
hr: {
insert: 'افزودن خط افقی'
},
style: {
style: 'استیل',
normal: 'نرمال',
blockquote: 'نقل قول',
pre: 'کد',
h1: 'سرتیتر 1',
h2: 'سرتیتر 2',
h3: 'سرتیتر 3',
h4: 'سرتیتر 4',
h5: 'سرتیتر 5',
h6: 'سرتیتر 6'
},
lists: {
unordered: 'لیست غیر ترتیبی',
ordered: 'لیست ترتیبی'
},
options: {
help: 'راهنما',
fullscreen: 'نمایش تمام صفحه',
codeview: 'مشاهده ی کد'
},
paragraph: {
paragraph: 'پاراگراف',
outdent: 'کاهش تو رفتگی',
indent: 'افزایش تو رفتگی',
left: 'چپ چین',
center: 'میان چین',
right: 'راست چین',
justify: 'بلوک چین'
},
color: {
recent: 'رنگ اخیرا استفاده شده',
more: 'رنگ بیشتر',
background: 'رنگ پس زمینه',
foreground: 'رنگ متن',
transparent: 'بی رنگ',
setTransparent: 'تنظیم حالت بی رنگ',
reset: 'بازنشاندن',
resetToDefault: 'حالت پیش فرض'
},
shortcut: {
shortcuts: 'دکمه های میان بر',
close: 'بستن',
textFormatting: 'فرمت متن',
action: 'عملیات',
paragraphFormatting: 'فرمت پاراگراف',
documentStyle: 'استیل سند'
},
history: {
undo: 'واچیدن',
redo: 'بازچیدن'
}
}
});
$.extend($.summernote.lang, {
'fa-IR': {
font: {
bold: 'درشت',
italic: 'خمیده',
underline: 'میان خط',
clear: 'پاک کردن فرمت فونت',
height: 'فاصله ی خطی',
name: 'اسم فونت'
},
image: {
image: 'تصویر',
insert: 'وارد کردن تصویر',
resizeFull: 'تغییر به اندازه ی کامل',
resizeHalf: 'تغییر به اندازه نصف',
resizeQuarter: 'تغییر به اندازه یک چهارم',
floatLeft: 'چسباندن به چپ',
floatRight: 'چسباندن به راست',
floatNone: 'بدون چسبندگی',
dragImageHere: 'یک تصویر را اینجا بکشید',
selectFromFiles: 'فایل ها را انتخاب کنید',
url: 'آدرس تصویر',
remove: 'حذف تصویر'
},
link: {
link: 'لینک',
insert: 'اضافه کردن لینک',
unlink: 'حذف لینک',
edit: 'ویرایش',
textToDisplay: 'متن جهت نمایش',
url: 'این لینک به چه آدرسی باید برود ؟',
openInNewWindow: 'در یک پنجره ی جدید باز شود'
},
table: {
table: 'جدول'
},
hr: {
insert: 'افزودن خط افقی'
},
style: {
style: 'استیل',
normal: 'نرمال',
blockquote: 'نقل قول',
pre: 'کد',
h1: 'سرتیتر 1',
h2: 'سرتیتر 2',
h3: 'سرتیتر 3',
h4: 'سرتیتر 4',
h5: 'سرتیتر 5',
h6: 'سرتیتر 6'
},
lists: {
unordered: 'لیست غیر ترتیبی',
ordered: 'لیست ترتیبی'
},
options: {
help: 'راهنما',
fullscreen: 'نمایش تمام صفحه',
codeview: 'مشاهده ی کد'
},
paragraph: {
paragraph: 'پاراگراف',
outdent: 'کاهش تو رفتگی',
indent: 'افزایش تو رفتگی',
left: 'چپ چین',
center: 'میان چین',
right: 'راست چین',
justify: 'بلوک چین'
},
color: {
recent: 'رنگ اخیرا استفاده شده',
more: 'رنگ بیشتر',
background: 'رنگ پس زمینه',
foreground: 'رنگ متن',
transparent: 'بی رنگ',
setTransparent: 'تنظیم حالت بی رنگ',
reset: 'بازنشاندن',
resetToDefault: 'حالت پیش فرض'
},
shortcut: {
shortcuts: 'دکمه های میان بر',
close: 'بستن',
textFormatting: 'فرمت متن',
action: 'عملیات',
paragraphFormatting: 'فرمت پاراگراف',
documentStyle: 'استیل سند'
},
history: {
undo: 'واچیدن',
redo: 'بازچیدن'
}
}
});
})(jQuery);

@@ -8,7 +8,5 @@ (function ($) {

underline: 'Alleviivaa',
strikethrough: 'Yliviivaus',
clear: 'Tyhjennä muotoilu',
height: 'Riviväli',
name: 'Kirjasintyyppi',
size: 'Kirjasinkoko'
name: 'Kirjasintyyppi'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Linkki videoon',
insert: 'Lisää video',
url: 'Videon URL-osoite?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion tai Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Taulukko'

@@ -8,9 +8,5 @@ (function ($) {

underline: 'Souligné',
strikethrough: 'Barré',
superscript: 'Exposant',
subscript: 'Indicé',
clear: 'Effacer la mise en forme',
height: 'Interligne',
name: 'Famille de police',
size: 'Taille de police'
name: 'Famille de police'
},

@@ -40,9 +36,2 @@ image: {

},
video: {
video: 'Vidéo',
videoLink: 'Lien vidéo',
insert: 'Insérer une vidéo',
url: 'URL de la vidéo',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ou Youku)'
},
table: {

@@ -49,0 +38,0 @@ table: 'Tableau'

@@ -1,105 +0,96 @@

(function($) {
$.extend($.summernote.lang, {
'hu-HU': {
font: {
bold: 'Félkövér',
italic: 'Dőlt',
underline: 'Aláhúzott',
strikethrough: 'Áthúzott',
clear: 'Formázás törlése',
height: 'Sorköz',
name: 'Betűtípus',
size: 'Betűméret'
},
image: {
image: 'Kép',
insert: 'Kép beszúrása',
resizeFull: 'Átméretezés teljes méretre',
resizeHalf: 'Átméretezés felére',
resizeQuarter: 'Átméretezés negyedére',
floatLeft: 'Igazítás balra',
floatRight: 'Igazítás jobbra',
floatNone: 'Igazítás törlése',
dragImageHere: 'Ide húzhatod a képet',
selectFromFiles: 'Fájlok kiválasztása',
url: 'Kép URL címe',
remove: 'Kép törlése'
},
link: {
link: 'Hivatkozás',
insert: 'Hivatkozás beszúrása',
unlink: 'Hivatkozás megszüntetése',
edit: 'Szerkesztés',
textToDisplay: 'Megjelenítendő szöveg',
url: 'Milyen URL címre hivatkozzon?',
openInNewWindow: 'Megnyitás új ablakban'
},
video: {
video: 'Videó',
videoLink: 'Videó hivatkozás',
insert: 'Videó beszúrása',
url: 'Videó URL címe',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, vagy Youku)'
},
table: {
table: 'Táblázat'
},
hr: {
insert: 'Elválasztó vonal beszúrása'
},
style: {
style: 'Stílus',
normal: 'Normál',
blockquote: 'Idézet',
pre: 'Kód',
h1: 'Fejléc 1',
h2: 'Fejléc 2',
h3: 'Fejléc 3',
h4: 'Fejléc 4',
h5: 'Fejléc 5',
h6: 'Fejléc 6'
},
lists: {
unordered: 'Listajeles lista',
ordered: 'Számozott lista'
},
options: {
help: 'Súgó',
fullscreen: 'Teljes képernyő',
codeview: 'Kód nézet'
},
paragraph: {
paragraph: 'Bekezdés',
outdent: 'Behúzás csökkentése',
indent: 'Behúzás növelése',
left: 'Igazítás balra',
center: 'Igazítás középre',
right: 'Igazítás jobbra',
justify: 'Sorkizárt'
},
color: {
recent: 'Jelenlegi szín',
more: 'További színek',
background: 'Háttérszín',
foreground: 'Betűszín',
transparent: 'Átlátszó',
setTransparent: 'Átlászóság beállítása',
reset: 'Visszaállítás',
resetToDefault: 'Alaphelyzetbe állítás'
},
shortcut: {
shortcuts: 'Gyorsbillentyű',
close: 'Bezárás',
textFormatting: 'Szöveg formázása',
action: 'Művelet',
paragraphFormatting: 'Bekezdés formázása',
documentStyle: 'Dokumentumstílus'
},
history: {
undo: 'Visszavonás',
redo: 'Újra'
}
(function ($) {
$.extend($.summernote.lang, {
'hu-HU': {
font: {
bold: 'Félkövér',
italic: 'Dőlt',
underline: 'Aláhúzott',
clear: 'Formázás törlése',
height: 'Sorköz',
name: 'Betűtípus'
},
image: {
image: 'Kép',
insert: 'Kép beszúrása',
resizeFull: 'Átméretezés teljes méretre',
resizeHalf: 'Átméretezés felére',
resizeQuarter: 'Átméretezés negyedére',
floatLeft: 'Igazítás balra',
floatRight: 'Igazítás jobbra',
floatNone: 'Igazítás törlése',
dragImageHere: 'Ide húzhatod a képet',
selectFromFiles: 'Fájlok kiválasztása',
url: 'Kép URL címe',
remove: 'Kép törlése'
},
link: {
link: 'Hivatkozás',
insert: 'Hivatkozás beszúrása',
unlink: 'Hivatkozás megszüntetése',
edit: 'Szerkesztés',
textToDisplay: 'Megjelenítendő szöveg',
url: 'Milyen URL címre hivatkozzon?',
openInNewWindow: 'Megnyitás új ablakban'
},
table: {
table: 'Táblázat'
},
hr: {
insert: 'Elválasztó vonal beszúrása'
},
style: {
style: 'Stílus',
normal: 'Normál',
blockquote: 'Idézet',
pre: 'Kód',
h1: 'Fejléc 1',
h2: 'Fejléc 2',
h3: 'Fejléc 3',
h4: 'Fejléc 4',
h5: 'Fejléc 5',
h6: 'Fejléc 6'
},
lists: {
unordered: 'Listajeles lista',
ordered: 'Számozott lista'
},
options: {
help: 'Súgó',
fullscreen: 'Teljes képernyő',
codeview: 'Kód nézet'
},
paragraph: {
paragraph: 'Bekezdés',
outdent: 'Behúzás csökkentése',
indent: 'Behúzás növelése',
left: 'Igazítás balra',
center: 'Igazítás középre',
right: 'Igazítás jobbra',
justify: 'Sorkizárt'
},
color: {
recent: 'Jelenlegi szín',
more: 'További színek',
background: 'Háttérszín',
foreground: 'Betűszín',
transparent: 'Átlátszó',
setTransparent: 'Átlászóság beállítása',
reset: 'Visszaállítás',
resetToDefault: 'Alaphelyzetbe állítás'
},
shortcut: {
shortcuts: 'Gyorsbillentyű',
close: 'Bezárás',
textFormatting: 'Szöveg formázása',
action: 'Művelet',
paragraphFormatting: 'Bekezdés formázása',
documentStyle: 'Dokumentumstílus'
},
history: {
undo: 'Visszavonás',
redo: 'Újra'
}
}
});
}
});
})(jQuery);

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Garis bawah',
strikethrough: 'Coret',
clear: 'Bersihkan gaya',
height: 'Jarak baris',
size: 'Ukuran font'
height: 'Jarak baris'
},

@@ -37,9 +35,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Link video',
insert: 'Sisipkan video',
url: 'Tautan video',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, atau Youku)'
},
table: {

@@ -46,0 +37,0 @@ table: 'Tabel'

@@ -8,7 +8,5 @@ (function ($) {

underline: 'Testo sottolineato',
strikethrough: 'Testo barrato',
clear: 'Elimina la formattazione del testo',
height: 'Altezza della linea di testo',
name: 'Famiglia Font',
size: 'Dimensione del carattere'
name: 'Famiglia Font'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Collegamento ad un Video',
insert: 'Inserisci Video',
url: 'URL del Video',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion o Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Tabella'

@@ -8,7 +8,5 @@ (function ($) {

underline: '下線',
strikethrough: '取り消し線',
clear: 'クリア',
height: '文字高',
name: 'フォント',
size: '大きさ'
name: 'フォント'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: '動画',
videoLink: '動画リンク',
insert: '動画挿入',
url: '動画のURL',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'テーブル'

@@ -8,7 +8,5 @@ (function ($) {

underline: '밑줄',
strikethrough: '취소선',
clear: '글자 효과 없애기',
height: '줄간격',
name: '글꼴',
size: '글자 크기'
name: '글꼴'
},

@@ -24,2 +22,6 @@ image: {

floatNone: '정렬하지 않음',
shapeRounded: '스타일: 둥근 모서리',
shapeCircle: '스타일: 원형',
shapeThumbnail: '스타일: 액자',
shapeNone: '스타일: 없음',
dragImageHere: '사진을 이곳으로 끌어오세요',

@@ -39,9 +41,2 @@ selectFromFiles: '파일 선택',

},
video: {
video: '동영상',
videoLink: '동영상 링크',
insert: '동영상 추가',
url: '동영상 URL',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku 사용 가능)'
},
table: {

@@ -48,0 +43,0 @@ table: '테이블'

@@ -8,7 +8,5 @@ (function ($) {

underline: 'Understrek',
strikethrough: 'Gjennomstrek',
clear: 'Fjern formatering',
height: 'Linjehøyde',
name: 'Skrifttype',
size: 'Skriftstørrelse'
name: 'Skrifttype'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Videolenke',
insert: 'Sett inn video',
url: 'Video-URL',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion eller Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Tabell'

@@ -8,7 +8,5 @@ (function ($) {

underline: 'Onderstrepen',
strikethrough: 'Doorhalen',
clear: 'Stijl verwijderen',
height: 'Regelhoogte',
name: 'Lettertype',
size: 'Tekstgrootte'
name: 'Lettertype'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Video link',
insert: 'Video invoegen',
url: 'URL van de video',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion of Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Tabel'

@@ -8,7 +8,5 @@ (function ($) {

underline: 'Podkreślenie',
strikethrough: 'Przekreślenie',
clear: 'Usuń formatowanie',
height: 'Interlinia',
name: 'Czcionka',
size: 'Rozmiar'
name: 'Czcionka'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Wideo',
videoLink: 'Adres wideo',
insert: 'Wstaw wideo',
url: 'Adres wideo',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, lub Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Tabela'

@@ -8,6 +8,5 @@ (function ($) {

underline: 'Sublinhado',
strikethrough: 'Riscado',
clear: 'Remover estilo da fonte',
height: 'Altura da linha',
size: 'Tamanho da fonte'
name: 'Fonte'
},

@@ -34,11 +33,4 @@ image: {

url: 'Para qual URL esse link leva?',
openInNewWindow: 'Abrir em uma nova janela'
openInNewWindow: 'Abrir em uma nova janela'
},
video: {
video: 'Vídeo',
videoLink: 'Link para vídeo',
insert: 'Inserir vídeo',
url: 'URL do vídeo?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, ou Youku)'
},
table: {

@@ -45,0 +37,0 @@ table: 'Tabela'

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Subliniat',
strikethrough: 'Tăiat',
clear: 'Înlătură formatare font',
height: 'Înălțime rând',
size: 'Dimensiune font'
height: 'Înălțime rând'
},

@@ -35,9 +33,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Link video',
insert: 'Inserează video',
url: 'URL video?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, sau Youku)'
},
table: {

@@ -44,0 +35,0 @@ table: 'Tabel'

@@ -8,9 +8,5 @@ (function ($) {

underline: 'Подчёркнутый',
strikethrough: 'Зачёркнутый',
subscript: 'Нижний индекс',
superscript: 'Верхний индекс',
clear: 'Убрать стили шрифта',
height: 'Высота линии',
name: 'Шрифт',
size: 'Размер шрифта'
name: 'Шрифт'
},

@@ -40,9 +36,2 @@ image: {

},
video: {
video: 'Видео',
videoLink: 'Ссылка на видео',
insert: 'Вставить видео',
url: 'URL видео',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion или Youku)'
},
table: {

@@ -100,3 +89,3 @@ table: 'Таблица'

paragraphFormatting: 'Форматирование параграфа',
documentStyle: 'Стиль документа',
documentStyle: 'Стиль документа',
extraKeys: 'Дополнительные комбинации'

@@ -103,0 +92,0 @@ },

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Podtržené',
strikethrough: 'Preškrtnuté',
clear: 'Odstrániť štýl písma',
height: 'Výška riadku',
size: 'Veľkosť písma'
height: 'Výška riadku'
},

@@ -36,9 +34,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Odkaz videa',
insert: 'Vložiť video',
url: 'URL videa?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion nebo Youku)'
},
table: {

@@ -45,0 +36,0 @@ table: 'Tabuľka'

@@ -8,9 +8,5 @@ (function ($) {

underline: 'Podčrtano',
strikethrough: 'Prečrtano',
subscript: 'Podpisano',
superscript: 'Nadpisano',
clear: 'Počisti oblikovanje izbire',
height: 'Razmik med vrsticami',
name: 'Pisava',
size: 'Velikost pisave'
name: 'Pisava'
},

@@ -40,9 +36,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Video povezava',
insert: 'Vstavi video',
url: 'Povezava do videa',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ali Youku)'
},
table: {

@@ -49,0 +38,0 @@ table: 'Tabela'

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Podvučeno',
strikethrough: 'Precrtano',
clear: 'Ukloni stilove fonta',
height: 'Visina linije',
size: 'Veličina fonta'
height: 'Visina linije'
},

@@ -37,9 +35,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Veza ka videu',
insert: 'Umetni video',
url: 'URL video',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ili Youku)'
},
table: {

@@ -46,0 +37,0 @@ table: 'Tabela'

@@ -8,6 +8,4 @@ (function ($) {

underline: 'Подвучено',
strikethrough: 'Прецртано',
clear: 'Уклони стилове фонта',
height: 'Висина линије',
size: 'Величина фонта'
height: 'Висина линије'
},

@@ -37,9 +35,2 @@ image: {

},
video: {
video: 'Видео',
videoLink: 'Веза ка видеу',
insert: 'Уметни видео',
url: 'URL видео',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion или Youku)'
},
table: {

@@ -46,0 +37,0 @@ table: 'Табела'

@@ -8,7 +8,5 @@ (function ($) {

underline: 'Understruken',
strikethrough: 'Genomstruken',
clear: 'Radera formatering',
height: 'Radavstånd',
name: 'Teckensnitt',
size: 'Teckenstorlek'
name: 'Teckensnitt'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Filmklipp',
videoLink: 'Länk till filmklipp',
insert: 'Infoga filmklipp',
url: 'Länk till filmklipp',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion eller Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Tabell'

@@ -8,9 +8,5 @@ (function ($) {

underline: 'ขีดเส้นใต้',
strikethrough: 'ขีดฆ่า',
subscript: 'ตัวห้อย',
superscript: 'ตัวยก',
clear: 'ล้างรูปแบบตัวอักษร',
height: 'ความสูงบรรทัด',
name: 'แบบตัวอักษร',
size: 'ขนาดตัวอักษร'
name: 'แบบตัวอักษร'
},

@@ -40,9 +36,2 @@ image: {

},
video: {
video: 'วีดีโอ',
videoLink: 'ลิงก์ของวีดีโอ',
insert: 'แทรกวีดีโอ',
url: 'ที่อยู่ URL ของวีดีโอ?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion หรือ Youku)'
},
table: {

@@ -49,0 +38,0 @@ table: 'ตาราง'

@@ -8,6 +8,5 @@ (function ($) {

underline: 'Altı çizili',
strikethrough: 'Üstü çizili',
clear: 'Temizle',
height: 'Satır yüksekliği',
size: 'Yazı tipi boyutu'
name: 'Yazı Tipi'
},

@@ -23,5 +22,10 @@ image: {

floatNone: 'Hizalamayı kaldır',
shapeRounded: 'Şekil: Yuvarlatılmış Köşe',
shapeCircle: 'Şekil: Daire',
shapeThumbnail: 'Şekil: K.Resim',
shapeNone: 'Şekil: Yok',
dragImageHere: 'Buraya sürükleyin',
selectFromFiles: 'Dosya seçin',
url: 'Resim bağlantısı'
url: 'Resim bağlantısı',
remove: 'Resimi Kaldır'
},

@@ -34,11 +38,5 @@ link: {

textToDisplay: 'Görüntülemek için',
url: 'Bağlantı adresi?'
url: 'Bağlantı adresi?',
openInNewWindow: 'Yeni pencerede aç'
},
video: {
video: 'Video',
videoLink: 'Video bağlantısı',
insert: 'Video ekle',
url: 'Video bağlantısı?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion veya Youku)'
},
table: {

@@ -45,0 +43,0 @@ table: 'Tablo'

@@ -8,9 +8,5 @@ (function ($) {

underline: 'Підкреслений',
strikethrough: 'Закреслений',
subscript: 'Нижній індекс',
superscript: 'Верхній індекс',
clear: 'Прибрати стилі шрифту',
height: 'Висота лінії',
name: 'Шрифт',
size: 'Розмір шрифту'
name: 'Шрифт'
},

@@ -40,9 +36,2 @@ image: {

},
video: {
video: 'Відео',
videoLink: 'Посилання на відео',
insert: 'Вставити відео',
url: 'URL відео',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion чи Youku)'
},
table: {

@@ -49,0 +38,0 @@ table: 'Таблиця'

@@ -5,10 +5,8 @@ (function ($) {

font: {
bold: 'In Đậm',
bold: 'In Đậm',
italic: 'In Nghiên',
underline: 'Gạch Dưới',
strikethrough: 'Gạch Ngang',
clear: 'Bỏ Định Dạng',
height: 'Khoảng Cách Hàng',
size: 'Cỡ Chữ',
name: 'Phông Chữ',
name: 'Phông Chữ'
},

@@ -38,9 +36,2 @@ image: {

},
video: {
video: 'Video',
videoLink: 'Đường Dẫn đến Video',
insert: 'Chèn Video',
url: 'URL',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion và Youku)'
},
table: {

@@ -47,0 +38,0 @@ table: 'Bảng'

@@ -8,7 +8,5 @@ (function ($) {

underline: '下划线',
strikethrough: '删除线',
clear: '清除格式',
height: '行高',
name:'字体',
size: '字号'
name: '字体'
},

@@ -37,9 +35,2 @@ image: {

},
video: {
video: '视频',
videoLink: '视频链接',
insert: '插入视频',
url: '视频地址',
providers: '(优酷, Instagram, DailyMotion, Youtube等)'
},
table: {

@@ -46,0 +37,0 @@ table: '表格'

@@ -8,6 +8,4 @@ (function ($) {

underline: '底線',
strikethrough: '刪除線',
clear: '清除格式',
height: '行高',
size: '字體大小'
height: '行高'
},

@@ -36,9 +34,2 @@ image: {

},
video: {
video: '影片',
videoLink: '影片連結',
insert: '插入影片',
url: '影片網址',
providers: '(優酷, Instagram, DailyMotion, Youtube等)'
},
table: {

@@ -45,0 +36,0 @@ table: '表格'

{
"name": "summernote",
"description": "Super Simple WYSIWYG Editor on Bootstrap",
"version": "0.5.9",
"version": "0.6.0-ga",
"repository": {

@@ -23,2 +23,3 @@ "type": "git",

"grunt-contrib-connect": "*",
"grunt-shell": "^1.1.1",
"connect-livereload": "*"

@@ -25,0 +26,0 @@ },

# Summernote
Super Simple WYSIWYG Editor on Bootstrap(3.0 and 2.x).
Super simple WYSIWYG Editor using Bootstrap (3.0 and 2.x).

@@ -7,3 +7,3 @@ [![Build Status](https://secure.travis-ci.org/HackerWins/summernote.png)](http://travis-ci.org/HackerWins/summernote)

### Summernote
Summernote is a javascript program that helps you to create WYSIWYG Editor on web.
Summernote is a JavaScript library that helps you create WYSIWYG editors online.

@@ -14,19 +14,26 @@ Home Page: http://hackerwins.github.io/summernote/

Summernote has something specials no like others.
Summernote has a few special features:
* Paste images from clipboard
* Saves images directly in the content of the field using base64 encoding, so you don't need to implement image handling at all
* Simple UI
* Interative WYSIWYG editing
* Interactive WYSIWYG editing
* Handy integration with server
#### Inspired by
* Gmail WYSIWYG Editor (http://www.gmail.com)
* Gmail's WYSIWYG editor (http://www.gmail.com)
* Redactor (http://imperavi.com/redactor/)
### Easy to install
### Installation and dependencies
Summernote uses opensouce libraries(jQuery, bootstrap, fontAwesome)
Summernote uses opensouce libraries: [jQuery](http://jquery.com/), [Bootstrap](http://getbootstrap.com), [Font Awesome](https://github.com/FortAwesome/Font-Awesome).
#### 01. include js/css
For [Meteor](http://github.com/meteor/meteor), just run `meteor add summernote:summernote`. More info in the [Meteor README](meteor/README.md).
Include Following code into `<head>` tag of your HTML:
For other/no frameworks:
#### 1. include JS/CSS
Include the following code in the `<head>` tag of your HTML:
```html

@@ -44,6 +51,6 @@ <!-- include libraries(jQuery, bootstrap, fontawesome) -->

If your summernote download is placed in a different folder, don't forget to change file's paths.
#### 2. target elements
#### 02. target elements
And place `div` tag to somewhere in the `body` tag. This element will be placed by the visual representation of the summernote.
Then place a `div` tag somewhere in the `body` tag. This element will be replaced with the summernote editor.
```html

@@ -53,4 +60,6 @@ <div id="summernote">Hello Summernote</div>

#### 03. summernote
Finally, run script after document ready.
#### 3. summernote
Finally, run this script after the DOM is ready:
```javascript

@@ -63,4 +72,5 @@ $(document).ready(function() {

### API
Get HTML `code` if you need.
`code` - get the HTML source code underlying the text in the editor:
```javascript

@@ -70,3 +80,3 @@ var sHTML = $('#summernote').code();

`Destroy` summernote.
`Destroy` summernote:

@@ -77,81 +87,16 @@ ```javascript

#### Dependencies
* jQuery: http://jquery.com/
* Bootstrap: http://getbootstrap.com (both 2.x and 3.x)
* fontAwesome: https://github.com/FortAwesome/Font-Awesome (both 3.x and 4.x)
### Supported platforms
### Supported platform
* Modern Browser (Safari, Chrome, Firefox, Opera, Internet Explorer 9+)
* OS (Windows, Mac, Linux)
Any modern browser: Safari, Chrome, Firefox, Opera, Internet Explorer 9+.
### Upcoming Features
* Responsive Toolbar
* Table: Handles(Sizing, Selection) and Popover
* support IE8
* Clipboard
* Media Object Selection
* Responsive toolbar
* Table: Handles (sizing, selection) and popover
* IE8 Support
* Clipboard (you can paste images already)
* Media object selection
### Change Log
#### v0.5.9 2014-09-21
* Dom Editing: insert(Un)OrderedList, indent/outdent
* History in a line.
### Developer information
#### v0.5.8 2014-08-31
* Remove `autoFormatRange` option
* Fixed `onChange` issues
#### v0.5.7 ~ v0.5.4 2014-08-29 ~ 2014-08-23
* Dom editing: insertPara, insertNode
#### v0.5.3 2014-07-25
* Extract codemirror.autoFormatOnStart option
* Bug patch (createLink)
#### v0.5.2 2014-07-20
* Air Mode
* And bug patch (scroll, createLink, ...)
#### v0.5.1 2014-03-16
* Support 15 Languages(https://github.com/HackerWins/summernote/tree/master/lang)
* Add local-server for develop summernote.
* Font style: Font-Family
* And Bug patch.
#### v0.5 2013-12-29
* Support both Font-Awesome 3.x and 4.x
* CodeMirror as Codeview
* Insert Video (by cdownie)
* Support 5 Languages(by hendrismit, tschiela, inomies, cverond)
* Restructuring: jQuery build pattern
#### v0.4 2013-11-01
* Support both Bootstrap 3.0 and 2.x
* Fullscreen
* Codeview
* Image Upload callback
#### v0.3 2013-09-01
* Bugs(image upload, fontsize, tab, recent color, ...)
* Help dialog(keyboard shortcut)
* Init options(event callbacks, custom toolbar)
* Resize bar
* Support IE8 Beta(some range bugs, can't insert Image)
#### v0.2, 2013-08-01
* Undo/Redo
* Image sizing handle and popover
* Support standalone css
* Support Multiple Editor
* Remove jQuery.curstyles dependency
#### v0.1, 2013-07-01
* Font style: size, color, bold, italic, underline, remove font style
* Para style: bullet, align, outdent, indent, line height
* Image: drag & drop, dialog
* Link: popover and dialog
* Table: create table with dimension picker
### for Hacker
#### structure of summernote.js

@@ -158,0 +103,0 @@

@@ -6,2 +6,3 @@ require.config({

bootstrap: '//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min',
summernotevideo: '/../../plugin/summernote-ext-video',
CodeMirror: '//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror',

@@ -15,3 +16,4 @@ CodeMirrorXml: '//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.min',

CodeMirrorXml: ['CodeMirror'],
CodeMirrorFormatting: ['CodeMirror', 'CodeMirrorXml']
CodeMirrorFormatting: ['CodeMirror', 'CodeMirrorXml'],
summernotevideo: ['summernote']
},

@@ -27,3 +29,3 @@ packages: [{

'jquery', 'bootstrap', 'CodeMirrorFormatting',
'summernote'
'summernote', 'summernotevideo'
], function ($) {

@@ -35,2 +37,3 @@ // summernote

tabsize: 2, // size of tab
placeholder: 'Type your message here...', // set editable area's placeholder text
codemirror: { // code mirror options

@@ -37,0 +40,0 @@ mode: 'text/html',

@@ -37,3 +37,3 @@ define('summernote/core/async', function () {

}).one('error abort', function () {
deferred.reject($(this));
deferred.reject($(this).detach());
}).css({

@@ -40,0 +40,0 @@ display: 'none'

@@ -1,2 +0,4 @@

define('summernote/core/key', function () {
define([
'summernote/core/list'
], function (list) {
/**

@@ -7,3 +9,3 @@ * Object for keycodes.

isEdit: function (keyCode) {
return [8, 9, 13, 32].indexOf(keyCode) !== -1;
return list.contains([8, 9, 13, 32], keyCode);
},

@@ -10,0 +12,0 @@ nameFromCode: {

@@ -70,3 +70,3 @@ define(['summernote/core/func'], function (func) {

var contains = function (array, item) {
return array.indexOf(item) !== -1;
return $.inArray(item, array) !== -1;
};

@@ -143,3 +143,3 @@

for (var idx = 0, len = array.length; idx < len; idx ++) {
if (results.indexOf(array[idx]) === -1) {
if (!contains(results, array[idx])) {
results.push(array[idx]);

@@ -151,5 +151,28 @@ }

};
/**
* returns next item.
* @param {Array} array
*/
var next = function (array, item) {
var idx = array.indexOf(item);
if (idx === -1) { return null; }
return array[idx + 1];
};
/**
* returns prev item.
* @param {Array} array
*/
var prev = function (array, item) {
var idx = array.indexOf(item);
if (idx === -1) { return null; }
return array[idx - 1];
};
return { head: head, last: last, initial: initial, tail: tail,
find: find, contains: contains,
prev: prev, next: next, find: find, contains: contains,
all: all, sum: sum, from: from,

@@ -156,0 +179,0 @@ clusterBy: clusterBy, compact: compact, unique: unique };

@@ -438,14 +438,21 @@ define([

this.wrapBodyInlineWithPara = function () {
// startContainer on bodyContainer
if (dom.isEditable(sc) && !sc.childNodes[so]) {
return new WrappedRange(sc.appendChild($(dom.emptyPara)[0]), 0);
} else if (!dom.isInline(sc) || dom.isParaInline(sc)) {
return this;
if (dom.isBodyContainer(sc) && dom.isEmpty(sc)) {
sc.innerHTML = dom.emptyPara;
return new WrappedRange(sc.firstChild, 0);
}
if (dom.isParaInline(sc) || dom.isPara(sc)) {
return this.normalize();
}
// find inline top ancestor
var ancestors = dom.listAncestor(sc, func.not(dom.isInline));
var topAncestor = list.last(ancestors);
if (!dom.isInline(topAncestor)) {
topAncestor = ancestors[ancestors.length - 2] || sc.childNodes[so];
var topAncestor;
if (dom.isInline(sc)) {
var ancestors = dom.listAncestor(sc, func.not(dom.isInline));
topAncestor = list.last(ancestors);
if (!dom.isInline(topAncestor)) {
topAncestor = ancestors[ancestors.length - 2] || sc.childNodes[so];
}
} else {
topAncestor = sc.childNodes[so - 1];
}

@@ -463,3 +470,3 @@

return this;
return this.normalize();
};

@@ -576,3 +583,10 @@

endPoint = textRangeToPoint(textRangeEnd, false);
// same visible point case: range was collapsed.
if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&
dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&
endPoint.node.nextSibling === startPoint.node) {
startPoint = endPoint;
}
sc = startPoint.cont;

@@ -579,0 +593,0 @@ so = startPoint.offset;

@@ -26,2 +26,10 @@ define([

/**
* create range
*/
this.createRange = function ($editable) {
$editable.focus();
return range.create();
};
/**
* save current range

@@ -116,3 +124,3 @@ *

*
* @param {jQuery} $editable
* @param {jQuery} $editable
* @param {Object} options

@@ -205,65 +213,21 @@ */

/**
* insert video
* @param {jQuery} $editable
* @param {String} sUrl
* insert node
* @param {Node} $editable
* @param {Node} node
* @param {Boolean} [isInline]
*/
this.insertVideo = function ($editable, sUrl) {
// video url patterns(youtube, instagram, vimeo, dailymotion, youku)
var ytRegExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
var ytMatch = sUrl.match(ytRegExp);
this.insertNode = function ($editable, node, isInline) {
range.create().insertNode(node, isInline);
afterCommand($editable);
};
var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/;
var igMatch = sUrl.match(igRegExp);
var vRegExp = /\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/;
var vMatch = sUrl.match(vRegExp);
var vimRegExp = /\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/;
var vimMatch = sUrl.match(vimRegExp);
var dmRegExp = /.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/;
var dmMatch = sUrl.match(dmRegExp);
var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)\.html/;
var youkuMatch = sUrl.match(youkuRegExp);
var $video;
if (ytMatch && ytMatch[2].length === 11) {
var youtubeId = ytMatch[2];
$video = $('<iframe>')
.attr('src', '//www.youtube.com/embed/' + youtubeId)
.attr('width', '640').attr('height', '360');
} else if (igMatch && igMatch[0].length) {
$video = $('<iframe>')
.attr('src', igMatch[0] + '/embed/')
.attr('width', '612').attr('height', '710')
.attr('scrolling', 'no')
.attr('allowtransparency', 'true');
} else if (vMatch && vMatch[0].length) {
$video = $('<iframe>')
.attr('src', vMatch[0] + '/embed/simple')
.attr('width', '600').attr('height', '600')
.attr('class', 'vine-embed');
} else if (vimMatch && vimMatch[3].length) {
$video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')
.attr('src', '//player.vimeo.com/video/' + vimMatch[3])
.attr('width', '640').attr('height', '360');
} else if (dmMatch && dmMatch[2].length) {
$video = $('<iframe>')
.attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])
.attr('width', '640').attr('height', '360');
} else if (youkuMatch && youkuMatch[1].length) {
$video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')
.attr('height', '498')
.attr('width', '510')
.attr('src', '//player.youku.com/embed/' + youkuMatch[1]);
} else {
// this is not a known video link. Now what, Cat? Now what?
}
if ($video) {
$video.attr('frameborder', 0);
range.create().insertNode($video[0]);
afterCommand($editable);
}
/**
* insert text
* @param {Node} $editable
* @param {String} text
*/
this.insertText = function ($editable, text) {
var textNode = this.createRange($editable).insertNode(dom.createText(text), true);
range.create(textNode, dom.nodeLength(textNode)).select();
afterCommand($editable);
};

@@ -404,23 +368,2 @@

/**
* get video info
*
* @param {jQuery} $editable
* @return {Object}
*/
this.getVideoInfo = function ($editable) {
$editable.focus();
var rng = range.create();
if (rng.isOnAnchor()) {
var anchor = dom.ancestor(rng.sc, dom.isAnchor);
rng = range.createFromNode(anchor);
}
return {
text: rng.toString()
};
};
this.color = function ($editable, sObjColor) {

@@ -454,2 +397,12 @@ var oColor = JSON.parse(sObjColor);

this.imageShape = function ($editable, value, $target) {
$target.removeClass('img-rounded img-circle img-thumbnail');
if (value) {
$target.addClass(value);
}
afterCommand($editable);
};
/**

@@ -463,3 +416,3 @@ * resize overlay element

$target.css({
width: $editable.width() * value + 'px',
width: value * 100 + '%',
height: ''

@@ -466,0 +419,0 @@ });

@@ -7,3 +7,3 @@ define(['summernote/core/range'], function (range) {

var History = function ($editable) {
var stack = [], stackOffset = 0;
var stack = [], stackOffset = -1;
var editable = $editable[0];

@@ -45,2 +45,4 @@

this.recordUndo = function () {
stackOffset++;
// Wash out stack after stackOffset

@@ -53,3 +55,2 @@ if (stack.length > stackOffset) {

stack.push(makeSnapshot());
stackOffset++;
};

@@ -56,0 +57,0 @@

@@ -31,15 +31,30 @@ define([

// Wrap range if it needs to be wrapped by paragraph
rng = rng.wrapBodyInlineWithPara();
// find split root node: block level node
// finding paragraph
var splitRoot = dom.ancestor(rng.sc, dom.isPara);
var nextPara = dom.splitTree(splitRoot, rng.getStartPoint());
var emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);
emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));
var nextPara;
// on paragraph: split paragraph
if (splitRoot) {
nextPara = dom.splitTree(splitRoot, rng.getStartPoint());
$.each(emptyAnchors, function (idx, anchor) {
dom.remove(anchor);
});
var emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);
emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));
$.each(emptyAnchors, function (idx, anchor) {
dom.remove(anchor);
});
// no paragraph: insert empty paragraph
} else {
var next = rng.sc.childNodes[rng.so];
nextPara = $(dom.emptyPara)[0];
if (next) {
rng.sc.insertBefore(nextPara, next);
} else {
rng.sc.appendChild(nextPara);
}
}
range.create(nextPara, 0).normalize().select();

@@ -46,0 +61,0 @@ };

@@ -32,2 +32,6 @@ define([

this.getEditor = function () {
return editor;
};
/**

@@ -57,8 +61,11 @@ * returns makeLayoutInfo from editor's descendant node.

*
* @param {jQuery} $editable
* @param {Object} layoutInfo
* @param {File[]} files
*/
var insertImages = function ($editable, files) {
editor.restoreRange($editable);
var insertImages = function (layoutInfo, files) {
var $editor = layoutInfo.editor(),
$editable = layoutInfo.editable();
var callbacks = $editable.data('callbacks');
var options = $editor.data('options');

@@ -72,9 +79,17 @@ // If onImageUpload options setted

var filename = file.name;
async.readFileAsDataURL(file).then(function (sDataURL) {
editor.insertImage($editable, sDataURL, filename);
}).fail(function () {
if (options.maximumImageFileSize && options.maximumImageFileSize < file.size) {
if (callbacks.onImageUploadError) {
callbacks.onImageUploadError();
callbacks.onImageUploadError(options.langInfo.image.maximumFileSizeError);
} else {
alert(options.langInfo.image.maximumFileSizeError);
}
});
} else {
async.readFileAsDataURL(file).then(function (sDataURL) {
editor.insertImage($editable, sDataURL, filename);
}).fail(function () {
if (callbacks.onImageUploadError) {
callbacks.onImageUploadError();
}
});
}
});

@@ -123,3 +138,3 @@ }

// array of files
insertImages($editable, data);
insertImages(layoutInfo, data);
}

@@ -134,19 +149,2 @@ }).fail(function () {

*/
showVideoDialog: function (layoutInfo) {
var $dialog = layoutInfo.dialog(),
$editable = layoutInfo.editable(),
videoInfo = editor.getVideoInfo($editable);
editor.saveRange($editable);
dialog.showVideoDialog($editable, $dialog, videoInfo).then(function (sUrl) {
editor.restoreRange($editable);
editor.insertVideo($editable, sUrl);
}).fail(function () {
editor.restoreRange($editable);
});
},
/**
* @param {Object} layoutInfo
*/
showHelpDialog: function (layoutInfo) {

@@ -168,6 +166,3 @@ var $dialog = layoutInfo.dialog(),

var options = $editor.data('options');
var resize = function (size) {
$editor.css('width', size.w);
$editable.css('height', size.h);

@@ -187,3 +182,2 @@ $codable.css('height', size.h);

resize({
w: $window.width(),
h: $window.height() - $toolbar.outerHeight()

@@ -197,3 +191,2 @@ });

resize({
w: options.width || '',
h: $editable.data('orgheight')

@@ -212,3 +205,4 @@ });

$codable = layoutInfo.codable(),
$popover = layoutInfo.popover();
$popover = layoutInfo.popover(),
$handle = layoutInfo.handle();

@@ -227,2 +221,3 @@ var options = $editor.data('options');

popover.hide($popover);
handle.hide($handle);
$codable.focus();

@@ -308,3 +303,5 @@

var layoutInfo = makeLayoutInfo(event.currentTarget || event.target);
var layoutInfo = makeLayoutInfo(event.currentTarget || event.target),
$editable = layoutInfo.editable();
var item = list.head(clipboardData.items);

@@ -314,4 +311,6 @@ var isClipboardImage = item.kind === 'file' && item.type.indexOf('image/') !== -1;

if (isClipboardImage) {
insertImages(layoutInfo.editable(), [item.getAsFile()]);
insertImages(layoutInfo, [item.getAsFile()]);
}
editor.afterCommand($editable);
};

@@ -351,2 +350,3 @@

$document.off('mousemove');
editor.afterCommand($editable);
});

@@ -357,4 +357,2 @@

}
editor.afterCommand($editable);
}

@@ -385,3 +383,3 @@ };

var $target;
if ($.inArray(eventName, ['resize', 'floatMe', 'removeMedia']) !== -1) {
if ($.inArray(eventName, ['resize', 'floatMe', 'removeMedia', 'imageShape']) !== -1) {
var $selection = layoutInfo.handle().find('.note-control-selection');

@@ -396,3 +394,3 @@ $target = $($selection.data('target'));

}
if (editor[eventName]) { // on command

@@ -404,2 +402,4 @@ var $editable = layoutInfo.editable();

commands[eventName].call(this, layoutInfo);
} else if ($.isFunction($.summernote.pluginEvents[eventName])) {
$.summernote.pluginEvents[eventName](layoutInfo, value, $target);
}

@@ -492,6 +492,6 @@

* @param {Object} layoutInfo - layout Informations
* @param {Boolean} disableDragAndDrop
* @param {Object} options
*/
var handleDragAndDropEvent = function (layoutInfo, disableDragAndDrop) {
if (disableDragAndDrop) {
var handleDragAndDropEvent = function (layoutInfo, options) {
if (options.disableDragAndDrop) {
// prevent default drop event

@@ -502,3 +502,3 @@ $document.on('drop', function (e) {

} else {
attachDragAndDropEvent(layoutInfo);
attachDragAndDropEvent(layoutInfo, options);
}

@@ -511,4 +511,5 @@ };

* @param {Object} layoutInfo - layout Informations
* @param {Object} options
*/
var attachDragAndDropEvent = function (layoutInfo) {
var attachDragAndDropEvent = function (layoutInfo, options) {
var collection = $(),

@@ -525,3 +526,3 @@ $dropzone = layoutInfo.dropzone,

$dropzone.height(layoutInfo.editor.height());
$dropzoneMessage.text('Drag Image Here');
$dropzoneMessage.text(options.langInfo.image.dragImageHere);
}

@@ -542,6 +543,6 @@ collection = collection.add(e.target);

$dropzone.addClass('hover');
$dropzoneMessage.text('Drop Image');
$dropzoneMessage.text(options.langInfo.image.dropImage);
}).on('dragleave', function () {
$dropzone.removeClass('hover');
$dropzoneMessage.text('Drag Image Here');
$dropzoneMessage.text(options.langInfo.image.dragImageHere);
});

@@ -557,3 +558,3 @@

layoutInfo.editable().focus();
insertImages(layoutInfo.editable(), dataTransfer.files);
insertImages(layoutInfo, dataTransfer.files);
}

@@ -596,2 +597,7 @@ }).on('dragover', false); // prevent default dragover event

commands[eventName].call(this, layoutInfo);
} else if ($.summernote.plugins[eventName]) {
var plugin = $.summernote.plugins[eventName];
if ($.isFunction(plugin.event)) {
plugin.event(event, editor, layoutInfo);
}
}

@@ -613,3 +619,5 @@ } else if (key.isEdit(event.keyCode)) {

// handlers for editable
this.bindKeyMap(layoutInfo, options.keyMap[agent.isMac ? 'mac' : 'pc']);
if (options.shortcuts) {
this.bindKeyMap(layoutInfo, options.keyMap[agent.isMac ? 'mac' : 'pc']);
}
layoutInfo.editable.on('mousedown', hMousedown);

@@ -628,3 +636,3 @@ layoutInfo.editable.on('keyup mouseup', hToolbarAndPopoverUpdate);

// handler for drag and drop
handleDragAndDropEvent(layoutInfo, options.disableDragAndDrop);
handleDragAndDropEvent(layoutInfo, options);

@@ -656,6 +664,6 @@ // handler for toolbar

// ret styleWithCSS for backColor / foreColor clearing with 'inherit'.
if (options.styleWithSpan && !agent.isMSIE) {
if (!agent.isMSIE) {
// protect FF Error: NS_ERROR_FAILURE: Failure
setTimeout(function () {
document.execCommand('styleWithCSS', 0, true);
document.execCommand('styleWithCSS', 0, options.styleWithSpan);
}, 0);

@@ -709,3 +717,3 @@ }

this.dettach = function (layoutInfo, options) {
this.detach = function (layoutInfo, options) {
layoutInfo.editable.off();

@@ -712,0 +720,0 @@

@@ -76,38 +76,2 @@ define('summernote/module/Dialog', function () {

/**
* Show video dialog and set event handlers on dialog controls.
*
* @param {jQuery} $dialog
* @param {Object} videoInfo
* @return {Promise}
*/
this.showVideoDialog = function ($editable, $dialog, videoInfo) {
return $.Deferred(function (deferred) {
var $videoDialog = $dialog.find('.note-video-dialog');
var $videoUrl = $videoDialog.find('.note-video-url'),
$videoBtn = $videoDialog.find('.note-video-btn');
$videoDialog.one('shown.bs.modal', function () {
$videoUrl.val(videoInfo.text).keyup(function () {
toggleBtn($videoBtn, $videoUrl.val());
}).trigger('keyup').trigger('focus');
$videoBtn.click(function (event) {
event.preventDefault();
deferred.resolve($videoUrl.val());
$videoDialog.modal('hide');
});
}).one('hidden.bs.modal', function () {
// dettach events
$videoUrl.off('keyup');
$videoBtn.off('click');
if (deferred.state() === 'pending') {
deferred.reject();
}
}).modal('show');
});
};
/**
* Show link dialog and set event handlers on dialog controls.

@@ -131,3 +95,3 @@ *

$linkText.keyup(function () {
$linkText.on('input', function () {
// if linktext was modified by keyup,

@@ -144,3 +108,3 @@ // stop cloning text from linkUrl

$linkUrl.keyup(function () {
$linkUrl.on('input', function () {
toggleBtn($linkBtn, $linkUrl.val());

@@ -168,5 +132,5 @@ // display same link on `Text to display` input

}).one('hidden.bs.modal', function () {
// dettach events
$linkText.off('keyup');
$linkUrl.off('keyup');
// detach events
$linkText.off('input');
$linkUrl.off('input');
$linkBtn.off('click');

@@ -173,0 +137,0 @@

@@ -93,3 +93,3 @@ define([

* hide all popovers
* @param {jQuery} $popover - popover contaienr
* @param {jQuery} $popover - popover container
*/

@@ -96,0 +96,0 @@ this.hide = function ($popover) {

@@ -96,5 +96,3 @@ define([

'<form class="note-modal-form">' +
'<div class="modal-body">' +
'<div class="row-fluid">' + body + '</div>' +
'</div>' +
'<div class="modal-body">' + body + '</div>' +
(footer ?

@@ -111,3 +109,3 @@ '<div class="modal-footer">' + footer + '</div>' : ''

picture: function (lang) {
return tplIconButton('fa fa-picture-o icon-picture', {
return tplIconButton('fa fa-picture-o', {
event: 'showImageDialog',

@@ -119,3 +117,3 @@ title: lang.image.image,

link: function (lang) {
return tplIconButton('fa fa-link icon-link', {
return tplIconButton('fa fa-link', {
event: 'showLinkDialog',

@@ -126,9 +124,2 @@ title: lang.link.link,

},
video: function (lang) {
return tplIconButton('fa fa-youtube-play icon-play', {
event: 'showVideoDialog',
title: lang.video.video,
hide: true
});
},
table: function (lang) {

@@ -143,3 +134,3 @@ var dropdown = '<ul class="note-table dropdown-menu">' +

'</ul>';
return tplIconButton('fa fa-table icon-table', {
return tplIconButton('fa fa-table', {
title: lang.table.table,

@@ -160,3 +151,3 @@ dropdown: dropdown

return tplIconButton('fa fa-magic icon-magic', {
return tplIconButton('fa fa-magic', {
title: lang.style.style,

@@ -170,3 +161,3 @@ dropdown: '<ul class="dropdown-menu">' + items + '</ul>'

return memo + '<li><a data-event="fontName" href="#" data-value="' + v + '">' +
'<i class="fa fa-check icon-ok"></i> ' + v +
'<i class="fa fa-check"></i> ' + v +
'</a></li>';

@@ -182,18 +173,4 @@ }, '');

},
fontsize: function (lang, options) {
var items = options.fontSizes.reduce(function (memo, v) {
return memo + '<li><a data-event="fontSize" href="#" data-value="' + v + '">' +
'<i class="fa fa-check icon-ok"></i> ' + v +
'</a></li>';
}, '');
var label = '<span class="note-current-fontsize">11</span>';
return tplButton(label, {
title: lang.font.size,
dropdown: '<ul class="dropdown-menu">' + items + '</ul>'
});
},
color: function (lang) {
var colorButtonLabel = '<i class="fa fa-font icon-font" style="color:black;background-color:yellow;"></i>';
var colorButtonLabel = '<i class="fa fa-font" style="color:black;background-color:yellow;"></i>';
var colorButton = tplButton(colorButtonLabel, {

@@ -234,3 +211,3 @@ className: 'note-recent-color',

bold: function (lang) {
return tplIconButton('fa fa-bold icon-bold', {
return tplIconButton('fa fa-bold', {
event: 'bold',

@@ -241,3 +218,3 @@ title: lang.font.bold

italic: function (lang) {
return tplIconButton('fa fa-italic icon-italic', {
return tplIconButton('fa fa-italic', {
event: 'italic',

@@ -248,3 +225,3 @@ title: lang.font.italic

underline: function (lang) {
return tplIconButton('fa fa-underline icon-underline', {
return tplIconButton('fa fa-underline', {
event: 'underline',

@@ -254,22 +231,4 @@ title: lang.font.underline

},
strikethrough: function (lang) {
return tplIconButton('fa fa-strikethrough icon-strikethrough', {
event: 'strikethrough',
title: lang.font.strikethrough
});
},
superscript: function (lang) {
return tplIconButton('fa fa-superscript icon-superscript', {
event: 'superscript',
title: lang.font.superscript
});
},
subscript: function (lang) {
return tplIconButton('fa fa-subscript icon-subscript', {
event: 'subscript',
title: lang.font.subscript
});
},
clear: function (lang) {
return tplIconButton('fa fa-eraser icon-eraser', {
return tplIconButton('fa fa-eraser', {
event: 'removeFormat',

@@ -280,3 +239,3 @@ title: lang.font.clear

ul: function (lang) {
return tplIconButton('fa fa-list-ul icon-list-ul', {
return tplIconButton('fa fa-list-ul', {
event: 'insertUnorderedList',

@@ -287,3 +246,3 @@ title: lang.lists.unordered

ol: function (lang) {
return tplIconButton('fa fa-list-ol icon-list-ol', {
return tplIconButton('fa fa-list-ol', {
event: 'insertOrderedList',

@@ -294,15 +253,15 @@ title: lang.lists.ordered

paragraph: function (lang) {
var leftButton = tplIconButton('fa fa-align-left icon-align-left', {
var leftButton = tplIconButton('fa fa-align-left', {
title: lang.paragraph.left,
event: 'justifyLeft'
});
var centerButton = tplIconButton('fa fa-align-center icon-align-center', {
var centerButton = tplIconButton('fa fa-align-center', {
title: lang.paragraph.center,
event: 'justifyCenter'
});
var rightButton = tplIconButton('fa fa-align-right icon-align-right', {
var rightButton = tplIconButton('fa fa-align-right', {
title: lang.paragraph.right,
event: 'justifyRight'
});
var justifyButton = tplIconButton('fa fa-align-justify icon-align-justify', {
var justifyButton = tplIconButton('fa fa-align-justify', {
title: lang.paragraph.justify,

@@ -312,7 +271,7 @@ event: 'justifyFull'

var outdentButton = tplIconButton('fa fa-outdent icon-indent-left', {
var outdentButton = tplIconButton('fa fa-outdent', {
title: lang.paragraph.outdent,
event: 'outdent'
});
var indentButton = tplIconButton('fa fa-indent icon-indent-right', {
var indentButton = tplIconButton('fa fa-indent', {
title: lang.paragraph.indent,

@@ -331,3 +290,3 @@ event: 'indent'

return tplIconButton('fa fa-align-left icon-align-left', {
return tplIconButton('fa fa-align-left', {
title: lang.paragraph.paragraph,

@@ -340,7 +299,7 @@ dropdown: dropdown

return memo + '<li><a data-event="lineHeight" href="#" data-value="' + parseFloat(v) + '">' +
'<i class="fa fa-check icon-ok"></i> ' + v +
'<i class="fa fa-check"></i> ' + v +
'</a></li>';
}, '');
return tplIconButton('fa fa-text-height icon-text-height', {
return tplIconButton('fa fa-text-height', {
title: lang.font.height,

@@ -352,3 +311,3 @@ dropdown: '<ul class="dropdown-menu">' + items + '</ul>'

help: function (lang) {
return tplIconButton('fa fa-question icon-question', {
return tplIconButton('fa fa-question', {
event: 'showHelpDialog',

@@ -360,3 +319,3 @@ title: lang.options.help,

fullscreen: function (lang) {
return tplIconButton('fa fa-arrows-alt icon-fullscreen', {
return tplIconButton('fa fa-arrows-alt', {
event: 'fullscreen',

@@ -367,3 +326,3 @@ title: lang.options.fullscreen

codeview: function (lang) {
return tplIconButton('fa fa-code icon-code', {
return tplIconButton('fa fa-code', {
event: 'codeview',

@@ -374,3 +333,3 @@ title: lang.options.codeview

undo: function (lang) {
return tplIconButton('fa fa-undo icon-undo', {
return tplIconButton('fa fa-undo', {
event: 'undo',

@@ -381,3 +340,3 @@ title: lang.history.undo

redo: function (lang) {
return tplIconButton('fa fa-repeat icon-repeat', {
return tplIconButton('fa fa-repeat', {
event: 'redo',

@@ -388,3 +347,3 @@ title: lang.history.redo

hr: function (lang) {
return tplIconButton('fa fa-minus icon-hr', {
return tplIconButton('fa fa-minus', {
event: 'insertHorizontalRule',

@@ -398,3 +357,3 @@ title: lang.hr.insert

var tplLinkPopover = function () {
var linkButton = tplIconButton('fa fa-edit icon-edit', {
var linkButton = tplIconButton('fa fa-edit', {
title: lang.link.edit,

@@ -404,3 +363,3 @@ event: 'showLinkDialog',

});
var unlinkButton = tplIconButton('fa fa-unlink icon-unlink', {
var unlinkButton = tplIconButton('fa fa-unlink', {
title: lang.link.unlink,

@@ -433,3 +392,3 @@ event: 'unlink'

var leftButton = tplIconButton('fa fa-align-left icon-align-left', {
var leftButton = tplIconButton('fa fa-align-left', {
title: lang.image.floatLeft,

@@ -439,3 +398,3 @@ event: 'floatMe',

});
var rightButton = tplIconButton('fa fa-align-right icon-align-right', {
var rightButton = tplIconButton('fa fa-align-right', {
title: lang.image.floatRight,

@@ -445,3 +404,3 @@ event: 'floatMe',

});
var justifyButton = tplIconButton('fa fa-align-justify icon-align-justify', {
var justifyButton = tplIconButton('fa fa-align-justify', {
title: lang.image.floatNone,

@@ -452,3 +411,24 @@ event: 'floatMe',

var removeButton = tplIconButton('fa fa-trash-o icon-trash', {
var roundedButton = tplIconButton('fa fa-square', {
title: lang.image.shapeRounded,
event: 'imageShape',
value: 'img-rounded'
});
var circleButton = tplIconButton('fa fa-circle-o', {
title: lang.image.shapeCircle,
event: 'imageShape',
value: 'img-circle'
});
var thumbnailButton = tplIconButton('fa fa-picture-o', {
title: lang.image.shapeThumbnail,
event: 'imageShape',
value: 'img-thumbnail'
});
var noneButton = tplIconButton('fa fa-times', {
title: lang.image.shapeNone,
event: 'imageShape',
value: ''
});
var removeButton = tplIconButton('fa fa-trash-o', {
title: lang.image.remove,

@@ -461,2 +441,3 @@ event: 'removeMedia',

'<div class="btn-group">' + leftButton + rightButton + justifyButton + '</div>' +
'<div class="btn-group">' + roundedButton + circleButton + thumbnailButton + noneButton + '</div>' +
'<div class="btn-group">' + removeButton + '</div>';

@@ -505,52 +486,66 @@ return tplPopover('note-image-popover', content);

*/
var tplShortcut = function (title, body) {
return '<table class="note-shortcut">' +
'<thead>' +
'<tr><th></th><th>' + title + '</th></tr>' +
'</thead>' +
'<tbody>' + body + '</tbody>' +
'</table>';
var tplShortcut = function (title, keys) {
var keyClass = 'note-shortcut-col col-xs-6 note-shortcut-';
var body = [];
for (var i in keys) {
body.push(
'<div class="' + keyClass + 'key">' + keys[i].kbd + '</div>' +
'<div class="' + keyClass + 'name">' + keys[i].text + '</div>'
);
}
return '<div class="note-shortcut-row row"><div class="' + keyClass + 'title col-xs-offset-6">' + title + '</div></div>' +
'<div class="note-shortcut-row row">' + body.join('</div><div class="note-shortcut-row row">') + '</div>';
};
var tplShortcutText = function (lang) {
var body = '<tr><td>⌘ + B</td><td>' + lang.font.bold + '</td></tr>' +
'<tr><td>⌘ + I</td><td>' + lang.font.italic + '</td></tr>' +
'<tr><td>⌘ + U</td><td>' + lang.font.underline + '</td></tr>' +
'<tr><td>⌘ + ⇧ + S</td><td>' + lang.font.strikethrough + '</td></tr>' +
'<tr><td>⌘ + \\</td><td>' + lang.font.clear + '</td></tr>';
var keys = [
{ kbd: '⌘ + B', text: lang.font.bold },
{ kbd: '⌘ + I', text: lang.font.italic },
{ kbd: '⌘ + U', text: lang.font.underline },
{ kbd: '⌘ + ⇧ + S', text: lang.font.sdivikethrough },
{ kbd: '⌘ + \\', text: lang.font.clear }
];
return tplShortcut(lang.shortcut.textFormatting, body);
return tplShortcut(lang.shortcut.textFormatting, keys);
};
var tplShortcutAction = function (lang) {
var body = '<tr><td>⌘ + Z</td><td>' + lang.history.undo + '</td></tr>' +
'<tr><td>⌘ + ⇧ + Z</td><td>' + lang.history.redo + '</td></tr>' +
'<tr><td>⌘ + ]</td><td>' + lang.paragraph.indent + '</td></tr>' +
'<tr><td>⌘ + [</td><td>' + lang.paragraph.outdent + '</td></tr>' +
'<tr><td>⌘ + ENTER</td><td>' + lang.hr.insert + '</td></tr>';
var keys = [
{ kbd: '⌘ + Z', text: lang.history.undo },
{ kbd: '⌘ + ⇧ + Z', text: lang.history.redo },
{ kbd: '⌘ + ]', text: lang.paragraph.indent },
{ kbd: '⌘ + [', text: lang.paragraph.oudivent },
{ kbd: '⌘ + ENTER', text: lang.hr.insert }
];
return tplShortcut(lang.shortcut.action, body);
return tplShortcut(lang.shortcut.action, keys);
};
var tplShortcutPara = function (lang) {
var body = '<tr><td>⌘ + ⇧ + L</td><td>' + lang.paragraph.left + '</td></tr>' +
'<tr><td>⌘ + ⇧ + E</td><td>' + lang.paragraph.center + '</td></tr>' +
'<tr><td>⌘ + ⇧ + R</td><td>' + lang.paragraph.right + '</td></tr>' +
'<tr><td>⌘ + ⇧ + J</td><td>' + lang.paragraph.justify + '</td></tr>' +
'<tr><td>⌘ + ⇧ + NUM7</td><td>' + lang.lists.ordered + '</td></tr>' +
'<tr><td>⌘ + ⇧ + NUM8</td><td>' + lang.lists.unordered + '</td></tr>';
var keys = [
{ kbd: '⌘ + ⇧ + L', text: lang.paragraph.left },
{ kbd: '⌘ + ⇧ + E', text: lang.paragraph.center },
{ kbd: '⌘ + ⇧ + R', text: lang.paragraph.right },
{ kbd: '⌘ + ⇧ + J', text: lang.paragraph.justify },
{ kbd: '⌘ + ⇧ + NUM7', text: lang.lists.ordered },
{ kbd: '⌘ + ⇧ + NUM8', text: lang.lists.unordered }
];
return tplShortcut(lang.shortcut.paragraphFormatting, body);
return tplShortcut(lang.shortcut.paragraphFormatting, keys);
};
var tplShortcutStyle = function (lang) {
var body = '<tr><td>⌘ + NUM0</td><td>' + lang.style.normal + '</td></tr>' +
'<tr><td>⌘ + NUM1</td><td>' + lang.style.h1 + '</td></tr>' +
'<tr><td>⌘ + NUM2</td><td>' + lang.style.h2 + '</td></tr>' +
'<tr><td>⌘ + NUM3</td><td>' + lang.style.h3 + '</td></tr>' +
'<tr><td>⌘ + NUM4</td><td>' + lang.style.h4 + '</td></tr>' +
'<tr><td>⌘ + NUM5</td><td>' + lang.style.h5 + '</td></tr>' +
'<tr><td>⌘ + NUM6</td><td>' + lang.style.h6 + '</td></tr>';
var keys = [
{ kbd: '⌘ + NUM0', text: lang.style.normal },
{ kbd: '⌘ + NUM1', text: lang.style.h1 },
{ kbd: '⌘ + NUM2', text: lang.style.h2 },
{ kbd: '⌘ + NUM3', text: lang.style.h3 },
{ kbd: '⌘ + NUM4', text: lang.style.h4 },
{ kbd: '⌘ + NUM5', text: lang.style.h5 },
{ kbd: '⌘ + NUM6', text: lang.style.h6 }
];
return tplShortcut(lang.shortcut.documentStyle, body);
return tplShortcut(lang.shortcut.documentStyle, keys);
};

@@ -560,22 +555,29 @@

var extraKeys = options.extraKeys;
var body = '';
var keys = [];
for (var key in extraKeys) {
if (extraKeys.hasOwnProperty(key)) {
body += '<tr><td>' + key + '</td><td>' + extraKeys[key] + '</td></tr>';
keys.push({ kbd: key, text: extraKeys[key] });
}
}
return tplShortcut(lang.shortcut.extraKeys, body);
return tplShortcut(lang.shortcut.extraKeys, keys);
};
var tplShortcutTable = function (lang, options) {
var template = '<table class="note-shortcut-layout">' +
'<tbody>' +
'<tr><td>' + tplShortcutAction(lang, options) + '</td><td>' + tplShortcutText(lang, options) + '</td></tr>' +
'<tr><td>' + tplShortcutStyle(lang, options) + '</td><td>' + tplShortcutPara(lang, options) + '</td></tr>';
var colClass = 'class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"';
var template = [
'<div ' + colClass + '>' + tplShortcutAction(lang, options) + '</div>' +
'<div ' + colClass + '>' + tplShortcutText(lang, options) + '</div>',
'<div ' + colClass + '>' + tplShortcutStyle(lang, options) + '</div>' +
'<div ' + colClass + '>' + tplShortcutPara(lang, options) + '</div>'
];
if (options.extraKeys) {
template += '<tr><td colspan="2">' + tplExtraShortcuts(lang, options) + '</td></tr>';
template.push('<div ' + colClass + '>' + tplExtraShortcuts(lang, options) + '</div>');
}
template += '</tbody></table>';
return template;
return '<div class="note-shortcut-row row">' +
template.join('</div><div class="note-shortcut-row row">') +
'</div>';
};

@@ -587,21 +589,31 @@

var tplDialogs = function (lang, options) {
var tplImageDialog = function () {
var body =
'<div class="note-group-select-from-files">' +
'<h5>' + lang.image.selectFromFiles + '</h5>' +
'<input class="note-image-input" type="file" name="files" accept="image/*" />' +
var tplDialogInfo = {
image: function (lang, options) {
var imageLimitation = '';
if (options.maximumImageFileSize) {
var unit = Math.floor(Math.log(options.maximumImageFileSize) / Math.log(1024));
var readableSize = (options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +
' ' + ' KMGTP'[unit] + 'B';
imageLimitation = '<small>' + lang.image.maximumFileSize + ' : ' + readableSize + '</small>';
}
var body = '<div class="form-group row-fluid note-group-select-from-files">' +
'<label>' + lang.image.selectFromFiles + '</label>' +
'<input class="note-image-input" type="file" name="files" accept="image/*" />' +
imageLimitation +
'</div>' +
'<h5>' + lang.image.url + '</h5>' +
'<input class="note-image-url form-control span12" type="text" />';
'<div class="form-group row-fluid">' +
'<label>' + lang.image.url + '</label>' +
'<input class="note-image-url form-control span12" type="text" />' +
'</div>';
var footer = '<button href="#" class="btn btn-primary note-image-btn disabled" disabled>' + lang.image.insert + '</button>';
return tplDialog('note-image-dialog', lang.image.insert, body, footer);
};
},
var tplLinkDialog = function () {
var body = '<div class="form-group">' +
link: function (lang, options) {
var body = '<div class="form-group row-fluid">' +
'<label>' + lang.link.textToDisplay + '</label>' +
'<input class="note-link-text form-control span12" type="text" />' +
'</div>' +
'<div class="form-group">' +
'<div class="form-group row-fluid">' +
'<label>' + lang.link.url + '</label>' +

@@ -619,14 +631,5 @@ '<input class="note-link-url form-control span12" type="text" />' +

return tplDialog('note-link-dialog', lang.link.insert, body, footer);
};
},
var tplVideoDialog = function () {
var body = '<div class="form-group">' +
'<label>' + lang.video.url + '</label>&nbsp;<small class="text-muted">' + lang.video.providers + '</small>' +
'<input class="note-video-url form-control span12" type="text" />' +
'</div>';
var footer = '<button href="#" class="btn btn-primary note-video-btn disabled" disabled>' + lang.video.insert + '</button>';
return tplDialog('note-video-dialog', lang.video.insert, body, footer);
};
var tplHelpDialog = function () {
help: function (lang, options) {
var body = '<a class="modal-close pull-right" aria-hidden="true" tabindex="-1">' + lang.shortcut.close + '</a>' +

@@ -641,10 +644,13 @@ '<div class="title">' + lang.shortcut.shortcuts + '</div>' +

return tplDialog('note-help-dialog', '', body, '');
};
}
};
return '<div class="note-dialog">' +
tplImageDialog() +
tplLinkDialog() +
tplVideoDialog() +
tplHelpDialog() +
'</div>';
var tplDialogs = function (lang, options) {
var dialogs = '';
$.each(tplDialogInfo, function (idx, tplDialog) {
dialogs += tplDialog(lang, options);
});
return '<div class="note-dialog">' + dialogs + '</div>';
};

@@ -731,5 +737,4 @@

this.createLayoutByAirMode = function ($holder, options) {
var langInfo = options.langInfo;
var keyMap = options.keyMap[agent.isMac ? 'mac' : 'pc'];
var langInfo = $.summernote.lang[options.lang];
var id = func.uniqueId();

@@ -776,2 +781,4 @@

this.createLayoutByFrame = function ($holder, options) {
var langInfo = options.langInfo;
//01. create Editor

@@ -798,4 +805,7 @@ var $editor = $('<div class="note-editor"></div>');

}
if (options.placeholder) {
$editable.attr('data-placeholder', options.placeholder);
}
$editable.html(dom.html($holder) || dom.emptyPara);
$editable.html(dom.html($holder));

@@ -805,4 +815,2 @@ //031. create codable

var langInfo = $.summernote.lang[options.lang];
//04. create Toolbar

@@ -816,5 +824,6 @@ var toolbarHTML = '';

for (var i = 0, btnLength = groupButtons.length; i < btnLength; i++) {
var buttonInfo = tplButtonInfo[groupButtons[i]];
// continue creating toolbar even if a button doesn't exist
if (!$.isFunction(tplButtonInfo[groupButtons[i]])) { continue; }
toolbarHTML += tplButtonInfo[groupButtons[i]](langInfo, options);
if (!$.isFunction(buttonInfo)) { continue; }
toolbarHTML += buttonInfo(langInfo, options);
}

@@ -924,2 +933,18 @@ toolbarHTML += '</div>';

};
this.getTemplate = function () {
return {
button: tplButton,
iconButton: tplIconButton,
dialog: tplDialog
};
};
this.addButtonInfo = function (name, buttonInfo) {
tplButtonInfo[name] = buttonInfo;
};
this.addDialogInfo = function (name, dialogInfo) {
tplDialogInfo[name] = dialogInfo;
};
};

@@ -926,0 +951,0 @@

@@ -25,2 +25,6 @@ define('summernote/settings', function () {

shortcuts: true, // enable keyboard shortcuts
placeholder: false, // enable placeholder text
codemirror: { // codemirror options

@@ -39,5 +43,4 @@ mode: 'text/html',

['style', ['style']],
['font', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
['font', ['bold', 'italic', 'underline', 'clear']],
['fontname', ['fontname']],
// ['fontsize', ['fontsize']], // Still buggy
['color', ['color']],

@@ -47,3 +50,3 @@ ['para', ['ul', 'ol', 'paragraph']],

['table', ['table']],
['insert', ['link', 'picture', 'video', 'hr']],
['insert', ['link', 'picture', 'hr']],
['view', ['fullscreen', 'codeview']],

@@ -59,3 +62,2 @@ ['help', ['help']]

// ['fontname', ['fontname']],
// ['fontsize', ['fontsize']], // Still buggy
// ['color', ['color']],

@@ -65,3 +67,3 @@ // ['para', ['ul', 'ol', 'paragraph']],

// ['table', ['table']],
// ['insert', ['link', 'picture', 'video']],
// ['insert', ['link', 'picture']],
// ['help', ['help']]

@@ -102,5 +104,2 @@ // ],

// fontSize
fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],
// lineHeight

@@ -115,2 +114,5 @@ lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],

// image
maximumImageFileSize: null, // size in bytes, null = no limit
// callbacks

@@ -126,2 +128,3 @@ oninit: null, // initialize

onToolbarClick: null,
onsubmit: null,

@@ -213,9 +216,5 @@ /**

underline: 'Underline',
strikethrough: 'Strikethrough',
subscript: 'Subscript',
superscript: 'Superscript',
clear: 'Remove Font Style',
height: 'Line Height',
name: 'Font Family',
size: 'Font Size'
name: 'Font Family'
},

@@ -231,4 +230,11 @@ image: {

floatNone: 'Float None',
dragImageHere: 'Drag an image here',
shapeRounded: 'Shape: Rounded',
shapeCircle: 'Shape: Circle',
shapeThumbnail: 'Shape: Thumbnail',
shapeNone: 'Shape: None',
dragImageHere: 'Drag image here',
dropImage: 'Drop image',
selectFromFiles: 'Select from files',
maximumFileSize: 'Maximum file size',
maximumFileSizeError: 'Maximum file size exceeded.',
url: 'Image URL',

@@ -246,9 +252,2 @@ remove: 'Remove Image'

},
video: {
video: 'Video',
videoLink: 'Video Link',
insert: 'Insert Video',
url: 'Video URL?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)'
},
table: {

@@ -255,0 +254,0 @@ table: 'Table'

define([
'summernote/core/agent', 'summernote/core/dom',
'summernote/core/range',
'summernote/settings',
'summernote/EventHandler', 'summernote/Renderer'
], function (agent, dom, settings, EventHandler, Renderer) {
], function (agent, dom, range, settings, EventHandler, Renderer) {
// jQuery namespace for summernote

@@ -15,3 +16,51 @@ $.summernote = $.summernote || {};

$.extend($.summernote, {
renderer: renderer,
eventHandler: eventHandler,
core: {
agent: agent,
dom: dom,
range: range
},
pluginEvents: {}
});
/**
* addPlugin
*
* @param {Object} plugin
*/
$.summernote.addPlugin = function (plugin) {
if (plugin.buttons) {
$.each(plugin.buttons, function (name, button) {
renderer.addButtonInfo(name, button);
});
}
if (plugin.dialogs) {
$.each(plugin.dialogs, function (name, dialog) {
renderer.addDialogInfo(name, dialog);
});
}
if (plugin.events) {
$.each(plugin.events, function (name, event) {
$.summernote.pluginEvents[name] = event;
});
}
if (plugin.langs) {
$.each(plugin.langs, function (locale, lang) {
if ($.summernote.lang[locale]) {
$.extend($.summernote.lang[locale], lang);
}
});
}
if (plugin.options) {
$.extend($.summernote.options, plugin.options);
}
};
/**
* extend jquery fn

@@ -31,5 +80,9 @@ */

this.each(function (idx, elHolder) {
var $holder = $(elHolder);
// Include langInfo in options for later use, e.g. for image drag-n-drop
// Setup language info with en-US as default
options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);
this.each(function (idx, holder) {
var $holder = $(holder);
// createLayout with options

@@ -44,3 +97,9 @@ renderer.createLayout($holder, options);

$holder.closest('form').submit(function () {
$holder.val($holder.code());
var contents = $holder.code();
$holder.val(contents);
// callback on submit
if (options.onsubmit) {
options.onsubmit(contents);
}
});

@@ -63,3 +122,3 @@ }

},
//
//

@@ -89,4 +148,4 @@ /**

// set the HTML contents of note
this.each(function (i, elHolder) {
var info = renderer.layoutInfoFromHolder($(elHolder));
this.each(function (i, holder) {
var info = renderer.layoutInfoFromHolder($(holder));
if (info && info.editable) { info.editable.html(sHTML); }

@@ -99,8 +158,9 @@ });

/**
* destroy Editor Layout and dettach Key and Mouse Event
* destroy Editor Layout and detach Key and Mouse Event
*
* @returns {this}
*/
destroy: function () {
this.each(function (idx, elHolder) {
var $holder = $(elHolder);
this.each(function (idx, holder) {
var $holder = $(holder);

@@ -112,3 +172,3 @@ var info = renderer.layoutInfoFromHolder($holder);

eventHandler.dettach(info, options);
eventHandler.detach(info, options);
renderer.removeLayout($holder, info, options);

@@ -115,0 +175,0 @@ });

@@ -183,3 +183,3 @@ /**

$u = $para.find('u');
dom.splitTree($para[0], { node: $u[0], offset: 0 });
dom.splitTree($para[0], {node: $u[0], offset: 0 });
equalsToUpperCase($para.html(), '<b>b</b><u><br></u>', 'splitBy u tag with offset 0');

@@ -190,3 +190,3 @@ equalsToUpperCase($para.next().html(), '<u>u</u><s>strike</s><i>i</i>', 'right hand side');

$u = $para.find('u');
dom.splitTree($para[0], { node: $u[0], offset: 1 });
dom.splitTree($para[0], {node: $u[0], offset: 1 });
equalsToUpperCase($para.html(), '<b>b</b><u>u</u>', 'splitBy u tag with offset 1');

@@ -197,3 +197,3 @@ equalsToUpperCase($para.next().html(), '<u><br></u><s>strike</s><i>i</i>', 'right hand side');

$b = $para.find('b');
dom.splitTree($para[0], { node: $b[0], offset: 0 });
dom.splitTree($para[0], {node: $b[0], offset: 0 });
equalsToUpperCase($para.html(), '<b><br></b>', 'splitBy b tag with offset 0 (left edge case)');

@@ -204,3 +204,3 @@ equalsToUpperCase($para.next().html(), '<b>b</b><u>u</u><s>strike</s><i>i</i>', 'right hand side');

$i = $para.find('i');
dom.splitTree($para[0], { node: $i[0], offset: 1 });
dom.splitTree($para[0], {node: $i[0], offset: 1 });
equalsToUpperCase($para.html(),

@@ -213,3 +213,3 @@ '<b>b</b><u>u</u><s>strike</s><i>i</i>', 'splitBy i tag with offset 1 (right edge case)');

$s = $para.find('s');
dom.splitTree($para[0], { node: $s[0].firstChild, offset: 3 });
dom.splitTree($para[0], {node: $s[0].firstChild, offset: 3 });
equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>str</s>', 'splitBy s tag with offset 3 (middle case)');

@@ -220,3 +220,3 @@ equalsToUpperCase($para.next().html(), '<s>ike</s><i>i</i>', 'right hand side');

$s = $para.find('s');
dom.splitTree($para[0], { node: $s[0].firstChild, offset: 0 });
dom.splitTree($para[0], {node: $s[0].firstChild, offset: 0 });
equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s><br></s>', 'splitBy s tag with offset 0 (left edge case)');

@@ -227,3 +227,3 @@ equalsToUpperCase($para.next().html(), '<s>strike</s><i>i</i>', 'right hand side');

$s = $para.find('s');
dom.splitTree($para[0], { node: $s[0].firstChild, offset: 6});
dom.splitTree($para[0], {node: $s[0].firstChild, offset: 6});
equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>strike</s>', 'splitBy s tag with offset 6 (right edge case)');

@@ -234,3 +234,3 @@ equalsToUpperCase($para.next().html(), '<s><br></s><i>i</i>', 'right hand side');

$s = $para.find('s');
dom.splitTree($s[0], { node: $s[0].firstChild, offset: 3});
dom.splitTree($s[0], {node: $s[0].firstChild, offset: 3});
equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>str</s><s>ike</s><i>i</i>',

@@ -241,3 +241,3 @@ 'splitBy s tag with offset 3 (2 depth case)');

$s = $para.find('s');
dom.splitTree($s[0].firstChild, { node: $s[0].firstChild, offset: 3});
dom.splitTree($s[0].firstChild, {node: $s[0].firstChild, offset: 3});
equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>strike</s><i>i</i>',

@@ -248,3 +248,3 @@ 'splitBy s tag with offset 3 (1 depth, textNode case)');

$span = $cont.find('span');
dom.splitTree($span[0], { node: $span[0], offset: 2});
dom.splitTree($span[0], {node: $span[0], offset: 2});
equalsToUpperCase($cont.html(), '<p><span><b>b</b><u>u</u></span><span><s>s</s><i>i</i></span></p>',

@@ -251,0 +251,0 @@ 'splitBy span tag with offset 2 (1 depth, element case)');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc