react-froala-wysiwyg
Advanced tools
Comparing version 3.1.1 to 3.2.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorA=t(require("react"),require("froala-editor")):e.FroalaEditorA=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()}))}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("a",{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorA=t(require("react"),require("froala-editor")):e.FroalaEditorA=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("a",{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorA=t(require("react"),require("froala-editor")):e.FroalaEditorA=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()}))}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("a",{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorA=t(require("react"),require("froala-editor")):e.FroalaEditorA=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("a",{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],e):"object"==typeof exports?exports.FroalaEditorButton=e(require("react"),require("froala-editor")):t.FroalaEditorButton=e(t.React,t["froala-editor"])}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=r(n(2));function r(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var t=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(t)&&(this.tag=t,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var t=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return t.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var e=0;e<this._initEvents.length;e++)this._initEvents[e].call(this.editor)}},{key:"setContent",value:function(t){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(t))}},{key:"setNormalTagContent",value:function(t){var e=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}t?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){e.editorInitialized=!0}))):this.registerEvent("initialized",(function(){e.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var t=this.props.model;if(t){for(var e in t)t.hasOwnProperty(e)&&e!=this.INNER_HTML_ATTR&&this.element.setAttribute(e,t[e]);t.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=t[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var t=this,e={initialize:function(){return t.createEditor.call(t)},destroy:function(){return t.destroyEditor.call(t)},getEditor:function(){return t.getEditor.call(t)}};this.props.onManualControllerReady(e)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var t="";if(this.hasSpecialTag){for(var e=this.element.attributes,n={},i=0;i<e.length;i++){var o=e[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=e[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),t=n}else{var r=this.editor.html.get();"string"==typeof r&&(t=r)}this.oldModel=t,this.props.onModelChange(t)}}},{key:"initListeners",value:function(){var t=this;this.editor.events.on("contentChanged",(function(){t.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){t.updateModel()}))}},{key:"registerEvent",value:function(t,e){t&&e&&("initialized"==t?(this._initEvents||(this._initEvents=[]),this._initEvents.push(e)):(this.config.events||(this.config.events={}),this.config.events[t]=e))}}]),e}(r(n(0)).default.Component);e.default=s},function(t,n){t.exports=e},,,,,function(t,e,n){t.exports=n(8)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=s(n(1)),r=s(n(0));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(){return a(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"render",value:function(){var t=this;return r.default.createElement("button",{ref:function(e){return t.el=e}},this.props.children)}}]),e}(o.default);e.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorButton=t(require("react"),require("froala-editor")):e.FroalaEditorButton=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("button",{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],e):"object"==typeof exports?exports.FroalaEditorButton=e(require("react"),require("froala-editor")):t.FroalaEditorButton=e(t.React,t["froala-editor"])}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=r(n(2));function r(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var t=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(t)&&(this.tag=t,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var t=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return t.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var e=0;e<this._initEvents.length;e++)this._initEvents[e].call(this.editor)}},{key:"setContent",value:function(t){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(t))}},{key:"setNormalTagContent",value:function(t){var e=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}t?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){e.editorInitialized=!0}))):this.registerEvent("initialized",(function(){e.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var t=this.props.model;if(t){for(var e in t)t.hasOwnProperty(e)&&e!=this.INNER_HTML_ATTR&&this.element.setAttribute(e,t[e]);t.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=t[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var t=this,e={initialize:function(){return t.createEditor.call(t)},destroy:function(){return t.destroyEditor.call(t)},getEditor:function(){return t.getEditor.call(t)}};this.props.onManualControllerReady(e)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var t="";if(this.hasSpecialTag){for(var e=this.element.attributes,n={},i=0;i<e.length;i++){var o=e[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=e[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),t=n}else{var r=this.editor.html.get();"string"==typeof r&&(t=r)}this.oldModel=t,this.props.onModelChange(t)}}},{key:"initListeners",value:function(){var t=this;this.editor.events.on("contentChanged",(function(){t.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){t.updateModel()}))}},{key:"registerEvent",value:function(t,e){t&&e&&("initialized"==t?(this._initEvents||(this._initEvents=[]),this._initEvents.push(e)):(this.config.events||(this.config.events={}),this.config.events[t]=e))}}]),e}(r(n(0)).default.Component);e.default=s},function(t,n){t.exports=e},,,,,function(t,e,n){t.exports=n(8)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=s(n(1)),r=s(n(0));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(){return a(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"render",value:function(){var t=this;return r.default.createElement("button",{ref:function(e){return t.el=e}},this.props.children)}}]),e}(o.default);e.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorButton=t(require("react"),require("froala-editor")):e.FroalaEditorButton=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("button",{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorImg=t(require("react"),require("froala-editor")):e.FroalaEditorImg=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()}))}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,,,function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("img",{ref:function(t){return e.el=t}})}}]),t}(o.default);t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorImg=t(require("react"),require("froala-editor")):e.FroalaEditorImg=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,,,function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("img",{ref:function(t){return e.el=t}})}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorImg=t(require("react"),require("froala-editor")):e.FroalaEditorImg=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()}))}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,,,function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("img",{ref:function(t){return e.el=t}})}}]),t}(o.default);t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorImg=t(require("react"),require("froala-editor")):e.FroalaEditorImg=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,,,function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("img",{ref:function(t){return e.el=t}})}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],e):"object"==typeof exports?exports.FroalaEditorInput=e(require("react"),require("froala-editor")):t.FroalaEditorInput=e(t.React,t["froala-editor"])}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=r(n(2));function r(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var t=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(t)&&(this.tag=t,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var t=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return t.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var e=0;e<this._initEvents.length;e++)this._initEvents[e].call(this.editor)}},{key:"setContent",value:function(t){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(t))}},{key:"setNormalTagContent",value:function(t){var e=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}t?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){e.editorInitialized=!0}))):this.registerEvent("initialized",(function(){e.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var t=this.props.model;if(t){for(var e in t)t.hasOwnProperty(e)&&e!=this.INNER_HTML_ATTR&&this.element.setAttribute(e,t[e]);t.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=t[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var t=this,e={initialize:function(){return t.createEditor.call(t)},destroy:function(){return t.destroyEditor.call(t)},getEditor:function(){return t.getEditor.call(t)}};this.props.onManualControllerReady(e)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var t="";if(this.hasSpecialTag){for(var e=this.element.attributes,n={},i=0;i<e.length;i++){var o=e[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=e[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),t=n}else{var r=this.editor.html.get();"string"==typeof r&&(t=r)}this.oldModel=t,this.props.onModelChange(t)}}},{key:"initListeners",value:function(){var t=this;this.editor.events.on("contentChanged",(function(){t.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){t.updateModel()}))}},{key:"registerEvent",value:function(t,e){t&&e&&("initialized"==t?(this._initEvents||(this._initEvents=[]),this._initEvents.push(e)):(this.config.events||(this.config.events={}),this.config.events[t]=e))}}]),e}(r(n(0)).default.Component);e.default=s},function(t,n){t.exports=e},,,,,,,,,function(t,e,n){t.exports=n(12)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=s(n(1)),r=s(n(0));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(){return a(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"render",value:function(){var t=this;return r.default.createElement("input",{ref:function(e){return t.el=e}})}}]),e}(o.default);e.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorInput=t(require("react"),require("froala-editor")):e.FroalaEditorInput=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,,,,,function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("input",{ref:function(t){return e.el=t}})}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],e):"object"==typeof exports?exports.FroalaEditorInput=e(require("react"),require("froala-editor")):t.FroalaEditorInput=e(t.React,t["froala-editor"])}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=r(n(2));function r(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var t=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(t)&&(this.tag=t,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var t=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return t.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var e=0;e<this._initEvents.length;e++)this._initEvents[e].call(this.editor)}},{key:"setContent",value:function(t){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(t))}},{key:"setNormalTagContent",value:function(t){var e=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}t?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){e.editorInitialized=!0}))):this.registerEvent("initialized",(function(){e.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var t=this.props.model;if(t){for(var e in t)t.hasOwnProperty(e)&&e!=this.INNER_HTML_ATTR&&this.element.setAttribute(e,t[e]);t.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=t[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var t=this,e={initialize:function(){return t.createEditor.call(t)},destroy:function(){return t.destroyEditor.call(t)},getEditor:function(){return t.getEditor.call(t)}};this.props.onManualControllerReady(e)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var t="";if(this.hasSpecialTag){for(var e=this.element.attributes,n={},i=0;i<e.length;i++){var o=e[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=e[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),t=n}else{var r=this.editor.html.get();"string"==typeof r&&(t=r)}this.oldModel=t,this.props.onModelChange(t)}}},{key:"initListeners",value:function(){var t=this;this.editor.events.on("contentChanged",(function(){t.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){t.updateModel()}))}},{key:"registerEvent",value:function(t,e){t&&e&&("initialized"==t?(this._initEvents||(this._initEvents=[]),this._initEvents.push(e)):(this.config.events||(this.config.events={}),this.config.events[t]=e))}}]),e}(r(n(0)).default.Component);e.default=s},function(t,n){t.exports=e},,,,,,,,,function(t,e,n){t.exports=n(12)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=s(n(1)),r=s(n(0));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(){return a(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"render",value:function(){var t=this;return r.default.createElement("input",{ref:function(e){return t.el=e}})}}]),e}(o.default);e.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.FroalaEditorInput=t(require("react"),require("froala-editor")):e.FroalaEditorInput=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},,,,,,,,,function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement("input",{ref:function(t){return e.el=t}})}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.index=t(require("react"),require("froala-editor")):e.index=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()}))}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement(this.tag,{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.index=t(require("react"),require("froala-editor")):e.index=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement(this.tag,{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.index=t(require("react"),require("froala-editor")):e.index=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag=null,n.defaultTag="div",n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.tag=this.props.tag||this.defaultTag}},{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;if(!this.editorInitialized&&(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config),this._initEvents))for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()}))}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement(this.tag,{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("froala-editor")):"function"==typeof define&&define.amd?define(["react","froala-editor"],t):"object"==typeof exports?exports.index=t(require("react"),require("froala-editor")):e.index=t(e.React,e["froala-editor"])}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultTag="div",n.tag=e.tag||n.defaultTag,n.listeningEvents=[],n.element=null,n.editor=null,n.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},n.editorInitialized=!1,n.SPECIAL_TAGS=["img","button","input","a"],n.INNER_HTML_ATTR="innerHTML",n.hasSpecialTag=!1,n.oldModel=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.el.tagName.toLowerCase();-1!=this.SPECIAL_TAGS.indexOf(e)&&(this.tag=e,this.hasSpecialTag=!0),this.props.onManualControllerReady?this.generateManualController():this.createEditor()}},{key:"componentWillUnmount",value:function(){this.destroyEditor()}},{key:"componentDidUpdate",value:function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()}},{key:"createEditor",value:function(){var e=this;this.editorInitialized||(this.config=this.props.config||this.config,this.element=this.el,this.props.model&&(this.element.innerHTML=this.props.model),this.setContent(!0),this.registerEvent("initialized",this.config.events&&this.config.events.initialized),this.config.events||(this.config.events={}),this.config.events.initialized=function(){return e.initListeners()},this.editor=new o.default(this.element,this.config))}},{key:"setContent",value:function(e){(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.hasSpecialTag?this.setSpecialTagContent():this.setNormalTagContent(e))}},{key:"setNormalTagContent",value:function(e){var t=this,n=this;function i(){n.editor.html&&n.editor.html.set(n.props.model||""),n.editorInitialized&&n.editor.undo&&(n.editor.undo.reset(),n.editor.undo.saveStep())}e?this.config.initOnClick?(this.registerEvent("initializationDelayed",(function(){i()})),this.registerEvent("initialized",(function(){t.editorInitialized=!0}))):this.registerEvent("initialized",(function(){t.editorInitialized=!0,i()})):i()}},{key:"setSpecialTagContent",value:function(){var e=this.props.model;if(e){for(var t in e)e.hasOwnProperty(t)&&t!=this.INNER_HTML_ATTR&&this.element.setAttribute(t,e[t]);e.hasOwnProperty(this.INNER_HTML_ATTR)&&(this.element.innerHTML=e[this.INNER_HTML_ATTR])}}},{key:"destroyEditor",value:function(){this.element&&(this.editor.destroy&&this.editor.destroy(),this.listeningEvents.length=0,this.element=null,this.editorInitialized=!1)}},{key:"getEditor",value:function(){return this.element?this.editor:null}},{key:"generateManualController",value:function(){var e=this,t={initialize:function(){return e.createEditor.call(e)},destroy:function(){return e.destroyEditor.call(e)},getEditor:function(){return e.getEditor.call(e)}};this.props.onManualControllerReady(t)}},{key:"updateModel",value:function(){if(this.props.onModelChange){var e="";if(this.hasSpecialTag){for(var t=this.element.attributes,n={},i=0;i<t.length;i++){var o=t[i].name;this.config.reactIgnoreAttrs&&-1!=this.config.reactIgnoreAttrs.indexOf(o)||(n[o]=t[i].value)}this.element.innerHTML&&(n[this.INNER_HTML_ATTR]=this.element.innerHTML),e=n}else{var r=this.editor.html.get();"string"==typeof r&&(e=r)}this.oldModel=e,this.props.onModelChange(e)}}},{key:"initListeners",value:function(){var e=this;if(this.editor.events.on("contentChanged",(function(){e.updateModel()})),this.config.immediateReactModelUpdate&&this.editor.events.on("keyup",(function(){e.updateModel()})),this._initEvents)for(var t=0;t<this._initEvents.length;t++)this._initEvents[t].call(this.editor)}},{key:"registerEvent",value:function(e,t){e&&t&&("initialized"==e?(this._initEvents||(this._initEvents=[]),this._initEvents.push(t)):(this.config.events||(this.config.events={}),this.config.events[e]=t))}}]),t}(r(n(0)).default.Component);t.default=s},function(e,n){e.exports=t},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this;return r.default.createElement(this.tag,{ref:function(t){return e.el=t}},this.props.children)}}]),t}(o.default);t.default=u}])})); |
@@ -10,4 +10,4 @@ import FroalaEditor from 'froala-editor'; | ||
// Tag on which the editor is initialized. | ||
this.tag = null; | ||
this.defaultTag = 'div'; | ||
this.tag = props.tag || this.defaultTag; | ||
this.listeningEvents = []; | ||
@@ -36,7 +36,2 @@ | ||
// Before first time render. | ||
componentWillMount() { | ||
this.tag = this.props.tag || this.defaultTag; | ||
} | ||
// After first time render. | ||
@@ -92,8 +87,2 @@ componentDidMount() { | ||
this.editor = new FroalaEditor(this.element, this.config); | ||
// Call init events. | ||
if (this._initEvents) { | ||
for (let i = 0; i < this._initEvents.length; i++) { | ||
this._initEvents[i].call(this.editor); | ||
} | ||
} | ||
} | ||
@@ -238,2 +227,9 @@ | ||
} | ||
// Call init events. | ||
if (this._initEvents) { | ||
for (let i = 0; i < this._initEvents.length; i++) { | ||
this._initEvents[i].call(this.editor); | ||
} | ||
} | ||
} | ||
@@ -240,0 +236,0 @@ |
{ | ||
"name": "react-froala-wysiwyg", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "React component for Froala WYSIWYG HTML rich text editor.", | ||
"main": "index.js", | ||
"types": "./lib/index.d.ts", | ||
"author": "Froala Labs", | ||
@@ -25,3 +26,3 @@ "keywords": [ | ||
"create-react-class": "^15.5.2", | ||
"froala-editor": "3.1.1" | ||
"froala-editor": "3.2.0" | ||
}, | ||
@@ -28,0 +29,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138500
898
+ Addedfroala-editor@3.2.0(transitive)
- Removedfroala-editor@3.1.1(transitive)
Updatedfroala-editor@3.2.0