3 lines
135 KiB
JavaScript
3 lines
135 KiB
JavaScript
|
/*! Summernote v0.8.11 | (c) 2013- Alan Hong and other contributors | MIT license */
|
||
|
|
||
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e(t.jQuery)}(this,function(C){"use strict";C=C&&C.hasOwnProperty("default")?C.default:C;var i=function(){function t(t,e,o,n){this.markup=t,this.children=e,this.options=o,this.callback=n}return t.prototype.render=function(t){var o=C(this.markup);if(this.options&&this.options.contents&&o.html(this.options.contents),this.options&&this.options.className&&o.addClass(this.options.className),this.options&&this.options.data&&C.each(this.options.data,function(t,e){o.attr("data-"+t,e)}),this.options&&this.options.click&&o.on("click",this.options.click),this.children){var e=o.find(".note-children-container");this.children.forEach(function(t){t.render(e.length?e:o)})}return this.callback&&this.callback(o,this.options),this.options&&this.options.callback&&this.options.callback(o),t&&t.append(o),o},t}(),t=function(o,n){return function(){var t="object"==typeof arguments[1]?arguments[1]:arguments[0],e=C.isArray(arguments[0])?arguments[0]:[];return t&&t.children&&(e=t.children),new i(o,e,t,n)}},p=function(){function t(e,t){if(this.$node=e,this.options=$.extend({},{title:"",target:t.container,trigger:"hover focus",placement:"bottom"},t),this.$tooltip=$(['<div class="note-tooltip in">',' <div class="note-tooltip-arrow"/>',' <div class="note-tooltip-content"/>',"</div>"].join("")),"manual"!==this.options.trigger){var o=this.show.bind(this),n=this.hide.bind(this),i=this.toggle.bind(this);this.options.trigger.split(" ").forEach(function(t){"hover"===t?(e.off("mouseenter mouseleave"),e.on("mouseenter",o).on("mouseleave",n)):"click"===t?e.on("click",i):"focus"===t&&e.on("focus",o).on("blur",n)})}}return t.prototype.show=function(){var t=this.$node,e=t.offset(),o=this.$tooltip,n=this.options.title||t.attr("title")||t.data("title"),i=this.options.placement||t.data("placement");o.addClass(i),o.addClass("in"),o.find(".note-tooltip-content").text(n),o.appendTo(this.options.target);var r=t.outerWidth(),s=t.outerHeight(),a=o.outerWidth(),l=o.outerHeight();"bottom"===i?o.css({top:e.top+s,left:e.left+(r/2-a/2)}):"top"===i?o.css({top:e.top-l,left:e.left+(r/2-a/2)}):"left"===i?o.css({top:e.top+(s/2-l/2),left:e.left-a}):"right"===i&&o.css({top:e.top+(s/2-l/2),left:e.left+r})},t.prototype.hide=function(){this.$tooltip.removeClass("in"),this.$tooltip.remove()},t.prototype.toggle=function(){this.$tooltip.hasClass("in")?this.hide():this.show()},t}(),o=function(){function t(t,e){this.$button=t,this.options=$.extend({},{target:e.container},e),this.setEvent()}return t.prototype.setEvent=function(){var e=this;this.$button.on("click",function(t){e.toggle(),t.stopImmediatePropagation()})},t.prototype.clear=function(){var t=$(".note-btn-group.open");t.find(".note-btn.active").removeClass("active"),t.removeClass("open")},t.prototype.show=function(){this.$button.addClass("active"),this.$button.parent().addClass("open");var t=this.$button.next(),e=t.offset(),o=t.outerWidth(),n=$(window).width(),i=parseFloat($(this.options.target).css("margin-right"));e.left+o>n-i?t.css("margin-left",n-i-(e.left+o)):t.css("margin-left","")},t.prototype.hide=function(){this.$button.removeClass("active"),this.$button.parent().removeClass("open")},t.prototype.toggle=function(){var t=this.$button.parent().hasClass("open");this.clear(),t?this.hide():this.show()},t}();$(document).on("click",function(t){$(t.target).closest(".note-btn-group").length||$(".note-btn-group.open").removeClass("open")}),$(document).on("click.note-dropdown-menu",function(t){$(t.target).closest(".note-dropdown-menu").parent().removeClass("open")});var n=function(){function t(t,e){this.options=$.extend({},{target:e.container||"body"},e),this.$modal=t,this.$backdrop=$('<div class="note-modal-backdrop" />')}return t.prototype.show=function(){"body"===this.options.target?(this.$backdrop.css("position","fixed"),this.$modal.css("position","fixed")):(this.$backdrop.css("position","absolute"),this.$modal.css("position","absolute")),this.$backdrop.appendTo(this.options.target).sho
|