EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 2.3.2

Version Description

Download this release

Release Info

Developer embedpress
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 2.3.2
Comparing to
See all releases

Code changes from version 2.3.1 to 2.3.2

Gutenberg/dist/blocks.build.js CHANGED
@@ -456,7 +456,7 @@ eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_embed_control
456
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
457
 
458
  "use strict";
459
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss__ = __webpack_require__(/*! ./style.scss */ 36);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editor_scss__ = __webpack_require__(/*! ./editor.scss */ 37);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editor_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__editor_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__edit__ = __webpack_require__(/*! ./edit */ 38);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_icons__ = __webpack_require__(/*! ../common/icons */ 4);\n/**\n * BLOCK: embedpress-blocks\n *\n * Registering a basic block with Gutenberg.\n * Simple block, renders and saves the same content without any interactivity.\n */\n\n// Import CSS.\n\n\n\n\nvar __ = wp.i18n.__; // Import __() from wp.i18n\n\nvar registerBlockType = wp.blocks.registerBlockType; // Import registerBlockType() from wp.blocks\n\n/**\n * Register: aa Gutenberg Block.\n *\n * Registers a new block provided a unique name and an object defining its\n * behavior. Once registered, the block is made editor as an option to any\n * editor interface where blocks are implemented.\n *\n * @link https://wordpress.org/gutenberg/handbook/block-api/\n * @param {string} name Block name.\n * @param {Object} settings Block settings.\n * @return {?WPBlock} The block, if it has been successfully\n * registered; otherwise `undefined`.\n */\n\nregisterBlockType('embedpress/wistia-block', {\n\t// Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.\n\ttitle: __('Wistia'), // Block title.\n\ticon: __WEBPACK_IMPORTED_MODULE_3__common_icons__[\"h\" /* wistiaIcon */], // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.\n\tcategory: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.\n\tkeywords: [__('embedpress'), __('wistia')],\n\tattributes: {\n\t\turl: {\n\t\t\ttype: 'string',\n\t\t\tdefault: ''\n\t\t},\n\t\tiframeSrc: {\n\t\t\ttype: 'string',\n\t\t\tdefault: ''\n\t\t}\n\t},\n\t/**\n * The edit function describes the structure of your block in the context of the editor.\n * This represents what the editor will render when the block is used.\n *\n * The \"edit\" property must be a valid function.\n *\n * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/\n */\n\tedit: __WEBPACK_IMPORTED_MODULE_2__edit__[\"a\" /* default */],\n\n\t/**\n * The save function defines the way in which the different attributes should be combined\n * into the final markup, which is then serialized by Gutenberg into post_content.\n *\n * The \"save\" property must be specified and must be a valid function.\n *\n * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/\n */\n\tsave: function save(props) {\n\t\tvar iframeSrc = props.attributes.iframeSrc;\n\n\t\treturn wp.element.createElement(\n\t\t\t'div',\n\t\t\t{ 'class': 'ose-wistia' },\n\t\t\twp.element.createElement('iframe', { src: iframeSrc,\n\t\t\t\tallowtransparency: 'true',\n\t\t\t\tframeborder: '0',\n\t\t\t\t'class': 'wistia_embed',\n\t\t\t\tname: 'wistia_embed',\n\t\t\t\twidth: '600', height: '330' })\n\t\t);\n\t}\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///35\n");
460
 
461
  /***/ }),
462
  /* 36 */
@@ -488,7 +488,7 @@ eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourc
488
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
489
 
490
  "use strict";
491
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_embed_controls__ = __webpack_require__(/*! ../common/embed-controls */ 0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_embed_loading__ = __webpack_require__(/*! ../common/embed-loading */ 1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_embed_placeholder__ = __webpack_require__(/*! ../common/embed-placeholder */ 2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_Iframe__ = __webpack_require__(/*! ../common/Iframe */ 3);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n/**\n * WordPress dependencies\n */\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\n\nvar WistiaEdit = function (_Component) {\n _inherits(WistiaEdit, _Component);\n\n function WistiaEdit() {\n _classCallCheck(this, WistiaEdit);\n\n var _this = _possibleConstructorReturn(this, (WistiaEdit.__proto__ || Object.getPrototypeOf(WistiaEdit)).apply(this, arguments));\n\n _this.switchBackToURLInput = _this.switchBackToURLInput.bind(_this);\n _this.setUrl = _this.setUrl.bind(_this);\n _this.onLoad = _this.onLoad.bind(_this);\n _this.state = {\n editingURL: false,\n url: _this.props.attributes.url,\n fetching: true,\n cannotEmbed: false\n };\n return _this;\n }\n\n _createClass(WistiaEdit, [{\n key: 'onLoad',\n value: function onLoad() {\n this.setState({\n fetching: false\n });\n }\n }, {\n key: 'decodeHTMLEntities',\n value: function decodeHTMLEntities(str) {\n if (str && typeof str === 'string') {\n // strip script/html tags\n str = str.replace(/<script[^>]*>([\\S\\s]*?)<\\/script>/gmi, '');\n str = str.replace(/<\\/?\\w(?:[^\"'>]|\"[^\"]*\"|'[^']*')*>/gmi, '');\n }\n return str;\n }\n }, {\n key: 'setUrl',\n value: function setUrl(event) {\n if (event) {\n event.preventDefault();\n }\n var url = this.state.url;\n var setAttributes = this.props.setAttributes;\n\n setAttributes({ url: url });\n if (url && (url.match(/^http[s]?:\\/\\/(?:www\\.)?wistia\\.com\\/medias/i) || url.match(/^http[s]?:\\/\\/(?:www\\.)?fast\\/.wistia\\.com\\/embed\\/medias/i.jsonp))) {\n var mediaIdMatches = url.match(/medias(.*)/);\n var mediaId = mediaIdMatches[1];\n\n var iframeSrc = '//fast.wistia.net/embed/iframe/' + mediaId;\n\n this.setState({ editingURL: false, cannotEmbed: false });\n setAttributes({ iframeSrc: iframeSrc });\n } else {\n this.setState({\n cannotEmbed: true,\n editingURL: true\n });\n }\n }\n }, {\n key: 'switchBackToURLInput',\n value: function switchBackToURLInput() {\n this.setState({ editingURL: true });\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n url = _state.url,\n editingURL = _state.editingURL,\n fetching = _state.fetching,\n cannotEmbed = _state.cannotEmbed;\n var iframeSrc = this.props.attributes.iframeSrc;\n\n\n var label = __('Wistia URL');\n\n // No preview, or we can't embed the current URL, or we've clicked the edit button.\n if (!iframeSrc || editingURL) {\n return wp.element.createElement(__WEBPACK_IMPORTED_MODULE_2__common_embed_placeholder__[\"a\" /* default */], {\n label: label,\n onSubmit: this.setUrl,\n value: url,\n cannotEmbed: cannotEmbed,\n onChange: function onChange(event) {\n return _this2.setState({ url: event.target.value });\n }\n });\n } else {\n return wp.element.createElement(\n Fragment,\n null,\n fetching ? wp.element.createElement(__WEBPACK_IMPORTED_MODULE_1__common_embed_loading__[\"a\" /* default */], null) : null,\n wp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__common_Iframe__[\"a\" /* default */], { src: iframeSrc, onLoad: this.onLoad, style: { display: fetching ? 'none' : '' }, frameborder: '0', width: '600', height: '330', allowfullscreen: 'true', mozallowfullscreen: 'true', webkitallowfullscreen: 'true' }),\n wp.element.createElement(__WEBPACK_IMPORTED_MODULE_0__common_embed_controls__[\"a\" /* default */], {\n showEditButton: iframeSrc && !cannotEmbed,\n switchBackToURLInput: this.switchBackToURLInput\n })\n );\n }\n }\n }]);\n\n return WistiaEdit;\n}(Component);\n\n;\n/* harmony default export */ __webpack_exports__[\"a\"] = (WistiaEdit);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvd2lzdGlhL2VkaXQuanM/NTQ2NCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX2NyZWF0ZUNsYXNzID0gZnVuY3Rpb24gKCkgeyBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0aWVzKHRhcmdldCwgcHJvcHMpIHsgZm9yICh2YXIgaSA9IDA7IGkgPCBwcm9wcy5sZW5ndGg7IGkrKykgeyB2YXIgZGVzY3JpcHRvciA9IHByb3BzW2ldOyBkZXNjcmlwdG9yLmVudW1lcmFibGUgPSBkZXNjcmlwdG9yLmVudW1lcmFibGUgfHwgZmFsc2U7IGRlc2NyaXB0b3IuY29uZmlndXJhYmxlID0gdHJ1ZTsgaWYgKFwidmFsdWVcIiBpbiBkZXNjcmlwdG9yKSBkZXNjcmlwdG9yLndyaXRhYmxlID0gdHJ1ZTsgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRhcmdldCwgZGVzY3JpcHRvci5rZXksIGRlc2NyaXB0b3IpOyB9IH0gcmV0dXJuIGZ1bmN0aW9uIChDb25zdHJ1Y3RvciwgcHJvdG9Qcm9wcywgc3RhdGljUHJvcHMpIHsgaWYgKHByb3RvUHJvcHMpIGRlZmluZVByb3BlcnRpZXMoQ29uc3RydWN0b3IucHJvdG90eXBlLCBwcm90b1Byb3BzKTsgaWYgKHN0YXRpY1Byb3BzKSBkZWZpbmVQcm9wZXJ0aWVzKENvbnN0cnVjdG9yLCBzdGF0aWNQcm9wcyk7IHJldHVybiBDb25zdHJ1Y3RvcjsgfTsgfSgpO1xuXG5mdW5jdGlvbiBfY2xhc3NDYWxsQ2hlY2soaW5zdGFuY2UsIENvbnN0cnVjdG9yKSB7IGlmICghKGluc3RhbmNl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HcoPzpbXlwiJz5dfFwiW15cIl0qXCJ8J1teJ10qJykqPi9nbWksICcnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBzdHI7XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ3NldFVybCcsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBzZXRVcmwoZXZlbnQpIHtcbiAgICAgICAgICAgIGlmIChldmVudCkge1xuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5zdGF0ZS51cmw7XG4gICAgICAgICAgICB2YXIgc2V0QXR0cmlidXRlcyA9IHRoaXMucHJvcHMuc2V0QXR0cmlidXRlcztcblxuICAgICAgICAgICAgc2V0QXR0cmlidXRlcyh7IHVybDogdXJsIH0pO1xuICAgICAgICAgICAgaWYgKHVybCAmJiAodXJsLm1hdGNoKC9eaHR0cFtzXT86XFwvXFwvKD86d3d3XFwuKT93aXN0aWFcXC5jb21cXC9tZWRpYXMvaSkgfHwgdXJsLm1hdGNoKC9eaHR0cFtzXT86XFwvXFwvKD86d3d3XFwuKT9mYXN0XFwvLndpc3RpYVxcLmNvbVxcL2VtYmVkXFwvbWVkaWFzL2kuanNvbnApKSkge1xuICAgICAgICAgICAgICAgIHZhciBtZWRpYUlkTWF0Y2hlcyA9IHVybC5tYXRjaCgvbWVkaWFzKC4qKS8pO1xuICAgICAgICAgICAgICAgIHZhciBtZWRpYUlkID0gbWVkaWFJZE1hdGNoZXNbMV07XG5cbiAgICAgICAgICAgICAgICB2YXIgaWZyYW1lU3JjID0gJy8vZmFzdC53aXN0aWEubmV0L2VtYmVkL2lmcmFtZS8nICsgbWVkaWFJZDtcblxuICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoeyBlZGl0aW5nVVJMOiBmYWxzZSwgY2Fubm90RW1iZWQ6IGZhbHNlIH0pO1xuICAgICAgICAgICAgICAgIHNldEF0dHJpYnV0ZXMoeyBpZnJhbWVTcmM6IGlmcmFtZVNyYyB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICAgICAgICAgICAgICAgIGNhbm5vdEVtYmVkOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBlZGl0aW5nVVJMOiB0cnVlXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ3N3aXRjaEJhY2tUb1VSTElucHV0JyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIHN3aXRjaEJhY2tUb1VSTElucHV0KCkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7IGVkaXRpbmdVUkw6IHRydWUgfSk7XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ3JlbmRlcicsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiByZW5kZXIoKSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMyID0gdGhpcztcblxuICAgICAgICAgICAgdmFyIF9zdGF0ZSA9IHRoaXMuc3RhdGUsXG4gICAgICAgICAgICAgICAgdXJsID0gX3N0YXRlLnVybCxcbiAgICAgICAgICAgICAgICBlZGl0aW5nVVJMID0gX3N0YXRlLmVkaXRpbmdVUkwsXG4gICAgICAgICAgICAgICAgZmV0Y2hpbmcgPSBfc3RhdGUuZmV0Y2hpbmcsXG4gICAgICAgICAgICAgICAgY2Fubm90RW1iZWQgPSBfc3RhdGUuY2Fubm90RW1iZWQ7XG4gICAgICAgICAgICB2YXIgaWZyYW1lU3JjID0gdGhpcy5wcm9wcy5hdHRyaWJ1dGVzLmlmcmFtZVNyYztcblxuXG4gICAgICAgICAgICB2YXIgbGFiZWwgPSBfXygnV2lzdGlhIFVSTCcpO1xuXG4gICAgICAgICAgICAvLyBObyBwcmV2aWV3LCBvciB3ZSBjYW4ndCBlbWJlZCB0aGUgY3VycmVudCBVUkwsIG9yIHdlJ3ZlIGNsaWNrZWQgdGhlIGVkaXQgYnV0dG9uLlxuICAgICAgICAgICAgaWYgKCFpZnJhbWVTcmMgfHwgZWRpdGluZ1VSTCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB3cC5lbGVtZW50LmNyZWF0ZUVsZW1lbnQoRW1iZWRQbGFjZWhvbGRlciwge1xuICAgICAgICAgICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICAgICAgICAgIG9uU3VibWl0OiB0aGlzLnNldFVybCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHVybCxcbiAgICAgICAgICAgICAgICAgICAgY2Fubm90RW1iZWQ6IGNhbm5vdEVtYmVkLFxuICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogZnVuY3Rpb24gb25DaGFuZ2UoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpczIuc2V0U3RhdGUoeyB1cmw6IGV2ZW50LnRhcmdldC52YWx1ZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFxuICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCxcbiAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgZmV0Y2hpbmcgPyB3cC5lbGVtZW50LmNyZWF0ZUVsZW1lbnQoRW1iZWRMb2FkaW5nLCBudWxsKSA6IG51bGwsXG4gICAgICAgICAgICAgICAgICAgIHdwLmVsZW1lbnQuY3JlYXRlRWxlbWVudChJZnJhbWUsIHsgc3JjOiBpZnJhbWVTcmMsIG9uTG9hZDogdGhpcy5vbkxvYWQsIHN0eWxlOiB7IGRpc3BsYXk6IGZ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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///38\n");
492
 
493
  /***/ })
494
  /******/ ]);
456
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
457
 
458
  "use strict";
459
+ eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss__ = __webpack_require__(/*! ./style.scss */ 36);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editor_scss__ = __webpack_require__(/*! ./editor.scss */ 37);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editor_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__editor_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__edit__ = __webpack_require__(/*! ./edit */ 38);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_icons__ = __webpack_require__(/*! ../common/icons */ 4);\n/**\n * BLOCK: embedpress-blocks\n *\n * Registering a basic block with Gutenberg.\n * Simple block, renders and saves the same content without any interactivity.\n */\n\n// Import CSS.\n\n\n\n\nvar __ = wp.i18n.__; // Import __() from wp.i18n\n\nvar registerBlockType = wp.blocks.registerBlockType; // Import registerBlockType() from wp.blocks\n\n/**\n * Register: aa Gutenberg Block.\n *\n * Registers a new block provided a unique name and an object defining its\n * behavior. Once registered, the block is made editor as an option to any\n * editor interface where blocks are implemented.\n *\n * @link https://wordpress.org/gutenberg/handbook/block-api/\n * @param {string} name Block name.\n * @param {Object} settings Block settings.\n * @return {?WPBlock} The block, if it has been successfully\n * registered; otherwise `undefined`.\n */\n\nregisterBlockType('embedpress/wistia-block', {\n\t// Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.\n\ttitle: __('Wistia'), // Block title.\n\ticon: __WEBPACK_IMPORTED_MODULE_3__common_icons__[\"h\" /* wistiaIcon */], // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.\n\tcategory: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.\n\tkeywords: [__('embedpress'), __('wistia')],\n\tedit: __WEBPACK_IMPORTED_MODULE_2__edit__[\"a\" /* default */],\n\tsave: function save(props) {\n\t\treturn null;\n\t},\n\tdeprecated: [{\n\t\tattributes: {\n\t\t\turl: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: ''\n\t\t\t},\n\t\t\tiframeSrc: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: ''\n\t\t\t}\n\t\t},\n\t\tedit: __WEBPACK_IMPORTED_MODULE_2__edit__[\"a\" /* default */],\n\t\t/**\n * The save function defines the way in which the different attributes should be combined\n * into the final markup, which is then serialized by Gutenberg into post_content.\n *\n * The \"save\" property must be specified and must be a valid function.\n *\n * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/\n */\n\t\tsave: function save(props) {\n\t\t\tvar iframeSrc = props.attributes.iframeSrc;\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ 'class': 'ose-wistia' },\n\t\t\t\twp.element.createElement('iframe', { src: iframeSrc,\n\t\t\t\t\tallowtransparency: 'true',\n\t\t\t\t\tframeborder: '0',\n\t\t\t\t\t'class': 'wistia_embed',\n\t\t\t\t\tname: 'wistia_embed',\n\t\t\t\t\twidth: '600', height: '330' })\n\t\t\t);\n\t\t}\n\t}]\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvd2lzdGlhL2luZGV4LmpzPzVmN2QiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBCTE9DSzogZW1iZWRwcmVzcy1ibG9ja3NcbiAqXG4gKiBSZWdpc3RlcmluZyBhIGJhc2ljIGJsb2NrIHdpdGggR3V0ZW5iZXJnLlxuICogU2ltcGxlIGJsb2NrLCByZW5kZXJzIGFuZCBzYXZlcyB0aGUgc2FtZSBjb250ZW50IHdpdGhvdXQgYW55IGludGVyYWN0aXZpdHkuXG4gKi9cblxuLy8gIEltcG9ydCBDU1MuXG5pbXBvcnQgJy4vc3R5bGUuc2Nzcyc7XG5pbXBvcnQgJy4vZWRpdG9yLnNjc3MnO1xuaW1wb3J0IGVkaXQgZnJvbSAnLi9lZGl0JztcbmltcG9ydCB7IHdpc3RpYUljb24gfSBmcm9tICcuLi9jb21tb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BjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///35\n");
460
 
461
  /***/ }),
462
  /* 36 */
488
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
489
 
490
  "use strict";
491
+ eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_embed_controls__ = __webpack_require__(/*! ../common/embed-controls */ 0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_embed_loading__ = __webpack_require__(/*! ../common/embed-loading */ 1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_embed_placeholder__ = __webpack_require__(/*! ../common/embed-placeholder */ 2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_Iframe__ = __webpack_require__(/*! ../common/Iframe */ 3);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n/**\n * WordPress dependencies\n */\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\n\nvar WistiaEdit = function (_Component) {\n _inherits(WistiaEdit, _Component);\n\n function WistiaEdit() {\n _classCallCheck(this, WistiaEdit);\n\n var _this = _possibleConstructorReturn(this, (WistiaEdit.__proto__ || Object.getPrototypeOf(WistiaEdit)).apply(this, arguments));\n\n _this.switchBackToURLInput = _this.switchBackToURLInput.bind(_this);\n _this.setUrl = _this.setUrl.bind(_this);\n _this.onLoad = _this.onLoad.bind(_this);\n _this.state = {\n editingURL: false,\n url: _this.props.attributes.url,\n fetching: true,\n cannotEmbed: false,\n mediaId: null\n };\n _this.setUrl();\n return _this;\n }\n\n _createClass(WistiaEdit, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.props.attributes.url) {\n var mediaIdMatches = this.props.attributes.url.match(/medias\\/(.*)/);\n var mediaId = mediaIdMatches[1];\n this.setState(Object.assign({}, this.state, {\n mediaId: mediaId\n }));\n }\n }\n }, {\n key: 'onLoad',\n value: function onLoad() {\n this.setState({\n fetching: false\n });\n console.log(embedpressObj);\n if (embedpressObj['wisita_options']) {\n var $state = Object.assign({}, this.state);\n setTimeout(function () {\n var script = document.createElement(\"script\");\n script.src = \"https://fast.wistia.com/assets/external/E-v1.js\";\n script.charset = \"ISO-8859-1\";\n document.body.appendChild(script);\n }, 100);\n\n setTimeout(function () {\n var script = document.createElement(\"script\");\n script.type = 'text/javascript';\n script.innerHTML = 'window.pp_embed_wistia_labels = ' + embedpressObj['wistia_labels'];\n document.body.appendChild(script);\n\n script = document.createElement(\"script\");\n script.type = 'text/javascript';\n script.innerHTML = 'wistiaEmbed = Wistia.embed( \\\"' + $state.mediaId + '\\\", ' + embedpressObj.wisita_options + ' );';\n document.body.appendChild(script);\n }, 400);\n }\n }\n }, {\n key: 'decodeHTMLEntities',\n value: function decodeHTMLEntities(str) {\n if (str && typeof str === 'string') {\n // strip script/html tags\n str = str.replace(/<script[^>]*>([\\S\\s]*?)<\\/script>/gmi, '');\n str = str.replace(/<\\/?\\w(?:[^\"'>]|\"[^\"]*\"|'[^']*')*>/gmi, '');\n }\n return str;\n }\n }, {\n key: 'setUrl',\n value: function setUrl(event) {\n if (event) {\n event.preventDefault();\n }\n var url = this.state.url;\n var setAttributes = this.props.setAttributes;\n\n setAttributes({ url: url });\n if (url && (url.match(/^http[s]?:\\/\\/(?:www\\.)?wistia\\.com\\/medias/i) || url.match(/^http[s]?:\\/\\/(?:www\\.)?fast\\/.wistia\\.com\\/embed\\/medias/i.jsonp))) {\n var mediaIdMatches = url.match(/medias\\/(.*)/);\n var mediaId = mediaIdMatches[1];\n var iframeSrc = '//fast.wistia.net/embed/iframe/' + mediaId;\n\n this.setState({ editingURL: false, cannotEmbed: false, mediaId: mediaId });\n setAttributes({ iframeSrc: iframeSrc });\n } else {\n this.setState({\n cannotEmbed: true,\n editingURL: true\n });\n }\n }\n }, {\n key: 'switchBackToURLInput',\n value: function switchBackToURLInput() {\n this.setState({ editingURL: true });\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n url = _state.url,\n editingURL = _state.editingURL,\n fetching = _state.fetching,\n cannotEmbed = _state.cannotEmbed;\n var iframeSrc = this.props.attributes.iframeSrc;\n\n\n var label = __('Wistia URL');\n\n // No preview, or we can't embed the current URL, or we've clicked the edit button.\n if (!iframeSrc || editingURL) {\n return wp.element.createElement(__WEBPACK_IMPORTED_MODULE_2__common_embed_placeholder__[\"a\" /* default */], {\n label: label,\n onSubmit: this.setUrl,\n value: url,\n cannotEmbed: cannotEmbed,\n onChange: function onChange(event) {\n return _this2.setState({ url: event.target.value });\n }\n });\n } else {\n return wp.element.createElement(\n Fragment,\n null,\n fetching ? wp.element.createElement(__WEBPACK_IMPORTED_MODULE_1__common_embed_loading__[\"a\" /* default */], null) : null,\n wp.element.createElement(\n 'div',\n { className: 'ose-wistia', id: \"wistia_\" + this.state.mediaId },\n wp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__common_Iframe__[\"a\" /* default */], { src: iframeSrc, onLoad: this.onLoad, style: { display: fetching ? 'none' : '' }, frameborder: '0', width: '600', height: '330', allowfullscreen: 'true', mozallowfullscreen: 'true', webkitallowfullscreen: 'true' })\n ),\n wp.element.createElement(__WEBPACK_IMPORTED_MODULE_0__common_embed_controls__[\"a\" /* default */], {\n showEditButton: iframeSrc && !cannotEmbed,\n switchBackToURLInput: this.switchBackToURLInput\n })\n );\n }\n }\n }]);\n\n return WistiaEdit;\n}(Component);\n\n;\n/* harmony default export */ __webpack_exports__[\"a\"] = (WistiaEdit);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMv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ChfdGhpcyk7XG4gICAgICAgIF90aGlzLnN0YXRlID0ge1xuICAgICAgICAgICAgZWRpdGluZ1VSTDogZmFsc2UsXG4gICAgICAgICAgICB1cmw6IF90aGlzLnByb3BzLmF0dHJpYnV0ZXMudXJsLFxuICAgICAgICAgICAgZmV0Y2hpbmc6IHRydWUsXG4gICAgICAgICAgICBjYW5ub3RFbWJlZDogZmFsc2UsXG4gICAgICAgICAgICBtZWRpYUlkOiBudWxsXG4gICAgICAgIH07XG4gICAgICAgIF90aGlzLnNldFVybCgpO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuXG4gICAgX2NyZWF0ZUNsYXNzKFdpc3RpYUVkaXQsIFt7XG4gICAgICAgIGtleTogJ2NvbXBvbmVudERpZE1vdW50JyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIGNvbXBvbmVudERpZE1vdW50KCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJvcHMuYXR0cmlidXRlcy51cmwpIHtcbiAgICAgICAgICAgICAgICB2YXIgbWVkaWFJZE1hdGNoZXMgPSB0aGlzLnByb3BzLmF0dHJpYnV0ZXMudXJsLm1hdGNoKC9tZWRpYXNcXC8oLiopLyk7XG4gICAgICAgICAgICAgICAgdmFyIG1lZGlhSWQgPSBtZWRpYUlkTWF0Y2hlc1sxXTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKE9iamVjdC5hc3NpZ24oe30sIHRoaXMuc3RhdGUsIHtcbiAgICAgICAgICAgICAgICAgICAgbWVkaWFJZDogbWVkaWFJZFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiAnb25Mb2FkJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIG9uTG9hZCgpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoe1xuICAgICAgICAgICAgICAgIGZldGNoaW5nOiBmYWxzZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjb25zb2xlLmxvZyhlbWJlZHByZXNzT2JqKTtcbiAgICAgICAgICAgIGlmIChlbWJlZHByZXNzT2JqWyd3aXNpdGFfb3B0aW9ucyddKSB7XG4gICAgICAgICAgICAgICAgdmFyICRzdGF0ZSA9IE9iamVjdC5hc3NpZ24oe30sIHRoaXMuc3RhdGUpO1xuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc2NyaXB0ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInNjcmlwdFwiKTtcbiAgICAgICAgICAgICAgICAgICAgc2NyaXB0LnNyYyA9IFwiaHR0cHM6Ly9mYXN0Lndpc3RpYS5jb20vYXNzZXRzL2V4dGVybmFsL0UtdjEuanNcIjtcbiAgICAgICAgICAgICAgICAgICAgc2NyaXB0LmNoYXJzZXQgPSBcIklTTy04ODU5LTFcIjtcbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChzY3JpcHQpO1xuICAgICAgICAgICAgICAgIH0sIDEwMCk7XG5cbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNjcmlwdCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJzY3JpcHRcIik7XG4gICAgICAgICAgICAgICAgICAgIHNjcmlwdC50eXBlID0gJ3RleHQvamF2YXNjcmlwdCc7XG4gICAgICAgICAgICAgICAgICAgIHNjcmlwdC5pbm5lckhUTUwgPSAnd2luZG93LnBwX2VtYmVkX3dpc3RpYV9sYWJlbHMgPSAnICsgZW1iZWRwcmVzc09ialsnd2lzdGlhX2xhYmVscyddO1xuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHNjcmlwdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgc2NyaXB0ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInNjcmlwdFwiKTtcbiAgICAgICAgICAgICAgICAgICAgc2NyaXB0LnR5cGUgPSAndGV4dC9qYXZhc2NyaXB0JztcbiAgICAgICAgICAgICAgICAgICAgc2NyaXB0LmlubmVySFRNTCA9ICd3aXN0aWFFbWJlZCA9IFdpc3RpYS5lbWJlZCggXFxcIicgKyAkc3RhdGUubWVkaWFJZCArICdcXFwiLCAnICsgZW1iZWRwcmVzc09iai53aXNpdGFfb3B0aW9ucyArICcgKTsnO1xuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHNjcmlwdCk7XG4gICAgICAgICAgICAgICAgfSwgNDAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiAnZGVjb2RlSFRNTEVudGl0aWVzJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIGRlY29kZUhUTUxFbnRpdGllcyhzdHIpIHtcbiAgICAgICAgICAgIGlmIChzdHIgJiYgdHlwZW9mIHN0ciA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAvLyBzdHJpcCBzY3JpcHQvaHRtbCB0YWdzXG4gICAgICAgICAgICAgICAgc3RyID0gc3RyLnJlcGxhY2UoLzxzY3JpcHRbXj5dKj4oW1xcU1xcc10qPyk8XFwvc2NyaXB0Pi9nbWksICcnKTtcbiAgICAgICAgICAgICAgICBzdHIgPSBzdHIucmVwbGFjZSgvPFxcLz9cXHcoPzpbXlwiJz5dfFwiW15cIl0qXCJ8J1teJ10qJykqPi9nbWksICcnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBzdHI7XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ3NldFVybCcsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBzZXRVcmwoZXZlbnQpIHtcbiAgICA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AuZWxlbWVudC5jcmVhdGVFbGVtZW50KEVtYmVkUGxhY2Vob2xkZXIsIHtcbiAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGxhYmVsLFxuICAgICAgICAgICAgICAgICAgICBvblN1Ym1pdDogdGhpcy5zZXRVcmwsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiB1cmwsXG4gICAgICAgICAgICAgICAgICAgIGNhbm5vdEVtYmVkOiBjYW5ub3RFbWJlZCxcbiAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IGZ1bmN0aW9uIG9uQ2hhbmdlKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMyLnNldFN0YXRlKHsgdXJsOiBldmVudC50YXJnZXQudmFsdWUgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdwLmVsZW1lbnQuY3JlYXRlRWxlbWVudChcbiAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIGZldGNoaW5nID8gd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KEVtYmVkTG9hZGluZywgbnVsbCkgOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICB3cC5lbGVtZW50LmNyZWF0ZUVsZW1lbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGl2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgY2xhc3NOYW1lOiAnb3NlLXdpc3RpYScsIGlkOiBcIndpc3RpYV9cIiArIHRoaXMuc3RhdGUubWVkaWFJZCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KElmcmFtZSwgeyBzcmM6IGlmcmFtZVNyYywgb25Mb2FkOiB0aGlzLm9uTG9hZCwgc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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///38\n");
492
 
493
  /***/ })
494
  /******/ ]);
Gutenberg/src/init.php CHANGED
@@ -50,6 +50,20 @@ function embedpress_blocks_cgb_editor_assets() { // phpcs:ignore
50
  // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: File modification time.
51
  true // Enqueue the script in the footer.
52
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  // Styles.
55
  wp_enqueue_style(
@@ -76,3 +90,7 @@ function embedpress_block_category( $categories, $post ) {
76
  );
77
  }
78
  add_filter( 'block_categories', 'embedpress_block_category', 10, 2);
 
 
 
 
50
  // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: File modification time.
51
  true // Enqueue the script in the footer.
52
  );
53
+ $wistia_labels = array(
54
+ 'watch_from_beginning' => __('Watch from the beginning', 'embedpress-wistia'),
55
+ 'skip_to_where_you_left_off' => __('Skip to where you left off', 'embedpress-wistia'),
56
+ 'you_have_watched_it_before' => __('It looks like you\'ve watched<br />part of this video before!', 'embedpress-wistia'),
57
+ );
58
+ $wistia_labels = json_encode($wistia_labels);
59
+ $wistia_options = null;
60
+ if(function_exists('embedpress_wisita_pro_get_options') ):
61
+ $wistia_options = embedpress_wisita_pro_get_options();
62
+ endif;
63
+ wp_localize_script( 'embedpress_blocks-cgb-block-js', 'embedpressObj', array(
64
+ 'wistia_labels' => $wistia_labels,
65
+ 'wisita_options' => $wistia_options
66
+ ) );
67
 
68
  // Styles.
69
  wp_enqueue_style(
90
  );
91
  }
92
  add_filter( 'block_categories', 'embedpress_block_category', 10, 2);
93
+
94
+ foreach ( glob( plugin_dir_path(__FILE__) . '*/index.php' ) as $block_logic ) {
95
+ require $block_logic;
96
+ }
Gutenberg/src/wistia/edit.js CHANGED
@@ -22,14 +22,51 @@ class WistiaEdit extends Component {
22
  editingURL: false,
23
  url: this.props.attributes.url,
24
  fetching: true,
25
- cannotEmbed: false
 
26
  };
 
27
  }
28
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  onLoad() {
30
  this.setState({
31
  fetching: false
32
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
  decodeHTMLEntities (str) {
35
  if(str && typeof str === 'string') {
@@ -50,13 +87,12 @@ class WistiaEdit extends Component {
50
  const { setAttributes } = this.props;
51
  setAttributes( { url } );
52
  if(url && ( url.match( /^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i ) || url.match( /^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp) ) ) {
53
- let mediaIdMatches = url.match(/medias(.*)/);
54
  let mediaId = mediaIdMatches[1];
55
-
56
  let iframeSrc = '//fast.wistia.net/embed/iframe/' + mediaId;
57
 
58
- this.setState( { editingURL: false, cannotEmbed: false } );
59
- setAttributes( {iframeSrc: iframeSrc });
60
  }
61
  else {
62
  this.setState({
@@ -92,7 +128,9 @@ class WistiaEdit extends Component {
92
  return (
93
  <Fragment>
94
  {fetching ? <EmbedLoading /> : null}
95
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="330" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
 
 
96
  <EmbedControls
97
  showEditButton={ iframeSrc && ! cannotEmbed }
98
  switchBackToURLInput={ this.switchBackToURLInput }
22
  editingURL: false,
23
  url: this.props.attributes.url,
24
  fetching: true,
25
+ cannotEmbed: false,
26
+ mediaId: null
27
  };
28
+ this.setUrl();
29
  }
30
 
31
+
32
+ componentDidMount () {
33
+ if(this.props.attributes.url) {
34
+ let mediaIdMatches = this.props.attributes.url.match(/medias\/(.*)/);
35
+ let mediaId = mediaIdMatches[1];
36
+ this.setState({
37
+ ...this.state,
38
+ mediaId
39
+ });
40
+ }
41
+ }
42
+
43
  onLoad() {
44
  this.setState({
45
  fetching: false
46
+ });
47
+ console.log(embedpressObj);
48
+ if(embedpressObj['wisita_options']) {
49
+ let $state = { ...this.state }
50
+ setTimeout(function() {
51
+ let script = document.createElement("script");
52
+ script.src = "https://fast.wistia.com/assets/external/E-v1.js";
53
+ script.charset="ISO-8859-1"
54
+ document.body.appendChild(script);
55
+ }, 100);
56
+
57
+ setTimeout(function() {
58
+ let script = document.createElement("script");
59
+ script.type = 'text/javascript';
60
+ script.innerHTML = 'window.pp_embed_wistia_labels = ' + embedpressObj['wistia_labels'];
61
+ document.body.appendChild(script);
62
+
63
+ script = document.createElement("script");
64
+ script.type = 'text/javascript';
65
+ script.innerHTML = 'wistiaEmbed = Wistia.embed( \"'+ $state.mediaId + '\", ' + embedpressObj.wisita_options + ' );';
66
+ document.body.appendChild(script);
67
+ }, 400);
68
+ }
69
+
70
  }
71
  decodeHTMLEntities (str) {
72
  if(str && typeof str === 'string') {
87
  const { setAttributes } = this.props;
88
  setAttributes( { url } );
89
  if(url && ( url.match( /^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i ) || url.match( /^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp) ) ) {
90
+ let mediaIdMatches = url.match(/medias\/(.*)/);
91
  let mediaId = mediaIdMatches[1];
 
92
  let iframeSrc = '//fast.wistia.net/embed/iframe/' + mediaId;
93
 
94
+ this.setState( { editingURL: false, cannotEmbed: false, mediaId } );
95
+ setAttributes( {iframeSrc });
96
  }
97
  else {
98
  this.setState({
128
  return (
129
  <Fragment>
130
  {fetching ? <EmbedLoading /> : null}
131
+ <div className="ose-wistia" id={"wistia_" + this.state.mediaId }>
132
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="330" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
133
+ </div>
134
  <EmbedControls
135
  showEditButton={ iframeSrc && ! cannotEmbed }
136
  switchBackToURLInput={ this.switchBackToURLInput }
Gutenberg/src/wistia/index.js CHANGED
@@ -26,54 +26,51 @@ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.b
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
- registerBlockType( 'embedpress/wistia-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
- title: __( 'Wistia' ), // Block title.
32
  icon: wistiaIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
34
  keywords: [
35
- __( 'embedpress' ),
36
- __( 'wistia' ),
37
  ],
38
- attributes: {
39
- url: {
40
- type: 'string',
41
- default: ''
42
- },
43
- iframeSrc: {
44
- type: 'string',
45
- default: ''
46
- }
47
- },
48
- /**
49
- * The edit function describes the structure of your block in the context of the editor.
50
- * This represents what the editor will render when the block is used.
51
- *
52
- * The "edit" property must be a valid function.
53
- *
54
- * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
55
- */
56
  edit,
57
-
58
- /**
59
- * The save function defines the way in which the different attributes should be combined
60
- * into the final markup, which is then serialized by Gutenberg into post_content.
61
- *
62
- * The "save" property must be specified and must be a valid function.
63
- *
64
- * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
65
- */
66
- save: function( props ) {
67
- const { iframeSrc } = props.attributes
68
- return (
69
- <div class="ose-wistia">
70
- <iframe src={ iframeSrc }
71
- allowtransparency="true"
72
- frameborder="0"
73
- class="wistia_embed"
74
- name="wistia_embed"
75
- width="600" height="330"></iframe>
76
- </div>
77
- );
78
  },
79
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
+ registerBlockType('embedpress/wistia-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
+ title: __('Wistia'), // Block title.
32
  icon: wistiaIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
34
  keywords: [
35
+ __('embedpress'),
36
+ __('wistia'),
37
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  edit,
39
+ save: function(props) {
40
+ return null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  },
42
+ deprecated: [{
43
+ attributes: {
44
+ url: {
45
+ type: 'string',
46
+ default: ''
47
+ },
48
+ iframeSrc: {
49
+ type: 'string',
50
+ default: ''
51
+ }
52
+ },
53
+ edit,
54
+ /**
55
+ * The save function defines the way in which the different attributes should be combined
56
+ * into the final markup, which is then serialized by Gutenberg into post_content.
57
+ *
58
+ * The "save" property must be specified and must be a valid function.
59
+ *
60
+ * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
61
+ */
62
+ save: function (props) {
63
+ const { iframeSrc } = props.attributes
64
+ return (
65
+ <div class="ose-wistia">
66
+ <iframe src={iframeSrc}
67
+ allowtransparency="true"
68
+ frameborder="0"
69
+ class="wistia_embed"
70
+ name="wistia_embed"
71
+ width="600" height="330"></iframe>
72
+ </div>
73
+ );
74
+ },
75
+ }]
76
+ });
Gutenberg/src/wistia/index.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Renders the `unity-gutenberg/post-slider` block on server.
5
+ *
6
+ * @param array $attributes The block attributes.
7
+ *
8
+ * @return string Returns the post slider.
9
+ */
10
+ function embedpress_gutenberg_render_block_wistia($attributes)
11
+ {
12
+ ob_start();
13
+ if (!empty($attributes) && !empty($attributes['url'])) :
14
+ preg_match('~medias/(.*)~i', $attributes['url'], $matches);
15
+ $id = false;
16
+ if (isset($matches[1])) {
17
+ $id = $matches[1];
18
+ }
19
+ if (!empty($id)) :
20
+ ?>
21
+ <div class="ose-wistia" id="wistia_<?php echo $id; ?>">
22
+ <iframe src="<?php echo $attributes['iframeSrc']; ?>" allowtransparency="true" frameborder="0" class="wistia_embed" name="wistia_embed" width="600" height="330"></iframe>
23
+ <?php
24
+ do_action('embedpress_gutenberg_wistia_block_after_embed', $attributes); ?>
25
+ </div>
26
+ <?php
27
+ endif;
28
+ endif;
29
+ return ob_get_clean();
30
+ }
31
+
32
+ /**
33
+ * Registers the `embedpress/wistia-block` block on server.
34
+ */
35
+ function embedpress_gutenberg_register_block_wistia()
36
+ {
37
+ if (function_exists('register_block_type')) :
38
+ register_block_type('embedpress/wistia-block', array(
39
+ 'attributes' => array(
40
+ 'url' => array(
41
+ 'type' => 'string',
42
+ ),
43
+ 'iframeSrc' => array(
44
+ 'type' => 'string',
45
+ ),
46
+ ),
47
+ 'render_callback' => 'embedpress_gutenberg_render_block_wistia',
48
+ ));
49
+ endif;
50
+ }
51
+
52
+ add_action('init', 'embedpress_gutenberg_register_block_wistia');
embedpress.php CHANGED
@@ -6,7 +6,7 @@
6
  * Facebook, Google Maps, Google Docs, UStream! Just use the URL!
7
  * Author:EmbedPress
8
  * Author URI:http://embedpress.com
9
- * Version: 2.3.1
10
  * Text Domain: embedpress
11
  * Domain Path: /languages
12
  *
6
  * Facebook, Google Maps, Google Docs, UStream! Just use the URL!
7
  * Author:EmbedPress
8
  * Author URI:http://embedpress.com
9
+ * Version: 2.3.2
10
  * Text Domain: embedpress
11
  * Domain Path: /languages
12
  *
readme.txt CHANGED
@@ -4,8 +4,8 @@ Author: EmbedPress, PressShack
4
  Author URI: https://embedpress.com
5
  Tags: YouTube, Google, Facebook, Wistia, Vimeo
6
  Requires at least: 4.6
7
- Tested up to: 5.2.1
8
- Stable tag: 2.3.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -183,6 +183,9 @@ Not at all. You can set up everything your team needs without any coding knowled
183
 
184
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
185
  and this project adheres to [Semantic Versioning](http://semver.org/).
 
 
 
186
  = [2.3.1] - 2019-04-24 =
187
  Added Wistia and Twitch blocks for Gutenberg
188
 
4
  Author URI: https://embedpress.com
5
  Tags: YouTube, Google, Facebook, Wistia, Vimeo
6
  Requires at least: 4.6
7
+ Tested up to: 5.0
8
+ Stable tag: 2.3.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
183
 
184
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
185
  and this project adheres to [Semantic Versioning](http://semver.org/).
186
+ = [2.3.2] - 2019-11-11 =
187
+ Refactoring Gutenberg Blocks
188
+
189
  = [2.3.1] - 2019-04-24 =
190
  Added Wistia and Twitch blocks for Gutenberg
191