Version Description
Download this release
Release Info
Developer | themeisle |
Plugin | Orbit Fox by ThemeIsle |
Version | 2.9.8 |
Comparing to | |
See all releases |
Code changes from version 2.9.7 to 2.9.8
- CHANGELOG.md +4 -0
- core/includes/class-orbit-fox.php +1 -1
- obfx_modules/mystock-import/css/editor-style.css +4 -0
- obfx_modules/mystock-import/init.php +54 -21
- obfx_modules/mystock-import/js/admin.js +5 -5
- obfx_modules/mystock-import/js/script.js +2 -2
- readme.md +7 -0
- readme.txt +7 -0
- themeisle-companion.php +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +4 -4
CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
##### [Version 2.9.7](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.6...v2.9.7) (2020-04-22)
|
2 |
|
3 |
- New Hidden field in the contact form widget
|
1 |
+
##### [Version 2.9.8](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.7...v2.9.8) (2020-04-28)
|
2 |
+
|
3 |
+
- Fixed importing multiple photos and better error handling in the Mystock module
|
4 |
+
|
5 |
##### [Version 2.9.7](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.6...v2.9.7) (2020-04-22)
|
6 |
|
7 |
- New Hidden field in the contact form widget
|
core/includes/class-orbit-fox.php
CHANGED
@@ -69,7 +69,7 @@ class Orbit_Fox {
|
|
69 |
|
70 |
$this->plugin_name = 'orbit-fox';
|
71 |
|
72 |
-
$this->version = '2.9.
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
69 |
|
70 |
$this->plugin_name = 'orbit-fox';
|
71 |
|
72 |
+
$this->version = '2.9.8';
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
obfx_modules/mystock-import/css/editor-style.css
CHANGED
@@ -407,3 +407,7 @@
|
|
407 |
text-align: center;
|
408 |
padding: 10px 0;
|
409 |
}
|
|
|
|
|
|
|
|
407 |
text-align: center;
|
408 |
padding: 10px 0;
|
409 |
}
|
410 |
+
|
411 |
+
.is-sidebar-opened .block-editor-editor-skeleton__sidebar{
|
412 |
+
z-index: 100001;
|
413 |
+
}
|
obfx_modules/mystock-import/init.php
CHANGED
@@ -125,36 +125,69 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
|
|
125 |
* Upload image.
|
126 |
*/
|
127 |
public function handle_request() {
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
if ( ! isset( $_POST['url'] ) ) {
|
131 |
-
|
132 |
-
|
133 |
}
|
134 |
|
|
|
135 |
$url = esc_url_raw( $_POST['url'] );
|
136 |
-
$
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
wp_die();
|
141 |
-
}
|
142 |
-
$file = array();
|
143 |
-
$file['name'] = $name;
|
144 |
-
$file['tmp_name'] = $tmp_file;
|
145 |
-
$image_id = media_handle_sideload( $file, 0 );
|
146 |
-
if ( is_wp_error( $image_id ) ) {
|
147 |
-
echo esc_html__( 'Image failed to upload', 'themeisle-companion' );
|
148 |
-
wp_die();
|
149 |
}
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
154 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
wp_update_attachment_metadata( $image_id, $attach_data );
|
156 |
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
/**
|
125 |
* Upload image.
|
126 |
*/
|
127 |
public function handle_request() {
|
128 |
+
$response = array(
|
129 |
+
'success' => false,
|
130 |
+
'msg' => __( 'There was an error getting image details from the request, please try again.', 'themeisle-companion' ),
|
131 |
+
'attachment' => '',
|
132 |
+
);
|
133 |
+
|
134 |
+
if ( ! current_user_can( 'upload_files' ) ) {
|
135 |
+
$response['msg'] = __( 'The current user does not have permission to upload files.', 'themeisle-companion' );
|
136 |
+
wp_send_json_error( $response );
|
137 |
+
}
|
138 |
+
|
139 |
+
$check_referer = check_ajax_referer( $this->slug . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ), 'security', false );
|
140 |
+
if ( $check_referer === false ) {
|
141 |
+
$response['msg'] = __( 'Invalid nonce.', 'themeisle-companion' );
|
142 |
+
wp_send_json_error( $response );
|
143 |
+
}
|
144 |
|
145 |
if ( ! isset( $_POST['url'] ) ) {
|
146 |
+
$response['msg'] = __( 'The URL of the image does not exist.', 'themeisle-companion' );
|
147 |
+
wp_send_json_error( $response );
|
148 |
}
|
149 |
|
150 |
+
// Send request to `wp_remote_get`
|
151 |
$url = esc_url_raw( $_POST['url'] );
|
152 |
+
$response = wp_remote_get( $url );
|
153 |
+
if ( is_wp_error( $response ) ) {
|
154 |
+
$response['msg'] = __( 'Image download failed, please try again.', 'themeisle-companion' );
|
155 |
+
wp_send_json_error( $response );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
+
|
158 |
+
// Get Headers
|
159 |
+
$type = wp_remote_retrieve_header( $response, 'content-type' );
|
160 |
+
if ( ! $type ) {
|
161 |
+
$response['msg'] = __( 'Image type could not be determined', 'themeisle-companion' );
|
162 |
+
wp_send_json_error( $response );
|
163 |
}
|
164 |
+
|
165 |
+
// Upload remote file
|
166 |
+
$name = basename( $url );
|
167 |
+
$mirror = wp_upload_bits( $name, null, wp_remote_retrieve_body( $response ) );
|
168 |
+
|
169 |
+
// Build Attachment Data Array
|
170 |
+
$attachment = array(
|
171 |
+
'post_content' => '',
|
172 |
+
'post_status' => 'inherit',
|
173 |
+
'post_mime_type' => $type,
|
174 |
+
);
|
175 |
+
|
176 |
+
// Insert as attachment
|
177 |
+
$image_id = wp_insert_attachment( $attachment, $mirror['file'], 0 );
|
178 |
+
|
179 |
+
// Generate Metadata
|
180 |
+
$attach_data = wp_generate_attachment_metadata( $image_id, $mirror['file'] );
|
181 |
wp_update_attachment_metadata( $image_id, $attach_data );
|
182 |
|
183 |
+
$response['success'] = true;
|
184 |
+
$response['msg'] = __( 'Image successfully uploaded to the media library!', 'themeisle-companion' );
|
185 |
+
$response['attachment'] = array(
|
186 |
+
'id' => $image_id,
|
187 |
+
'url' => wp_get_attachment_url( $image_id ),
|
188 |
+
);
|
189 |
+
|
190 |
+
wp_send_json_success( $response );
|
191 |
}
|
192 |
|
193 |
/**
|
obfx_modules/mystock-import/js/admin.js
CHANGED
@@ -195,13 +195,13 @@ function loadMyStockTab($) {
|
|
195 |
'security' : mystock_import.nonce
|
196 |
},
|
197 |
url : mystock_import.ajaxurl,
|
198 |
-
success : function(
|
199 |
$( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.insert_image_new );
|
200 |
if ( 'mystock' === wp.media.frame.content.mode() ) {
|
201 |
wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
|
202 |
wp.media.frame.content.mode( 'browse' );
|
203 |
$( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' );
|
204 |
-
wp.media.frame.state().get( 'selection' ).reset( wp.media.attachment(
|
205 |
$( document ).find( '.media-button-insert' ).trigger( 'click' );
|
206 |
}
|
207 |
}
|
@@ -222,13 +222,13 @@ function loadMyStockTab($) {
|
|
222 |
'security' : mystock_import.nonce
|
223 |
},
|
224 |
url : mystock_import.ajaxurl,
|
225 |
-
success : function(
|
226 |
$( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.featured_image_new );
|
227 |
if ( 'mystock' === wp.media.frame.content.mode() ) {
|
228 |
wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
|
229 |
wp.media.frame.content.mode( 'browse' );
|
230 |
$( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' );
|
231 |
-
wp.media.frame.state().get( 'selection' ).reset( wp.media.attachment(
|
232 |
$( document ).find( '.media-button-select' ).trigger( 'click' );
|
233 |
}
|
234 |
}
|
@@ -242,4 +242,4 @@ function loadMyStockTab($) {
|
|
242 |
}
|
243 |
document.addEventListener('DOMContentLoaded', function() {
|
244 |
loadMyStockTab(jQuery);
|
245 |
-
});
|
195 |
'security' : mystock_import.nonce
|
196 |
},
|
197 |
url : mystock_import.ajaxurl,
|
198 |
+
success : function(res) {
|
199 |
$( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.insert_image_new );
|
200 |
if ( 'mystock' === wp.media.frame.content.mode() ) {
|
201 |
wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
|
202 |
wp.media.frame.content.mode( 'browse' );
|
203 |
$( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' );
|
204 |
+
wp.media.frame.state().get( 'selection' ).reset( wp.media.attachment( res.data.attachment.id ) );
|
205 |
$( document ).find( '.media-button-insert' ).trigger( 'click' );
|
206 |
}
|
207 |
}
|
222 |
'security' : mystock_import.nonce
|
223 |
},
|
224 |
url : mystock_import.ajaxurl,
|
225 |
+
success : function(res) {
|
226 |
$( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.featured_image_new );
|
227 |
if ( 'mystock' === wp.media.frame.content.mode() ) {
|
228 |
wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
|
229 |
wp.media.frame.content.mode( 'browse' );
|
230 |
$( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' );
|
231 |
+
wp.media.frame.state().get( 'selection' ).reset( wp.media.attachment( res.data.attachment.id ) );
|
232 |
$( document ).find( '.media-button-select' ).trigger( 'click' );
|
233 |
}
|
234 |
}
|
242 |
}
|
243 |
document.addEventListener('DOMContentLoaded', function() {
|
244 |
loadMyStockTab(jQuery);
|
245 |
+
});
|
obfx_modules/mystock-import/js/script.js
CHANGED
@@ -1104,7 +1104,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n
|
|
1104 |
/***/ (function(module, exports, __webpack_require__) {
|
1105 |
|
1106 |
"use strict";
|
1107 |
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\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/* global mystock_import */\n\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar __ = wp.i18n.__;\nvar Snackbar = wp.components.Snackbar;\n\nvar _wp$data$dispatch = wp.data.dispatch('core/notices'),\n createNotice = _wp$data$dispatch.createNotice;\n\nvar dispatchNotice = function dispatchNotice(value) {\n\tif (!Snackbar) {\n\t\treturn;\n\t}\n\n\tcreateNotice('info', value, {\n\t\tisDismissible: true,\n\t\ttype: 'snackbar'\n\t});\n};\n\nvar Photo = function (_Component) {\n\t_inherits(Photo, _Component);\n\n\tfunction Photo(props) {\n\t\t_classCallCheck(this, Photo);\n\n\t\tvar _this = _possibleConstructorReturn(this, (Photo.__proto__ || Object.getPrototypeOf(Photo)).call(this, props));\n\n\t\t_this.img = _this.props.result.url_m;\n\t\t_this.fullSize = _this.props.result.url_o;\n\t\t_this.imgTitle = _this.props.result.title;\n\t\t_this.setAsFeaturedImage = false;\n\t\t_this.insertIntoPost = false;\n\t\t_this.inProgress = false;\n\n\t\t_this.SetFeaturedImage = _this.props.SetFeaturedImage;\n\t\t_this.InsertImage = _this.props.InsertImage;\n\n\t\t_this.noticeRef = createRef();\n\t\t_this.imageRef = createRef();\n\n\t\t_this.state = { attachmentId: '' };\n\t\treturn _this;\n\t}\n\n\t/**\n * uploadPhoto\n * Function to trigger image upload\n *\n * @param e element clicked item\n * @returns {boolean}\n */\n\n\n\t_createClass(Photo, [{\n\t\tkey: 'uploadPhoto',\n\t\tvalue: function uploadPhoto(e) {\n\t\t\te.preventDefault();\n\n\t\t\tvar self = this;\n\t\t\tvar target = e.currentTarget;\n\t\t\tvar photo = target.parentElement.parentElement.parentElement.parentElement.parentElement;\n\t\t\tvar notice = this.noticeRef.current;\n\t\t\tvar photoContainer = this.imageRef.current;\n\t\t\t/**\n * Bail if image was imported and the user clicks on Add to Media Library\n */\n\t\t\tif (target.classList.contains('download') && this.state.attachmentId !== '') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tphotoContainer.classList.add('uploading');\n\t\t\tphoto.classList.add('in-progress');\n\t\t\tnotice.innerHTML = __('Downloading Image...', 'themeisle-companion');\n\t\t\tthis.inProgress = true;\n\n\t\t\t/**\n * Skip the uploading image part if image was already uploaded\n */\n\t\t\tif (this.state.attachmentId !== '') {\n\t\t\t\tthis.doPhotoAction(target, photo, this.state.attachmentId);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append('action', 'handle-request-' + mystock_import.slug);\n\t\t\tformData.append('url', this.fullSize);\n\t\t\tformData.append('security', mystock_import.nonce);\n\n\t\t\twp.apiFetch({\n\t\t\t\turl: mystock_import.ajaxurl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData\n\t\t\t}).then(function (res) {\n\t\t\t\tif (res && res.success === true && res.data.id) {\n\t\t\t\t\tself.doPhotoAction(target, photo, res.data.id);\n\t\t\t\t\tself.setState({ attachmentId: res.data.id });\n\t\t\t\t} else {\n\t\t\t\t\tself.uploadError(target, photo, __('Unable to download image to server, please check your server permissions.', 'themeisle-companion'));\n\t\t\t\t}\n\t\t\t}).catch(function (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Insert image into post or set image as thumbnail\n *\n * @param target element clicked item\n * @param photo element current photo element\n * @param attachmentId attachement id\n */\n\n\t}, {\n\t\tkey: 'doPhotoAction',\n\t\tvalue: function doPhotoAction(target, photo, attachmentId) {\n\t\t\tthis.uploadComplete(target, photo, attachmentId);\n\n\t\t\tif (this.setAsFeaturedImage) {\n\t\t\t\tthis.SetFeaturedImage(attachmentId);\n\t\t\t\tthis.setAsFeaturedImage = false;\n\t\t\t}\n\n\t\t\tif (this.insertIntoPost) {\n\t\t\t\tthis.InsertImage(this.fullSize, this.imgTitle);\n\t\t\t\tthis.insertIntoPost = false;\n\t\t\t}\n\t\t}\n\n\t\t/*\n * uploadError\n * Function runs when error occurs on upload or resize\n *\n * @param target element Current clicked item\n * @param photo element Nearest parent .photo\n * @param msg string Error Msg\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'uploadError',\n\t\tvalue: function uploadError(target, photo, msg) {\n\t\t\tvar photoContainer = this.imageRef.current;\n\t\t\tphotoContainer.classList.remove('uploading');\n\n\t\t\ttarget.classList.add('errors');\n\t\t\tthis.inProgress = false;\n\t\t\tconsole.warn(msg);\n\t\t}\n\n\t\t/*\n * uploadComplete\n * Function runs when upload has completed\n *\n * @param target element clicked item\n * @param photo element Nearest parent .photo\n * @param msg string Success Msg\n * @param url string The attachment edit link\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'uploadComplete',\n\t\tvalue: function uploadComplete(target, photo, attachment) {\n\n\t\t\tthis.setState({ attachmentId: attachment });\n\n\t\t\tvar photoContainer = this.imageRef.current;\n\t\t\tphotoContainer.classList.remove('uploading');\n\t\t\tphotoContainer.classList.add('success');\n\n\t\t\tphoto.classList.remove('in-progress');\n\t\t\tphoto.classList.add('uploaded', 'done');\n\t\t\ttarget.parentNode.parentNode.classList.add('disabled');\n\t\t\tsetTimeout(function () {\n\t\t\t\tphotoContainer.classList.remove('success');\n\t\t\t\tphoto.classList.remove('uploaded');\n\t\t\t\ttarget.parentNode.parentNode.classList.remove('disabled');\n\t\t\t}, 3000, target, photo);\n\t\t\tthis.inProgress = false;\n\t\t\tdispatchNotice(__('Image was added to Media Library.', 'themeisle-companion'));\n\t\t}\n\n\t\t/*\n * setFeaturedImageClick\n * Function used to trigger a download and then set as featured image\n */\n\n\t}, {\n\t\tkey: 'setFeaturedImageClick',\n\t\tvalue: function setFeaturedImageClick(e) {\n\t\t\tvar target = e.currentTarget;\n\t\t\tif (!target) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.setAsFeaturedImage = true;\n\t\t\tthis.uploadPhoto(e);\n\t\t}\n\n\t\t/*\n * insertImageIntoPost\n * Function used to insert an image directly into the block (Gutenberg) editor.\n *\n * @since 4.0\n */\n\n\t}, {\n\t\tkey: 'insertImageIntoPost',\n\t\tvalue: function insertImageIntoPost(e) {\n\t\t\tvar target = e.currentTarget;\n\t\t\tif (!target) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.insertIntoPost = true;\n\t\t\tthis.uploadPhoto(e);\n\t\t}\n\n\t\t/**\n * Render photo image.\n *\n * @returns {*}\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this2 = this;\n\n\t\t\treturn React.createElement(\n\t\t\t\t'article',\n\t\t\t\t{ className: 'photo' },\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'photo--wrap' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{ className: 'img-wrap' },\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: 'upload',\n\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\tref: this.imageRef\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tReact.createElement('img', { src: this.img, alt: this.imgTitle }),\n\t\t\t\t\t\t\tReact.createElement('div', { className: 'status' })\n\t\t\t\t\t\t),\n\t\t\t\t\t\tReact.createElement('div', { ref: this.noticeRef, className: 'notice-msg' }),\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t{ className: 'user-controls' },\n\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t\t{ className: 'photo-options' },\n\t\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t\t\t{ className: 'download fade',\n\t\t\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\t\t\treturn _this2.uploadPhoto(e);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttitle: __('Add to Media Library', 'themeisle-companion')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-download' })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t\t\t{ className: 'set-featured fade',\n\t\t\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\t\t\treturn _this2.setFeaturedImageClick(e);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttitle: __('Set as featured image', 'themeisle-companion')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-format-image' })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t\t\t{ className: 'insert fade',\n\t\t\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\t\t\treturn _this2.insertImageIntoPost(e);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttitle: __('Insert into post', 'themeisle-companion')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-plus' })\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn Photo;\n}(Component);\n\nexports.default = Photo;\n\n//# sourceURL=webpack:///./obfx_modules/mystock-import/js/src/components/Photo.js?");
|
1108 |
|
1109 |
/***/ }),
|
1110 |
|
@@ -1116,7 +1116,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n
|
|
1116 |
/***/ (function(module, exports, __webpack_require__) {
|
1117 |
|
1118 |
"use strict";
|
1119 |
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\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\nvar _flickrSdk = __webpack_require__(/*! flickr-sdk */ \"./node_modules/flickr-sdk/index.js\");\n\nvar _flickrSdk2 = _interopRequireDefault(_flickrSdk);\n\nvar _Photo = __webpack_require__(/*! ./Photo */ \"./obfx_modules/mystock-import/js/src/components/Photo.js\");\n\nvar _Photo2 = _interopRequireDefault(_Photo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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; } /* global mystock_import */\n\n\nvar Spinner = wp.components.Spinner;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar __ = wp.i18n.__;\n\nvar PhotoList = function (_Component) {\n\t_inherits(PhotoList, _Component);\n\n\tfunction PhotoList(props) {\n\t\t_classCallCheck(this, PhotoList);\n\n\t\tvar _this = _possibleConstructorReturn(this, (PhotoList.__proto__ || Object.getPrototypeOf(PhotoList)).call(this, props));\n\n\t\t_this.apiKey = mystock_import.api_key;\n\t\t_this.userId = mystock_import.user_id;\n\t\t_this.perPage = mystock_import.per_page;\n\n\t\t_this.flickr = new _flickrSdk2.default(_this.apiKey);\n\t\t_this.results = _this.props.results ? _this.props.results : [];\n\t\t_this.state = { results: _this.results };\n\n\t\t_this.isSearch = false;\n\t\t_this.search_term = '';\n\t\t_this.nothingFound = false;\n\n\t\t_this.isLoading = false; // loading flag\n\t\t_this.isDone = false; // Done flag - no photos remain\n\n\t\t_this.page = _this.props.page;\n\n\t\t_this.SetFeaturedImage = _this.props.SetFeaturedImage ? _this.props.SetFeaturedImage.bind(_this) : '';\n\t\t_this.InsertImage = _this.props.InsertImage ? _this.props.InsertImage.bind(_this) : '';\n\n\t\t_this.errorRef = createRef();\n\t\t_this.searchRef = createRef();\n\t\treturn _this;\n\t}\n\n\t/**\n * test()\n * Test access to the Flickr API\n *\n * @since 3.2\n */\n\n\n\t_createClass(PhotoList, [{\n\t\tkey: 'test',\n\t\tvalue: function test() {\n\t\t\tvar self = this;\n\t\t\tvar target = this.errorRef.current;\n\t\t\tthis.flickr.test.echo(this.apiKey).then(function (res) {\n\t\t\t\tif (res.statusCode < 200 || res.statusCode >= 400) {\n\t\t\t\t\tself.renderTestError(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Render test error\n *\n * @param target\n */\n\n\t}, {\n\t\tkey: 'renderTestError',\n\t\tvalue: function renderTestError(target) {\n\t\t\ttarget.classList.add('active');\n\t\t\ttarget.innerHTML = __('There was an error accessing the server. Please try again later. If you still receive this error, contact the support team.', 'themeisle-companion');\n\t\t}\n\n\t\t/**\n * getPhotos\n * Load next set of photos, infinite scroll style\n *\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'getPhotos',\n\t\tvalue: function getPhotos() {\n\t\t\tvar self = this;\n\t\t\tthis.page = parseInt(this.page) + 1;\n\t\t\tthis.isLoading = true;\n\n\t\t\tif (this.isSearch) {\n\t\t\t\tthis.doSearch(this.search_term, true);\n\t\t\t} else {\n\t\t\t\tvar args = {\n\t\t\t\t\t'api_key': this.apiKey,\n\t\t\t\t\t'user_id': this.userId,\n\t\t\t\t\t'per_page': this.perPage,\n\t\t\t\t\t'extras': 'url_m, url_o',\n\t\t\t\t\t'page': this.page\n\t\t\t\t};\n\t\t\t\tthis.flickr.people.getPublicPhotos(args).then(function (res) {\n\t\t\t\t\tvar photos = res.body.photos.photo;\n\n\t\t\t\t\tphotos.map(function (data) {\n\t\t\t\t\t\tself.results.push(data);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Check for returned data\n\t\t\t\t\tself.checkTotalResults(photos.length);\n\n\t\t\t\t\t// Update Props\n\t\t\t\t\tself.setState({ results: self.results });\n\t\t\t\t}).catch(function (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tself.isLoading = false;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t/**\n * checkTotalResults\n * A checker to determine is there are remaining search results.\n *\n * @param num int Total search results\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'checkTotalResults',\n\t\tvalue: function checkTotalResults(num) {\n\t\t\tthis.isDone = num < this.perPage;\n\t\t}\n\n\t\t/**\n * search()\n * Trigger Unsplash Search\n *\n * @param e element the search form\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'search',\n\t\tvalue: function search(e) {\n\n\t\t\te.preventDefault();\n\t\t\tvar input = this.searchRef.current;\n\t\t\tvar term = input.value;\n\t\t\tif (term.length > 2) {\n\t\t\t\tinput.classList.add('searching');\n\t\t\t\tthis.search_term = term;\n\t\t\t\tthis.nothingFound = false;\n\t\t\t\tthis.isSearch = true;\n\t\t\t\tthis.page = 0;\n\t\t\t\tthis.doSearch(this.search_term);\n\t\t\t} else {\n\t\t\t\tinput.focus();\n\t\t\t}\n\t\t}\n\n\t\t/**\n * doSearch\n * Run the search\n *\n * @param term string the search term\n * @param append bool should append\n * @since 3.0\n * @updated 3.1\n */\n\n\t}, {\n\t\tkey: 'doSearch',\n\t\tvalue: function doSearch(term) {\n\t\t\tvar append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n\n\t\t\tvar self = this;\n\t\t\tthis.page = parseInt(this.page) + 1;\n\t\t\tvar input = this.searchRef.current;\n\n\t\t\tif (append !== true) {\n\t\t\t\tself.results = [];\n\t\t\t\tself.setState({ results: [] });\n\t\t\t}\n\t\t\tvar args = {\n\t\t\t\t'api_key': this.apiKey,\n\t\t\t\t'user_id': this.userId,\n\t\t\t\t'text': this.search_term,\n\t\t\t\t'per_page': this.perPage,\n\t\t\t\t'extras': 'url_m, url_o',\n\t\t\t\t'page': this.page\n\t\t\t};\n\t\t\tthis.flickr.photos.search(args).then(function (res) {\n\t\t\t\tvar photos = res.body.photos.photo;\n\t\t\t\tif (photos.length === 0) {\n\t\t\t\t\tself.nothingFound = true;\n\t\t\t\t}\n\n\t\t\t\tif (photos.length === 0 && self.append === false) {\n\t\t\t\t\tself.nothingFound = true;\n\t\t\t\t}\n\n\t\t\t\tphotos.map(function (data) {\n\t\t\t\t\tself.results.push(data);\n\t\t\t\t});\n\n\t\t\t\t// Check for returned data\n\t\t\t\tself.checkTotalResults(photos.length);\n\n\t\t\t\t// Update Props\n\t\t\t\tself.setState({ results: self.results });\n\n\t\t\t\tinput.classList.remove('searching');\n\t\t\t}).catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\tself.isLoading = false;\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Reset search\n */\n\n\t}, {\n\t\tkey: 'resetSearch',\n\t\tvalue: function resetSearch() {\n\t\t\tvar input = this.searchRef.current;\n\t\t\tthis.isSearch = false;\n\t\t\tthis.page = 0;\n\t\t\tthis.results = [];\n\t\t\tinput.value = '';\n\t\t\tthis.getPhotos();\n\t\t}\n\n\t\t/**\n * Component Init\n \t */\n\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.test();\n\n\t\t\tthis.page = 0;\n\t\t\tthis.getPhotos();\n\t\t}\n\n\t\t/**\n * render()\n * Render function for this component\n *\n * @returns {*}\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar button = '';\n\t\t\tvar spinner = '';\n\t\t\tif (!this.isDone) {\n\t\t\t\tbutton = React.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'load-more-wrap' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'button',\n\t\t\t\t\t\t{ type: 'button', className: 'button', onClick: function onClick() {\n\t\t\t\t\t\t\t\treturn _this2.getPhotos();\n\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t__('Load More Images', 'themeisle-companion')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.results.length === 0 && !this.nothingFound) {\n\t\t\t\tspinner = React.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'loading-wrap' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'h3',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t__('Loading images...', 'themeisle-companion')\n\t\t\t\t\t),\n\t\t\t\t\tReact.createElement(Spinner, null)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ id: 'photo-listing' },\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'search-field', id: 'search-bar' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'form',\n\t\t\t\t\t\t{ onSubmit: function onSubmit(e) {\n\t\t\t\t\t\t\t\treturn _this2.search(e);\n\t\t\t\t\t\t\t}, autoComplete: 'off' },\n\t\t\t\t\t\tReact.createElement('input', { ref: this.searchRef, type: 'text', id: 'photo-search', placeholder: __('Search', 'themeisle-companion') }),\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t{ type: 'submit', id: 'photo-search-submit' },\n\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-search' })\n\t\t\t\t\t\t),\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t{ id: 'clear-search', onClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\treturn _this2.resetSearch();\n\t\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-no' })\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tReact.createElement('div', { ref: this.errorRef, className: 'error-messaging' }),\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ id: 'msp-photos' },\n\t\t\t\t\tspinner,\n\t\t\t\t\tthis.state.results.map(function (result, iterator) {\n\t\t\t\t\t\treturn React.createElement(_Photo2.default, { result: result, key: result.id + iterator, SetFeaturedImage: _this2.SetFeaturedImage, InsertImage: _this2.InsertImage });\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: this.nothingFound === true && this.isSearch ? 'no-results show' : 'no-results', title: this.props.title },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'h3',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t__('Sorry, nothing matched your query.', 'themeisle-companion'),\n\t\t\t\t\t\t' '\n\t\t\t\t\t),\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'p',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t__('Please try with another word.', 'themeisle-companion'),\n\t\t\t\t\t\t' '\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tbutton\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn PhotoList;\n}(Component);\n\nexports.default = PhotoList;\n\n//# sourceURL=webpack:///./obfx_modules/mystock-import/js/src/components/PhotoList.js?");
|
1120 |
|
1121 |
/***/ }),
|
1122 |
|
1104 |
/***/ (function(module, exports, __webpack_require__) {
|
1105 |
|
1106 |
"use strict";
|
1107 |
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\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/* global mystock_import */\n\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar __ = wp.i18n.__;\nvar Snackbar = wp.components.Snackbar;\n\nvar _wp$data$dispatch = wp.data.dispatch('core/notices'),\n createNotice = _wp$data$dispatch.createNotice;\n\nvar dispatchNotice = function dispatchNotice(value) {\n\tif (!Snackbar) {\n\t\treturn;\n\t}\n\n\tcreateNotice('info', value, {\n\t\tisDismissible: true,\n\t\ttype: 'snackbar'\n\t});\n};\n\nvar Photo = function (_Component) {\n\t_inherits(Photo, _Component);\n\n\tfunction Photo(props) {\n\t\t_classCallCheck(this, Photo);\n\n\t\tvar _this = _possibleConstructorReturn(this, (Photo.__proto__ || Object.getPrototypeOf(Photo)).call(this, props));\n\n\t\t_this.img = _this.props.result.url_m;\n\t\t_this.fullSize = _this.props.result.url_l;\n\t\t_this.imgTitle = _this.props.result.title;\n\t\t_this.setAsFeaturedImage = false;\n\t\t_this.insertIntoPost = false;\n\t\t_this.inProgress = false;\n\n\t\t_this.SetFeaturedImage = _this.props.SetFeaturedImage;\n\t\t_this.InsertImage = _this.props.InsertImage;\n\n\t\t_this.noticeRef = createRef();\n\t\t_this.imageRef = createRef();\n\t\t_this.photoContainerRef = createRef();\n\n\t\t_this.state = { attachmentId: '' };\n\t\treturn _this;\n\t}\n\n\t/**\n * uploadPhoto\n * Function to trigger image upload\n *\n * @param e element clicked item\n * @returns {boolean}\n */\n\n\n\t_createClass(Photo, [{\n\t\tkey: 'uploadPhoto',\n\t\tvalue: function uploadPhoto(e) {\n\t\t\te.preventDefault();\n\n\t\t\tvar self = this;\n\t\t\tvar target = e.currentTarget;\n\t\t\tvar photo = target.parentElement.parentElement.parentElement.parentElement.parentElement;\n\t\t\tvar notice = this.noticeRef.current;\n\t\t\tvar photoContainer = this.imageRef.current;\n\t\t\t/**\n * Bail if image was imported and the user clicks on Add to Media Library\n */\n\t\t\tif (target.classList.contains('download') && this.state.attachmentId !== '') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tphotoContainer.classList.add('uploading');\n\t\t\tphoto.classList.add('in-progress');\n\t\t\tnotice.innerHTML = __('Downloading Image...', 'themeisle-companion');\n\t\t\tthis.inProgress = true;\n\n\t\t\t/**\n * Skip the uploading image part if image was already uploaded\n */\n\t\t\tif (this.state.attachmentId !== '') {\n\t\t\t\tthis.doPhotoAction(target, photo, this.state.attachmentId);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (typeof this.fullSize === 'undefined') {\n\t\t\t\tself.uploadError(target, photo, __('Error! Empty image.', 'themeisle-companion'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append('action', 'handle-request-' + mystock_import.slug);\n\t\t\tformData.append('url', this.fullSize);\n\t\t\tformData.append('security', mystock_import.nonce);\n\n\t\t\twp.apiFetch({\n\t\t\t\turl: mystock_import.ajaxurl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData\n\t\t\t}).then(function (res) {\n\t\t\t\tif (res && res.success === true && res.data.attachment.id) {\n\t\t\t\t\tself.doPhotoAction(target, photo, res.data.attachment.id);\n\t\t\t\t\tself.setState({ attachmentId: res.data.attachment.id });\n\t\t\t\t} else {\n\t\t\t\t\tself.uploadError(target, photo, res.data.msg);\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tself.uploadError(target, photo, __('There was an error. Please try again.', 'themeisle-companion'));\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Insert image into post or set image as thumbnail\n *\n * @param target element clicked item\n * @param photo element current photo element\n * @param attachmentId attachement id\n */\n\n\t}, {\n\t\tkey: 'doPhotoAction',\n\t\tvalue: function doPhotoAction(target, photo, attachmentId) {\n\t\t\tthis.uploadComplete(target, photo, attachmentId);\n\n\t\t\tif (this.setAsFeaturedImage) {\n\t\t\t\tthis.SetFeaturedImage(attachmentId);\n\t\t\t\tthis.setAsFeaturedImage = false;\n\t\t\t}\n\n\t\t\tif (this.insertIntoPost) {\n\t\t\t\tthis.InsertImage(this.fullSize, this.imgTitle);\n\t\t\t\tthis.insertIntoPost = false;\n\t\t\t}\n\t\t}\n\n\t\t/*\n * uploadError\n * Function runs when error occurs on upload or resize\n *\n * @param target element Current clicked item\n * @param photo element Nearest parent .photo\n * @param msg string Error Msg\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'uploadError',\n\t\tvalue: function uploadError(target, photo, msg) {\n\t\t\tvar imageWrapper = this.imageRef.current;\n\t\t\timageWrapper.classList.remove('uploading');\n\t\t\timageWrapper.classList.add('errors');\n\n\t\t\tvar photoContainer = this.photoContainerRef.current;\n\t\t\tphotoContainer.classList.remove('in-progress');\n\n\t\t\ttarget.parentNode.parentNode.classList.add('disabled');\n\t\t\tsetTimeout(function () {\n\t\t\t\timageWrapper.classList.remove('errors');\n\t\t\t\ttarget.parentNode.parentNode.classList.remove('disabled');\n\t\t\t}, 3000, target, photo);\n\n\t\t\tdispatchNotice(msg);\n\n\t\t\tthis.inProgress = false;\n\t\t\tconsole.warn(msg);\n\t\t}\n\n\t\t/*\n * uploadComplete\n * Function runs when upload has completed\n *\n * @param target element clicked item\n * @param photo element Nearest parent .photo\n * @param msg string Success Msg\n * @param url string The attachment edit link\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'uploadComplete',\n\t\tvalue: function uploadComplete(target, photo, attachment) {\n\n\t\t\tthis.setState({ attachmentId: attachment });\n\n\t\t\tvar photoContainer = this.imageRef.current;\n\t\t\tphotoContainer.classList.remove('uploading');\n\t\t\tphotoContainer.classList.add('success');\n\n\t\t\tphoto.classList.remove('in-progress');\n\t\t\tphoto.classList.add('uploaded', 'done');\n\t\t\ttarget.parentNode.parentNode.classList.add('disabled');\n\t\t\tsetTimeout(function () {\n\t\t\t\tphotoContainer.classList.remove('success');\n\t\t\t\tphoto.classList.remove('uploaded');\n\t\t\t\ttarget.parentNode.parentNode.classList.remove('disabled');\n\t\t\t}, 3000, target, photo);\n\t\t\tthis.inProgress = false;\n\n\t\t\tif (target.classList.contains('download')) {\n\t\t\t\tdispatchNotice(__('Image was added to Media Library.', 'themeisle-companion'));\n\t\t\t}\n\t\t\tif (target.classList.contains('set-featured')) {\n\t\t\t\tdispatchNotice(__('Image was set as featured image.', 'themeisle-companion'));\n\t\t\t}\n\t\t\tif (target.classList.contains('insert')) {\n\t\t\t\tdispatchNotice(__('Image was inserted in post content.', 'themeisle-companion'));\n\t\t\t}\n\t\t}\n\n\t\t/*\n * setFeaturedImageClick\n * Function used to trigger a download and then set as featured image\n */\n\n\t}, {\n\t\tkey: 'setFeaturedImageClick',\n\t\tvalue: function setFeaturedImageClick(e) {\n\t\t\tvar target = e.currentTarget;\n\t\t\tif (!target) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.setAsFeaturedImage = true;\n\t\t\tthis.uploadPhoto(e);\n\t\t}\n\n\t\t/*\n * insertImageIntoPost\n * Function used to insert an image directly into the block (Gutenberg) editor.\n *\n * @since 4.0\n */\n\n\t}, {\n\t\tkey: 'insertImageIntoPost',\n\t\tvalue: function insertImageIntoPost(e) {\n\t\t\tvar target = e.currentTarget;\n\t\t\tif (!target) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.insertIntoPost = true;\n\t\t\tthis.uploadPhoto(e);\n\t\t}\n\n\t\t/**\n * Render photo image.\n *\n * @returns {*}\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this2 = this;\n\n\t\t\treturn React.createElement(\n\t\t\t\t'article',\n\t\t\t\t{ className: 'photo', ref: this.photoContainerRef },\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'photo--wrap' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{ className: 'img-wrap' },\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: 'upload',\n\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\tref: this.imageRef\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tReact.createElement('img', { src: this.img, alt: this.imgTitle }),\n\t\t\t\t\t\t\tReact.createElement('div', { className: 'status' })\n\t\t\t\t\t\t),\n\t\t\t\t\t\tReact.createElement('div', { ref: this.noticeRef, className: 'notice-msg' }),\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t{ className: 'user-controls' },\n\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\t\t{ className: 'photo-options' },\n\t\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t\t\t{ className: 'download fade',\n\t\t\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\t\t\treturn _this2.uploadPhoto(e);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttitle: __('Add to Media Library', 'themeisle-companion')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-download' })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t\t\t{ className: 'set-featured fade',\n\t\t\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\t\t\treturn _this2.setFeaturedImageClick(e);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttitle: __('Set as featured image', 'themeisle-companion')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-format-image' })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t\t\t'a',\n\t\t\t\t\t\t\t\t\t{ className: 'insert fade',\n\t\t\t\t\t\t\t\t\t\thref: '#',\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\t\t\treturn _this2.insertImageIntoPost(e);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttitle: __('Insert into post', 'themeisle-companion')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-plus' })\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn Photo;\n}(Component);\n\nexports.default = Photo;\n\n//# sourceURL=webpack:///./obfx_modules/mystock-import/js/src/components/Photo.js?");
|
1108 |
|
1109 |
/***/ }),
|
1110 |
|
1116 |
/***/ (function(module, exports, __webpack_require__) {
|
1117 |
|
1118 |
"use strict";
|
1119 |
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\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\nvar _flickrSdk = __webpack_require__(/*! flickr-sdk */ \"./node_modules/flickr-sdk/index.js\");\n\nvar _flickrSdk2 = _interopRequireDefault(_flickrSdk);\n\nvar _Photo = __webpack_require__(/*! ./Photo */ \"./obfx_modules/mystock-import/js/src/components/Photo.js\");\n\nvar _Photo2 = _interopRequireDefault(_Photo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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; } /* global mystock_import */\n\n\nvar Spinner = wp.components.Spinner;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar __ = wp.i18n.__;\n\nvar PhotoList = function (_Component) {\n\t_inherits(PhotoList, _Component);\n\n\tfunction PhotoList(props) {\n\t\t_classCallCheck(this, PhotoList);\n\n\t\tvar _this = _possibleConstructorReturn(this, (PhotoList.__proto__ || Object.getPrototypeOf(PhotoList)).call(this, props));\n\n\t\t_this.apiKey = mystock_import.api_key;\n\t\t_this.userId = mystock_import.user_id;\n\t\t_this.perPage = mystock_import.per_page;\n\n\t\t_this.flickr = new _flickrSdk2.default(_this.apiKey);\n\t\t_this.results = _this.props.results ? _this.props.results : [];\n\t\t_this.state = { results: _this.results };\n\n\t\t_this.isSearch = false;\n\t\t_this.search_term = '';\n\t\t_this.nothingFound = false;\n\n\t\t_this.isLoading = false; // loading flag\n\t\t_this.isDone = false; // Done flag - no photos remain\n\n\t\t_this.page = _this.props.page;\n\n\t\t_this.SetFeaturedImage = _this.props.SetFeaturedImage ? _this.props.SetFeaturedImage.bind(_this) : '';\n\t\t_this.InsertImage = _this.props.InsertImage ? _this.props.InsertImage.bind(_this) : '';\n\n\t\t_this.errorRef = createRef();\n\t\t_this.searchRef = createRef();\n\t\treturn _this;\n\t}\n\n\t/**\n * test()\n * Test access to the Flickr API\n *\n * @since 3.2\n */\n\n\n\t_createClass(PhotoList, [{\n\t\tkey: 'test',\n\t\tvalue: function test() {\n\t\t\tvar self = this;\n\t\t\tvar target = this.errorRef.current;\n\t\t\tthis.flickr.test.echo(this.apiKey).then(function (res) {\n\t\t\t\tif (res.statusCode < 200 || res.statusCode >= 400) {\n\t\t\t\t\tself.renderTestError(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Render test error\n *\n * @param target\n */\n\n\t}, {\n\t\tkey: 'renderTestError',\n\t\tvalue: function renderTestError(target) {\n\t\t\ttarget.classList.add('active');\n\t\t\ttarget.innerHTML = __('There was an error accessing the server. Please try again later. If you still receive this error, contact the support team.', 'themeisle-companion');\n\t\t}\n\n\t\t/**\n * getPhotos\n * Load next set of photos, infinite scroll style\n *\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'getPhotos',\n\t\tvalue: function getPhotos() {\n\t\t\tvar self = this;\n\t\t\tthis.page = parseInt(this.page) + 1;\n\t\t\tthis.isLoading = true;\n\n\t\t\tif (this.isSearch) {\n\t\t\t\tthis.doSearch(this.search_term, true);\n\t\t\t} else {\n\t\t\t\tvar args = {\n\t\t\t\t\t'api_key': this.apiKey,\n\t\t\t\t\t'user_id': this.userId,\n\t\t\t\t\t'per_page': this.perPage,\n\t\t\t\t\t'extras': 'url_m, url_l',\n\t\t\t\t\t'page': this.page\n\t\t\t\t};\n\t\t\t\tthis.flickr.people.getPublicPhotos(args).then(function (res) {\n\t\t\t\t\tvar photos = res.body.photos.photo;\n\n\t\t\t\t\tphotos.map(function (data) {\n\t\t\t\t\t\tself.results.push(data);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Check for returned data\n\t\t\t\t\tself.checkTotalResults(photos.length);\n\n\t\t\t\t\t// Update Props\n\t\t\t\t\tself.setState({ results: self.results });\n\t\t\t\t}).catch(function (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tself.isLoading = false;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t/**\n * checkTotalResults\n * A checker to determine is there are remaining search results.\n *\n * @param num int Total search results\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'checkTotalResults',\n\t\tvalue: function checkTotalResults(num) {\n\t\t\tthis.isDone = num < this.perPage;\n\t\t}\n\n\t\t/**\n * search()\n * Trigger Unsplash Search\n *\n * @param e element the search form\n * @since 3.0\n */\n\n\t}, {\n\t\tkey: 'search',\n\t\tvalue: function search(e) {\n\n\t\t\te.preventDefault();\n\t\t\tvar input = this.searchRef.current;\n\t\t\tvar term = input.value;\n\t\t\tif (term.length > 2) {\n\t\t\t\tinput.classList.add('searching');\n\t\t\t\tthis.search_term = term;\n\t\t\t\tthis.nothingFound = false;\n\t\t\t\tthis.isSearch = true;\n\t\t\t\tthis.page = 0;\n\t\t\t\tthis.doSearch(this.search_term);\n\t\t\t} else {\n\t\t\t\tinput.focus();\n\t\t\t}\n\t\t}\n\n\t\t/**\n * doSearch\n * Run the search\n *\n * @param term string the search term\n * @param append bool should append\n * @since 3.0\n * @updated 3.1\n */\n\n\t}, {\n\t\tkey: 'doSearch',\n\t\tvalue: function doSearch(term) {\n\t\t\tvar append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n\n\t\t\tvar self = this;\n\t\t\tthis.page = parseInt(this.page) + 1;\n\t\t\tvar input = this.searchRef.current;\n\n\t\t\tif (append !== true) {\n\t\t\t\tself.results = [];\n\t\t\t\tself.setState({ results: [] });\n\t\t\t}\n\t\t\tvar args = {\n\t\t\t\t'api_key': this.apiKey,\n\t\t\t\t'user_id': this.userId,\n\t\t\t\t'text': this.search_term,\n\t\t\t\t'per_page': this.perPage,\n\t\t\t\t'extras': 'url_m, url_l',\n\t\t\t\t'page': this.page\n\t\t\t};\n\t\t\tthis.flickr.photos.search(args).then(function (res) {\n\t\t\t\tvar photos = res.body.photos.photo;\n\t\t\t\tif (photos.length === 0) {\n\t\t\t\t\tself.nothingFound = true;\n\t\t\t\t}\n\n\t\t\t\tif (photos.length === 0 && self.append === false) {\n\t\t\t\t\tself.nothingFound = true;\n\t\t\t\t}\n\n\t\t\t\tphotos.map(function (data) {\n\t\t\t\t\tself.results.push(data);\n\t\t\t\t});\n\n\t\t\t\t// Check for returned data\n\t\t\t\tself.checkTotalResults(photos.length);\n\n\t\t\t\t// Update Props\n\t\t\t\tself.setState({ results: self.results });\n\n\t\t\t\tinput.classList.remove('searching');\n\t\t\t}).catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\tself.isLoading = false;\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Reset search\n */\n\n\t}, {\n\t\tkey: 'resetSearch',\n\t\tvalue: function resetSearch() {\n\t\t\tvar input = this.searchRef.current;\n\t\t\tthis.isSearch = false;\n\t\t\tthis.page = 0;\n\t\t\tthis.results = [];\n\t\t\tinput.value = '';\n\t\t\tthis.getPhotos();\n\t\t}\n\n\t\t/**\n * Component Init\n \t */\n\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.test();\n\n\t\t\tthis.page = 0;\n\t\t\tthis.getPhotos();\n\t\t}\n\n\t\t/**\n * render()\n * Render function for this component\n *\n * @returns {*}\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar button = '';\n\t\t\tvar spinner = '';\n\t\t\tif (!this.isDone) {\n\t\t\t\tbutton = React.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'load-more-wrap' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'button',\n\t\t\t\t\t\t{ type: 'button', className: 'button', onClick: function onClick() {\n\t\t\t\t\t\t\t\treturn _this2.getPhotos();\n\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t__('Load More Images', 'themeisle-companion')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.results.length === 0 && !this.nothingFound) {\n\t\t\t\tspinner = React.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'loading-wrap' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'h3',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t__('Loading images...', 'themeisle-companion')\n\t\t\t\t\t),\n\t\t\t\t\tReact.createElement(Spinner, null)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ id: 'photo-listing' },\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'search-field', id: 'search-bar' },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'form',\n\t\t\t\t\t\t{ onSubmit: function onSubmit(e) {\n\t\t\t\t\t\t\t\treturn _this2.search(e);\n\t\t\t\t\t\t\t}, autoComplete: 'off' },\n\t\t\t\t\t\tReact.createElement('input', { ref: this.searchRef, type: 'text', id: 'photo-search', placeholder: __('Search', 'themeisle-companion') }),\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t{ type: 'submit', id: 'photo-search-submit' },\n\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-search' })\n\t\t\t\t\t\t),\n\t\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t{ id: 'clear-search', onClick: function onClick(e) {\n\t\t\t\t\t\t\t\t\treturn _this2.resetSearch();\n\t\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t\tReact.createElement('span', { className: 'dashicons dashicons-no' })\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tReact.createElement('div', { ref: this.errorRef, className: 'error-messaging' }),\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ id: 'msp-photos' },\n\t\t\t\t\tspinner,\n\t\t\t\t\tthis.state.results.map(function (result, iterator) {\n\t\t\t\t\t\treturn React.createElement(_Photo2.default, { result: result, key: result.id + iterator, SetFeaturedImage: _this2.SetFeaturedImage, InsertImage: _this2.InsertImage });\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: this.nothingFound === true && this.isSearch ? 'no-results show' : 'no-results', title: this.props.title },\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'h3',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t__('Sorry, nothing matched your query.', 'themeisle-companion'),\n\t\t\t\t\t\t' '\n\t\t\t\t\t),\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\t'p',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t__('Please try with another word.', 'themeisle-companion'),\n\t\t\t\t\t\t' '\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tbutton\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn PhotoList;\n}(Component);\n\nexports.default = PhotoList;\n\n//# sourceURL=webpack:///./obfx_modules/mystock-import/js/src/components/PhotoList.js?");
|
1120 |
|
1121 |
/***/ }),
|
1122 |
|
readme.md
CHANGED
@@ -109,6 +109,13 @@ Activating the Orbit Fox plugin is just like any other plugin. If you've uploade
|
|
109 |
|
110 |
## Changelog ##
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
##### [Version 2.9.7](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.6...v2.9.7) (2020-04-22)
|
113 |
|
114 |
- New Hidden field in the contact form widget
|
109 |
|
110 |
## Changelog ##
|
111 |
|
112 |
+
##### [Version 2.9.8](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.7...v2.9.8) (2020-04-28)
|
113 |
+
|
114 |
+
- Fixed importing multiple photos and better error handling in the Mystock module
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
##### [Version 2.9.7](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.6...v2.9.7) (2020-04-22)
|
120 |
|
121 |
- New Hidden field in the contact form widget
|
readme.txt
CHANGED
@@ -109,6 +109,13 @@ Activating the Orbit Fox plugin is just like any other plugin. If you've uploade
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
##### [Version 2.9.7](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.6...v2.9.7) (2020-04-22)
|
113 |
|
114 |
- New Hidden field in the contact form widget
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
##### [Version 2.9.8](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.7...v2.9.8) (2020-04-28)
|
113 |
+
|
114 |
+
- Fixed importing multiple photos and better error handling in the Mystock module
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
##### [Version 2.9.7](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.6...v2.9.7) (2020-04-22)
|
120 |
|
121 |
- New Hidden field in the contact form widget
|
themeisle-companion.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: Orbit Fox Companion
|
16 |
* Plugin URI: https://orbitfox.com/
|
17 |
* Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, Gutenberg blocks, and newly added Elementor/BeaverBuilder page builder widgets on each release.
|
18 |
-
* Version: 2.9.
|
19 |
* Author: Themeisle
|
20 |
* Author URI: https://orbitfox.com/
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: Orbit Fox Companion
|
16 |
* Plugin URI: https://orbitfox.com/
|
17 |
* Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, Gutenberg blocks, and newly added Elementor/BeaverBuilder page builder widgets on each release.
|
18 |
+
* Version: 2.9.8
|
19 |
* Author: Themeisle
|
20 |
* Author URI: https://orbitfox.com/
|
21 |
* License: GPL-2.0+
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitc31cefc01633492a0642e610989f86d3::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit413dcbd4187aee8bcb480ae76966a78a
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit413dcbd4187aee8bcb480ae76966a78a
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
-
$includeFiles = Composer\Autoload\
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitc31cefc01633492a0642e610989f86d3
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitc31cefc01633492a0642e610989f86d3', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitc31cefc01633492a0642e610989f86d3', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitc31cefc01633492a0642e610989f86d3::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInitc31cefc01633492a0642e610989f86d3::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequirec31cefc01633492a0642e610989f86d3($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequirec31cefc01633492a0642e610989f86d3($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
@@ -238,9 +238,9 @@ class ComposerStaticInit413dcbd4187aee8bcb480ae76966a78a
|
|
238 |
public static function getInitializer(ClassLoader $loader)
|
239 |
{
|
240 |
return \Closure::bind(function () use ($loader) {
|
241 |
-
$loader->prefixLengthsPsr4 =
|
242 |
-
$loader->prefixDirsPsr4 =
|
243 |
-
$loader->classMap =
|
244 |
|
245 |
}, null, ClassLoader::class);
|
246 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitc31cefc01633492a0642e610989f86d3
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
238 |
public static function getInitializer(ClassLoader $loader)
|
239 |
{
|
240 |
return \Closure::bind(function () use ($loader) {
|
241 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitc31cefc01633492a0642e610989f86d3::$prefixLengthsPsr4;
|
242 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitc31cefc01633492a0642e610989f86d3::$prefixDirsPsr4;
|
243 |
+
$loader->classMap = ComposerStaticInitc31cefc01633492a0642e610989f86d3::$classMap;
|
244 |
|
245 |
}, null, ClassLoader::class);
|
246 |
}
|