/*! * froala_editor v2.4.1 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2017 Froala Labs */ ! function(a) { "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof module && module.exports ? module.exports = function(b, c) { return void 0 === c && (c = "undefined" != typeof window ? require("jquery") : require("jquery")(b)), a(c), c } : a(jQuery) }(function(a) { var b = function(c, d) { this.id = ++a.FE.ID, this.opts = a.extend(!0, {}, a.extend({}, b.DEFAULTS, "object" == typeof d && d)); var e = JSON.stringify(this.opts); a.FE.OPTS_MAPPING[e] = a.FE.OPTS_MAPPING[e] || this.id, this.sid = a.FE.OPTS_MAPPING[e], a.FE.SHARED[this.sid] = a.FE.SHARED[this.sid] || {}, this.shared = a.FE.SHARED[this.sid], this.shared.count = (this.shared.count || 0) + 1, this.$oel = a(c), this.$oel.data("froala.editor", this), this.o_doc = c.ownerDocument, this.o_win = "defaultView" in this.o_doc ? this.o_doc.defaultView : this.o_doc.parentWindow; var f = a(this.o_win).scrollTop(); this.$oel.on("froala.doInit", a.proxy(function() { this.$oel.off("froala.doInit"), this.doc = this.$el.get(0).ownerDocument, this.win = "defaultView" in this.doc ? this.doc.defaultView : this.doc.parentWindow, this.$doc = a(this.doc), this.$win = a(this.win), this.opts.pluginsEnabled || (this.opts.pluginsEnabled = Object.keys(a.FE.PLUGINS)), this.opts.initOnClick ? (this.load(a.FE.MODULES), this.$el.on("touchstart.init", function() { a(this).data("touched", !0) }), this.$el.on("touchmove.init", function() { a(this).removeData("touched") }), this.$el.on("mousedown.init touchend.init dragenter.init focus.init", a.proxy(function(b) { if ("touchend" == b.type && !this.$el.data("touched")) return !0; if (1 === b.which || !b.which) { this.$el.off("mousedown.init touchstart.init touchmove.init touchend.init dragenter.init focus.init"), this.load(a.FE.MODULES), this.load(a.FE.PLUGINS); var c = b.originalEvent && b.originalEvent.originalTarget; c && "IMG" == c.tagName && a(c).trigger("mousedown"), "undefined" == typeof this.ul && this.destroy(), "touchend" == b.type && this.image && b.originalEvent && b.originalEvent.target && a(b.originalEvent.target).is("img") && setTimeout(a.proxy(function() { this.image.edit(a(b.originalEvent.target)) }, this), 100), this.ready = !0, this.events.trigger("initialized") } }, this))) : (this.load(a.FE.MODULES), this.load(a.FE.PLUGINS), a(this.o_win).scrollTop(f), "undefined" == typeof this.ul && this.destroy(), this.ready = !0, this.events.trigger("initialized")) }, this)), this._init() }; b.DEFAULTS = { initOnClick: !1, pluginsEnabled: null }, b.MODULES = {}, b.PLUGINS = {}, b.VERSION = "2.4.1", b.INSTANCES = [], b.OPTS_MAPPING = {}, b.SHARED = {}, b.ID = 0, b.prototype._init = function() { var b = this.$oel.prop("tagName"), c = a.proxy(function() { "TEXTAREA" != b && (this._original_html = this._original_html || this.$oel.html()), this.$box = this.$box || this.$oel, this.opts.fullPage && (this.opts.iframe = !0), this.opts.iframe ? (this.$iframe = a('