Orbit Fox by ThemeIsle - Version 2.2.5

Version Description

  • 2017-12-11
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Orbit Fox by ThemeIsle
Version 2.2.5
Comparing to
See all releases

Code changes from version 2.2.4 to 2.2.5

CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
 
 
 
 
 
 
 
2
  ### v2.2.4 - 2017-12-04
3
  **Changes:**
4
  * Fixed issue with menu icons module loading.
1
 
2
+ ### v2.2.5 - 2017-12-11
3
+ **Changes:**
4
+ * Better UX for CC0 images import module.
5
+ * Improved Elementor Services Widget.
6
+ * Added new templates to the template directory.
7
+
8
  ### v2.2.4 - 2017-12-04
9
  **Changes:**
10
  * Fixed issue with menu icons module loading.
core/assets/css/orbit-fox-admin.css CHANGED
@@ -8,7 +8,7 @@
8
  * Extends Spectre.css Library
9
  */
10
  /*
11
- Version: 2.2.4
12
  */
13
 
14
  /* Document
8
  * Extends Spectre.css Library
9
  */
10
  /*
11
+ Version: 2.2.5
12
  */
13
 
14
  /* Document
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.2.4';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
69
 
70
  $this->plugin_name = 'orbit-fox';
71
 
72
+ $this->version = '2.2.5';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
obfx_modules/elementor-widgets/js/obfx-grid.js CHANGED
@@ -59,4 +59,4 @@
59
  );
60
  }
61
 
62
- })(jQuery);
59
  );
60
  }
61
 
62
+ })( jQuery );
obfx_modules/elementor-widgets/widgets/class-obfx-elementor-widget-services.php CHANGED
@@ -85,25 +85,45 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
85
  'type' => Controls_Manager::REPEATER,
86
  'default' => [
87
  [
88
- 'title' => __( 'Responsive', 'themeisle-companion' ),
89
- 'text' => __( 'A lot of text here', 'themeisle-companion' ),
90
- 'icon' => 'fa fa-star',
91
  'color' => '#333333',
 
92
  ],
93
  [
94
- 'title' => __( 'Responsive', 'themeisle-companion' ),
95
- 'text' => __( 'A lot of text here', 'themeisle-companion' ),
96
- 'icon' => 'fa fa-star',
97
  'color' => '#333333',
 
98
  ],
99
  [
100
- 'title' => __( 'Responsive', 'themeisle-companion' ),
101
- 'text' => __( 'A lot of text here', 'themeisle-companion' ),
102
- 'icon' => 'fa fa-star',
103
  'color' => '#333333',
 
104
  ],
105
  ],
106
  'fields' => [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  [
108
  'type' => Controls_Manager::TEXT,
109
  'name' => 'title',
@@ -121,14 +141,28 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
121
  'type' => Controls_Manager::ICON,
122
  'name' => 'icon',
123
  'label' => __( 'Icon', 'themeisle-companion' ),
124
- 'default' => 'fa fa-star',
 
 
 
125
  ],
126
  [
127
  'type' => Controls_Manager::COLOR,
128
  'name' => 'color',
129
  'label_block' => false,
130
  'label' => __( 'Icon Color', 'themeisle-companion' ),
131
- 'default' => '#5764c6',
 
 
 
 
 
 
 
 
 
 
 
132
  ],
133
  [
134
  'type' => Controls_Manager::URL,
@@ -138,7 +172,7 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
138
  'placeholder' => __( 'https://example.com', 'themeisle-companion' ),
139
  ],
140
  ],
141
- 'title_field' => '<i style="color:{{color}}" class="{{icon}}"></i> {{title}}',
142
  ]
143
  );
144
 
@@ -195,7 +229,7 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
195
  $this->start_controls_section(
196
  'section_style_icon',
197
  [
198
- 'label' => __( 'Icon', 'themeisle-companion' ),
199
  'tab' => Controls_Manager::TAB_STYLE,
200
  ]
201
  );
@@ -214,9 +248,9 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
214
  ],
215
  ],
216
  'selectors' => [
217
- '{{WRAPPER}}.obfx-position-right .obfx-icon' => 'margin-left: {{SIZE}}{{UNIT}};',
218
- '{{WRAPPER}}.obfx-position-left .obfx-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
219
- '{{WRAPPER}}.obfx-position-top .obfx-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};',
220
  ],
221
  ]
222
  );
@@ -236,6 +270,7 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
236
  ],
237
  'selectors' => [
238
  '{{WRAPPER}} .obfx-icon' => 'font-size: {{SIZE}}{{UNIT}};',
 
239
  ],
240
  ]
241
  );
@@ -582,9 +617,14 @@ class OBFX_Elementor_Widget_Services extends Widget_Base {
582
  ?>
583
  <div class="obfx-service-box obfx-grid-col">
584
  <?php
585
- if ( ! empty( $service['icon'] ) ) {
586
  ?>
587
  <span class="obfx-icon-wrap"><i class="obfx-icon <?php echo esc_attr( $service['icon'] ); ?>" style="color: <?php echo esc_attr( $service['color'] ); ?>"></i></span>
 
 
 
 
 
588
  <?php
589
  }
590
  if ( ! empty( $service['title'] ) || ! empty( $service['text'] ) ) {
85
  'type' => Controls_Manager::REPEATER,
86
  'default' => [
87
  [
88
+ 'title' => __( 'Award-Winning​', 'themeisle-companion' ),
89
+ 'text' => __( 'Add some text here to describe your services to the page visitors.​', 'themeisle-companion' ),
90
+ 'icon' => 'fa fa-trophy',
91
  'color' => '#333333',
92
+ 'type' => 'icon',
93
  ],
94
  [
95
+ 'title' => __( 'Professional​', 'themeisle-companion' ),
96
+ 'text' => __( 'Add some text here to describe your services to the page visitors.​', 'themeisle-companion' ),
97
+ 'icon' => 'fa fa-suitcase',
98
  'color' => '#333333',
99
+ 'type' => 'icon',
100
  ],
101
  [
102
+ 'title' => __( 'Consulting​', 'themeisle-companion' ),
103
+ 'text' => __( 'Add some text here to describe your services to the page visitors.​', 'themeisle-companion' ),
104
+ 'icon' => 'fa fa-handshake-o',
105
  'color' => '#333333',
106
+ 'type' => 'icon',
107
  ],
108
  ],
109
  'fields' => [
110
+ [
111
+ 'type' => Controls_Manager::CHOOSE,
112
+ 'name' => 'type',
113
+ 'label_block' => true,
114
+ 'label' => __( 'Type', 'themeisle-companion' ),
115
+ 'default' => 'icon',
116
+ 'options' => [
117
+ 'icon' => [
118
+ 'title' => __( 'Icon', 'themeisle-companion' ),
119
+ 'icon' => 'fa fa-diamond',
120
+ ],
121
+ 'image' => [
122
+ 'title' => __( 'Image', 'themeisle-companion' ),
123
+ 'icon' => 'fa fa-photo',
124
+ ],
125
+ ],
126
+ ],
127
  [
128
  'type' => Controls_Manager::TEXT,
129
  'name' => 'title',
141
  'type' => Controls_Manager::ICON,
142
  'name' => 'icon',
143
  'label' => __( 'Icon', 'themeisle-companion' ),
144
+ 'default' => 'fa fa-diamond',
145
+ 'condition' => [
146
+ 'type' => 'icon',
147
+ ],
148
  ],
149
  [
150
  'type' => Controls_Manager::COLOR,
151
  'name' => 'color',
152
  'label_block' => false,
153
  'label' => __( 'Icon Color', 'themeisle-companion' ),
154
+ 'default' => '#333333',
155
+ 'condition' => [
156
+ 'type' => 'icon',
157
+ ],
158
+ ],
159
+ [
160
+ 'type' => Controls_Manager::MEDIA,
161
+ 'name' => 'image',
162
+ 'label' => __( 'Image', 'themeisle-companion' ),
163
+ 'condition' => [
164
+ 'type' => 'image',
165
+ ],
166
  ],
167
  [
168
  'type' => Controls_Manager::URL,
172
  'placeholder' => __( 'https://example.com', 'themeisle-companion' ),
173
  ],
174
  ],
175
+ 'title_field' => '{{title}}',
176
  ]
177
  );
178
 
229
  $this->start_controls_section(
230
  'section_style_icon',
231
  [
232
+ 'label' => __( 'Icon / Image', 'themeisle-companion' ),
233
  'tab' => Controls_Manager::TAB_STYLE,
234
  ]
235
  );
248
  ],
249
  ],
250
  'selectors' => [
251
+ '{{WRAPPER}}.obfx-position-right .obfx-icon, {{WRAPPER}}.obfx-position-right .obfx-image' => 'margin-left: {{SIZE}}{{UNIT}};',
252
+ '{{WRAPPER}}.obfx-position-left .obfx-icon, {{WRAPPER}}.obfx-position-left .obfx-image' => 'margin-right: {{SIZE}}{{UNIT}};',
253
+ '{{WRAPPER}}.obfx-position-top .obfx-icon, {{WRAPPER}}.obfx-position-top .obfx-image' => 'margin-bottom: {{SIZE}}{{UNIT}};',
254
  ],
255
  ]
256
  );
270
  ],
271
  'selectors' => [
272
  '{{WRAPPER}} .obfx-icon' => 'font-size: {{SIZE}}{{UNIT}};',
273
+ '{{WRAPPER}} .obfx-image' => 'max-width: {{SIZE}}{{UNIT}};',
274
  ],
275
  ]
276
  );
617
  ?>
618
  <div class="obfx-service-box obfx-grid-col">
619
  <?php
620
+ if ( $service['type'] === 'icon' && ! empty( $service['icon'] ) ) {
621
  ?>
622
  <span class="obfx-icon-wrap"><i class="obfx-icon <?php echo esc_attr( $service['icon'] ); ?>" style="color: <?php echo esc_attr( $service['color'] ); ?>"></i></span>
623
+ <?php
624
+ } elseif ( $service['type'] === 'image' && ! empty( $service['image']['url'] ) ) {
625
+ ?>
626
+
627
+ <span class="obfx-image-wrap"><img class="obfx-image" src="<?php echo esc_url( $service['image']['url'] ); ?>"/></span>
628
  <?php
629
  }
630
  if ( ! empty( $service['title'] ) || ! empty( $service['text'] ) ) {
obfx_modules/menu-icons/js/admin.js CHANGED
@@ -13,13 +13,13 @@ var obfx_menuicons_module_admin = function( $, menu_icons ) {
13
  'use strict';
14
 
15
  var default_icon = menu_icons.icon_default;
16
- // added blank icon for deselection.
17
- var all_icons = $.merge( [default_icon], $.merge( menu_icons.icons, $.iconpicker.defaultOptions.icons ) );
18
 
19
  function get_prefix(icon){
20
- if(typeof icon === 'undefined') {
21
- return '';
22
- }
23
  if (icon.match( /^fa-/ )) {
24
  return 'fa ';
25
  } else if (icon.match( /^dashicons-/ )) {
@@ -31,16 +31,22 @@ var obfx_menuicons_module_admin = function( $, menu_icons ) {
31
 
32
  // lets observe for new li tags added to the ul for when items are added to the menu.
33
  function listen_for_new_items(){
34
- var mutateObserver = new MutationObserver(function(records) {
35
- records.forEach(function(record) {
36
- $( record.addedNodes ).each(function(i, x){
37
- // process only the li elements.
38
- if ($( x ).prop( 'tagName' ) === 'LI') {
39
- add_icon( x );
 
 
 
 
 
 
40
  }
41
- });
42
- });
43
- });
44
 
45
  mutateObserver.observe( $( 'ul#menu-to-edit' ).get( 0 ), {childList: true} );
46
  }
@@ -55,41 +61,53 @@ var obfx_menuicons_module_admin = function( $, menu_icons ) {
55
  }
56
  var prefix = get_prefix( icon );
57
 
58
- if ( ! $( el ).find( '.menu-item-bar .menu-item-handle .item-title div' ).hasClass('obfx-menu-icon-container') ) {
59
- $( el ).find( '.menu-item-bar .menu-item-handle .item-title' ).prepend($(
60
- '<div class="input-group obfx-menu-icon-container" style="display: inline-block"><input class="form-control obfx-menu-icon ' + no_icon_class + '" value="' + icon + '" style="display: none" type="text" data-menu-item-id="' + item_id + '"><span class="input-group-addon" style="cursor: pointer"><i class="' + prefix + icon + '"></i></span></div>'
61
- ));
62
- }
 
 
63
 
64
  // ensure the popover comes over the menu bar.
65
  $( el ).find( '.menu-item-bar .menu-item-handle' ).css( 'overflow', 'initial' );
66
 
67
- $( el ).find( '.obfx-menu-icon ~ span' ).on('hover', function(){
68
- $(this).parent().find('.obfx-menu-icon').iconpicker({
69
- icons: all_icons,
70
- fullClassFormatter: function(val){
71
- return get_prefix( val ) + val;
72
- },
73
- hideOnSelect: true,
74
- placement: 'bottomLeft',
75
- selectedCustomClass: 'obfx-menu-icon-selected'
76
- }).on('iconpickerSelected', function(e) {
77
- var icon = e.iconpickerValue;
78
- var id = $( this ).attr( 'data-menu-item-id' );
79
- $( '#menu-item-icon-' + id ).val( icon );
80
- });
81
- });
 
 
 
 
 
 
82
 
83
  }
84
 
85
- $( function() {
86
- // add the existing menu item id to the dropdown as an attribute.
87
- $( 'li.menu-item' ).each(function(i, x){
88
- add_icon( x );
89
- });
 
 
 
90
 
91
- listen_for_new_items();
92
- } );
 
93
 
94
  };
95
 
13
  'use strict';
14
 
15
  var default_icon = menu_icons.icon_default;
16
+ // added blank icon for deselection.
17
+ var all_icons = $.merge( [default_icon], $.merge( menu_icons.icons, $.iconpicker.defaultOptions.icons ) );
18
 
19
  function get_prefix(icon){
20
+ if (typeof icon === 'undefined') {
21
+ return '';
22
+ }
23
  if (icon.match( /^fa-/ )) {
24
  return 'fa ';
25
  } else if (icon.match( /^dashicons-/ )) {
31
 
32
  // lets observe for new li tags added to the ul for when items are added to the menu.
33
  function listen_for_new_items(){
34
+ var mutateObserver = new MutationObserver(
35
+ function(records) {
36
+ records.forEach(
37
+ function(record) {
38
+ $( record.addedNodes ).each(
39
+ function(i, x){
40
+ // process only the li elements.
41
+ if ($( x ).prop( 'tagName' ) === 'LI') {
42
+ add_icon( x );
43
+ }
44
+ }
45
+ );
46
  }
47
+ );
48
+ }
49
+ );
50
 
51
  mutateObserver.observe( $( 'ul#menu-to-edit' ).get( 0 ), {childList: true} );
52
  }
61
  }
62
  var prefix = get_prefix( icon );
63
 
64
+ if ( ! $( el ).find( '.menu-item-bar .menu-item-handle .item-title div' ).hasClass( 'obfx-menu-icon-container' ) ) {
65
+ $( el ).find( '.menu-item-bar .menu-item-handle .item-title' ).prepend(
66
+ $(
67
+ '<div class="input-group obfx-menu-icon-container" style="display: inline-block"><input class="form-control obfx-menu-icon ' + no_icon_class + '" value="' + icon + '" style="display: none" type="text" data-menu-item-id="' + item_id + '"><span class="input-group-addon" style="cursor: pointer"><i class="' + prefix + icon + '"></i></span></div>'
68
+ )
69
+ );
70
+ }
71
 
72
  // ensure the popover comes over the menu bar.
73
  $( el ).find( '.menu-item-bar .menu-item-handle' ).css( 'overflow', 'initial' );
74
 
75
+ $( el ).find( '.obfx-menu-icon ~ span' ).on(
76
+ 'hover', function(){
77
+ $( this ).parent().find( '.obfx-menu-icon' ).iconpicker(
78
+ {
79
+ icons: all_icons,
80
+ fullClassFormatter: function(val){
81
+ return get_prefix( val ) + val;
82
+ },
83
+ hideOnSelect: true,
84
+ placement: 'bottomLeft',
85
+ selectedCustomClass: 'obfx-menu-icon-selected'
86
+ }
87
+ ).on(
88
+ 'iconpickerSelected', function(e) {
89
+ var icon = e.iconpickerValue;
90
+ var id = $( this ).attr( 'data-menu-item-id' );
91
+ $( '#menu-item-icon-' + id ).val( icon );
92
+ }
93
+ );
94
+ }
95
+ );
96
 
97
  }
98
 
99
+ $(
100
+ function() {
101
+ // add the existing menu item id to the dropdown as an attribute.
102
+ $( 'li.menu-item' ).each(
103
+ function(i, x){
104
+ add_icon( x );
105
+ }
106
+ );
107
 
108
+ listen_for_new_items();
109
+ }
110
+ );
111
 
112
  };
113
 
obfx_modules/mystock-import/css/media.css CHANGED
@@ -10,6 +10,7 @@
10
  outline: 0;
11
  opacity: 1;
12
  -webkit-overflow-scrolling: touch;
 
13
  }
14
 
15
  .obfx-preview {
@@ -178,7 +179,3 @@
178
  opacity: .5;
179
  filter: alpha(opacity=50);
180
  }
181
-
182
- .left-side {
183
- width: 70%;
184
- }
10
  outline: 0;
11
  opacity: 1;
12
  -webkit-overflow-scrolling: touch;
13
+ width: 95%;
14
  }
15
 
16
  .obfx-preview {
179
  opacity: .5;
180
  filter: alpha(opacity=50);
181
  }
 
 
 
 
obfx_modules/mystock-import/inc/photos.php CHANGED
@@ -7,7 +7,6 @@
7
 
8
  ?>
9
  <div id='obfx-mystock' data-pagenb="1">
10
- <div class="left-side">
11
  <ul class='obfx-image-list'>
12
  <?php
13
  if ( ! empty( $urls ) ) {
@@ -16,7 +15,7 @@
16
  if ( ! empty( $pid ) ) {
17
  $thumb = $photo['url_m'];
18
  ?>
19
- <li class='obfx-image' data-page="1" data-pid="<?php echo esc_attr( $pid ); ?>">
20
  <div class="obfx-preview">
21
  <div class="thumbnail">
22
  <div class="centered">
@@ -36,6 +35,4 @@
36
  ?>
37
  </ul>
38
  <div class="obfx_spinner"></div>
39
- <div class="media-sidebar"></div>
40
- </div>
41
  </div>
7
 
8
  ?>
9
  <div id='obfx-mystock' data-pagenb="1">
 
10
  <ul class='obfx-image-list'>
11
  <?php
12
  if ( ! empty( $urls ) ) {
15
  if ( ! empty( $pid ) ) {
16
  $thumb = $photo['url_m'];
17
  ?>
18
+ <li class='obfx-image' data-page="1" data-pid="<?php echo esc_attr( $pid ); ?>" data-url="<?php echo esc_attr( $photo['url_l'] ); ?>">
19
  <div class="obfx-preview">
20
  <div class="thumbnail">
21
  <div class="centered">
35
  ?>
36
  </ul>
37
  <div class="obfx_spinner"></div>
 
 
38
  </div>
obfx_modules/mystock-import/init.php CHANGED
@@ -82,9 +82,9 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
82
 
83
  /*Get tab content*/
84
  $this->loader->add_action( 'wp_ajax_get-tab-' . $this->slug, $this, 'get_tab_content' );
85
- $this->loader->add_action( 'wp_ajax_' . $this->slug, $this, 'display_photo_sizes' );
86
  $this->loader->add_action( 'wp_ajax_infinite-' . $this->slug, $this, 'infinite_scroll' );
87
  $this->loader->add_action( 'wp_ajax_handle-request-' . $this->slug, $this, 'handle_request' );
 
88
  }
89
 
90
  /**
@@ -132,18 +132,12 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
132
  function handle_request() {
133
  check_ajax_referer( $this->slug . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ), 'security' );
134
 
135
- if ( ! isset( $_POST['formdata'] ) ) {
136
  echo esc_html__( 'Image failed to upload', 'themeisle-companion' );
137
  wp_die();
138
  }
139
 
140
- $data = array();
141
- parse_str( $_POST['formdata'], $data );
142
- if ( empty( $data['imagesizes'] ) ) {
143
- echo esc_html__( 'Image failed to upload', 'themeisle-companion' );
144
- wp_die();
145
- }
146
- $url = $data['imagesizes'];
147
  $name = basename( $url );
148
  $tmp_file = download_url( $url );
149
  if ( is_wp_error( $tmp_file ) ) {
@@ -164,6 +158,8 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
164
  wp_die();
165
  }
166
  wp_update_attachment_metadata( $image_id, $attach_data );
 
 
167
  }
168
 
169
  /**
@@ -197,62 +193,6 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
197
  wp_die();
198
  }
199
 
200
- /**
201
- * Ajax function to display image sizes.
202
- */
203
- public function display_photo_sizes() {
204
-
205
- check_ajax_referer( $this->slug . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ), 'security' );
206
-
207
- $photo_id = $_POST['pid'];
208
- $page = $_POST['page'];
209
- if ( empty( $photo_id ) || empty( $page ) ) {
210
- wp_die();
211
- }
212
- $data = $this->get_images( $page );
213
- $photo = array_filter( $data, function ( $e ) use ( $photo_id ) {
214
- return $e['id'] === $photo_id;
215
- }, true );
216
- $photo = array_reverse( $photo );
217
- $photo = array_pop( $photo );
218
- if ( empty( $photo ) ) {
219
- wp_die();
220
- }
221
- $photo_sizes = array(
222
- 'url_sq' => __( 'Square', 'themeisle-companion' ),
223
- 'url_q' => __( 'Large Square', 'themeisle-companion' ),
224
- 'url_t' => __( 'Thumbnail', 'themeisle-companion' ),
225
- 'url_s' => __( 'Small', 'themeisle-companion' ),
226
- 'url_n' => __( 'Small 320', 'themeisle-companion' ),
227
- 'url_m' => __( 'Medium', 'themeisle-companion' ),
228
- 'url_z' => __( 'Medium 640', 'themeisle-companion' ),
229
- 'url_c' => __( 'Medium 800', 'themeisle-companion' ),
230
- 'url_l' => __( 'Large', 'themeisle-companion' ),
231
- 'url_o' => __( 'Original', 'themeisle-companion' ),
232
- );
233
-
234
- /**
235
- * Creating response for selected image
236
- */
237
- $response = '<div class="attachment-details">';
238
- $response .= '<form id="importmsp" method="post">';
239
- $response .= '<h2>' . esc_html__( 'Attachement display settings', 'themeisle-companion' ) . '</h2><hr/>';
240
- $response .= '<label class="attachement-settings">';
241
- $response .= '<span class="name">' . esc_html__( 'Size', 'themeisle-companion' ) . '</span>';
242
- $response .= '<select name="imagesizes">';
243
- foreach ( $photo_sizes as $key => $label ) {
244
- $response .= '<option value="' . esc_url( $photo[ $key ] ) . '">' . esc_html( $label ) . '</option>';
245
- }
246
- $response .= '</select>';
247
- $response .= '</label>';
248
-
249
- $response .= '<input type="submit" class="button obfx-import-media" value="Import media"/>';
250
- $response .= '</form>';
251
- $response .= '</div>';
252
- echo $response;
253
- wp_die();
254
- }
255
-
256
  /**
257
  * Method that returns an array of scripts and styles to be loaded
258
  * for the front end part.
@@ -293,6 +233,10 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
293
  'upload_image_complete' => esc_html__( 'Your image was imported. Go to Media Library tab to use it.', 'themeisle-companion' ),
294
  'load_more' => esc_html__( 'Loading more photos...', 'themeisle-companion' ),
295
  'tab_name' => esc_html__( 'MyStock Library', 'themeisle-companion' ),
 
 
 
 
296
  ),
297
  'slug' => $this->slug,
298
  'pages' => get_transient( $this->slug . 'photos_' . self::MAX_IMAGES . '_pages' ),
@@ -319,4 +263,9 @@ class Mystock_Import_OBFX_Module extends Orbit_Fox_Module_Abstract {
319
  public function options() {
320
  return array();
321
  }
 
 
 
 
 
322
  }
82
 
83
  /*Get tab content*/
84
  $this->loader->add_action( 'wp_ajax_get-tab-' . $this->slug, $this, 'get_tab_content' );
 
85
  $this->loader->add_action( 'wp_ajax_infinite-' . $this->slug, $this, 'infinite_scroll' );
86
  $this->loader->add_action( 'wp_ajax_handle-request-' . $this->slug, $this, 'handle_request' );
87
+ $this->loader->add_filter( 'media_view_strings', $this, 'media_view_strings' );
88
  }
89
 
90
  /**
132
  function handle_request() {
133
  check_ajax_referer( $this->slug . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ), 'security' );
134
 
135
+ if ( ! isset( $_POST['url'] ) ) {
136
  echo esc_html__( 'Image failed to upload', 'themeisle-companion' );
137
  wp_die();
138
  }
139
 
140
+ $url = $_POST['url'];
 
 
 
 
 
 
141
  $name = basename( $url );
142
  $tmp_file = download_url( $url );
143
  if ( is_wp_error( $tmp_file ) ) {
158
  wp_die();
159
  }
160
  wp_update_attachment_metadata( $image_id, $attach_data );
161
+
162
+ wp_send_json_success( array( 'id' => $image_id ) );
163
  }
164
 
165
  /**
193
  wp_die();
194
  }
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  /**
197
  * Method that returns an array of scripts and styles to be loaded
198
  * for the front end part.
233
  'upload_image_complete' => esc_html__( 'Your image was imported. Go to Media Library tab to use it.', 'themeisle-companion' ),
234
  'load_more' => esc_html__( 'Loading more photos...', 'themeisle-companion' ),
235
  'tab_name' => esc_html__( 'MyStock Library', 'themeisle-companion' ),
236
+ 'featured_image_new' => esc_html__( 'Import & set featured image', 'themeisle-companion' ),
237
+ 'insert_image_new' => esc_html__( 'Import & insert image', 'themeisle-companion' ),
238
+ 'featured_image' => $this->strings['setFeaturedImage'],
239
+ 'insert_image' => $this->strings['insertIntoPost'],
240
  ),
241
  'slug' => $this->slug,
242
  'pages' => get_transient( $this->slug . 'photos_' . self::MAX_IMAGES . '_pages' ),
263
  public function options() {
264
  return array();
265
  }
266
+
267
+ public function media_view_strings( $strings ) {
268
+ $this->strings = $strings;
269
+ return $strings;
270
+ }
271
  }
obfx_modules/mystock-import/js/admin.js CHANGED
@@ -27,6 +27,19 @@
27
  media.view.MediaFrame.Select.prototype.bindHandlers = function () {
28
  bindHandlers.apply( this, arguments );
29
  this.on( 'content:create:mystock', this.mystockContent, this );
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  };
31
 
32
  media.view.MediaFrame.Select.prototype.mystockContent = function ( contentRegion ) {
@@ -71,13 +84,14 @@
71
  this.loadContent( container,this );
72
  this.selectItem();
73
  this.deselectItem();
74
- this.displayDetails();
75
  this.handleRequest();
76
  },
77
 
78
  showSpinner: function(container) {
79
  $( container ).find( '.obfx-image-list' ).addClass( 'obfx_loading' );
80
  $( container ).find( '.obfx_spinner' ).show();
 
 
81
  },
82
  hideSpinner: function(container) {
83
  $( container ).find( '.obfx-image-list' ).removeClass( 'obfx_loading' );
@@ -106,6 +120,8 @@
106
  'click', '.obfx-image', function () {
107
  $( '.obfx-image' ).removeClass( 'selected details' );
108
  $( this ).addClass( 'selected details' );
 
 
109
  }
110
  );
111
  },
@@ -115,7 +131,8 @@
115
  'click', '.obfx-image-check', function (e) {
116
  e.stopPropagation();
117
  $( this ).parent().removeClass( 'selected details' );
118
- $( '#obfx-mystock' ).find( '.media-sidebar' ).html( '' );
 
119
  }
120
  );
121
  },
@@ -152,6 +169,7 @@
152
  imageList.append( response );
153
  }
154
  frame.hideSpinner( container );
 
155
  }
156
 
157
  }
@@ -161,66 +179,61 @@
161
  );
162
  },
163
 
164
- displayDetails : function () {
165
  $( document ).on(
166
- 'click', '.obfx-image', function () {
167
- var th = $( this );
168
-
169
  $.ajax(
170
  {
171
- type : 'POST',
172
  data : {
173
- 'action': mystock_import.slug,
174
- 'pid' : $( this ).data( 'pid' ),
175
- 'page' : $( this ).data( 'page' ),
176
  'security' : mystock_import.nonce
177
  },
178
  url : mystock_import.ajaxurl,
179
- beforeSend : function () {
180
- var text = mystock_import.l10n.fetch_image_sizes;
181
- var data = '<div class="attachement-loading"><h2>' + text + '</h2><div class="spinner is-active"></div></div>';
182
- th.parent().parent().find( '.media-sidebar' ).html( data );
183
- },
184
- success : function(response) {
185
- th.parent().parent().find( '.media-sidebar' ).html( response );
 
 
186
  }
187
-
188
  }
189
  );
190
  }
191
  );
192
- },
193
 
194
- handleRequest : function () {
195
  $( document ).on(
196
- 'submit','#obfx-mystock #importmsp', function (e) {
197
- var mediaContainer = $( '#obfx-mystock' ).find( '.media-sidebar' );
198
  $.ajax(
199
  {
200
- type : 'POST',
201
  data : {
202
  'action': 'handle-request-' + mystock_import.slug,
203
- 'formdata' : $( '#importmsp' ).serialize(),
204
  'security' : mystock_import.nonce
205
  },
206
  url : mystock_import.ajaxurl,
207
- beforeSend : function () {
208
- var text = mystock_import.l10n.upload_image;
209
- var data = '<div class="attachement-loading"><h2>' + text + '</h2><div class="spinner is-active"></div></div>';
210
- mediaContainer.html( data );
211
- },
212
- success : function() {
213
- var text = mystock_import.l10n.upload_image_complete;
214
- var data = '<div class="attachement-loading"><h2>' + text + '</h2></div>';
215
- mediaContainer.html( data );
216
- wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
217
  }
218
  }
219
  );
220
- e.preventDefault(); // avoid to execute the actual submit of the form.
221
  }
222
  );
223
  }
224
  }
225
  );
226
- })(jQuery);
27
  media.view.MediaFrame.Select.prototype.bindHandlers = function () {
28
  bindHandlers.apply( this, arguments );
29
  this.on( 'content:create:mystock', this.mystockContent, this );
30
+ this.on(
31
+ 'content:render:mystock', function(){
32
+ wp.media.frame.state().get( 'selection' ).reset();
33
+ $( document ).find( '.media-button-select' ).addClass( 'obfx-mystock-featured' ).html( mystock_import.l10n.featured_image_new );
34
+ $( document ).find( '.media-button-insert' ).addClass( 'obfx-mystock-insert' ).html( mystock_import.l10n.insert_image_new );
35
+ }, this
36
+ );
37
+ this.on(
38
+ 'content:render:browse content:render:upload', function(){
39
+ $( document ).find( '.media-button-select' ).removeClass( 'obfx-mystock-featured' ).html( mystock_import.l10n.featured_image );
40
+ $( document ).find( '.media-button-insert' ).removeClass( 'obfx-mystock-insert' ).html( mystock_import.l10n.insert_image );
41
+ }, this
42
+ );
43
  };
44
 
45
  media.view.MediaFrame.Select.prototype.mystockContent = function ( contentRegion ) {
84
  this.loadContent( container,this );
85
  this.selectItem();
86
  this.deselectItem();
 
87
  this.handleRequest();
88
  },
89
 
90
  showSpinner: function(container) {
91
  $( container ).find( '.obfx-image-list' ).addClass( 'obfx_loading' );
92
  $( container ).find( '.obfx_spinner' ).show();
93
+ $( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' ).addClass( 'obfx-mystock-featured' ).html( mystock_import.l10n.featured_image_new );
94
+ $( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' ).addClass( 'obfx-mystock-insert' ).html( mystock_import.l10n.insert_image_new );
95
  },
96
  hideSpinner: function(container) {
97
  $( container ).find( '.obfx-image-list' ).removeClass( 'obfx_loading' );
120
  'click', '.obfx-image', function () {
121
  $( '.obfx-image' ).removeClass( 'selected details' );
122
  $( this ).addClass( 'selected details' );
123
+ $( document ).find( '.media-button-insert' ).removeAttr( 'disabled', 'disabled' ).addClass( 'obfx-mystock-insert' ).html( mystock_import.l10n.insert_image_new );
124
+ $( document ).find( '.media-button-select' ).removeAttr( 'disabled', 'disabled' ).addClass( 'obfx-mystock-featured' ).html( mystock_import.l10n.featured_image_new );
125
  }
126
  );
127
  },
131
  'click', '.obfx-image-check', function (e) {
132
  e.stopPropagation();
133
  $( this ).parent().removeClass( 'selected details' );
134
+ $( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' );
135
+ $( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' );
136
  }
137
  );
138
  },
169
  imageList.append( response );
170
  }
171
  frame.hideSpinner( container );
172
+ frame.deselectItem();
173
  }
174
 
175
  }
179
  );
180
  },
181
 
182
+ handleRequest : function () {
183
  $( document ).on(
184
+ 'click','.obfx-mystock-insert', function () {
185
+ $( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.upload_image );
 
186
  $.ajax(
187
  {
188
+ method : 'POST',
189
  data : {
190
+ 'action': 'handle-request-' + mystock_import.slug,
191
+ 'url' : $( '.obfx-image.selected' ).attr( 'data-url' ),
 
192
  'security' : mystock_import.nonce
193
  },
194
  url : mystock_import.ajaxurl,
195
+ success : function(data) {
196
+ $( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.insert_image_new );
197
+ if ( 'mystock' === wp.media.frame.content.mode() ) {
198
+ wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
199
+ wp.media.frame.content.mode( 'browse' );
200
+ $( document ).find( '.media-button-insert' ).attr( 'disabled', 'disabled' );
201
+ wp.media.frame.state().get( 'selection' ).reset( wp.media.attachment( data.data.id ) );
202
+ $( document ).find( '.media-button-insert' ).trigger( 'click' );
203
+ }
204
  }
 
205
  }
206
  );
207
  }
208
  );
 
209
 
 
210
  $( document ).on(
211
+ 'click','.obfx-mystock-featured', function () {
212
+ $( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.upload_image );
213
  $.ajax(
214
  {
215
+ method : 'POST',
216
  data : {
217
  'action': 'handle-request-' + mystock_import.slug,
218
+ 'url' : $( '.obfx-image.selected' ).attr( 'data-url' ),
219
  'security' : mystock_import.nonce
220
  },
221
  url : mystock_import.ajaxurl,
222
+ success : function(data) {
223
+ $( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' ).html( mystock_import.l10n.featured_image_new );
224
+ if ( 'mystock' === wp.media.frame.content.mode() ) {
225
+ wp.media.frame.content.get( 'library' ).collection.props.set( { '__ignore_force_update': (+ new Date()) } );
226
+ wp.media.frame.content.mode( 'browse' );
227
+ $( document ).find( '.media-button-select' ).attr( 'disabled', 'disabled' );
228
+ wp.media.frame.state().get( 'selection' ).reset( wp.media.attachment( data.data.id ) );
229
+ $( document ).find( '.media-button-select' ).trigger( 'click' );
230
+ }
 
231
  }
232
  }
233
  );
 
234
  }
235
  );
236
  }
237
  }
238
  );
239
+ })( jQuery );
obfx_modules/template-directory/init.php CHANGED
@@ -258,6 +258,34 @@ class Template_Directory_OBFX_Module extends Orbit_Fox_Module_Abstract {
258
  'screenshot' => esc_url( $repository_raw_url . 'pricing-elementor/screenshot.png' ),
259
  'import_file' => esc_url( $repository_raw_url . 'pricing-elementor/template.json' ),
260
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  );
262
 
263
  foreach ( $templates_list as $template => $properties ) {
258
  'screenshot' => esc_url( $repository_raw_url . 'pricing-elementor/screenshot.png' ),
259
  'import_file' => esc_url( $repository_raw_url . 'pricing-elementor/template.json' ),
260
  ),
261
+ 'material-homepage-elementor' => array(
262
+ 'title' => __( 'Material Homepage', 'themeisle-companion' ),
263
+ 'description' => __( 'A fancy description here', 'themeisle-companion' ),
264
+ 'demo_url' => 'https://demo.themeisle.com/hestia-pro-demo-content/material-homepage-elementor/',
265
+ 'screenshot' => esc_url( $repository_raw_url . 'material-homepage-elementor/screenshot.png' ),
266
+ 'import_file' => esc_url( $repository_raw_url . 'material-homepage-elementor/template.json' ),
267
+ ),
268
+ 'ether-elementor' => array(
269
+ 'title' => __( 'Ether - Landing Page', 'themeisle-companion' ),
270
+ 'description' => __( 'A fancy description here', 'themeisle-companion' ),
271
+ 'demo_url' => 'https://demo.themeisle.com/hestia-pro-demo-content/ether-elementor/',
272
+ 'screenshot' => esc_url( $repository_raw_url . 'ether-elementor/screenshot.png' ),
273
+ 'import_file' => esc_url( $repository_raw_url . 'ether-elementor/template.json' ),
274
+ ),
275
+ 'jason-elementor' => array(
276
+ 'title' => __( 'Jason - Landing Page', 'themeisle-companion' ),
277
+ 'description' => __( 'A fancy description here', 'themeisle-companion' ),
278
+ 'demo_url' => 'https://demo.themeisle.com/hestia-pro-demo-content/jason-elementor/',
279
+ 'screenshot' => esc_url( $repository_raw_url . 'jason-elementor/screenshot.png' ),
280
+ 'import_file' => esc_url( $repository_raw_url . 'jason-elementor/template.json' ),
281
+ ),
282
+ 'pulse-elementor' => array(
283
+ 'title' => __( 'Pulse - Landing Page', 'themeisle-companion' ),
284
+ 'description' => __( 'A fancy description here', 'themeisle-companion' ),
285
+ 'demo_url' => 'https://demo.themeisle.com/hestia-pro-demo-content/pulse-elementor/',
286
+ 'screenshot' => esc_url( $repository_raw_url . 'pulse-elementor/screenshot.png' ),
287
+ 'import_file' => esc_url( $repository_raw_url . 'pulse-elementor/template.json' ),
288
+ ),
289
  );
290
 
291
  foreach ( $templates_list as $template => $properties ) {
readme.md CHANGED
@@ -86,6 +86,13 @@ Activating the Orbit Fox Companion plugin is just like any other plugin. If you'
86
  3. Screenshot 3. How reports module is looking
87
 
88
  ## Changelog ##
 
 
 
 
 
 
 
89
  ### 2.2.4 - 2017-12-04 ###
90
 
91
  * Fixed issue with menu icons module loading.
86
  3. Screenshot 3. How reports module is looking
87
 
88
  ## Changelog ##
89
+ ### 2.2.5 - 2017-12-11 ###
90
+
91
+ * Better UX for CC0 images import module.
92
+ * Improved Elementor Services Widget.
93
+ * Added new templates to the template directory.
94
+
95
+
96
  ### 2.2.4 - 2017-12-04 ###
97
 
98
  * Fixed issue with menu icons module loading.
readme.txt CHANGED
@@ -86,6 +86,13 @@ Activating the Orbit Fox Companion plugin is just like any other plugin. If you'
86
  3. Screenshot 3. How reports module is looking
87
 
88
  == Changelog ==
 
 
 
 
 
 
 
89
  = 2.2.4 - 2017-12-04 =
90
 
91
  * Fixed issue with menu icons module loading.
86
  3. Screenshot 3. How reports module is looking
87
 
88
  == Changelog ==
89
+ = 2.2.5 - 2017-12-11 =
90
+
91
+ * Better UX for CC0 images import module.
92
+ * Improved Elementor Services Widget.
93
+ * Added new templates to the template directory.
94
+
95
+
96
  = 2.2.4 - 2017-12-04 =
97
 
98
  * Fixed issue with menu icons module loading.
themeisle-companion.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Orbit Fox Companion
16
  * Plugin URI: https://themeisle.com/plugins/orbit-fox-companion
17
  * Description: Enhances ThemeIsle's themes with extra functionality.
18
- * Version: 2.2.4
19
  * Author: Themeisle
20
  * Author URI: https://themeisle.com
21
  * License: GPL-2.0+
15
  * Plugin Name: Orbit Fox Companion
16
  * Plugin URI: https://themeisle.com/plugins/orbit-fox-companion
17
  * Description: Enhances ThemeIsle's themes with extra functionality.
18
+ * Version: 2.2.5
19
  * Author: Themeisle
20
  * Author URI: https://themeisle.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 ComposerAutoloaderInit3c37963727aa7ad2edc99b3bed9e1711::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit28f2d4a1d11f34b08053b24cf7e97e23::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit3c37963727aa7ad2edc99b3bed9e1711
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit3c37963727aa7ad2edc99b3bed9e1711
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit3c37963727aa7ad2edc99b3bed9e1711', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit3c37963727aa7ad2edc99b3bed9e1711', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit3c37963727aa7ad2edc99b3bed9e1711
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire3c37963727aa7ad2edc99b3bed9e1711($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire3c37963727aa7ad2edc99b3bed9e1711($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit28f2d4a1d11f34b08053b24cf7e97e23
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit28f2d4a1d11f34b08053b24cf7e97e23', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit28f2d4a1d11f34b08053b24cf7e97e23', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire28f2d4a1d11f34b08053b24cf7e97e23($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire28f2d4a1d11f34b08053b24cf7e97e23($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;