summernote-rails 0.2.1.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,2 @@
1
- !function(a){"use strict";var b=navigator.appVersion.indexOf("Mac")>-1,c=navigator.userAgent.indexOf("MSIE")>-1,d=function(){var a=function(a){return function(b){return a===b}},b=function(a,b){return a===b},c=function(){return!1};return{eq:a,eq2:b,fail:c}}(),e=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(c,e){if(0===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)]])},f=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b};return{head:a,last:b,initial:c,tail:d,compact:f,clusterBy:e}}(),f=function(){var b=function(a){return function(b){return b&&b.nodeName===a}},c=function(a){return a&&/^P|^LI|^H[1-7]/.test(a.nodeName)},f=function(a){return a&&/^UL|^OL/.test(a.nodeName)},g=function(b){return b&&a(b).hasClass("note-editable")},h=function(b){return b&&a(b).hasClass("note-control-sizing")},i=function(a,b){for(;a;){if(b(a))return a;a=a.parentNode}return null},j=function(a,b){b=b||d.fail;var c=[];return i(a,function(a){return c.push(a),b(a)}),c},k=function(b,c){for(var d=j(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},l=function(a,b){for(var c,d=[],e=k(a,b),f=document.createNodeIterator(e,NodeFilter.SHOW_ALL,null,!1),g=!1;(c=f.nextNode())&&(a===c&&(g=!0),g&&d.push(c),b!==c););return d},m=function(a,b){b=b||d.fail;for(var c=[];a&&(c.push(a),a!==b);)a=a.nextSibling;return c},n=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},o=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},p=b("#text"),q=function(a){return p(a)?a.nodeValue.length:a.childNodes.length},r=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},s=function(b,c){var f=e.initial(j(c,d.eq(b)));return a.map(f,r).reverse()},t=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes[b[d]];return c},u=function(a,b){if(0===b)return a;if(b>=q(a))return a.nextSibling;if(p(a))return a.splitText(b);var c=a.childNodes[b];return a=n(a.cloneNode(!1),a),o(a,m(c))},v=function(a,b,c){var e=j(b,d.eq(a));return 1===e.length?u(b,c):e.reduce(function(a,d){var e=d.cloneNode(!1);return n(e,d),a===b&&(a=u(a,c)),o(e,m(a)),e})};return{isText:p,isPara:c,isList:f,isEditable:g,isControlSizing:h,isAnchor:b("A"),isDiv:b("DIV"),isSpan:b("SPAN"),isB:b("B"),isU:b("U"),isS:b("S"),isI:b("I"),isImg:b("IMG"),ancestor:i,listAncestor:j,listNext:m,commonAncestor:k,listBetween:l,insertAfter:n,position:r,makeOffsetPath:s,fromOffsetPath:t,split:v}}(),g=!!document.createRange,h=function(b,c,h,i){if(0===arguments.length&&document.getSelection){var j=document.getSelection().getRangeAt(0);b=j.startContainer,c=j.startOffset,h=j.endContainer,i=j.endOffset}this.sc=b,this.so=c,this.ec=h,this.eo=i;var k=function(){if(g){var a=document.createRange();return a.setStart(b,c),a.setEnd(h,i),a}};this.select=function(){var a=k();if(g){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}},this.listPara=function(){var c=f.listBetween(b,h),g=e.compact(a.map(c,function(a){return f.ancestor(a,f.isPara)}));return a.map(e.clusterBy(g,d.eq2),e.head)},this.isOnList=function(){var a=f.ancestor(b,f.isList),c=f.ancestor(h,f.isList);return a&&a===c},this.isOnAnchor=function(){var a=f.ancestor(b,f.isAnchor),c=f.ancestor(h,f.isAnchor);return a&&a===c},this.isCollapsed=function(){return b===h&&c===i},this.insertNode=function(a){var b=k();g&&b.insertNode(a)},this.surroundContents=function(b){var c=a("<"+b+" />")[0],d=k();return g&&d.surroundContents(c),c},this.toString=function(){var a=k();return g?a.toString():void 0},this.bookmark=function(a){return{s:{path:f.makeOffsetPath(a,b),offset:c},e:{path:f.makeOffsetPath(a,h),offset:i}}}},i=function(a,b){return new h(f.fromOffsetPath(a,b.s.path),b.s.offset,f.fromOffsetPath(a,b.e.path),b.e.offset)},j=function(){this.styleFont=function(b,c){var d=b.surroundContents("span");a.each(c,function(a,b){d.style[a]=b})},this.stylePara=function(b,c){var d=b.listPara();a.each(d,function(b,d){a.each(c,function(a,b){d.style[a]=b})})},this.current=function(b,c){var d=a(f.isText(b.sc)?b.sc.parentNode:b.sc),e=d.css(["font-size","font-weight","font-style","text-decoration","text-align","list-style-type","line-height"])||{};if(e["font-size"]=parseInt(e["font-size"]),isNaN(parseInt(e["font-weight"]))||(e["font-weight"]=e["font-weight"]>400?"bold":"normal"),b.isOnList()){var g=["circle","disc","disc-leading-zero","square"],h=a.inArray(e["list-style-type"],g)>-1;e["list-style"]=h?"unordered":"ordered"}else e["list-style"]="none";var i=f.ancestor(b.sc,f.isPara);if(i&&i.style["line-height"])e["line-height"]=i.style.lineHeight;else{var j=parseInt(e["line-height"])/parseInt(e["font-size"]);e["line-height"]=j.toFixed(1)}return e.image=f.isImg(c)&&c,e.anchor=b.isOnAnchor()&&f.ancestor(b.sc,f.isAnchor),e.aAncestor=f.listAncestor(b.sc,f.isEditable),e}},k=function(){var a=[],b=[],c=function(a){var b=a[0],c=new h;return{contents:a.html(),bookmark:c.bookmark(b),scrollTop:a.scrollTop()}},d=function(a,b){a.html(b.contents).scrollTop(b.scrollTop),i(a[0],b.bookmark).select()};this.undo=function(e){var f=c(e);0!==a.length&&(d(e,a.pop()),b.push(f))},this.redo=function(e){var f=c(e);0!==b.length&&(d(e,b.pop()),a.push(f))},this.recordUndo=function(d){b=[],a.push(c(d))}},l=function(){var b=new j;this.currentStyle=function(a){return 0==document.getSelection().rangeCount?null:b.current(new h,a)},this.undo=function(a){a.data("NoteHistory").undo(a)},this.redo=function(a){a.data("NoteHistory").redo(a)};for(var d=this.recordUndo=function(a){a.data("NoteHistory").recordUndo(a)},e=["bold","italic","underline","justifyLeft","justifyCenter","justifyRight","justifyFull","insertOrderedList","insertUnorderedList","indent","outdent","formatBlock","removeFormat","backColor","foreColor","insertImage","insertHorizontalRule"],g=0,i=e.length;i>g;g++)this[e[g]]=function(a){return function(b,c){d(b),document.execCommand(a,!1,c)}}(e[g]);this.tab=function(a){var b=new h;return b.isOnList()||!b.isCollapsed()?this.indent(a):void 0},this.fontSize=function(a,b){d(a),document.execCommand("fontSize",!1,3);var c=a.find("font[size=3]");c.removeAttr("size").css("font-size",b+"px")},this.lineHeight=function(a,c){d(a),b.stylePara(new h,{lineHeight:c})},this.unlink=function(a){var b=new h;if(b.isOnAnchor()){d(a);var c=f.ancestor(b.sc,f.isAnchor);b=new h(c,0,c,1),b.select(),document.execCommand("unlink")}},this.setLinkDialog=function(a,b){var c=new h;if(c.isOnAnchor()){var e=f.ancestor(c.sc,f.isAnchor);c=new h(e,0,e,1)}b({range:c,text:c.toString(),url:c.isOnAnchor()?f.ancestor(c.sc,f.isAnchor).href:""},function(b){c.select(),d(a),0!==b.toLowerCase().indexOf("http://")&&(b="http://"+b),document.execCommand("createlink",!1,b)})},this.color=function(a,b){var c=JSON.parse(b);d(a),document.execCommand("foreColor",!1,c.foreColor),document.execCommand("backColor",!1,c.backColor)},this.insertTable=function(b,e){d(b);for(var f,g=e.split("x"),i=g[0],j=g[1],k=[],l=c?"&nbsp;":"<br/>",m=0;i>m;m++)k.push("<td>"+l+"</td>");f=k.join("");for(var n,o=[],p=0;j>p;p++)o.push("<tr>"+f+"</tr>");n=o.join("");var q='<table class="table table-bordered">'+n+"</table>";(new h).insertNode(a(q)[0])},this.float=function(a,b,c){d(a),c.style.cssFloat=b},this.resize=function(a,b,c){d(a),c.style.width=a.width()*b+"px",c.style.height=""},this.resizeTo=function(a,b){b.style.width=a.x+"px",b.style.height=a.y+"px"}},m=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).attr("data-value")==c;this.className=b?"checked":""})},e=b.find(".note-fontsize");e.find(".note-current-fontsize").html(c["font-size"]),d(e,parseFloat(c["font-size"]));var f=b.find(".note-height");d(f,parseFloat(c["line-height"]));var g=function(a,c){var d=b.find(a);d[c()?"addClass":"removeClass"]("active")};g('button[data-event="bold"]',function(){return"bold"===c["font-weight"]}),g('button[data-event="italic"]',function(){return"italic"===c["font-style"]}),g('button[data-event="underline"]',function(){return"underline"===c["text-decoration"]}),g('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),g('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),g('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),g('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),g('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),g('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)}},n=function(){this.update=function(b,c){var d=b.find(".note-link-popover"),e=b.find(".note-image-popover");if(c.anchor){var f=d.find("a");f.attr("href",c.anchor.href).html(c.anchor.href);var g=c.anchor.getBoundingClientRect();d.css({display:"block",left:g.left,top:a(document).scrollTop()+g.bottom})}else d.hide();if(c.image){var g=c.image.getBoundingClientRect();e.css({display:"block",left:g.left,top:a(document).scrollTop()+g.bottom})}else e.hide()},this.hide=function(a){a.children().hide()}},o=function(){this.update=function(b,c){var d=b.find(".note-control-selection");if(c.image){var e=c.image.getBoundingClientRect();d.css({display:"block",left:e.left+"px",top:a(document).scrollTop()+e.top+"px",width:e.width+"px",height:e.height+"px"}).data("target",c.image);var f=e.width+"x"+e.height;d.find(".note-control-selection-info").text(f)}else d.hide()},this.hide=function(a){a.children().hide()}},p=function(){this.showImageDialog=function(b,c,d){var e=b.find(".note-image-dialog"),f=b.find(".note-dropzone"),g=b.find(".note-image-input");e.on("shown",function(){f.on("dragenter dragover dragleave",!1),f.on("drop",function(a){c(a),e.modal("hide")}),g.on("change",function(){d(this.files),a(this).val(""),e.modal("hide")})}).on("hidden",function(){f.off("dragenter dragover dragleave drop"),g.off("change")}).modal("show")},this.showLinkDialog=function(a,b,c){var d=a.find(".note-link-dialog"),e=d.find(".note-link-text"),f=d.find(".note-link-url"),g=d.find(".note-link-btn");d.on("shown",function(){e.html(b.text),f.val(b.url).keyup(function(){f.val()?g.removeClass("disabled").attr("disabled",!1):g.addClass("disabled").attr("disabled",!0),b.text||e.html(f.val())}).trigger("focus"),g.click(function(a){d.modal("hide"),c(f.val()),a.preventDefault()})}).on("hidden",function(){f.off("keyup"),d.off("shown hidden"),g.off("click")}).modal("show")},this.showHelpDialog=function(a){a.find(".note-help-dialog").modal("show")}},q=function(){var c=new l,d=new m,e=new n,g=new o,h=new p,i={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,NUM0:48,NUM1:49,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,U:85,Y:89,Z:90,BACKSLACH:220},j=function(b){var c=a(b).closest(".note-editor");return{editor:function(){return c},editable:function(){return c.find(".note-editable")},toolbar:function(){return c.find(".note-toolbar")},popover:function(){return c.find(".note-popover")},handle:function(){return c.find(".note-handle")},dialog:function(){return c.find(".note-dialog")}}},k=function(a){var d=b?a.metaKey:a.ctrlKey,e=a.shiftKey,f=a.keyCode,g=d||e||f===i.TAB,k=g?j(a.target):null;if(d&&(e&&f===i.Z||f===i.Y))c.redo(k.editable());else if(d&&f===i.Z)c.undo(k.editable());else if(d&&f===i.B)c.bold(k.editable());else if(d&&f===i.I)c.italic(k.editable());else if(d&&f===i.U)c.underline(k.editable());else if(d&&f===i.BACKSLACH)c.removeFormat(k.editable());else if(d&&f===i.K)c.setLinkDialog(k.editable(),function(a,b){h.showLinkDialog(k.dialog(),a,b)});else if(d&&e&&f===i.L)c.justifyLeft(k.editable());else if(d&&e&&f===i.E)c.justifyCenter(k.editable());else if(d&&e&&f===i.R)c.justifyRight(k.editable());else if(d&&e&&f===i.J)c.justifyFull(k.editable());else if(d&&e&&f===i.NUM7)c.insertUnorderedList(k.editable());else if(d&&e&&f===i.NUM8)c.insertOrderedList(k.editable());else if(e&&f===i.TAB)c.outdent(k.editable());else if(f===i.TAB)c.tab(k.editable());else if(d&&f===i.NUM0)c.formatBlock(k.editable(),"P");else if(d&&i.NUM1<=f&&f<=i.NUM6){var l="H"+String.fromCharCode(f);c.formatBlock(k.editable(),l)}else{if(!d||f!==i.ENTER)return(f===i.BACKSPACE||f===i.ENTER||f===i.SPACE)&&c.recordUndo(j(a.target).editable()),void 0;c.insertHorizontalRule(k.editable())}a.preventDefault()},q=function(b,d){a.each(d,function(a,d){var e=new FileReader;e.onload=function(a){c.insertImage(b,a.target.result)},e.readAsDataURL(d)})},r=function(a){var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=j(a.currentTarget||a.target);q(c.editable(),b.files)}a.stopPropagation(),a.preventDefault()},s=function(a){f.isImg(a.target)&&a.preventDefault()},t=function(a){var b=j(a.currentTarget||a.target),f=c.currentStyle(a.target);f&&(d.update(b.toolbar(),f),e.update(b.popover(),f),g.update(b.handle(),f))},u=function(a){var b=j(a.currentTarget||a.target);e.hide(b.popover()),g.hide(b.handle())},v=function(b){if(f.isControlSizing(b.target)){var d,h=j(b.target),i=h.handle(),k=h.popover(),l=h.editable(),m=h.editor(),n=i.find(".note-control-selection").data("target"),o=a(n).offset(),p=a(document).scrollTop();m.on("mousemove",function(a){d={x:a.clientX-o.left,y:a.clientY-(o.top-p)},c.resizeTo(d,n),g.update(i,{image:n}),e.update(k,{image:n})}).on("mouseup",function(){m.off("mousemove").off("mouseup")}),c.recordUndo(l),b.stopPropagation(),b.preventDefault()}},w=function(b){var c=a(b.target).closest("[data-event]");c.length>0&&b.preventDefault()},x=function(b){var e=a(b.target).closest("[data-event]");if(e.length>0){var f,g=e.attr("data-event"),i=e.attr("data-value"),k=j(b.target),l=k.dialog(),m=k.editable();if(-1!==a.inArray(g,["resize","float"])){var n=k.handle(),o=n.find(".note-control-selection");f=o.data("target")}c[g]&&(m.trigger("focus"),c[g](m,i,f)),-1!==a.inArray(g,["backColor","foreColor"])?d.updateRecentColor(e[0],g,i):"showLinkDialog"===g?c.setLinkDialog(m,function(a,b){h.showLinkDialog(l,a,b)}):"showImageDialog"===g?h.showImageDialog(l,r,function(a){q(m,a)}):"showHelpDialog"===g&&h.showHelpDialog(l),t(b)}},y=18,z=function(b){var c,d=a(b.target.parentNode),e=d.next(),f=d.find(".note-dimension-picker-mousecatcher"),g=d.find(".note-dimension-picker-highlighted"),h=d.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var i=a(b.target).offset();c={x:b.pageX-i.left,y:b.pageY-i.top}}else c={x:b.offsetX,y:b.offsetY};var j={c:Math.ceil(c.x/y)||1,r:Math.ceil(c.y/y)||1};g.css({width:j.c+"em",height:j.r+"em"}),f.attr("data-value",j.c+"x"+j.r),3<j.c&&j.c<20&&h.css({width:j.c+1+"em"}),3<j.r&&j.r<20&&h.css({height:j.r+1+"em"}),e.html(j.c+" x "+j.r)};this.attach=function(a,b){a.editable.on("keydown",k),a.editable.on("mousedown",s),a.editable.on("keyup mouseup",t),a.editable.on("scroll",u),a.editable.on("dragenter dragover dragleave",!1),a.editable.on("drop",r),a.handle.on("mousedown",v),a.toolbar.on("click",x),a.popover.on("click",x),a.toolbar.on("mousedown",w),a.popover.on("mousedown",w);var c=a.toolbar,d=c.find(".note-dimension-picker-mousecatcher");d.on("mousemove",z),b.onenter&&a.editable.keypress(function(a){a.keyCode===i.ENTER&&b.onenter(a)}),b.onfocus&&a.editable.focus(b.onfocus),b.onblur&&a.editable.blur(b.onblur),b.onkeyup&&a.editable.blur(b.onkeyup),b.onkeydown&&a.editable.blur(b.onkeydown)},this.dettach=function(a){a.editable.off(),a.toolbar.off(),a.handle.off(),a.popover.off()}},r=function(){var c={picture:'<button type="button" class="btn btn-small" title="Picture" data-event="showImageDialog" tabindex="-1"><i class="icon-picture"></i></button>',link:'<button type="button" class="btn btn-small" title="Link" data-event="showLinkDialog" data-shortcut="Ctrl+K" data-mac-shortcut="⌘+K" tabindex="-1"><i class="icon-link"></i></button>',table:'<button type="button" class="btn btn-small dropdown-toggle" title="Table" data-toggle="dropdown" tabindex="-1"><i class="icon-table"></i> <span class="caret"></span></button><ul class="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>',style:'<button type="button" class="btn btn-small dropdown-toggle" title="Style" data-toggle="dropdown" tabindex="-1"><i class="icon-magic"></i> <span class="caret"></span></button><ul class="dropdown-menu"><li><a data-event="formatBlock" data-value="p">Normal</a></li><li><a data-event="formatBlock" data-value="blockquote"><blockquote>Quote</blockquote></a></li><li><a data-event="formatBlock" data-value="pre">Code</a></li><li><a data-event="formatBlock" data-value="h1"><h1>Header 1</h1></a></li><li><a data-event="formatBlock" data-value="h2"><h2>Header 2</h2></a></li><li><a data-event="formatBlock" data-value="h3"><h3>Header 3</h3></a></li><li><a data-event="formatBlock" data-value="h4"><h4>Header 4</h4></a></li><li><a data-event="formatBlock" data-value="h5"><h5>Header 5</h5></a></li><li><a data-event="formatBlock" data-value="h6"><h6>Header 6</h6></a></li></ul>',fontsize:'<button type="button" class="btn btn-small dropdown-toggle" data-toggle="dropdown" title="Font Size" tabindex="-1"><span class="note-current-fontsize">11</span> <b class="caret"></b></button><ul class="dropdown-menu"><li><a data-event="fontSize" data-value="8"><i class="icon-ok"></i> 8</a></li><li><a data-event="fontSize" data-value="9"><i class="icon-ok"></i> 9</a></li><li><a data-event="fontSize" data-value="10"><i class="icon-ok"></i> 10</a></li><li><a data-event="fontSize" data-value="11"><i class="icon-ok"></i> 11</a></li><li><a data-event="fontSize" data-value="12"><i class="icon-ok"></i> 12</a></li><li><a data-event="fontSize" data-value="14"><i class="icon-ok"></i> 14</a></li><li><a data-event="fontSize" data-value="18"><i class="icon-ok"></i> 18</a></li><li><a data-event="fontSize" data-value="24"><i class="icon-ok"></i> 24</a></li><li><a data-event="fontSize" data-value="36"><i class="icon-ok"></i> 36</a></li></ul>',color:'<button type="button" class="btn btn-small note-recent-color" title="Recent Color" data-event="color" data-value=\'{"foreColor":"black","backColor":"yellow"}\' tabindex="-1"><i class="icon-font" style="color:black;background-color:yellow;"></i></button><button type="button" class="btn btn-small dropdown-toggle" title="More Color" data-toggle="dropdown" tabindex="-1"><span class="caret"></span></button><ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">BackColor</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">FontColor</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>',bold:'<button type="button" class="btn btn-small" title="Bold" data-shortcut="Ctrl+B" data-mac-shortcut="⌘+B" data-event="bold" tabindex="-1"><i class="icon-bold"></i></button>',italic:'<button type="button" class="btn btn-small" title="Italic" data-shortcut="Ctrl+I" data-mac-shortcut="⌘+I" data-event="italic" tabindex="-1"><i class="icon-italic"></i></button>',underline:'<button type="button" class="btn btn-small" title="Underline" data-shortcut="Ctrl+U" data-mac-shortcut="⌘+U" data-event="underline" tabindex="-1"><i class="icon-underline"></i></button>',clear:'<button type="button" class="btn btn-small" title="Remove Font Style" data-shortcut="Ctrl+\\" data-mac-shortcut="⌘+\\" data-event="removeFormat" tabindex="-1"><i class="icon-eraser"></i></button>',ul:'<button type="button" class="btn btn-small" title="Unordered list" data-shortcut="Ctrl+Shift+8" data-mac-shortcut="⌘+⇧+7" data-event="insertUnorderedList" tabindex="-1"><i class="icon-list-ul"></i></button>',ol:'<button type="button" class="btn btn-small" title="Ordered list" data-shortcut="Ctrl+Shift+7" data-mac-shortcut="⌘+⇧+8" data-event="insertOrderedList" tabindex="-1"><i class="icon-list-ol"></i></button>',paragraph:'<button type="button" class="btn btn-small dropdown-toggle" title="Paragraph" data-toggle="dropdown" tabindex="-1"><i class="icon-align-left"></i> <span class="caret"></span></button><ul class="dropdown-menu right"><li><div class="note-align btn-group"><button type="button" class="btn btn-small" title="Align left" data-shortcut="Ctrl+Shift+L" data-mac-shortcut="⌘+⇧+L" data-event="justifyLeft" tabindex="-1"><i class="icon-align-left"></i></button><button type="button" class="btn btn-small" title="Align center" data-shortcut="Ctrl+Shift+E" data-mac-shortcut="⌘+⇧+E" data-event="justifyCenter" tabindex="-1"><i class="icon-align-center"></i></button><button type="button" class="btn btn-small" title="Align right" data-shortcut="Ctrl+Shift+R" data-mac-shortcut="⌘+⇧+R" data-event="justifyRight" tabindex="-1"><i class="icon-align-right"></i></button><button type="button" class="btn btn-small" title="Justify full" data-shortcut="Ctrl+Shift+J" data-mac-shortcut="⌘+⇧+J" data-event="justifyFull" tabindex="-1"><i class="icon-align-justify"></i></button></div></li><li><div class="note-list btn-group"><button type="button" class="btn btn-small" title="Outdent" data-shortcut="Shift+TAB" data-mac-shortcut="⇧+TAB" data-event="outdent" tabindex="-1"><i class="icon-indent-left"></i></button><button type="button" class="btn btn-small" title="Indent" data-shortcut="TAB" data-mac-shortcut="TAB" data-event="indent" tabindex="-1"><i class="icon-indent-right"></i></button></li></ul>',height:'<button type="button" class="btn btn-small dropdown-toggle" data-toggle="dropdown" title="Line Height" tabindex="-1"><i class="icon-text-height"></i>&nbsp; <b class="caret"></b></button><ul class="dropdown-menu right"><li><a data-event="lineHeight" data-value="1.0"><i class="icon-ok"></i> 1.0</a></li><li><a data-event="lineHeight" data-value="1.2"><i class="icon-ok"></i> 1.2</a></li><li><a data-event="lineHeight" data-value="1.4"><i class="icon-ok"></i> 1.4</a></li><li><a data-event="lineHeight" data-value="1.5"><i class="icon-ok"></i> 1.5</a></li><li><a data-event="lineHeight" data-value="1.6"><i class="icon-ok"></i> 1.6</a></li><li><a data-event="lineHeight" data-value="1.8"><i class="icon-ok"></i> 1.8</a></li><li><a data-event="lineHeight" data-value="2.0"><i class="icon-ok"></i> 2.0</a></li><li><a data-event="lineHeight" data-value="3.0"><i class="icon-ok"></i> 3.0</a></li></ul>',help:'<button type="button" class="btn btn-small" title="Help" data-event="showHelpDialog" tabindex="-1"><i class="icon-question"></i></button>'},d='<div class="note-popover"><div class="note-link-popover popover fade bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content note-link-content"><a href="http://www.google.com" target="_blank">www.google.com</a>&nbsp;&nbsp;<div class="note-insert btn-group"><button type="button" class="btn btn-small" title="Edit" data-event="showLinkDialog" tabindex="-1"><i class="icon-edit"></i></button><button type="button" class="btn btn-small" title="Unlink" data-event="unlink" tabindex="-1"><i class="icon-unlink"></i></button></div></div></div><div class="note-image-popover popover fade bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content note-image-content"><div class="btn-group"><button type="button" class="btn btn-small" title="Resize Full" data-event="resize" data-value="1" tabindex="-1"><i class="icon-resize-full"></i></button><button type="button" class="btn btn-small" title="Resize Half" data-event="resize" data-value="0.5" tabindex="-1">½</button><button type="button" class="btn btn-small" title="Resize Thrid" data-event="resize" data-value="0.33" tabindex="-1">⅓</button><button type="button" class="btn btn-small" title="Resize Quarter" data-event="resize" data-value="0.25" tabindex="-1">¼</button></div><div class="btn-group"><button type="button" class="btn btn-small" title="Float Left" data-event="float" data-value="left" tabindex="-1"><i class="icon-align-left"></i></button><button type="button" class="btn btn-small" title="Float Right" data-event="float" data-value="right" tabindex="-1"><i class="icon-align-right"></i></button><button type="button" class="btn btn-small" title="Float None" data-event="float" data-value="none" tabindex="-1"><i class="icon-reorder"></i></button></div></div></div></div>',e='<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>',f='<table class="note-shortcut"><thead><tr><th></th><th>Text formatting</th></tr></thead><tbody><tr><td>⌘ + B</td><td>Bold</td></tr><tr><td>⌘ + I</td><td>Italic</td></tr><tr><td>⌘ + U</td><td>Underline</td></tr><tr><td>⌘ + \\</td><td>Remove Font Style</td></tr></tr></tbody></table>',g='<table class="note-shortcut"><thead><tr><th></th><th>Action</th></tr></thead><tbody><tr><td>⌘ + Z</td><td>Undo</td></tr><tr><td>⌘ + ⇧ + Z</td><td>Redo</td></tr><tr><td>Tab</td><td>Indent</td></tr><tr><td>⇧ + Tab</td><td>Outdent</td></tr><tr><td>⌘ + K</td><td>Insert Link</td></tr><tr><td>⌘ + ENTER</td><td>Insert Horizontal Rule</td></tr></tbody></table>',h='<table class="note-shortcut"><thead><tr><th></th><th>Paragraph formatting</th></tr></thead><tbody><tr><td>⌘ + ⇧ + L</td><td>Align Left</td></tr><tr><td>⌘ + ⇧ + E</td><td>Align Center</td></tr><tr><td>⌘ + ⇧ + R</td><td>Align Right</td></tr><tr><td>⌘ + ⇧ + J</td><td>Justify Full</td></tr><tr><td>⌘ + ⇧ + NUM7</td><td>Ordered List</td></tr><tr><td>⌘ + ⇧ + NUM8</td><td>Unordered List</td></tr></tbody></table>',i='<table class="note-shortcut"><thead><tr><th></th><th>Document Style</th></tr></thead><tbody><tr><td>⌘ + NUM0</td><td>Normal Text</td></tr><tr><td>⌘ + NUM1</td><td>Heading 1</td></tr><tr><td>⌘ + NUM2</td><td>Heading 2</td></tr><tr><td>⌘ + NUM3</td><td>Heading 3</td></tr><tr><td>⌘ + NUM4</td><td>Heading 4</td></tr><tr><td>⌘ + NUM5</td><td>Heading 5</td></tr><tr><td>⌘ + NUM6</td><td>Heading 6</td></tr></tbody></table>',j='<table class="note-shortcut-layout"><tbody><tr><td>'+g+"</td>"+"<td>"+f+"</td>"+"</tr>"+"<tr>"+"<td>"+i+"</td>"+"<td>"+h+"</td>"+"</tr>"+"</tbody>"+"</table>",l='<div class="note-dialog"><div class="note-image-dialog modal hide in" aria-hidden="false"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" tabindex="-1">×</button><h4>Insert Image</h4></div><div class="modal-body"><div class="row-fluid"><div class="note-dropzone span12">Drag an image here</div><div>or if you prefer...</div><input class="note-image-input" type="file" class="note-link-url" type="text" /></div></div></div><div class="note-link-dialog modal hide in" aria-hidden="false"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" tabindex="-1">×</button><h4>Edit Link</h4></div><div class="modal-body"><div class="row-fluid"><label>Text to display</label><span class="note-link-text input-xlarge uneditable-input" /><label>To what URL should this link go?</label><input class="note-link-url span12" type="text" /></div></div><div class="modal-footer"><a href="#" class="btn disabled note-link-btn" disabled="disabled">Link</a></div></div><div class="note-help-dialog modal hide in" aria-hidden="false"><div class="modal-body"><div class="modal-background"><a class="modal-close pull-right" data-dismiss="modal" aria-hidden="true" tabindex="-1">Close</a><div class="title">Keyboard shortcuts</div>'+j+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote v0.2</a> · <a href="//github.com/HackerWins/summernote" target="_blank">Project</a> · <a href="//github.com/HackerWins/summernote/issues" target="_blank">Issues</a></p>'+"</div>"+"</div>"+"</div>",m=function(c,d){c.find("button").each(function(c,d){var e=a(d),f=e.attr(b?"data-mac-shortcut":"data-shortcut");f&&e.attr("title",function(a,b){return b+" ("+f+")"})}).tooltip({container:"body",placement:d||"top"})},n=[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#EFF7F7","#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"]],o=function(b){b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),d="",e=0,f=n.length;f>e;e++){for(var g=n[e],h="<div>",i=0,j=g.length;j>i;i++){var k=g[i],l=['<button type="button" class="note-color-btn" style="background-color:',k,';" data-event="',c,'" data-value="',k,'" title="',k,'" data-toggle="button" tabindex="-1"></button>'].join("");h+=l}h+="</div>",d+=h}b.html(d)})};this.createLayout=function(b,f,g,h){if(!b.next().hasClass("note-editor")){var i=a('<div class="note-editor"></div>'),j=a('<div class="note-editable" contentEditable="true"></div>').prependTo(i);g&&j.attr("tabIndex",g),f&&j.height(f),j.html(b.html()),j.data("NoteHistory",new k);var n="";for(var p in h){var q=h[p];n+='<div class="note-'+q[0]+' btn-group">';for(var r in q[1])n+=c[q[1][r]];n+="</div>"}n='<div class="note-toolbar btn-toolbar">'+n+"</div>";var s=a(n).prependTo(i);o(s),m(s,"bottom");var t=a(d).prependTo(i);m(t),a(e).prependTo(i),a(l).prependTo(i),i.insertAfter(b),b.hide()}};var p=this.layoutInfoFromHolder=function(a){var b=a.next();if(b.hasClass("note-editor"))return{editor:b,editable:b.find(".note-editable"),toolbar:b.find(".note-toolbar"),popover:b.find(".note-popover"),handle:b.find(".note-handle"),dialog:b.find(".note-dialog")}};this.removeLayout=function(a){var b=p(a);b&&(a.html(b.editable.html()),b.editor.remove(),a.show())}},s=new r,t=new q;a.fn.extend({summernote:function(b){if(b=a.extend({toolbar:[["insert",["picture","link"]],["table",["table"]],["style",["style"]],["fontsize",["fontsize"]],["color",["color"]],["style",["bold","italic","underline","clear"]],["para",["ul","ol","paragraph"]],["height",["height"]],["help",["help"]]]},b),this.each(function(c,d){var e=a(d);s.createLayout(e,b.height,b.tabIndex,b.toolbar);var f=s.layoutInfoFromHolder(e);t.attach(f,b)}),this.first()&&b.focus){var c=s.layoutInfoFromHolder(this.first());c.editable.focus()}this.length>0&&b.oninit&&b.oninit()},code:function(b){return void 0===b?this.map(function(b,c){var d=s.layoutInfoFromHolder(a(c)),e=!(!d||!d.editable);return e?d.editable.html():a(c).html()}):(this.each(function(c,d){var e=s.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)}),void 0)},destroy:function(){this.each(function(b,c){var d=a(c),e=s.layoutInfoFromHolder(d);e&&e.editable&&(t.dettach(e),s.removeLayout(d))})},summernoteInner:function(){return{dom:f,list:e,func:d}}})}(jQuery);
1
+ !function(a){"use strict";var b=navigator.appVersion.indexOf("Mac")>-1,c=navigator.userAgent.indexOf("MSIE")>-1,d=function(){var a=function(a){return function(b){return a===b}},b=function(a,b){return a===b},c=function(){return!1},d=function(a){return function(){return!a.apply(a,arguments)}},e=function(a){return a};return{eq:a,eq2:b,fail:c,not:d,self:e}}(),e=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)},e=function(a){return a.slice(1)},f=function(a,b){return b=b||d.self,a.reduce(function(a,c){return a+b(c)},0)},g=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},h=function(c,d){if(0===c.length)return[];var f=e(c);return f.reduce(function(a,c){var e=b(a);return d(b(e),c)?e[e.length]=c:a[a.length]=[c],a},[[a(c)]])},i=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b};return{head:a,last:b,initial:c,tail:e,sum:f,from:g,compact:i,clusterBy:h}}(),f=function(){var b=function(a){return function(b){return b&&b.nodeName===a}},c=function(a){return a&&/^P|^LI|^H[1-7]/.test(a.nodeName)},f=function(a){return a&&/^UL|^OL/.test(a.nodeName)},g=function(b){return b&&a(b).hasClass("note-editable")},h=function(b){return b&&a(b).hasClass("note-control-sizing")},i=function(a,b){for(;a;){if(b(a))return a;a=a.parentNode}return null},j=function(a,b){b=b||d.fail;var c=[];return i(a,function(a){return c.push(a),b(a)}),c},k=function(b,c){for(var d=j(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},l=function(a,b){var c=[],d=!1,e=!1,f=function(g){if(g){if(g===a&&(d=!0),d&&!e&&c.push(g),g===b)return e=!0,void 0;for(var h=0,i=g.childNodes.length;i>h;h++)f(g.childNodes[h])}};return f(k(a,b)),c},m=function(a,b){b=b||d.fail;for(var c=[];a&&(c.push(a),!b(a));)a=a.previousSibling;return c},n=function(a,b){b=b||d.fail;for(var c=[];a&&(c.push(a),!b(a));)a=a.nextSibling;return c},o=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},p=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},q=b("#text"),r=function(a){return q(a)?a.nodeValue.length:a.childNodes.length},s=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},t=function(b,c){var f=e.initial(j(c,d.eq(b)));return a.map(f,s).reverse()},u=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes[b[d]];return c},v=function(a,b){if(0===b)return a;if(b>=r(a))return a.nextSibling;if(q(a))return a.splitText(b);var c=a.childNodes[b];return a=o(a.cloneNode(!1),a),p(a,n(c))},w=function(a,b,c){var e=j(b,d.eq(a));return 1===e.length?v(b,c):e.reduce(function(a,d){var e=d.cloneNode(!1);return o(e,d),a===b&&(a=v(a,c)),p(e,n(a)),e})};return{isText:q,isPara:c,isList:f,isEditable:g,isControlSizing:h,isAnchor:b("A"),isDiv:b("DIV"),isSpan:b("SPAN"),isB:b("B"),isU:b("U"),isS:b("S"),isI:b("I"),isImg:b("IMG"),ancestor:i,listAncestor:j,listNext:n,listPrev:m,commonAncestor:k,listBetween:l,insertAfter:o,position:s,makeOffsetPath:t,fromOffsetPath:u,split:w}}(),g=!!document.createRange,h=function(a,b){var c,d,g=a.parentElement(),h=document.body.createTextRange(),i=e.from(g.childNodes);for(c=0;c<i.length;c++)if(!f.isText(i[c])){if(h.moveToElementText(i[c]),h.compareEndPoints("StartToStart",a)>=0)break;d=i[c]}if(0!=c&&f.isText(i[c-1])){var j=document.body.createTextRange(),k=null;j.moveToElementText(d||g),j.collapse(!d),k=d?d.nextSibling:g.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",j);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&&f.isText(k.nextSibling)&&m==k.nodeValue.length&&(m-=k.nodeValue.length,k=k.nextSibling),g=k,c=m}return{cont:g,offset:c}},i=function(a){var b=function(a,c){var g,h;if(f.isText(a)){var i=f.listPrev(a,d.not(f.isText)),j=e.last(i).previousSibling;g=j||a.parentNode,c+=e.sum(e.tail(i),f.length),h=!j}else{if(g=a.childNodes[c]||a,f.isText(g))return b(g,c);c=0,h=!1}return{cont:g,collapseToStart:h,offset:c}},c=document.body.createTextRange(),g=b(a.cont,a.offset);return c.moveToElementText(g.cont),c.collapse(g.collapseToStart),c.moveStart("character",g.offset),c},j=function(b,c,j,k){if(0===arguments.length)if(g){var l=document.getSelection().getRangeAt(0);b=l.startContainer,c=l.startOffset,j=l.endContainer,k=l.endOffset}else{var m=document.selection.createRange(),n=m.duplicate();n.collapse(!1);var o=m;o.collapse(!0);var p=h(o,!0),q=h(n,!1);b=p.cont,c=p.offset,j=q.cont,k=q.offset}this.sc=b,this.so=c,this.ec=j,this.eo=k;var r=function(){if(g){var a=document.createRange();return a.setStart(b,c),a.setEnd(j,k),a}var d=i({cont:b,offset:c});return d.setEndPoint("EndToEnd",i({cont:j,offset:k})),d};this.select=function(){var a=r();if(g){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select()},this.listPara=function(){var c=f.listBetween(b,j),g=e.compact(a.map(c,function(a){return f.ancestor(a,f.isPara)}));return a.map(e.clusterBy(g,d.eq2),e.head)},this.isOnList=function(){var a=f.ancestor(b,f.isList),c=f.ancestor(j,f.isList);return a&&a===c},this.isOnAnchor=function(){var a=f.ancestor(b,f.isAnchor),c=f.ancestor(j,f.isAnchor);return a&&a===c},this.isCollapsed=function(){return b===j&&c===k},this.insertNode=function(a){var b=r();g?b.insertNode(a):b.pasteHTML(a.outerHTML)},this.toString=function(){var a=r();return g?a.toString():a.text},this.bookmark=function(a){return{s:{path:f.makeOffsetPath(a,b),offset:c},e:{path:f.makeOffsetPath(a,j),offset:k}}}},k=function(a,b){return new j(f.fromOffsetPath(a,b.s.path),b.s.offset,f.fromOffsetPath(a,b.e.path),b.e.offset)},l=function(){this.stylePara=function(b,c){var d=b.listPara();a.each(d,function(b,d){a.each(c,function(a,b){d.style[a]=b})})},this.current=function(b,c){var d=a(f.isText(b.sc)?b.sc.parentNode:b.sc),e=d.css(["font-size","text-align","list-style-type","line-height"])||{};if(e["font-size"]=parseInt(e["font-size"]),e["font-bold"]=document.queryCommandState("bold")?"bold":"normal",e["font-italic"]=document.queryCommandState("italic")?"italic":"normal",e["font-underline"]=document.queryCommandState("underline")?"underline":"normal",b.isOnList()){var g=["circle","disc","disc-leading-zero","square"],h=a.inArray(e["list-style-type"],g)>-1;e["list-style"]=h?"unordered":"ordered"}else e["list-style"]="none";var i=f.ancestor(b.sc,f.isPara);if(i&&i.style["line-height"])e["line-height"]=i.style.lineHeight;else{var j=parseInt(e["line-height"])/parseInt(e["font-size"]);e["line-height"]=j.toFixed(1)}return e.image=f.isImg(c)&&c,e.anchor=b.isOnAnchor()&&f.ancestor(b.sc,f.isAnchor),e.aAncestor=f.listAncestor(b.sc,f.isEditable),e}},m=function(){var a=[],b=[],c=function(a){var b=a[0],c=new j;return{contents:a.html(),bookmark:c.bookmark(b),scrollTop:a.scrollTop()}},d=function(a,b){a.html(b.contents).scrollTop(b.scrollTop),k(a[0],b.bookmark).select()};this.undo=function(e){var f=c(e);0!==a.length&&(d(e,a.pop()),b.push(f))},this.redo=function(e){var f=c(e);0!==b.length&&(d(e,b.pop()),a.push(f))},this.recordUndo=function(d){b=[],a.push(c(d))}},n=function(){var b=new l;this.currentStyle=function(a){return document.getSelection&&0==document.getSelection().rangeCount?null:b.current(new j,a)},this.undo=function(a){a.data("NoteHistory").undo(a)},this.redo=function(a){a.data("NoteHistory").redo(a)};for(var d=this.recordUndo=function(a){a.data("NoteHistory").recordUndo(a)},e=["bold","italic","underline","strikethrough","justifyLeft","justifyCenter","justifyRight","justifyFull","insertOrderedList","insertUnorderedList","indent","outdent","formatBlock","removeFormat","backColor","foreColor","insertImage","insertHorizontalRule"],g=0,h=e.length;h>g;g++)this[e[g]]=function(a){return function(b,c){d(b),document.execCommand(a,!1,c)}}(e[g]);this.formatBlock=function(a,b){b=c?"<"+b+">":b,document.execCommand("FormatBlock",!1,b)},this.fontSize=function(a,b){d(a),document.execCommand("fontSize",!1,3);var c=a.find("font[size=3]");c.removeAttr("size").css("font-size",b+"px")},this.lineHeight=function(a,c){d(a),b.stylePara(new j,{lineHeight:c})},this.unlink=function(a){var b=new j;if(b.isOnAnchor()){d(a);var c=f.ancestor(b.sc,f.isAnchor);b=new j(c,0,c,1),b.select(),document.execCommand("unlink")}},this.setLinkDialog=function(b,e){var g=new j;if(g.isOnAnchor()){var h=f.ancestor(g.sc,f.isAnchor);g=new j(h,0,h,1)}e({range:g,text:g.toString(),url:g.isOnAnchor()?f.ancestor(g.sc,f.isAnchor).href:""},function(e){g.select(),d(b);var f=-1!==e.toLowerCase().indexOf("://"),h=f?e:"http://"+e;if(c&&g.isCollapsed()){g.insertNode(a('<A id="linkAnchor">'+e+"</A>")[0]);var i=a("#linkAnchor").removeAttr("id").attr("href",h);g=new j(i[0],0,i[0],1),g.select()}else document.execCommand("createlink",!1,h)})},this.color=function(a,b){var c=JSON.parse(b);d(a),document.execCommand("foreColor",!1,c.foreColor),document.execCommand("backColor",!1,c.backColor)},this.insertTable=function(b,e){d(b);for(var f,g=e.split("x"),h=g[0],i=g[1],k=[],l=c?"&nbsp;":"<br/>",m=0;h>m;m++)k.push("<td>"+l+"</td>");f=k.join("");for(var n,o=[],p=0;i>p;p++)o.push("<tr>"+f+"</tr>");n=o.join("");var q='<table class="table table-bordered">'+n+"</table>";(new j).insertNode(a(q)[0])},this.float=function(a,b,c){d(a),c.style.cssFloat=b},this.resize=function(a,b,c){d(a),c.style.width=a.width()*b+"px",c.style.height=""},this.resizeTo=function(a,b){b.style.width=a.x+"px",b.style.height=a.y+"px"}},o=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).attr("data-value")==c;this.className=b?"checked":""})},e=b.find(".note-fontsize");e.find(".note-current-fontsize").html(c["font-size"]),d(e,parseFloat(c["font-size"]));var f=b.find(".note-height");d(f,parseFloat(c["line-height"]));var g=function(a,c){var d=b.find(a);d[c()?"addClass":"removeClass"]("active")};g('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),g('button[data-event="italic"]',function(){return"italic"===c["font-italic"]}),g('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),g('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),g('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),g('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),g('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),g('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),g('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)}},p=function(){this.update=function(b,c){var d=b.find(".note-link-popover"),e=b.find(".note-image-popover");if(c.anchor){var f=d.find("a");f.attr("href",c.anchor.href).html(c.anchor.href);var g=c.anchor.getBoundingClientRect();d.css({display:"block",left:g.left,top:a(document).scrollTop()+g.bottom})}else d.hide();if(c.image){var g=c.image.getBoundingClientRect();e.css({display:"block",left:g.left,top:a(document).scrollTop()+g.bottom})}else e.hide()},this.hide=function(a){a.children().hide()}},q=function(){this.update=function(b,c){var d=b.find(".note-control-selection");if(c.image){var e=c.image.getBoundingClientRect();d.css({display:"block",left:e.left+"px",top:a(document).scrollTop()+e.top+"px",width:e.width+"px",height:e.height+"px"}).data("target",c.image);var f=e.width+"x"+e.height;d.find(".note-control-selection-info").text(f)}else d.hide()},this.hide=function(a){a.children().hide()}},r=function(){this.showImageDialog=function(b,c,d){var e=b.find(".note-image-dialog"),f=b.find(".note-dropzone"),g=b.find(".note-image-input");e.on("shown.bs.modal",function(){f.on("dragenter dragover dragleave",!1),f.on("drop",function(a){c(a),e.modal("hide")}),g.on("change",function(){d(this.files),a(this).val(""),e.modal("hide")})}).on("hidden.bs.modal",function(){f.off("dragenter dragover dragleave drop"),g.off("change")}).modal("show")},this.showLinkDialog=function(a,b,c){var d=a.find(".note-link-dialog"),e=d.find(".note-link-text"),f=d.find(".note-link-url"),g=d.find(".note-link-btn");d.on("shown.bs.modal",function(){e.html(b.text),f.val(b.url).keyup(function(){f.val()?g.removeClass("disabled").attr("disabled",!1):g.addClass("disabled").attr("disabled",!0),b.text||e.html(f.val())}).trigger("focus"),g.click(function(a){d.modal("hide"),c(f.val()),a.preventDefault()})}).on("hidden.bs.modal",function(){f.off("keyup"),d.off("shown.bs.modal hidden.bs.modal"),g.off("click")}).modal("show")},this.showHelpDialog=function(a){a.find(".note-help-dialog").modal("show")}},s=function(){var c=new n,d=new o,e=new p,g=new q,h=new r,i={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,NUM0:48,NUM1:49,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLACH:220,RIGHTBRACKET:221},j=function(b){var c=a(b).closest(".note-editor");return{editor:function(){return c},toolbar:function(){return c.find(".note-toolbar")},editable:function(){return c.find(".note-editable")},statusbar:function(){return c.find(".note-statusbar")},popover:function(){return c.find(".note-popover")},handle:function(){return c.find(".note-handle")},dialog:function(){return c.find(".note-dialog")}}},k=function(a){var d=b?a.metaKey:a.ctrlKey,e=a.shiftKey,f=a.keyCode,g=d||e||f===i.TAB,k=g?j(a.target):null;if(d&&(e&&f===i.Z||f===i.Y))c.redo(k.editable());else if(d&&f===i.Z)c.undo(k.editable());else if(d&&f===i.B)c.bold(k.editable());else if(d&&f===i.I)c.italic(k.editable());else if(d&&f===i.U)c.underline(k.editable());else if(d&&e&&f===i.S)c.strikethrough(k.editable());else if(d&&f===i.BACKSLACH)c.removeFormat(k.editable());else if(d&&f===i.K)c.setLinkDialog(k.editable(),function(a,b){h.showLinkDialog(k.dialog(),a,b)});else if(d&&f===i.SLASH)h.showHelpDialog(k.dialog());else if(d&&e&&f===i.L)c.justifyLeft(k.editable());else if(d&&e&&f===i.E)c.justifyCenter(k.editable());else if(d&&e&&f===i.R)c.justifyRight(k.editable());else if(d&&e&&f===i.J)c.justifyFull(k.editable());else if(d&&e&&f===i.NUM7)c.insertUnorderedList(k.editable());else if(d&&e&&f===i.NUM8)c.insertOrderedList(k.editable());else if(d&&f===i.LEFTBRACKET)c.outdent(k.editable());else if(d&&f===i.RIGHTBRACKET)c.indent(k.editable());else if(d&&f===i.NUM0)c.formatBlock(k.editable(),"P");else if(d&&i.NUM1<=f&&f<=i.NUM6){var l="H"+String.fromCharCode(f);c.formatBlock(k.editable(),l)}else{if(!d||f!==i.ENTER)return(f===i.BACKSPACE||f===i.ENTER||f===i.SPACE)&&c.recordUndo(j(a.target).editable()),void 0;c.insertHorizontalRule(k.editable())}a.preventDefault()},l=function(b,d){b.trigger("focus"),a.each(d,function(a,d){var e=new FileReader;e.onload=function(a){c.insertImage(b,a.target.result)},e.readAsDataURL(d)})},m=function(a){var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=j(a.currentTarget||a.target);l(c.editable(),b.files)}a.stopPropagation(),a.preventDefault()},s=function(a){f.isImg(a.target)&&a.preventDefault()},t=function(a){var b=j(a.currentTarget||a.target),f=c.currentStyle(a.target);f&&(d.update(b.toolbar(),f),e.update(b.popover(),f),g.update(b.handle(),f))},u=function(a){var b=j(a.currentTarget||a.target);e.hide(b.popover()),g.hide(b.handle())},v=function(b){if(f.isControlSizing(b.target)){var d,h=j(b.target),i=h.handle(),k=h.popover(),l=h.editable(),m=h.editor(),n=i.find(".note-control-selection").data("target"),o=a(n).offset(),p=a(document).scrollTop();m.on("mousemove",function(a){d={x:a.clientX-o.left,y:a.clientY-(o.top-p)},c.resizeTo(d,n),g.update(i,{image:n}),e.update(k,{image:n})}).on("mouseup",function(){m.off("mousemove").off("mouseup")}),c.recordUndo(l),b.stopPropagation(),b.preventDefault()}},w=function(b){var c=a(b.target).closest("[data-event]");c.length>0&&b.preventDefault()},x=function(b){var e=a(b.target).closest("[data-event]");if(e.length>0){var f,g=e.attr("data-event"),i=e.attr("data-value"),k=j(b.target),n=k.dialog(),o=k.editable();if(-1!==a.inArray(g,["resize","float"])){var p=k.handle(),q=p.find(".note-control-selection");f=q.data("target")}c[g]&&(o.trigger("focus"),c[g](o,i,f)),-1!==a.inArray(g,["backColor","foreColor"])?d.updateRecentColor(e[0],g,i):"showLinkDialog"===g?c.setLinkDialog(o,function(a,b){h.showLinkDialog(n,a,b)}):"showImageDialog"===g?h.showImageDialog(n,m,function(a){l(o,a)}):"showHelpDialog"===g&&h.showHelpDialog(n),t(b)}},y=24,z=function(b){var c=a(document),d=j(b.target).editable(),e=d.offset().top-c.scrollTop(),f=function(a){d.height(a.clientY-(e+y))},g=function(){c.unbind("mousemove",f).unbind("mouseup",g)};c.mousemove(f).mouseup(g),b.stopPropagation(),b.preventDefault()},A=18,B=function(b){var c,d=a(b.target.parentNode),e=d.next(),f=d.find(".note-dimension-picker-mousecatcher"),g=d.find(".note-dimension-picker-highlighted"),h=d.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var i=a(b.target).offset();c={x:b.pageX-i.left,y:b.pageY-i.top}}else c={x:b.offsetX,y:b.offsetY};var j={c:Math.ceil(c.x/A)||1,r:Math.ceil(c.y/A)||1};g.css({width:j.c+"em",height:j.r+"em"}),f.attr("data-value",j.c+"x"+j.r),3<j.c&&j.c<10&&h.css({width:j.c+1+"em"}),3<j.r&&j.r<10&&h.css({height:j.r+1+"em"}),e.html(j.c+" x "+j.r)};this.attach=function(a,b){a.editable.on("keydown",k),a.editable.on("mousedown",s),a.editable.on("keyup mouseup",t),a.editable.on("scroll",u),a.editable.on("dragenter dragover dragleave",!1),a.editable.on("drop",m),a.handle.on("mousedown",v),a.toolbar.on("click",x),a.popover.on("click",x),a.toolbar.on("mousedown",w),a.popover.on("mousedown",w),a.statusbar.on("mousedown",z);var c=a.toolbar,d=c.find(".note-dimension-picker-mousecatcher");d.on("mousemove",B),b.onenter&&a.editable.keypress(function(a){a.keyCode===i.ENTER&&b.onenter(a)}),b.onfocus&&a.editable.focus(b.onfocus),b.onblur&&a.editable.blur(b.onblur),b.onkeyup&&a.editable.blur(b.onkeyup),b.onkeydown&&a.editable.blur(b.onkeydown)},this.dettach=function(a){a.editable.off(),a.toolbar.off(),a.handle.off(),a.popover.off()}},t=function(){var c={picture:'<button type="button" class="btn btn-default btn-sm btn-small" title="Picture" data-event="showImageDialog" tabindex="-1"><i class="icon-picture"></i></button>',link:'<button type="button" class="btn btn-default btn-sm btn-small" title="Link" data-event="showLinkDialog" data-shortcut="Ctrl+K" data-mac-shortcut="⌘+K" tabindex="-1"><i class="icon-link"></i></button>',table:'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="Table" data-toggle="dropdown" tabindex="-1"><i class="icon-table"></i> <span class="caret"></span></button><ul class="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>',style:'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="Style" data-toggle="dropdown" tabindex="-1"><i class="icon-magic"></i> <span class="caret"></span></button><ul class="dropdown-menu"><li><a data-event="formatBlock" data-value="p">Normal</a></li><li><a data-event="formatBlock" data-value="blockquote"><blockquote>Quote</blockquote></a></li><li><a data-event="formatBlock" data-value="pre">Code</a></li><li><a data-event="formatBlock" data-value="h1"><h1>Header 1</h1></a></li><li><a data-event="formatBlock" data-value="h2"><h2>Header 2</h2></a></li><li><a data-event="formatBlock" data-value="h3"><h3>Header 3</h3></a></li><li><a data-event="formatBlock" data-value="h4"><h4>Header 4</h4></a></li><li><a data-event="formatBlock" data-value="h5"><h5>Header 5</h5></a></li><li><a data-event="formatBlock" data-value="h6"><h6>Header 6</h6></a></li></ul>',fontsize:'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown" title="Font Size" tabindex="-1"><span class="note-current-fontsize">11</span> <b class="caret"></b></button><ul class="dropdown-menu"><li><a data-event="fontSize" data-value="8"><i class="icon-ok"></i> 8</a></li><li><a data-event="fontSize" data-value="9"><i class="icon-ok"></i> 9</a></li><li><a data-event="fontSize" data-value="10"><i class="icon-ok"></i> 10</a></li><li><a data-event="fontSize" data-value="11"><i class="icon-ok"></i> 11</a></li><li><a data-event="fontSize" data-value="12"><i class="icon-ok"></i> 12</a></li><li><a data-event="fontSize" data-value="14"><i class="icon-ok"></i> 14</a></li><li><a data-event="fontSize" data-value="18"><i class="icon-ok"></i> 18</a></li><li><a data-event="fontSize" data-value="24"><i class="icon-ok"></i> 24</a></li><li><a data-event="fontSize" data-value="36"><i class="icon-ok"></i> 36</a></li></ul>',color:'<button type="button" class="btn btn-default btn-sm btn-small note-recent-color" title="Recent Color" data-event="color" data-value=\'{"foreColor":"black","backColor":"yellow"}\' tabindex="-1"><i class="icon-font" style="color:black;background-color:yellow;"></i></button><button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="More Color" data-toggle="dropdown" tabindex="-1"><span class="caret"></span></button><ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">BackColor</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">FontColor</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>',bold:'<button type="button" class="btn btn-default btn-sm btn-small" title="Bold" data-shortcut="Ctrl+B" data-mac-shortcut="⌘+B" data-event="bold" tabindex="-1"><i class="icon-bold"></i></button>',italic:'<button type="button" class="btn btn-default btn-sm btn-small" title="Italic" data-shortcut="Ctrl+I" data-mac-shortcut="⌘+I" data-event="italic" tabindex="-1"><i class="icon-italic"></i></button>',underline:'<button type="button" class="btn btn-default btn-sm btn-small" title="Underline" data-shortcut="Ctrl+U" data-mac-shortcut="⌘+U" data-event="underline" tabindex="-1"><i class="icon-underline"></i></button>',clear:'<button type="button" class="btn btn-default btn-sm btn-small" title="Remove Font Style" data-shortcut="Ctrl+\\" data-mac-shortcut="⌘+\\" data-event="removeFormat" tabindex="-1"><i class="icon-eraser"></i></button>',ul:'<button type="button" class="btn btn-default btn-sm btn-small" title="Unordered list" data-shortcut="Ctrl+Shift+8" data-mac-shortcut="⌘+⇧+7" data-event="insertUnorderedList" tabindex="-1"><i class="icon-list-ul"></i></button>',ol:'<button type="button" class="btn btn-default btn-sm btn-small" title="Ordered list" data-shortcut="Ctrl+Shift+7" data-mac-shortcut="⌘+⇧+8" data-event="insertOrderedList" tabindex="-1"><i class="icon-list-ol"></i></button>',paragraph:'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="Paragraph" data-toggle="dropdown" tabindex="-1"><i class="icon-align-left"></i> <span class="caret"></span></button><ul class="dropdown-menu"><li><div class="note-align btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="Align left" data-shortcut="Ctrl+Shift+L" data-mac-shortcut="⌘+⇧+L" data-event="justifyLeft" tabindex="-1"><i class="icon-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Align center" data-shortcut="Ctrl+Shift+E" data-mac-shortcut="⌘+⇧+E" data-event="justifyCenter" tabindex="-1"><i class="icon-align-center"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Align right" data-shortcut="Ctrl+Shift+R" data-mac-shortcut="⌘+⇧+R" data-event="justifyRight" tabindex="-1"><i class="icon-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Justify full" data-shortcut="Ctrl+Shift+J" data-mac-shortcut="⌘+⇧+J" data-event="justifyFull" tabindex="-1"><i class="icon-align-justify"></i></button></div></li><li><div class="note-list btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="Outdent" data-shortcut="Ctrl+[" data-mac-shortcut="⌘+[" data-event="outdent" tabindex="-1"><i class="icon-indent-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Indent" data-shortcut="Ctrl+]" data-mac-shortcut="⌘+]" data-event="indent" tabindex="-1"><i class="icon-indent-right"></i></button></li></ul>',height:'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown" title="Line Height" tabindex="-1"><i class="icon-text-height"></i>&nbsp; <b class="caret"></b></button><ul class="dropdown-menu"><li><a data-event="lineHeight" data-value="1.0"><i class="icon-ok"></i> 1.0</a></li><li><a data-event="lineHeight" data-value="1.2"><i class="icon-ok"></i> 1.2</a></li><li><a data-event="lineHeight" data-value="1.4"><i class="icon-ok"></i> 1.4</a></li><li><a data-event="lineHeight" data-value="1.5"><i class="icon-ok"></i> 1.5</a></li><li><a data-event="lineHeight" data-value="1.6"><i class="icon-ok"></i> 1.6</a></li><li><a data-event="lineHeight" data-value="1.8"><i class="icon-ok"></i> 1.8</a></li><li><a data-event="lineHeight" data-value="2.0"><i class="icon-ok"></i> 2.0</a></li><li><a data-event="lineHeight" data-value="3.0"><i class="icon-ok"></i> 3.0</a></li></ul>',help:'<button type="button" class="btn btn-default btn-sm btn-small" title="Help" data-shortcut="Ctrl+/" data-mac-shortcut="⌘+/" data-event="showHelpDialog" tabindex="-1"><i class="icon-question"></i></button>'},d='<div class="note-popover"><div class="note-link-popover popover fade bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content note-link-content"><a href="http://www.google.com" target="_blank">www.google.com</a>&nbsp;&nbsp;<div class="note-insert btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="Edit" data-event="showLinkDialog" tabindex="-1"><i class="icon-edit"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Unlink" data-event="unlink" tabindex="-1"><i class="icon-unlink"></i></button></div></div></div><div class="note-image-popover popover fade bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content note-image-content"><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="Resize Full" data-event="resize" data-value="1" tabindex="-1"><i class="icon-resize-full"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Resize Half" data-event="resize" data-value="0.5" tabindex="-1">½</button><button type="button" class="btn btn-default btn-sm btn-small" title="Resize Thrid" data-event="resize" data-value="0.33" tabindex="-1">⅓</button><button type="button" class="btn btn-default btn-sm btn-small" title="Resize Quarter" data-event="resize" data-value="0.25" tabindex="-1">¼</button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="Float Left" data-event="float" data-value="left" tabindex="-1"><i class="icon-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Float Right" data-event="float" data-value="right" tabindex="-1"><i class="icon-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Float None" data-event="float" data-value="none" tabindex="-1"><i class="icon-reorder"></i></button></div></div></div></div>',e='<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>',f='<table class="note-shortcut"><thead><tr><th></th><th>Text formatting</th></tr></thead><tbody><tr><td>⌘ + B</td><td>Toggle Bold</td></tr><tr><td>⌘ + I</td><td>Toggle Italic</td></tr><tr><td>⌘ + U</td><td>Toggle Underline</td></tr><tr><td>⌘ + ⇧ + S</td><td>Toggle Strike</td></tr><tr><td>⌘ + \\</td><td>Remove Font Style</td></tr></tr></tbody></table>',g='<table class="note-shortcut"><thead><tr><th></th><th>Action</th></tr></thead><tbody><tr><td>⌘ + Z</td><td>Undo</td></tr><tr><td>⌘ + ⇧ + Z</td><td>Redo</td></tr><tr><td>⌘ + ]</td><td>Indent</td></tr><tr><td>⌘ + [</td><td>Outdent</td></tr><tr><td>⌘ + K</td><td>Insert Link</td></tr><tr><td>⌘ + ENTER</td><td>Insert Horizontal Rule</td></tr></tbody></table>',h='<table class="note-shortcut"><thead><tr><th></th><th>Paragraph formatting</th></tr></thead><tbody><tr><td>⌘ + ⇧ + L</td><td>Align Left</td></tr><tr><td>⌘ + ⇧ + E</td><td>Align Center</td></tr><tr><td>⌘ + ⇧ + R</td><td>Align Right</td></tr><tr><td>⌘ + ⇧ + J</td><td>Justify Full</td></tr><tr><td>⌘ + ⇧ + NUM7</td><td>Ordered List</td></tr><tr><td>⌘ + ⇧ + NUM8</td><td>Unordered List</td></tr></tbody></table>',i='<table class="note-shortcut"><thead><tr><th></th><th>Document Style</th></tr></thead><tbody><tr><td>⌘ + NUM0</td><td>Normal Text</td></tr><tr><td>⌘ + NUM1</td><td>Heading 1</td></tr><tr><td>⌘ + NUM2</td><td>Heading 2</td></tr><tr><td>⌘ + NUM3</td><td>Heading 3</td></tr><tr><td>⌘ + NUM4</td><td>Heading 4</td></tr><tr><td>⌘ + NUM5</td><td>Heading 5</td></tr><tr><td>⌘ + NUM6</td><td>Heading 6</td></tr></tbody></table>',j='<table class="note-shortcut-layout"><tbody><tr><td>'+g+"</td><td>"+f+"</td></tr>"+"<tr><td>"+i+"</td><td>"+h+"</td></tr>"+"</tbody>"+"</table>",k='<div class="note-dialog"><div class="note-image-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" tabindex="-1">×</button><h4>Insert Image</h4></div><div class="modal-body"><div class="row-fluid"><div class="note-dropzone span12">Drag an image here</div><div>or if you prefer...</div><input class="note-image-input" type="file" class="note-link-url" type="text" /></div></div></div></div></div><div class="note-link-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" tabindex="-1">×</button><h4>Edit Link</h4></div><div class="modal-body"><div class="row-fluid"><div class="form-group"><label>Text to display</label><span class="note-link-text form-control input-xlarge uneditable-input" /></div><div class="form-group"><label>To what URL should this link go?</label><input class="note-link-url form-control span12" type="text" /></div></div></div><div class="modal-footer"><a href="#" class="btn disabled note-link-btn" disabled="disabled">Link</a></div></div></div></div><div class="note-help-dialog modal fade" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-body"><div class="modal-background"><a class="modal-close pull-right" data-dismiss="modal" aria-hidden="true" tabindex="-1">Close</a><div class="title">Keyboard shortcuts</div>'+j+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote v0.3</a> · <a href="//github.com/HackerWins/summernote" target="_blank">Project</a> · <a href="//github.com/HackerWins/summernote/issues" target="_blank">Issues</a></p>'+"</div>"+"</div>"+"</div>"+"</div>"+"</div>",l=function(c,d){c.find("button").each(function(c,d){var e=a(d),f=e.attr(b?"data-mac-shortcut":"data-shortcut");f&&e.attr("title",function(a,b){return b+" ("+f+")"})}).tooltip({container:"body",placement:d||"top"})},n=[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#EFF7F7","#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"]],o=function(b){b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),d="",e=0,f=n.length;f>e;e++){for(var g=n[e],h="<div>",i=0,j=g.length;j>i;i++){var k=g[i],l=['<button type="button" class="note-color-btn" style="background-color:',k,';" data-event="',c,'" data-value="',k,'" title="',k,'" data-toggle="button" tabindex="-1"></button>'].join("");
2
+ h+=l}h+="</div>",d+=h}b.html(d)})};this.createLayout=function(b,f,g,h){if(!b.next().hasClass("note-editor")){var i=a('<div class="note-editor"></div>');f>0&&a('<div class="note-statusbar"><div class="note-resizebar"><div class="note-icon-bar"></div><div class="note-icon-bar"></div><div class="note-icon-bar"></div></div></div>').prependTo(i);var j=a('<div class="note-editable" contentEditable="true"></div>').prependTo(i);g&&j.attr("tabIndex",g),f&&j.height(f),j.html(b.html()),j.data("NoteHistory",new m);for(var n="",p=0,q=h.length;q>p;p++){var r=h[p];n+='<div class="note-'+r[0]+' btn-group">';for(var s=0,t=r[1].length;t>s;s++)n+=c[r[1][s]];n+="</div>"}n='<div class="note-toolbar btn-toolbar">'+n+"</div>";var u=a(n).prependTo(i);o(u),l(u,"bottom");var v=a(d).prependTo(i);l(v),a(e).prependTo(i),a(k).prependTo(i),i.insertAfter(b),b.hide()}};var p=this.layoutInfoFromHolder=function(a){var b=a.next();if(b.hasClass("note-editor"))return{editor:b,toolbar:b.find(".note-toolbar"),editable:b.find(".note-editable"),statusbar:b.find(".note-statusbar"),popover:b.find(".note-popover"),handle:b.find(".note-handle"),dialog:b.find(".note-dialog")}};this.removeLayout=function(a){var b=p(a);b&&(a.html(b.editable.html()),b.editor.remove(),a.show())}},u=new t,v=new s;a.fn.extend({summernote:function(b){if(b=a.extend({toolbar:[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontsize",["fontsize"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture"]],["help",["help"]]]},b),this.each(function(c,d){var e=a(d);u.createLayout(e,b.height,b.tabIndex,b.toolbar);var f=u.layoutInfoFromHolder(e);v.attach(f,b)}),this.first()&&b.focus){var c=u.layoutInfoFromHolder(this.first());c.editable.focus()}this.length>0&&b.oninit&&b.oninit()},code:function(b){return void 0===b?this.map(function(b,c){var d=u.layoutInfoFromHolder(a(c)),e=!(!d||!d.editable);return e?d.editable.html():a(c).html()}):(this.each(function(c,d){var e=u.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)}),void 0)},destroy:function(){this.each(function(b,c){var d=a(c),e=u.layoutInfoFromHolder(d);e&&e.editable&&(v.dettach(e),u.removeLayout(d))})},summernoteInner:function(){return{dom:f,list:e,func:d,Range:j}}})}(jQuery),"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(a,b){"use strict";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});
@@ -5265,4 +5265,4 @@
5265
5265
  }
5266
5266
  .note-editor .affix {
5267
5267
  position: fixed;
5268
- }
5268
+ }
@@ -1 +1 @@
1
- .note-editor{border:1px solid #a9a9a9}.note-editor .note-toolbar{padding:5px;margin:0;background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor .note-toolbar .note-table .dropdown-menu{min-width:0;padding:5px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker{font-size:18px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:20em;height:20em;cursor:pointer}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-editor .note-toolbar .note-style h1,.note-editor .note-toolbar .note-style h2,.note-editor .note-toolbar .note-style h3,.note-editor .note-toolbar .note-style h4,.note-editor .note-toolbar .note-style h5,.note-editor .note-toolbar .note-style h6,.note-editor .note-toolbar .note-style blockquote{margin:0}.note-editor .note-toolbar .note-fontsize button{height:26px}.note-editor .note-toolbar .note-color .dropdown-toggle{width:20px;padding:2px 5px}.note-editor .note-toolbar .note-color .dropdown-menu{padding:5px}.note-editor .note-toolbar .note-color .dropdown-menu .note-palette-title{font-size:12px}.note-editor .note-toolbar .note-para .dropdown-menu{min-width:140px;padding:5px}.note-editor .note-toolbar .note-para li:first-child{margin-bottom:5px}.note-editor .note-popover .popover{max-width:none}.note-editor .note-popover .popover .popover-content{padding:5px}.note-editor .note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-editor .note-popover .popover .arrow{left:20px}.note-editor .note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-editor .note-handle .note-control-selection>div{position:absolute}.note-editor .note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-editor .note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-editor .note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-editor .note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-editor .note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-editor .note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-editor .note-dialog .note-image-dialog .note-dropzone{min-height:200px;font-size:30px;line-height:6;color:lightgray;text-align:center;border:4px dashed lightgray}.note-editor .note-dialog .note-help-dialog{font-size:12px;color:white;background:transparent;border:1px solid white}.note-editor .note-dialog .note-help-dialog a{font-size:12px;color:white}.note-editor .note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:bold;color:white;border-bottom:white 1px solid}.note-editor .note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-editor .note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-editor .note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.note-editor .note-dialog .note-help-dialog .note-shortcut td:first-child{min-width:110px;padding-right:10px;font-family:"Courier New";color:#dd0;text-align:right}.note-editor .note-editable{padding:10px;overflow:scroll;outline:0}.note-editor .dropdown-menu{min-width:90px}.note-editor .dropdown-menu.right{right:0;left:auto}.note-editor .dropdown-menu.right::before{right:9px;left:auto!important}.note-editor .dropdown-menu.right::after{right:10px;left:auto!important}.note-editor .dropdown-menu li a i{color:deepskyblue;visibility:hidden}.note-editor .dropdown-menu li a.checked i{visibility:visible}.note-editor .btn-small{min-height:26px;font-size:14px}.note-editor .note-color-palette{line-height:1}.note-editor .note-color-palette div .note-color-btn{width:17px;height:17px;padding:0;margin:0;border:1px solid #fff}.note-editor .note-color-palette div .note-color-btn:hover{border:1px solid #000}
1
+ .note-editor{border:1px solid #a9a9a9}.note-editor .note-toolbar{padding:5px;margin:0;background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor .note-toolbar .note-table .dropdown-menu{min-width:0;padding:5px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker{font-size:18px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-editor .note-toolbar .note-style h1,.note-editor .note-toolbar .note-style h2,.note-editor .note-toolbar .note-style h3,.note-editor .note-toolbar .note-style h4,.note-editor .note-toolbar .note-style h5,.note-editor .note-toolbar .note-style h6,.note-editor .note-toolbar .note-style blockquote{margin:0}.note-editor .note-toolbar .note-fontsize button{height:26px}.note-editor .note-toolbar .note-color .dropdown-toggle{width:20px;padding:2px 5px}.note-editor .note-toolbar .note-color .dropdown-menu{min-width:290px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{font-size:12px}.note-editor .note-toolbar .note-para .dropdown-menu{min-width:153px;padding:5px}.note-editor .note-toolbar .note-para li:first-child{margin-bottom:5px}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;cursor:s-resize;border-top:1px solid #a9a9a9}.note-editor .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor .note-popover .popover{max-width:none}.note-editor .note-popover .popover .popover-content{padding:5px}.note-editor .note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-editor .note-popover .popover .popover-content .btn-group+.btn-group{margin-left:5px}.note-editor .note-popover .popover .arrow{left:20px}.note-editor .note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-editor .note-handle .note-control-selection>div{position:absolute}.note-editor .note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-editor .note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-editor .note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-editor .note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-editor .note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-editor .note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-editor .note-dialog>div{display:none}.note-editor .note-dialog .note-image-dialog .note-dropzone{min-height:200px;font-size:30px;line-height:6;color:lightgray;text-align:center;border:4px dashed lightgray}.note-editor .note-dialog .note-help-dialog{font-size:12px;color:white;background:transparent;border:0}.note-editor .note-dialog .note-help-dialog .modal-content{background:transparent;border:1px solid white;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.note-editor .note-dialog .note-help-dialog a{font-size:12px;color:white}.note-editor .note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:bold;color:white;border-bottom:white 1px solid}.note-editor .note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-editor .note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-editor .note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.note-editor .note-dialog .note-help-dialog .note-shortcut td:first-child{min-width:110px;padding-right:10px;font-family:"Courier New";color:#dd0;text-align:right}.note-editor .note-editable{padding:10px;overflow:scroll;outline:0}.note-editor .dropdown-menu{min-width:90px}.note-editor .dropdown-menu.right{right:0;left:auto}.note-editor .dropdown-menu.right::before{right:9px;left:auto!important}.note-editor .dropdown-menu.right::after{right:10px;left:auto!important}.note-editor .dropdown-menu li a i{color:deepskyblue;visibility:hidden}.note-editor .dropdown-menu li a.checked i{visibility:visible}.note-editor .btn-sm{min-height:33px;font-size:14px}.note-editor .note-color-palette{line-height:1}.note-editor .note-color-palette div .note-color-btn{width:17px;height:17px;padding:0;margin:0;border:1px solid #fff}.note-editor .note-color-palette div .note-color-btn:hover{border:1px solid #000}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: summernote-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hyo Seong Choi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -92,3 +92,4 @@ signing_key:
92
92
  specification_version: 4
93
93
  summary: Gemify Summernote for Ruby on Rails
94
94
  test_files: []
95
+ has_rdoc: