summernote-rails 0.4.0 → 0.5.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +83 -40
  3. data/lib/summernote/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/lang/summernote-ar-AR.js +104 -0
  5. data/vendor/assets/javascripts/lang/summernote-ca-ES.js +102 -0
  6. data/vendor/assets/javascripts/lang/summernote-cs-CZ.js +103 -0
  7. data/vendor/assets/javascripts/lang/summernote-da-DK.js +104 -0
  8. data/vendor/assets/javascripts/lang/summernote-de-DE.js +104 -0
  9. data/vendor/assets/javascripts/lang/summernote-es-ES.js +105 -0
  10. data/vendor/assets/javascripts/lang/summernote-es-EU.js +103 -0
  11. data/vendor/assets/javascripts/lang/summernote-fa-IR.js +105 -0
  12. data/vendor/assets/javascripts/lang/summernote-fi-FI.js +104 -0
  13. data/vendor/assets/javascripts/lang/summernote-fr-FR.js +107 -0
  14. data/vendor/assets/javascripts/lang/summernote-hu-HU.js +105 -0
  15. data/vendor/assets/javascripts/lang/summernote-id-ID.js +103 -0
  16. data/vendor/assets/javascripts/lang/summernote-it-IT.js +104 -0
  17. data/vendor/assets/javascripts/lang/summernote-ja-JP.js +104 -0
  18. data/vendor/assets/javascripts/lang/summernote-ko-KR.js +104 -0
  19. data/vendor/assets/javascripts/lang/summernote-nb-NO.js +104 -0
  20. data/vendor/assets/javascripts/lang/summernote-nl-NL.js +104 -0
  21. data/vendor/assets/javascripts/lang/summernote-pl-PL.js +104 -0
  22. data/vendor/assets/javascripts/lang/summernote-pt-BR.js +102 -0
  23. data/vendor/assets/javascripts/lang/summernote-ro-RO.js +102 -0
  24. data/vendor/assets/javascripts/lang/summernote-ru-RU.js +107 -0
  25. data/vendor/assets/javascripts/lang/summernote-sk-SK.js +102 -0
  26. data/vendor/assets/javascripts/lang/summernote-sl-SI.js +106 -0
  27. data/vendor/assets/javascripts/lang/summernote-sr-RS-Latin.js +104 -0
  28. data/vendor/assets/javascripts/lang/summernote-sr-RS.js +104 -0
  29. data/vendor/assets/javascripts/lang/summernote-sv-SE.js +104 -0
  30. data/vendor/assets/javascripts/lang/summernote-th-TH.js +106 -0
  31. data/vendor/assets/javascripts/lang/summernote-tr-TR.js +102 -0
  32. data/vendor/assets/javascripts/lang/summernote-uk-UA.js +106 -0
  33. data/vendor/assets/javascripts/lang/summernote-vi-VN.js +104 -0
  34. data/vendor/assets/javascripts/lang/summernote-zh-CN.js +103 -0
  35. data/vendor/assets/javascripts/lang/summernote-zh-TW.js +102 -0
  36. data/vendor/assets/javascripts/summernote.js +5009 -1678
  37. data/vendor/assets/javascripts/summernote.min.js +2 -2
  38. data/vendor/assets/stylesheets/summernote-bs2.css +4 -4
  39. data/vendor/assets/stylesheets/summernote-bs3.css +97 -10
  40. data/vendor/assets/stylesheets/summernote.css +1 -1
  41. metadata +46 -15
@@ -1,2 +1,2 @@
1
- !function(a){"use strict";var b={bMac:navigator.appVersion.indexOf("Mac")>-1,bMSIE:navigator.userAgent.indexOf("MSIE")>-1,bFF:navigator.userAgent.indexOf("Firefox")>-1},c=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}}(),d=function(){var a=function(a){return a[0]},b=function(a){return a[a.length-1]},d=function(a){return a.slice(0,a.length-1)},e=function(a){return a.slice(1)},f=function(a,b){return b=b||c.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:d,tail:e,sum:f,from:g,compact:i,clusterBy:h}}(),e=function(){var b=function(b){return a.Deferred(function(a){var c=new FileReader;c.onload=function(b){a.resolve(b.target.result)},c.onerror=function(){a.reject(this)},c.readAsDataURL(b)}).promise()},c=function(b){return a.Deferred(function(a){function c(){e(),a.resolve(f)}function d(){e(),a.reject(f)}function e(){f.onload=null,f.onerror=null,f.onabort=null}var f=new Image;f.onload=c,f.onerror=d,f.onabort=d,f.src=b}).promise()};return{readFile:b,loadImage:c}}(),f=function(){var b=function(a){return function(b){return b&&b.nodeName===a}},e=function(a){return a&&/^P|^LI|^H[1-7]/.test(a.nodeName)},g=function(a){return a&&/^UL|^OL/.test(a.nodeName)},h=function(b){return b&&a(b).hasClass("note-editable")},i=function(b){return b&&a(b).hasClass("note-control-sizing")},j=function(a,b){for(;a;){if(b(a))return a;a=a.parentNode}return null},k=function(a,b){b=b||c.fail;var d=[];return j(a,function(a){return d.push(a),b(a)}),d},l=function(b,c){for(var d=k(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},m=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(l(a,b)),c},n=function(a,b){b=b||c.fail;for(var d=[];a&&(d.push(a),!b(a));)a=a.previousSibling;return d},o=function(a,b){b=b||c.fail;for(var d=[];a&&(d.push(a),!b(a));)a=a.nextSibling;return d},p=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},q=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},r=b("#text"),s=function(a){return r(a)?a.nodeValue.length:a.childNodes.length},t=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},u=function(b,e){var f=d.initial(k(e,c.eq(b)));return a.map(f,t).reverse()},v=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes[b[d]];return c},w=function(a,b){if(0===b)return a;if(b>=s(a))return a.nextSibling;if(r(a))return a.splitText(b);var c=a.childNodes[b];return a=p(a.cloneNode(!1),a),q(a,o(c))},x=function(a,b,d){var e=k(b,c.eq(a));return 1===e.length?w(b,d):e.reduce(function(a,c){var e=c.cloneNode(!1);return p(e,c),a===b&&(a=w(a,d)),q(e,o(a)),e})},y=function(a,b){if(a&&a.parentNode){if(a.removeNode)return a.removeNode(b);var c=a.parentNode;if(!b){for(var d=[],e=0,f=a.childNodes.length;f>e;e++)d.push(a.childNodes[e]);for(var e=0,f=d.length;f>e;e++)c.insertBefore(d[e],a)}c.removeChild(a)}},z=function(b){return a("<div/>").html(b).text()},A=function(a){return f.isTextarea(a[0])?z(a.val()):a.html()};return{isText:r,isPara:e,isList:g,isEditable:h,isControlSizing:i,isAnchor:b("A"),isDiv:b("DIV"),isSpan:b("SPAN"),isB:b("B"),isU:b("U"),isS:b("S"),isI:b("I"),isImg:b("IMG"),isTextarea:b("TEXTAREA"),ancestor:j,listAncestor:k,listNext:o,listPrev:n,commonAncestor:l,listBetween:m,insertAfter:p,position:t,makeOffsetPath:u,fromOffsetPath:v,split:x,remove:y,html:A}}(),g=function(){var b=!!document.createRange,e=function(a,b){var c,e,g=a.parentElement(),h=document.body.createTextRange(),i=d.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;e=i[c]}if(0!==c&&f.isText(i[c-1])){var j=document.body.createTextRange(),k=null;j.moveToElementText(e||g),j.collapse(!e),k=e?e.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}},g=function(a){var b=function(a,e){var g,h;if(f.isText(a)){var i=f.listPrev(a,c.not(f.isText)),j=d.last(i).previousSibling;g=j||a.parentNode,e+=d.sum(d.tail(i),f.length),h=!j}else{if(g=a.childNodes[e]||a,f.isText(g))return b(g,e);e=0,h=!1}return{cont:g,collapseToStart:h,offset:e}},e=document.body.createTextRange(),g=b(a.cont,a.offset);return e.moveToElementText(g.cont),e.collapse(g.collapseToStart),e.moveStart("character",g.offset),e},h=function(e,h,i,j){this.sc=e,this.so=h,this.ec=i,this.eo=j;var k=function(){if(b){var a=document.createRange();return a.setStart(e,h),a.setEnd(i,j),a}var c=g({cont:e,offset:h});return c.setEndPoint("EndToEnd",g({cont:i,offset:j})),c};this.select=function(){var a=k();if(b){var c=document.getSelection();c.rangeCount>0&&c.removeAllRanges(),c.addRange(a)}else a.select()},this.listPara=function(){var b=f.listBetween(e,i),g=d.compact(a.map(b,function(a){return f.ancestor(a,f.isPara)}));return a.map(d.clusterBy(g,c.eq2),d.head)};var l=function(a){return function(){var b=f.ancestor(e,a);return b&&b===f.ancestor(i,a)}};this.isOnEditable=l(f.isEditable),this.isOnList=l(f.isList),this.isOnAnchor=l(f.isAnchor),this.isCollapsed=function(){return e===i&&h===j},this.insertNode=function(a){var c=k();b?c.insertNode(a):c.pasteHTML(a.outerHTML)},this.toString=function(){var a=k();return b?a.toString():a.text},this.bookmark=function(a){return{s:{path:f.makeOffsetPath(a,e),offset:h},e:{path:f.makeOffsetPath(a,i),offset:j}}}};return{create:function(a,c,d,f){if(0===arguments.length)if(b){var g=document.getSelection();if(0===g.rangeCount)return null;var i=g.getRangeAt(0);a=i.startContainer,c=i.startOffset,d=i.endContainer,f=i.endOffset}else{var j=document.selection.createRange(),k=j.duplicate();k.collapse(!1);var l=j;l.collapse(!0);var m=e(l,!0),n=e(k,!1);a=m.cont,c=m.offset,d=n.cont,f=n.offset}else 2===arguments.length&&(d=a,f=c);return new h(a,c,d,f)},createFromBookmark:function(a,b){var c=f.fromOffsetPath(a,b.s.path),d=b.s.offset,e=f.fromOffsetPath(a,b.e.path),g=b.e.offset;return new h(c,d,e,g)}}}(),h=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}},i=function(){var a=[],b=[],c=function(a){var b=a[0],c=g.create();return{contents:a.html(),bookmark:c.bookmark(b),scrollTop:a.scrollTop()}},d=function(a,b){a.html(b.contents).scrollTop(b.scrollTop),g.createFromBookmark(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))}},j=function(){this.saveRange=function(a){a.data("range",g.create())},this.restoreRange=function(a){var b=a.data("range");b&&b.select()};var c=new h;this.currentStyle=function(a){var b=g.create();return b.isOnEditable()&&c.current(b,a)},this.tab=function(b){d(b);var c=g.create(),e=new Array(b.data("tabsize")+1).join("&nbsp;");c.insertNode(a('<span id="noteTab">'+e+"</span>")[0]);var h=a("#noteTab").removeAttr("id");c=g.create(h[0],1),c.select(),f.remove(h[0])},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)},i=["bold","italic","underline","strikethrough","justifyLeft","justifyCenter","justifyRight","justifyFull","insertOrderedList","insertUnorderedList","indent","outdent","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule"],j=0,k=i.length;k>j;j++)this[i[j]]=function(a){return function(b,c){d(b),document.execCommand(a,!1,c)}}(i[j]);this.insertImage=function(b,c){e.loadImage(c).done(function(e){d(b);var f=a("<img>").attr("src",c);f.css("width",Math.min(b.width(),e.width)),g.create().insertNode(f[0])}).fail(function(){var a=b.data("callbacks");a.onImageUploadError&&a.onImageUploadError()})},this.formatBlock=function(a,c){d(a),c=b.bMSIE?"<"+c+">":c,document.execCommand("FormatBlock",!1,c)},this.fontSize=function(a,c){d(a),document.execCommand("fontSize",!1,3),b.bFF?a.find("font[size=3]").removeAttr("size").css("font-size",c+"px"):a.find("span").filter(function(){return"medium"==this.style.fontSize}).css("font-size",c+"px")},this.lineHeight=function(a,b){d(a),c.stylePara(g.create(),{lineHeight:b})},this.unlink=function(a){var b=g.create();if(b.isOnAnchor()){d(a);var c=f.ancestor(b.sc,f.isAnchor);b=g.create(c,0,c,1),b.select(),document.execCommand("unlink")}},this.setLinkDialog=function(c,e){var h=g.create();if(h.isOnAnchor()){var i=f.ancestor(h.sc,f.isAnchor);h=g.create(i,0,i,1)}e({range:h,text:h.toString(),url:h.isOnAnchor()?f.ancestor(h.sc,f.isAnchor).href:""},function(e){h.select(),d(c);var f=-1!==e.toLowerCase().indexOf("://"),i=f?e:"http://"+e;if(b.bMSIE&&h.isCollapsed()){h.insertNode(a('<A id="linkAnchor">'+e+"</A>")[0]);var j=a("#linkAnchor").removeAttr("id").attr("href",i);h=g.create(j[0],0,j[0],1),h.select()}else document.execCommand("createlink",!1,i)})},this.color=function(a,b){var c=JSON.parse(b),e=c.foreColor,f=c.backColor;d(a),e&&document.execCommand("foreColor",!1,e),f&&document.execCommand("backColor",!1,f)},this.insertTable=function(c,e){d(c);for(var f,h=e.split("x"),i=h[0],j=h[1],k=[],l=b.bMSIE?"&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>";g.create().insertNode(a(q)[0])},this.floatMe=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){var c=a.y/a.x,d=b.data("ratio");b.css({width:d>c?a.x:a.y/d,height:d>c?a.x*d:a.y})}},k=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)},this.updateFullscreen=function(a,b){var c=a.find('button[data-event="fullscreen"]');c[b?"addClass":"removeClass"]("active")},this.updateCodeview=function(a,b){var c=a.find('button[data-event="codeview"]');c[b?"addClass":"removeClass"]("active")},this.enable=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.disable=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")}},l=function(){var b=function(b,c){var d=a(c),e=d.position(),f=d.height();b.css({display:"block",left:e.left,top:e.top+f})};this.update=function(a,c){var d=a.find(".note-link-popover"),e=a.find(".note-image-popover");if(c.anchor){var f=d.find("a");f.attr("href",c.anchor.href).html(c.anchor.href),b(d,c.anchor)}else d.hide();c.image?b(e,c.image):e.hide()},this.hide=function(a){a.children().hide()}},m=function(){this.update=function(b,c){var d=b.find(".note-control-selection");if(c.image){var e=a(c.image),f=e.position(),g={w:e.width(),h:e.height()};d.css({display:"block",left:f.left,top:f.top,width:g.w,height:g.h}).data("target",c.image);var h=g.w+"x"+g.h;d.find(".note-control-selection-info").text(h)}else d.hide()},this.hide=function(a){a.children().hide()}},n=function(){this.showImageDialog=function(b,c,d,e){var f=b.find(".note-image-dialog"),g=b.find(".note-dropzone"),h=b.find(".note-image-input"),i=b.find(".note-image-url"),j=b.find(".note-image-btn");f.on("shown.bs.modal",function(){g.on("dragenter dragover dragleave",!1),g.on("drop",function(a){c(a),f.modal("hide")}),h.on("change",function(){d(this.files),a(this).val(""),f.modal("hide")}),i.val("").keyup(function(){i.val()?j.removeClass("disabled").attr("disabled",!1):j.addClass("disabled").attr("disabled",!0)}).trigger("focus"),j.click(function(a){f.modal("hide"),e(i.val()),a.preventDefault()})}).on("hidden.bs.modal",function(){g.off("dragenter dragover dragleave drop"),h.off("change"),f.off("shown.bs.modal hidden.bs.modal"),i.off("keyup"),j.off("click")}).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"),g.off("click"),d.off("shown.bs.modal hidden.bs.modal")}).modal("show")},this.showHelpDialog=function(a){a.find(".note-help-dialog").modal("show")}},o=function(){var c=new j,d=new k,g=new l,h=new m,i=new n,o={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},p=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")},codable:function(){return c.find(".note-codable")},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")}}},q=function(a){var d=b.bMac?a.metaKey:a.ctrlKey,e=a.shiftKey,f=a.keyCode,g=d||e||f===o.TAB,h=g?p(a.target):null;if(f===o.TAB&&h.editable().data("tabsize"))c.tab(h.editable());else if(d&&(e&&f===o.Z||f===o.Y))c.redo(h.editable());else if(d&&f===o.Z)c.undo(h.editable());else if(d&&f===o.B)c.bold(h.editable());else if(d&&f===o.I)c.italic(h.editable());else if(d&&f===o.U)c.underline(h.editable());else if(d&&e&&f===o.S)c.strikethrough(h.editable());else if(d&&f===o.BACKSLACH)c.removeFormat(h.editable());else if(d&&f===o.K)h.editable(),c.setLinkDialog(h.editable(),function(a,b){i.showLinkDialog(h.dialog(),a,b)});else if(d&&f===o.SLASH)i.showHelpDialog(h.dialog());else if(d&&e&&f===o.L)c.justifyLeft(h.editable());else if(d&&e&&f===o.E)c.justifyCenter(h.editable());else if(d&&e&&f===o.R)c.justifyRight(h.editable());else if(d&&e&&f===o.J)c.justifyFull(h.editable());else if(d&&e&&f===o.NUM7)c.insertUnorderedList(h.editable());else if(d&&e&&f===o.NUM8)c.insertOrderedList(h.editable());else if(d&&f===o.LEFTBRACKET)c.outdent(h.editable());else if(d&&f===o.RIGHTBRACKET)c.indent(h.editable());else if(d&&f===o.NUM0)c.formatBlock(h.editable(),"P");else if(d&&o.NUM1<=f&&f<=o.NUM6){var j="H"+String.fromCharCode(f);c.formatBlock(h.editable(),j)}else{if(!d||f!==o.ENTER)return(f===o.BACKSPACE||f===o.ENTER||f===o.SPACE)&&c.recordUndo(p(a.target).editable()),void 0;c.insertHorizontalRule(h.editable())}a.preventDefault()},r=function(b,d){var f=b.data("callbacks");c.restoreRange(b),f.onImageUpload?f.onImageUpload(d,c,b):a.each(d,function(a,d){e.readFile(d).done(function(a){c.insertImage(b,a)}).fail(function(){f.onImageUploadError&&f.onImageUploadError()})})},s=function(a){var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=p(a.currentTarget||a.target);r(c.editable(),b.files)}a.stopPropagation(),a.preventDefault()},t=function(a){f.isImg(a.target)&&a.preventDefault()},u=function(a){var b=p(a.currentTarget||a.target),e=c.currentStyle(a.target);e&&(d.update(b.toolbar(),e),g.update(b.popover(),e),h.update(b.handle(),e))},v=function(a){var b=p(a.currentTarget||a.target);g.hide(b.popover()),h.hide(b.handle())},w=function(b){if(f.isControlSizing(b.target)){var d,e=p(b.target),i=e.handle(),j=e.popover(),k=e.editable(),l=e.editor(),m=i.find(".note-control-selection").data("target"),n=a(m),o=n.offset(),q=a(document).scrollTop();l.on("mousemove",function(a){d={x:a.clientX-o.left,y:a.clientY-(o.top-q)},c.resizeTo(d,n),h.update(i,{image:m}),g.update(j,{image:m})}).on("mouseup",function(){l.off("mousemove").off("mouseup")}),n.data("ratio")||n.data("ratio",n.height()/n.width()),c.recordUndo(k),b.stopPropagation(),b.preventDefault()}},x=function(b){var c=a(b.target).closest("[data-event]");c.length>0&&b.preventDefault()},y=function(b){var e=a(b.target).closest("[data-event]");if(e.length>0){var f,g=e.attr("data-event"),h=e.attr("data-value"),j=p(b.target),k=j.dialog(),l=j.editable(),m=j.codable();if(-1!==a.inArray(g,["resize","floatMe"])){var n=j.handle(),o=n.find(".note-control-selection");f=o.data("target")}if(c[g]&&(l.trigger("focus"),c[g](l,h,f)),-1!==a.inArray(g,["backColor","foreColor"]))d.updateRecentColor(e[0],g,h);else if("showLinkDialog"===g)l.focus(),c.setLinkDialog(l,function(a,b){i.showLinkDialog(k,a,b)});else if("showImageDialog"===g)l.focus(),i.showImageDialog(k,s,function(a){r(l,a)},function(a){c.restoreRange(l),c.insertImage(l,a)});else if("showHelpDialog"===g)i.showHelpDialog(k);else if("fullscreen"===g){var q=j.editor();q.toggleClass("fullscreen");var t=j.toolbar(),v=function(){var b=a(window).height()-t.outerHeight();l.css("height",b)},w=q.hasClass("fullscreen");w?(l.data("orgHeight",l.css("height")),a(window).resize(v).trigger("resize")):(l.css("height",l.data("orgHeight")),a(window).off("resize")),d.updateFullscreen(t,w)}else if("codeview"===g){var q=j.editor(),t=j.toolbar();q.toggleClass("codeview");var x=q.hasClass("codeview");x?(m.val(l.html()),m.height(l.height()),d.disable(t),m.focus()):(l.html(m.val()),l.height(m.height()),d.enable(t),l.focus()),d.updateCodeview(j.toolbar(),x)}u(b)}},z=24,A=function(b){var c=a(document),d=p(b.target),e=d.editable(),f=(d.codable(),e.offset().top-c.scrollTop()),g=function(a){e.height(a.clientY-(f+z))},h=function(){c.unbind("mousemove",g).unbind("mouseup",h)};c.mousemove(g).mouseup(h),b.stopPropagation(),b.preventDefault()},B=18,C=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/B)||1,r:Math.ceil(c.y/B)||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",q),a.editable.on("mousedown",t),a.editable.on("keyup mouseup",u),a.editable.on("scroll",v),a.editable.on("dragenter dragover dragleave",!1),a.editable.on("drop",s),a.handle.on("mousedown",w),a.toolbar.on("click",y),a.popover.on("click",y),a.toolbar.on("mousedown",x),a.popover.on("mousedown",x),a.statusbar.on("mousedown",A);var d=a.toolbar,e=d.find(".note-dimension-picker-mousecatcher");e.on("mousemove",C),a.editable.on("blur",function(){c.saveRange(a.editable)}),b.onenter&&a.editable.keypress(function(a){a.keyCode===o.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),a.editable.data("callbacks",{onChange:b.onChange,onAutoSave:b.onAutoSave,onPasteBefore:b.onPasteBefore,onPasteAfter:b.onPasteAfter,onImageUpload:b.onImageUpload,onImageUploadError:b.onImageUpload,onFileUpload:b.onFileUpload,onFileUploadError:b.onFileUpload})},this.dettach=function(a){a.editable.off(),a.toolbar.off(),a.handle.off(),a.popover.off()}},p=function(){var c={picture:'<button type="button" class="btn btn-default btn-sm btn-small" title="Picture" data-event="showImageDialog" tabindex="-1"><i class="fa fa-picture-o 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="fa fa-link 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="fa fa-table 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="fa fa-magic 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="fa fa-check icon-ok"></i> 8</a></li><li><a data-event="fontSize" data-value="9"><i class="fa fa-check icon-ok"></i> 9</a></li><li><a data-event="fontSize" data-value="10"><i class="fa fa-check icon-ok"></i> 10</a></li><li><a data-event="fontSize" data-value="11"><i class="fa fa-check icon-ok"></i> 11</a></li><li><a data-event="fontSize" data-value="12"><i class="fa fa-check icon-ok"></i> 12</a></li><li><a data-event="fontSize" data-value="14"><i class="fa fa-check icon-ok"></i> 14</a></li><li><a data-event="fontSize" data-value="18"><i class="fa fa-check icon-ok"></i> 18</a></li><li><a data-event="fontSize" data-value="24"><i class="fa fa-check icon-ok"></i> 24</a></li><li><a data-event="fontSize" data-value="36"><i class="fa fa-check 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=\'{"backColor":"yellow"}\' tabindex="-1"><i class="fa fa-font 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-reset" data-event="backColor" data-value="inherit" title="Transparent">Set transparent</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-reset" data-event="foreColor" data-value="inherit" title="Reset">Reset to default</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="fa fa-bold 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="fa fa-italic 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="fa fa-underline 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="fa fa-eraser 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="fa fa-list-ul 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="fa fa-list-ol 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="fa fa-align-left 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="fa fa-align-left 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="fa fa-align-center 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="fa fa-align-right 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="fa fa-align-justify 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="fa fa-outdent 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="fa fa-indent 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="fa fa-text-height 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="fa fa-check icon-ok"></i> 1.0</a></li><li><a data-event="lineHeight" data-value="1.2"><i class="fa fa-check icon-ok"></i> 1.2</a></li><li><a data-event="lineHeight" data-value="1.4"><i class="fa fa-check icon-ok"></i> 1.4</a></li><li><a data-event="lineHeight" data-value="1.5"><i class="fa fa-check icon-ok"></i> 1.5</a></li><li><a data-event="lineHeight" data-value="1.6"><i class="fa fa-check icon-ok"></i> 1.6</a></li><li><a data-event="lineHeight" data-value="1.8"><i class="fa fa-check icon-ok"></i> 1.8</a></li><li><a data-event="lineHeight" data-value="2.0"><i class="fa fa-check icon-ok"></i> 2.0</a></li><li><a data-event="lineHeight" data-value="3.0"><i class="fa fa-check 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="fa fa-question icon-question"></i></button>',fullscreen:'<button type="button" class="btn btn-default btn-sm btn-small" title="Full Screen" data-event="fullscreen" tabindex="-1"><i class="fa fa-arrows-alt icon-fullscreen"></i></button>',codeview:'<button type="button" class="btn btn-default btn-sm btn-small" title="Code View" data-event="codeview" tabindex="-1"><i class="fa fa-code icon-code"></i></button>'},d='<div class="note-popover"><div class="note-link-popover popover 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="fa fa-edit icon-edit"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Unlink" data-event="unlink" tabindex="-1"><i class="fa fa-unlink icon-unlink"></i></button></div></div></div><div class="note-image-popover popover 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"><span class="note-fontsize-10">100%</span> </button><button type="button" class="btn btn-default btn-sm btn-small" title="Resize Half" data-event="resize" data-value="0.5" tabindex="-1"><span class="note-fontsize-10">50%</span> </button><button type="button" class="btn btn-default btn-sm btn-small" title="Resize Quarter" data-event="resize" data-value="0.25" tabindex="-1"><span class="note-fontsize-10">25%</span> </button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="Float Left" data-event="floatMe" data-value="left" tabindex="-1"><i class="fa fa-align-left icon-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Float Right" data-event="floatMe" data-value="right" tabindex="-1"><i class="fa fa-align-right icon-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="Float None" data-event="floatMe" data-value="none" tabindex="-1"><i class="fa fa-align-justify icon-align-justify"></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>',g='<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>',h='<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>',j='<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>',k='<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>',l='<table class="note-shortcut-layout"><tbody><tr><td>'+h+"</td><td>"+g+"</td></tr><tr><td>"+k+"</td><td>"+j+"</td></tr></tbody></table>";
2
- b.bMac||(l=l.replace(/⌘/g,"Ctrl").replace(/⇧/g,"Shift"));{var m='<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" 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><h5>Select from files</h5><input class="note-image-input" type="file" name="files" accept="image/*" capture="camera" /><h5>Image URL</h5><input class="note-image-url form-control span12" type="text" /></div></div><div class="modal-footer"><button href="#" class="btn btn-primary note-image-btn disabled" disabled="disabled">Insert</button></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" 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"><button href="#" class="btn btn-primary note-link-btn disabled" disabled="disabled">Link</button></div></div></div></div><div class="note-help-dialog modal" 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" aria-hidden="true" tabindex="-1">Close</a><div class="title">Keyboard shortcuts</div>'+l+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote v0.4</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>',n=function(c,d){c.find("button").each(function(c,d){var e=a(d),f=e.attr(b.bMac?"data-mac-shortcut":"data-shortcut");f&&e.attr("title",function(a,b){return b+" ("+f+")"})}).tooltip({container:"body",placement:d||"top"})},o=[["#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"]],p=function(b){b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),d="",e=0,f=o.length;f>e;e++){for(var g=o[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)})},q=(this.createLayout=function(b,g,h,j){if(!b.next().hasClass("note-editor")){var k=a('<div class="note-editor"></div>');if(g>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(k)}var l=a('<div class="note-editable" contentEditable="true"></div>').prependTo(k);g&&l.height(g),h&&l.data("tabsize",h),l.html(f.html(b)),l.data("NoteHistory",new i);{a('<textarea class="note-codable"></textarea>').prependTo(k)}setTimeout(function(){document.execCommand("styleWithCSS",0,!0)});for(var o="",q=0,r=j.length;r>q;q++){var s=j[q];o+='<div class="note-'+s[0]+' btn-group">';for(var t=0,u=s[1].length;u>t;t++)o+=c[s[1][t]];o+="</div>"}o='<div class="note-toolbar btn-toolbar">'+o+"</div>";var v=a(o).prependTo(k);p(v),n(v,"bottom");var w=a(d).prependTo(k);n(w),a(e).prependTo(k);var x=a(m).prependTo(k);x.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),k.insertAfter(b),b.hide()}},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"),codable:b.find(".note-codable"),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=q(a);b&&(a.html(b.editable.html()),b.editor.remove(),a.show())}}},q=new p,r=new o;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"]],["view",["fullscreen","codeview"]],["help",["help"]]]},b),this.each(function(c,d){var e=a(d);q.createLayout(e,b.height,b.tabsize,b.toolbar);var f=q.layoutInfoFromHolder(e);r.attach(f,b)}),this.first()&&b.focus){var c=q.layoutInfoFromHolder(this.first());c.editable.focus()}this.length>0&&b.oninit&&b.oninit()},code:function(b){if(void 0===b){var c=this.first();if(0===c.length)return;var d=q.layoutInfoFromHolder(c);if(d&&d.editable){var e=d.editor.hasClass("codeview");return e?d.codable.val():d.editable.html()}return c.html()}this.each(function(c,d){var e=q.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)})},destroy:function(){this.each(function(b,c){var d=a(c),e=q.layoutInfoFromHolder(d);e&&e.editable&&(r.dettach(e),q.removeLayout(d))})},summernoteInner:function(){return{dom:f,list:d,func:c,range:g}}})}(window.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});
1
+ !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};return{head:b,last:c,initial:d,tail:e,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={version:"0.5.10",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",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: 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 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"}},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.isBodyContainer(b)&&j.isEmpty(b))return b.innerHTML=j.emptyPara,new d(b.firstChild,0);if(!j.isInline(b)||j.isParaInline(b))return this;var a=j.listAncestor(b,f.not(j.isInline)),c=g.last(a);j.isInline(c)||(c=a[a.length-2]||b.childNodes[h]);var e=j.listPrev(c,j.isParaInline).reverse();if(e=e.concat(j.listNext(c.nextSibling,j.isParaInline)),e.length){var i=j.wrap(g.head(e),"p");j.appendChildNodes(i,g.tail(e))}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);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)}}}(),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,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)}o.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&&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.imageShape=function(a,b,c){c.removeClass("img-rounded img-circle img-thumbnail"),b&&c.addClass(b)},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=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(){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");
2
+ 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){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=c.editable(),e=g.head(b.items),f="file"===e.kind&&-1!==e.type.indexOf("image/");f&&q(d,[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(),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","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);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-square icon-unchecked",{title:a.image.shapeRounded,event:"imageShape",value:"img-rounded"}),l=c("fa fa-circle-o icon-circle-blank",{title:a.image.shapeCircle,event:"imageShape",value:"img-circle"}),m=c("fa fa-picture-o icon-picture",{title:a.image.shapeThumbnail,event:"imageShape",value:"img-thumbnail"}),n=c("fa fa-times icon-times",{title:a.image.shapeNone,event:"imageShape",value:""}),o=c("fa fa-trash-o icon-trash",{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){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.10</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.extend(a.summernote.lang["en-US"],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.extend(a.summernote.lang["en-US"],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}})});
@@ -4433,7 +4433,7 @@
4433
4433
  top: 10%;
4434
4434
  left: 50%;
4435
4435
  z-index: 1050;
4436
- width: 560px;
4436
+ width: 640px;
4437
4437
  margin-left: -280px;
4438
4438
  background-color: #ffffff;
4439
4439
  border: 1px solid #999;
@@ -4476,7 +4476,7 @@
4476
4476
  .note-editor .modal-body {
4477
4477
  position: relative;
4478
4478
  overflow-y: auto;
4479
- max-height: 400px;
4479
+ max-height: 600px;
4480
4480
  padding: 15px;
4481
4481
  }
4482
4482
  .note-editor .modal-form {
@@ -4517,7 +4517,7 @@
4517
4517
  }
4518
4518
  .tooltip {
4519
4519
  position: absolute;
4520
- z-index: 1030;
4520
+ z-index: 10000;
4521
4521
  display: block;
4522
4522
  visibility: visible;
4523
4523
  font-size: 11px;
@@ -5265,4 +5265,4 @@
5265
5265
  }
5266
5266
  .note-editor .affix {
5267
5267
  position: fixed;
5268
- }
5268
+ }
@@ -545,10 +545,10 @@
545
545
  .note-editor .dl-horizontal dd:after {
546
546
  content: " ";
547
547
  /* 1 */
548
-
548
+
549
549
  display: table;
550
550
  /* 2 */
551
-
551
+
552
552
  }
553
553
  .note-editor .dl-horizontal dd:after {
554
554
  clear: both;
@@ -557,10 +557,10 @@
557
557
  .note-editor .dl-horizontal dd:after {
558
558
  content: " ";
559
559
  /* 1 */
560
-
560
+
561
561
  display: table;
562
562
  /* 2 */
563
-
563
+
564
564
  }
565
565
  .note-editor .dl-horizontal dd:after {
566
566
  clear: both;
@@ -721,13 +721,70 @@
721
721
  .note-editor .row:after {
722
722
  clear: both;
723
723
  }
724
- .note-editor .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
724
+ .note-editor .col-xs-1,
725
+ .note-editor .col-sm-1,
726
+ .note-editor .col-md-1,
727
+ .note-editor .col-lg-1,
728
+ .note-editor .col-xs-2,
729
+ .note-editor .col-sm-2,
730
+ .note-editor .col-md-2,
731
+ .note-editor .col-lg-2,
732
+ .note-editor .col-xs-3,
733
+ .note-editor .col-sm-3,
734
+ .note-editor .col-md-3,
735
+ .note-editor .col-lg-3,
736
+ .note-editor .col-xs-4,
737
+ .note-editor .col-sm-4,
738
+ .note-editor .col-md-4,
739
+ .note-editor .col-lg-4,
740
+ .note-editor .col-xs-5,
741
+ .note-editor .col-sm-5,
742
+ .note-editor .col-md-5,
743
+ .note-editor .col-lg-5,
744
+ .note-editor .col-xs-6,
745
+ .note-editor .col-sm-6,
746
+ .note-editor .col-md-6,
747
+ .note-editor .col-lg-6,
748
+ .note-editor .col-xs-7,
749
+ .note-editor .col-sm-7,
750
+ .note-editor .col-md-7,
751
+ .note-editor .col-lg-7,
752
+ .note-editor .col-xs-8,
753
+ .note-editor .col-sm-8,
754
+ .note-editor .col-md-8,
755
+ .note-editor .col-lg-8,
756
+ .note-editor .col-xs-9,
757
+ .note-editor .col-sm-9,
758
+ .note-editor .col-md-9,
759
+ .note-editor .col-lg-9,
760
+ .note-editor .col-xs-10,
761
+ .note-editor .col-sm-10,
762
+ .note-editor .col-md-10,
763
+ .note-editor .col-lg-10,
764
+ .note-editor .col-xs-11,
765
+ .note-editor .col-sm-11,
766
+ .note-editor .col-md-11,
767
+ .note-editor .col-lg-11,
768
+ .note-editor .col-xs-12,
769
+ .note-editor .col-sm-12,
770
+ .note-editor .col-md-12,
771
+ .note-editor .col-lg-12 {
725
772
  position: relative;
726
773
  min-height: 1px;
727
774
  padding-left: 15px;
728
775
  padding-right: 15px;
729
776
  }
730
- .note-editor .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11 {
777
+ .note-editor .col-xs-1,
778
+ .note-editor .col-xs-2,
779
+ .note-editor .col-xs-3,
780
+ .note-editor .col-xs-4,
781
+ .note-editor .col-xs-5,
782
+ .note-editor .col-xs-6,
783
+ .note-editor .col-xs-7,
784
+ .note-editor .col-xs-8,
785
+ .note-editor .col-xs-9,
786
+ .note-editor .col-xs-10,
787
+ .note-editor .col-xs-11 {
731
788
  float: left;
732
789
  }
733
790
  .note-editor .col-xs-12 {
@@ -878,7 +935,17 @@
878
935
  .note-editor .container {
879
936
  width: 750px;
880
937
  }
881
- .note-editor .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11 {
938
+ .note-editor .col-sm-1,
939
+ .note-editor .col-sm-2,
940
+ .note-editor .col-sm-3,
941
+ .note-editor .col-sm-4,
942
+ .note-editor .col-sm-5,
943
+ .note-editor .col-sm-6,
944
+ .note-editor .col-sm-7,
945
+ .note-editor .col-sm-8,
946
+ .note-editor .col-sm-9,
947
+ .note-editor .col-sm-10,
948
+ .note-editor .col-sm-11 {
882
949
  float: left;
883
950
  }
884
951
  .note-editor .col-sm-12 {
@@ -1030,7 +1097,17 @@
1030
1097
  .note-editor .container {
1031
1098
  width: 970px;
1032
1099
  }
1033
- .note-editor .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11 {
1100
+ .note-editor .col-md-1,
1101
+ .note-editor .col-md-2,
1102
+ .note-editor .col-md-3,
1103
+ .note-editor .col-md-4,
1104
+ .note-editor .col-md-5,
1105
+ .note-editor .col-md-6,
1106
+ .note-editor .col-md-7,
1107
+ .note-editor .col-md-8,
1108
+ .note-editor .col-md-9,
1109
+ .note-editor .col-md-10,
1110
+ .note-editor .col-md-11 {
1034
1111
  float: left;
1035
1112
  }
1036
1113
  .note-editor .col-md-12 {
@@ -1182,7 +1259,17 @@
1182
1259
  .note-editor .container {
1183
1260
  width: 1170px;
1184
1261
  }
1185
- .note-editor .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11 {
1262
+ .note-editor .col-lg-1,
1263
+ .note-editor .col-lg-2,
1264
+ .note-editor .col-lg-3,
1265
+ .note-editor .col-lg-4,
1266
+ .note-editor .col-lg-5,
1267
+ .note-editor .col-lg-6,
1268
+ .note-editor .col-lg-7,
1269
+ .note-editor .col-lg-8,
1270
+ .note-editor .col-lg-9,
1271
+ .note-editor .col-lg-10,
1272
+ .note-editor .col-lg-11 {
1186
1273
  float: left;
1187
1274
  }
1188
1275
  .note-editor .col-lg-12 {
@@ -5967,4 +6054,4 @@ td.visible-print {
5967
6054
  td.hidden-print {
5968
6055
  display: none !important;
5969
6056
  }
5970
- }
6057
+ }
@@ -1 +1 @@
1
- .note-editor{border:1px solid #a9a9a9}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen .note-editable{background-color:white}.note-editor.fullscreen .note-resizebar{display:none}.note-editor.codeview .note-editable{display:none}.note-editor.codeview .note-codable{display:block}.note-editor .note-toolbar{padding-bottom:5px;padding-left:5px;margin:0;background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor .note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.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-color .dropdown-toggle{width:20px;padding-left: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{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:5px;font-size:12px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.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:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}.note-editor .note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:transparent;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.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 .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.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 .note-fontsize-10{font-size:10px}.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{position:relative;border:1px solid #a9a9a9}.note-editor .note-dropzone{position:absolute;z-index:1;display:none;color:#87cefa;background-color:white;border:2px dashed #87cefa;opacity:.95;pointer-event:none}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:bold;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf;border:2px dashed #098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-toolbar{background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen .note-editable{background-color:white}.note-editor.fullscreen .note-resizebar{display:none}.note-editor.codeview .note-editable{display:none}.note-editor.codeview .note-codable{display:block}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;cursor:ns-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-editable{padding:10px;overflow:auto;outline:0}.note-editor .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-air-editor{outline:0}.note-popover .popover{max-width:none}.note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover .popover .arrow{left:20px}.note-popover .popover .popover-content,.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover .popover-content>.btn-group,.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover .popover-content .btn-group .note-table,.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker,.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.note-toolbar .btn-group .note-table .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-popover .popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.note-toolbar .btn-group .note-table .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-popover .popover .popover-content .note-style h1,.note-toolbar .note-style h1,.note-popover .popover .popover-content .note-style h2,.note-toolbar .note-style h2,.note-popover .popover .popover-content .note-style h3,.note-toolbar .note-style h3,.note-popover .popover .popover-content .note-style h4,.note-toolbar .note-style h4,.note-popover .popover .popover-content .note-style h5,.note-toolbar .note-style h5,.note-popover .popover .popover-content .note-style h6,.note-toolbar .note-style h6,.note-popover .popover .popover-content .note-style blockquote,.note-toolbar .note-style blockquote{margin:0}.note-popover .popover .popover-content .note-color .dropdown-toggle,.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover .popover-content .note-color .dropdown-menu,.note-toolbar .note-color .dropdown-menu{min-width:340px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group,.note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group:first-child,.note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-palette-title,.note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset,.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-row,.note-toolbar .note-color .dropdown-menu .btn-group .note-color-row{height:20px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset:hover,.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-popover .popover .popover-content .note-para .dropdown-menu,.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover .popover-content .note-para .dropdown-menu>div:first-child,.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover .popover-content .dropdown-menu,.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover .popover-content .dropdown-menu.right,.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover .popover-content .dropdown-menu.right::before,.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover .popover-content .dropdown-menu.right::after,.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover .popover-content .dropdown-menu li a i,.note-toolbar .dropdown-menu li a i{color:deepskyblue;visibility:hidden}.note-popover .popover .popover-content .dropdown-menu li a.checked i,.note-toolbar .dropdown-menu li a.checked i{visibility:visible}.note-popover .popover .popover-content .note-fontsize-10,.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover .popover-content .note-color-palette,.note-toolbar .note-color-palette{line-height:1}.note-popover .popover .popover-content .note-color-palette div .note-color-btn,.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover .popover-content .note-color-palette div .note-color-btn:hover,.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}.note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:transparent;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.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-dialog .note-help-dialog a{font-size:12px;color:white}.note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:bold;color:white;border-bottom:white 1px solid}.note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.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-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-handle .note-control-selection>div{position:absolute}.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-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.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)}
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: summernote-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.10.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-11-30 00:00:00.000000000 Z
11
+ date: 2014-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Super Simple WYSIWYG Editor on Bootstrap
@@ -59,15 +59,47 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - lib/summernote/rails/version.rb
62
+ - LICENSE.txt
63
+ - README.md
63
64
  - lib/summernote/rails.rb
65
+ - lib/summernote/rails/version.rb
66
+ - vendor/assets/javascripts/lang/summernote-ar-AR.js
67
+ - vendor/assets/javascripts/lang/summernote-ca-ES.js
68
+ - vendor/assets/javascripts/lang/summernote-cs-CZ.js
69
+ - vendor/assets/javascripts/lang/summernote-da-DK.js
70
+ - vendor/assets/javascripts/lang/summernote-de-DE.js
71
+ - vendor/assets/javascripts/lang/summernote-es-ES.js
72
+ - vendor/assets/javascripts/lang/summernote-es-EU.js
73
+ - vendor/assets/javascripts/lang/summernote-fa-IR.js
74
+ - vendor/assets/javascripts/lang/summernote-fi-FI.js
75
+ - vendor/assets/javascripts/lang/summernote-fr-FR.js
76
+ - vendor/assets/javascripts/lang/summernote-hu-HU.js
77
+ - vendor/assets/javascripts/lang/summernote-id-ID.js
78
+ - vendor/assets/javascripts/lang/summernote-it-IT.js
79
+ - vendor/assets/javascripts/lang/summernote-ja-JP.js
80
+ - vendor/assets/javascripts/lang/summernote-ko-KR.js
81
+ - vendor/assets/javascripts/lang/summernote-nb-NO.js
82
+ - vendor/assets/javascripts/lang/summernote-nl-NL.js
83
+ - vendor/assets/javascripts/lang/summernote-pl-PL.js
84
+ - vendor/assets/javascripts/lang/summernote-pt-BR.js
85
+ - vendor/assets/javascripts/lang/summernote-ro-RO.js
86
+ - vendor/assets/javascripts/lang/summernote-ru-RU.js
87
+ - vendor/assets/javascripts/lang/summernote-sk-SK.js
88
+ - vendor/assets/javascripts/lang/summernote-sl-SI.js
89
+ - vendor/assets/javascripts/lang/summernote-sr-RS-Latin.js
90
+ - vendor/assets/javascripts/lang/summernote-sr-RS.js
91
+ - vendor/assets/javascripts/lang/summernote-sv-SE.js
92
+ - vendor/assets/javascripts/lang/summernote-th-TH.js
93
+ - vendor/assets/javascripts/lang/summernote-tr-TR.js
94
+ - vendor/assets/javascripts/lang/summernote-uk-UA.js
95
+ - vendor/assets/javascripts/lang/summernote-vi-VN.js
96
+ - vendor/assets/javascripts/lang/summernote-zh-CN.js
97
+ - vendor/assets/javascripts/lang/summernote-zh-TW.js
64
98
  - vendor/assets/javascripts/summernote.js
65
99
  - vendor/assets/javascripts/summernote.min.js
66
100
  - vendor/assets/stylesheets/summernote-bs2.css
67
101
  - vendor/assets/stylesheets/summernote-bs3.css
68
102
  - vendor/assets/stylesheets/summernote.css
69
- - LICENSE.txt
70
- - README.md
71
103
  homepage: http://rorlab.github.io/summernote-rails/
72
104
  licenses:
73
105
  - MIT
@@ -78,19 +110,18 @@ require_paths:
78
110
  - lib
79
111
  required_ruby_version: !ruby/object:Gem::Requirement
80
112
  requirements:
81
- - - '>='
113
+ - - ">="
82
114
  - !ruby/object:Gem::Version
83
115
  version: '0'
84
116
  required_rubygems_version: !ruby/object:Gem::Requirement
85
117
  requirements:
86
- - - '>='
118
+ - - ">="
87
119
  - !ruby/object:Gem::Version
88
120
  version: '0'
89
121
  requirements: []
90
122
  rubyforge_project:
91
- rubygems_version: 2.0.0
123
+ rubygems_version: 2.2.2
92
124
  signing_key:
93
125
  specification_version: 4
94
126
  summary: Gemify Summernote for Ruby on Rails
95
127
  test_files: []
96
- has_rdoc: