YITH WooCommerce Compare - Version 2.4.1

Version Description

Released on 13 October 2020

  • New: Support for WooCommerce 4.6.x
  • Update: Plugin framework
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Compare
Version 2.4.1
Comparing to
See all releases

Code changes from version 2.4.0 to 2.4.1

README.txt CHANGED
@@ -4,12 +4,12 @@ Contributors: yithemes
4
  Tags: yith, woocommerce compare, compare products, product compare, product comparison
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
- Stable tag: 2.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
12
- WooCommerce Compatible up to 4.5.x
13
 
14
  == Description ==
15
 
@@ -66,6 +66,11 @@ yith-woocommerce-compare-<WORDPRESS LOCALE >.mo
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
69
  = 2.4.0 = Released on 18 September 2020
70
 
71
  * New: Support for WooCommerce 4.5.x
@@ -408,8 +413,7 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woo
408
 
409
  == Upgrade notice ==
410
 
411
- = 2.4.0 = Released on 18 September 2020
412
 
413
- * New: Support for WooCommerce 4.5.x
414
- * Update: Plugin framework
415
- * Tweak: Improved plugin responsive style
4
  Tags: yith, woocommerce compare, compare products, product compare, product comparison
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
+ Stable tag: 2.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
12
+ WooCommerce Compatible up to 4.6.x
13
 
14
  == Description ==
15
 
66
 
67
  == Changelog ==
68
 
69
+ = 2.4.1 = Released on 13 October 2020
70
+
71
+ * New: Support for WooCommerce 4.6.x
72
+ * Update: Plugin framework
73
+
74
  = 2.4.0 = Released on 18 September 2020
75
 
76
  * New: Support for WooCommerce 4.5.x
413
 
414
  == Upgrade notice ==
415
 
416
+ = 2.4.1 = Released on 13 October 2020
417
 
418
+ * New: Support for WooCommerce 4.6.x
419
+ * Update: Plugin framework
 
init.php CHANGED
@@ -3,17 +3,17 @@
3
  * Plugin Name: YITH WooCommerce Compare
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
5
  * Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 2.4.0
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-compare
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.8
12
- * WC tested up to: 4.5
13
  *
14
  * @author YITH
15
  * @package YITH WooCommerce Compare
16
- * @version 2.4.0
17
  */
18
  /* Copyright 2020 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
@@ -58,7 +58,7 @@ if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
58
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
59
 
60
  if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
61
- define( 'YITH_WOOCOMPARE_VERSION', '2.4.0' );
62
  }
63
  if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
64
  define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Compare
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
5
  * Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 2.4.1
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-compare
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.8
12
+ * WC tested up to: 4.6
13
  *
14
  * @author YITH
15
  * @package YITH WooCommerce Compare
16
+ * @version 2.4.1
17
  */
18
  /* Copyright 2020 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
58
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
59
 
60
  if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
61
+ define( 'YITH_WOOCOMPARE_VERSION', '2.4.1' );
62
  }
63
  if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
64
  define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -23,9 +23,9 @@
23
  }
24
 
25
  .yith-plugin-fw-field-wrapper .yith-inline-fields > div {
26
- display: inline-block;
27
- vertical-align: middle;
28
- margin-right: 5px;
29
  }
30
 
31
  .yith-plugin-fw-field-wrapper span.desc {
@@ -286,7 +286,7 @@ ul.yit-icons-manager-list li.active {
286
 
287
  .yith-plugin-fw-checkbox-array__row {
288
  margin-bottom : 10px;
289
- display:flex;
290
  }
291
 
292
  .yith-plugin-fw-checkbox-array__row label {
@@ -298,10 +298,11 @@ ul.yit-icons-manager-list li.active {
298
  font-weight : 400 !important;
299
  }
300
 
301
- .yith-plugin-fw-checkbox-array__row label small{
302
- display:block;
303
- line-height: 2em;
304
  }
 
305
  /* ------- Sidebar Layout ------- */
306
  .yith-plugin-fw-sidebar-layout input[type="radio"] {
307
  display : none;
@@ -735,7 +736,7 @@ YITH UI
735
  font-size : 15px;
736
  padding : 7px 20px;
737
  border : 0;
738
- transition: background-color 0.3s linear;
739
  }
740
 
741
  .yith-plugin-ui .nav-tab:first-child {
@@ -745,9 +746,10 @@ YITH UI
745
  .yith-plugin-ui .nav-tab.yith-premium {
746
  background-color : #be421c;
747
  }
 
748
  .yith-plugin-ui .yith-nav-tab-wrapper .yith-plugin-fw-tab-element:hover > a.nav-tab:not(.nav-tab-active),
749
- .yith-plugin-ui .yith-nav-tab-wrapper .nav-tab:not(.nav-tab-active):hover{
750
- background-color:#207a92;
751
  }
752
 
753
  .yith-plugin-ui .nav-tab-active {
@@ -1225,8 +1227,8 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
1225
  font-size : 13px;
1226
  }
1227
 
1228
- .wc-wp-version-gte-53 .yith-plugin-ui .select2-container .select2-selection--single .select2-selection__arrow{
1229
- background-image: none;
1230
  }
1231
 
1232
  .yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before {
@@ -1438,7 +1440,7 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
1438
  background-color : #fff;
1439
  width : 58px;
1440
  height : 24px;
1441
- line-height :14px;
1442
  }
1443
 
1444
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
@@ -1475,7 +1477,7 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
1475
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
1476
  .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
1477
  background-color : #98aa36;
1478
- left: 38px;
1479
  }
1480
 
1481
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
@@ -2114,6 +2116,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2114
  margin-top : 10px;
2115
  line-height : 20px;
2116
  max-width : 40%;
 
2117
  }
2118
 
2119
  .yith-plugin-fw-option-with-description {
@@ -2174,17 +2177,23 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2174
  */
2175
 
2176
  .yith-plugin-fw-dimensions {
2177
- max-width : 400px;
 
2178
  }
2179
 
2180
  .yith-plugin-fw-dimensions__units {
2181
- text-align : right;
2182
- text-transform : uppercase;
 
 
 
 
 
2183
  }
2184
 
2185
  .yith-plugin-fw-dimensions__unit {
2186
  display : inline-block;
2187
- padding : 5px 3px;
2188
  cursor : pointer;
2189
  font-weight : 700;
2190
  }
@@ -2195,38 +2204,60 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2195
  }
2196
 
2197
  .yith-plugin-fw-dimensions__dimensions {
2198
- display : flex;
2199
- margin-top : 3px;
 
 
2200
  }
2201
 
2202
  .yith-plugin-fw-dimensions__dimension {
2203
  text-align : center;
 
2204
  }
2205
 
2206
- .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number {
2207
- width : 100% !important;
2208
- min-width : 0 !important;
2209
- border-radius : 0 !important;
2210
- border : 1px solid #d8d8d8 !important;
2211
- border-left : none !important;
2212
- height : 38px !important;
 
 
2213
  text-align : center;
 
 
 
 
 
 
 
 
2214
  }
2215
 
2216
- .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
2217
- border-left : 1px solid #d8d8d8 !important;
2218
- border-radius : 6px 0 0 6px !important;
 
2219
  }
2220
 
2221
- .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
2222
- border-radius : 0 6px 6px 0 !important;
 
 
 
 
 
2223
  }
2224
 
2225
- .yith-plugin-fw-dimensions__dimension__label {
 
 
2226
  text-transform : uppercase;
2227
- font-weight : 700;
2228
- color : #91959b;
2229
- font-size : .8em;
 
2230
  }
2231
 
2232
  .yith-plugin-fw-dimensions__linked {
@@ -2264,9 +2295,41 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2264
  .yith-plugin-ui .yith-toggle-row:not(.fixed) {
2265
  width : 80%;
2266
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2267
  }
2268
 
2269
  @media screen and (max-width : 1024px) {
 
2270
  .yith-plugin-ui .yith-add-box,
2271
  .yith-plugin-ui .yith-toggle-row:not(.fixed) {
2272
  width : 90%;
@@ -2291,6 +2354,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2291
  .yith-plugin-ui td.forminp-checkbox.three-cols fieldset:nth-child(3n+1) {
2292
  clear : initial;
2293
  }
 
2294
  }
2295
 
2296
  @media screen and (max-width : 782px) {
@@ -2322,76 +2386,86 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2322
  #yith-plugin-fw-panel table.form-table th.titledesc,
2323
  .yith-plugin-ui #plugin-fw-wc table.form-table td,
2324
  #yith-plugin-fw-panel table.form-table td.forminp {
2325
- padding: 20px 20px;
2326
  }
2327
 
2328
  .yith-plugin-ui #plugin-fw-wc table.form-table th.titledesc,
2329
  #yith-plugin-fw-panel table.form-table th.titledesc {
2330
- padding-bottom: 0;
2331
  }
2332
  }
2333
 
2334
- @media (max-width: 480px) {
2335
  .yith-plugin-ui .nav-tab {
2336
- font-size: 12px;
2337
  }
 
2338
  .yith-plugin-ui h2 {
2339
- padding: 20px 20px;
2340
  }
 
2341
  .yith-plugin-ui [type="radio"]:checked + label:before, .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
2342
- width: 14px;
2343
- height: 14px;
2344
  }
 
2345
  .yith-plugin-ui [type="radio"]:checked + label:after, .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
2346
- width: 10px;
2347
- height: 10px;
2348
- top: 3px;
2349
- left: 3px;
2350
  }
 
2351
  .yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
2352
- padding-left: 25px;
2353
  }
2354
 
2355
  .yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
2356
- font-size: 13px;
2357
  }
 
2358
  .yith-plugin-ui span.description {
2359
- font-size: 12px;
2360
  }
 
2361
  .yith-plugin-ui #plugin-fw-wc table.form-table th,
2362
  #yith-plugin-fw-panel table.form-table th.titledesc,
2363
  .yith-plugin-ui #plugin-fw-wc table.form-table td,
2364
  #yith-plugin-fw-panel table.form-table td.forminp {
2365
- padding: 15px 20px;
2366
  }
2367
 
2368
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span {
2369
- width: 48px;
2370
- height: 20px;
2371
  }
 
2372
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
2373
- top: 3px;
2374
- left: 3px;
2375
  }
 
2376
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
2377
- left: 30px;
2378
  }
 
2379
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after {
2380
- font-size: 11px;
2381
- padding: 0px 6px;
2382
- margin-top: 3px;
2383
  }
 
2384
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after {
2385
- font-size: 11px;
2386
- padding-left: 24px;
2387
- margin-top: 3px;
2388
  }
2389
 
2390
  .yith-plugin-fw .select2-container .select2-selection--single .select2-selection__rendered {
2391
- font-size: 14px;
2392
  }
2393
 
2394
  .yith-plugin-ui input {
2395
- font-size: 14px;
2396
  }
2397
  }
23
  }
24
 
25
  .yith-plugin-fw-field-wrapper .yith-inline-fields > div {
26
+ display : inline-block;
27
+ vertical-align : middle;
28
+ margin-right : 5px;
29
  }
30
 
31
  .yith-plugin-fw-field-wrapper span.desc {
286
 
287
  .yith-plugin-fw-checkbox-array__row {
288
  margin-bottom : 10px;
289
+ display : flex;
290
  }
291
 
292
  .yith-plugin-fw-checkbox-array__row label {
298
  font-weight : 400 !important;
299
  }
300
 
301
+ .yith-plugin-fw-checkbox-array__row label small {
302
+ display : block;
303
+ line-height : 2em;
304
  }
305
+
306
  /* ------- Sidebar Layout ------- */
307
  .yith-plugin-fw-sidebar-layout input[type="radio"] {
308
  display : none;
736
  font-size : 15px;
737
  padding : 7px 20px;
738
  border : 0;
739
+ transition : background-color 0.3s linear;
740
  }
741
 
742
  .yith-plugin-ui .nav-tab:first-child {
746
  .yith-plugin-ui .nav-tab.yith-premium {
747
  background-color : #be421c;
748
  }
749
+
750
  .yith-plugin-ui .yith-nav-tab-wrapper .yith-plugin-fw-tab-element:hover > a.nav-tab:not(.nav-tab-active),
751
+ .yith-plugin-ui .yith-nav-tab-wrapper .nav-tab:not(.nav-tab-active):hover {
752
+ background-color : #207a92;
753
  }
754
 
755
  .yith-plugin-ui .nav-tab-active {
1227
  font-size : 13px;
1228
  }
1229
 
1230
+ .wc-wp-version-gte-53 .yith-plugin-ui .select2-container .select2-selection--single .select2-selection__arrow {
1231
+ background-image : none;
1232
  }
1233
 
1234
  .yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before {
1440
  background-color : #fff;
1441
  width : 58px;
1442
  height : 24px;
1443
+ line-height : 14px;
1444
  }
1445
 
1446
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
1477
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
1478
  .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
1479
  background-color : #98aa36;
1480
+ left : 38px;
1481
  }
1482
 
1483
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
2116
  margin-top : 10px;
2117
  line-height : 20px;
2118
  max-width : 40%;
2119
+ min-width : min(100%, 360px);
2120
  }
2121
 
2122
  .yith-plugin-fw-option-with-description {
2177
  */
2178
 
2179
  .yith-plugin-fw-dimensions {
2180
+ display : flex;
2181
+ align-items : flex-end;
2182
  }
2183
 
2184
  .yith-plugin-fw-dimensions__units {
2185
+ flex : 1;
2186
+ display : flex;
2187
+ margin-left : 5px;
2188
+ width : calc(100% - 105px);
2189
+ flex-wrap : wrap;
2190
+ min-height : 38px;
2191
+ margin-bottom : -8px;
2192
  }
2193
 
2194
  .yith-plugin-fw-dimensions__unit {
2195
  display : inline-block;
2196
+ padding : 0 3px;
2197
  cursor : pointer;
2198
  font-weight : 700;
2199
  }
2204
  }
2205
 
2206
  .yith-plugin-fw-dimensions__dimensions {
2207
+ display : flex;
2208
+ margin : 0;
2209
+ align-items : flex-end;
2210
+ max-width : 400px;
2211
  }
2212
 
2213
  .yith-plugin-fw-dimensions__dimension {
2214
  text-align : center;
2215
+ flex : 1;
2216
  }
2217
 
2218
+ .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number,
2219
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number,
2220
+ .yith-plugin-ui .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number {
2221
+ width : 100%;
2222
+ min-width : 0;
2223
+ border-radius : 0;
2224
+ border : 1px solid #d8d8d8;
2225
+ border-left : none;
2226
+ height : 38px;
2227
  text-align : center;
2228
+ padding-right : 0;
2229
+ }
2230
+
2231
+ .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
2232
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
2233
+ .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
2234
+ border-left : 1px solid #d8d8d8;
2235
+ border-radius : 6px 0 0 6px;
2236
  }
2237
 
2238
+ .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
2239
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
2240
+ .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
2241
+ border-radius : 0 6px 6px 0;
2242
  }
2243
 
2244
+ .metaboxes-tab .yith-plugin-fw-dimensions__dimension__label,
2245
+ .yith-plugin-ui.metaboxes-tab label.yith-plugin-fw-dimensions__dimension__label {
2246
+ float : none;
2247
+ margin : 0;
2248
+ width : auto;
2249
+ font-weight : inherit;
2250
+ line-height : inherit;
2251
  }
2252
 
2253
+ .yith-plugin-fw-dimensions__dimension__label,
2254
+ .metaboxes-tab .yith-plugin-fw-dimensions__dimension__label,
2255
+ .yith-plugin-ui.metaboxes-tab label.yith-plugin-fw-dimensions__dimension__label {
2256
  text-transform : uppercase;
2257
+ letter-spacing : 2px;
2258
+ font-size : 11px;
2259
+ margin-bottom : 5px;
2260
+ display : inline-block;
2261
  }
2262
 
2263
  .yith-plugin-fw-dimensions__linked {
2295
  .yith-plugin-ui .yith-toggle-row:not(.fixed) {
2296
  width : 80%;
2297
  }
2298
+
2299
+
2300
+ .yith-plugin-ui .yith-add-box-row,
2301
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row,
2302
+ .yith-plugin-ui .yith-add-box-row label {
2303
+ display : block;
2304
+ }
2305
+
2306
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row > label {
2307
+ display : block;
2308
+ }
2309
+
2310
+ .yith-plugin-ui .yith-toggle-row-opened .yith-plugin-fw-option-with-description {
2311
+ width : 100%;
2312
+ }
2313
+
2314
+ .yith-plugin-ui .yith-add-box-row,
2315
+ .yith-plugin-ui .yith-add-box-row label {
2316
+ display : block;
2317
+ }
2318
+
2319
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-plugin-fw-option-with-description,
2320
+ .yith-plugin-ui .yith-add-box-row .yith-plugin-fw-option-with-description {
2321
+ display : block;
2322
+ padding-top : 20px;
2323
+ }
2324
+
2325
+
2326
+ .yith-plugin-ui .yith-add-box-row .yith-plugin-fw-option-with-description span.description {
2327
+ max-width : 100%;
2328
+ }
2329
  }
2330
 
2331
  @media screen and (max-width : 1024px) {
2332
+
2333
  .yith-plugin-ui .yith-add-box,
2334
  .yith-plugin-ui .yith-toggle-row:not(.fixed) {
2335
  width : 90%;
2354
  .yith-plugin-ui td.forminp-checkbox.three-cols fieldset:nth-child(3n+1) {
2355
  clear : initial;
2356
  }
2357
+
2358
  }
2359
 
2360
  @media screen and (max-width : 782px) {
2386
  #yith-plugin-fw-panel table.form-table th.titledesc,
2387
  .yith-plugin-ui #plugin-fw-wc table.form-table td,
2388
  #yith-plugin-fw-panel table.form-table td.forminp {
2389
+ padding : 20px 20px;
2390
  }
2391
 
2392
  .yith-plugin-ui #plugin-fw-wc table.form-table th.titledesc,
2393
  #yith-plugin-fw-panel table.form-table th.titledesc {
2394
+ padding-bottom : 0;
2395
  }
2396
  }
2397
 
2398
+ @media (max-width : 480px) {
2399
  .yith-plugin-ui .nav-tab {
2400
+ font-size : 12px;
2401
  }
2402
+
2403
  .yith-plugin-ui h2 {
2404
+ padding : 20px 20px;
2405
  }
2406
+
2407
  .yith-plugin-ui [type="radio"]:checked + label:before, .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
2408
+ width : 14px;
2409
+ height : 14px;
2410
  }
2411
+
2412
  .yith-plugin-ui [type="radio"]:checked + label:after, .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
2413
+ width : 10px;
2414
+ height : 10px;
2415
+ top : 3px;
2416
+ left : 3px;
2417
  }
2418
+
2419
  .yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
2420
+ padding-left : 25px;
2421
  }
2422
 
2423
  .yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
2424
+ font-size : 13px;
2425
  }
2426
+
2427
  .yith-plugin-ui span.description {
2428
+ font-size : 12px;
2429
  }
2430
+
2431
  .yith-plugin-ui #plugin-fw-wc table.form-table th,
2432
  #yith-plugin-fw-panel table.form-table th.titledesc,
2433
  .yith-plugin-ui #plugin-fw-wc table.form-table td,
2434
  #yith-plugin-fw-panel table.form-table td.forminp {
2435
+ padding : 15px 20px;
2436
  }
2437
 
2438
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span {
2439
+ width : 48px;
2440
+ height : 20px;
2441
  }
2442
+
2443
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
2444
+ top : 3px;
2445
+ left : 3px;
2446
  }
2447
+
2448
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
2449
+ left : 30px;
2450
  }
2451
+
2452
  .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after {
2453
+ font-size : 11px;
2454
+ padding : 0px 6px;
2455
+ margin-top : 3px;
2456
  }
2457
+
2458
  .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after {
2459
+ font-size : 11px;
2460
+ padding-left : 24px;
2461
+ margin-top : 3px;
2462
  }
2463
 
2464
  .yith-plugin-fw .select2-container .select2-selection--single .select2-selection__rendered {
2465
+ font-size : 14px;
2466
  }
2467
 
2468
  .yith-plugin-ui input {
2469
+ font-size : 14px;
2470
  }
2471
  }
plugin-fw/assets/js/yith-fields.js CHANGED
@@ -41,15 +41,15 @@
41
 
42
  /* Colorpicker */
43
  $colorpicker.wpColorPicker( {
44
- palettes: false,
45
- width : 200,
46
- mode : 'hsl',
47
- clear : function () {
48
- var input = $( this );
49
- input.val( input.data( 'default-color' ) );
50
- input.change();
51
- }
52
- } );
53
 
54
 
55
  $colorpicker.each( function () {
@@ -64,15 +64,15 @@
64
 
65
  if ( !wrap1.find( '.wp-picker-clear-custom' ).length ) {
66
  var button = $( '<span/>' ).attr( {
67
- class: "wp-picker-default-custom"
68
- } );
69
  wrap1.find( '.wp-picker-default' ).wrap( button );
70
  }
71
 
72
  if ( !wrap2.find( '.wp-picker-clear-custom' ).length ) {
73
  var button = $( '<span/>' ).attr( {
74
- class: "wp-picker-default-custom"
75
- } );
76
  wrap2.find( '.wp-picker-default' ).wrap( button );
77
  }
78
  } );
@@ -84,7 +84,7 @@
84
  // preview
85
  $upload.imgUrl.change( function () {
86
  var url = $( this ).val(),
87
- re = new RegExp( "(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)" ),
88
  preview = $( this ).parent().find( $upload.imgPreviewHandler ).first();
89
 
90
  if ( preview.length < 1 ) {
@@ -103,7 +103,7 @@
103
 
104
  var t = $( this ),
105
  custom_uploader,
106
- id = t.attr( 'id' ).replace( /-button$/, '' );
107
 
108
  //If the uploader object has already been created, reopen the dialog
109
  if ( custom_uploader ) {
@@ -114,27 +114,27 @@
114
  var custom_uploader_states = [
115
  // Main states.
116
  new wp.media.controller.Library( {
117
- library : wp.media.query(),
118
- multiple : false,
119
- title : 'Choose Image',
120
- priority : 20,
121
- filterable: 'uploaded'
122
- } )
123
  ];
124
 
125
  // Create the media frame.
126
  custom_uploader = wp.media.frames.downloadable_file = wp.media( {
127
- // Set the title of the modal.
128
- title : 'Choose Image',
129
- library : {
130
- type: ''
131
- },
132
- button : {
133
- text: 'Choose Image'
134
- },
135
- multiple: false,
136
- states : custom_uploader_states
137
- } );
138
 
139
  //When a file is selected, grab the URL and set it as the text field's value
140
  custom_uploader.on( 'select', function () {
@@ -154,8 +154,8 @@
154
 
155
  $( document ).on( 'click', $upload.resetButtonHandler, function ( e ) {
156
  var t = $( this ),
157
- id = t.attr( 'id' ),
158
- input_id = t.attr( 'id' ).replace( /-button-reset$/, '' ),
159
  default_value = $( '#' + id ).data( 'default' );
160
 
161
  $( "#" + input_id ).val( default_value );
@@ -178,19 +178,19 @@
178
 
179
  // Create the media frame.
180
  var image_gallery_frame = wp.media.frames.image_gallery = wp.media( {
181
- // Set the title of the modal.
182
- title : $t.data( 'choose' ),
183
- button: {
184
- text: $t.data( 'update' )
185
- },
186
- states: [
187
- new wp.media.controller.Library( {
188
- title : $t.data( 'choose' ),
189
- filterable: 'all',
190
- multiple : true
191
- } )
192
- ]
193
- } );
194
 
195
  // When an image is selected, run a callback.
196
  image_gallery_frame.on( 'select', function () {
@@ -215,30 +215,30 @@
215
  $imageGallery.sliderWrapper.each( function () {
216
  var $t = $( this );
217
  $t.sortable( {
218
- items : 'li.image',
219
- cursor : 'move',
220
- scrollSensitivity : 40,
221
- forcePlaceholderSize: true,
222
- forceHelperSize : false,
223
- helper : 'clone',
224
- opacity : 0.65,
225
- start : function ( event, ui ) {
226
- ui.item.css( 'background-color', '#f6f6f6' );
227
- },
228
- stop : function ( event, ui ) {
229
- ui.item.removeAttr( 'style' );
230
- },
231
- update : function ( event, ui ) {
232
- var attachment_ids = '';
233
-
234
- $t.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
235
- var attachment_id = $( this ).attr( 'data-attachment_id' );
236
- attachment_ids = attachment_ids + attachment_id + ',';
237
- } );
238
-
239
- $t.closest( '.image-gallery' ).find( '.image_gallery_ids' ).val( attachment_ids );
240
- }
241
- } );
242
  } );
243
 
244
  // Remove images
@@ -304,23 +304,23 @@
304
  labels = $( this ).data( 'labels' );
305
 
306
  $( this ).slider( {
307
- value: val,
308
- min : minValue,
309
- max : maxValue,
310
- range: 'min',
311
- step : step,
312
-
313
- create: function () {
314
- $( this ).find( '.ui-slider-handle' ).text( $( this ).slider( "value" ) );
315
- },
316
-
317
-
318
- slide: function ( event, ui ) {
319
- $( this ).find( 'input' ).val( ui.value );
320
- $( this ).find( '.ui-slider-handle' ).text( ui.value );
321
- $( this ).siblings( '.feedback' ).find( 'strong' ).text( ui.value + labels );
322
- }
323
- } );
324
  } );
325
 
326
  /* codemirror */
@@ -459,29 +459,29 @@
459
  yit_metaboxes_nonce = $( this ).closest( 'form#post' ).find( '#yit_metaboxes_nonce' ).val();
460
  metabox_tab = $( this ).closest( '.tabs-panel' ).attr( 'id' );
461
  url = yith_framework_fw_fields.ajax_url +
462
- '?action=' + action +
463
- "&post_ID=" + post_id +
464
- '&yit_metaboxes_nonce=' + yit_metaboxes_nonce +
465
- "&toggle_id=" + id +
466
- "&metabox_tab=" + metabox_tab;
467
  } else {
468
  url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
469
  }
470
 
471
  $.ajax( {
472
- type : "POST",
473
- url : url,
474
- data : formdata,
475
- contentType: false,
476
- processData: false,
477
- success : function ( result ) {
478
- if ( spinner ) {
479
- spinner.removeClass( 'show' );
480
- }
481
 
482
- $( document ).trigger( 'yith_save_toggle_element_done', [result, toggle] );
483
- }
484
- } );
485
  };
486
 
487
  $.fn.serializeToggleElement = function () {
@@ -696,22 +696,22 @@
696
  toggle.saveToggleElement();
697
  } );
698
 
699
- // Radio
700
- $( document ).on( 'click', '.yith-plugin-fw-radio input[type=radio]', function () {
701
- var _radioContainer = $( this ).closest( '.yith-plugin-fw-radio' ),
702
- _value = $( this ).val();
703
 
704
- _radioContainer.val( _value ).data( 'value', _value ).trigger( 'change' );
705
- } );
706
 
707
- $( document.body ).on( 'yith-plugin-fw-init-radio', function () {
708
- $( '.yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)' ).each( function () {
709
- $( this ).val( $( this ).data( 'value' ) );
710
- $( this ).addClass( 'yith-plugin-fw-radio--initialized' );
711
- } );
712
- } ).trigger( 'yith-plugin-fw-init-radio' );
713
 
714
- // Password Eye field
715
  $( document ).on( 'click', '.yith-password-eye', function () {
716
  var $this = $( this ),
717
  inp = $( this ).closest( '.yith-password-wrapper' ).find( 'input' );
@@ -732,70 +732,70 @@
732
  $( '.select2-results' ).closest( '.select2-container' ).addClass( 'yith-plugin-fw-select2-container' );
733
  }
734
  } );
735
- /**
736
- * Dimensions
737
- */
738
- var fw_dimensions = {
739
- selectors : {
740
- wrapper : '.yith-plugin-fw-dimensions',
741
- units : {
742
- wrapper : '.yith-plugin-fw-dimensions__units',
743
- single : '.yith-plugin-fw-dimensions__unit',
744
- value : '.yith-plugin-fw-dimensions__unit__value',
745
- selectedClass: 'yith-plugin-fw-dimensions__unit--selected'
746
- },
747
- linked : {
748
- button : '.yith-plugin-fw-dimensions__linked',
749
- value : '.yith-plugin-fw-dimensions__linked__value',
750
- wrapperActiveClass: 'yith-plugin-fw-dimensions--linked-active'
751
- },
752
- dimensions: {
753
- number: '.yith-plugin-fw-dimensions__dimension__number'
754
- }
755
- },
756
- init : function () {
757
- var self = fw_dimensions;
758
- $( document ).on( 'click', self.selectors.units.single, self.unitChange );
759
- $( document ).on( 'click', self.selectors.linked.button, self.linkedChange );
760
- $( document ).on( 'change keyup', self.selectors.dimensions.number, self.numberChange );
761
- },
762
- unitChange : function ( e ) {
763
- var unit = $( this ).closest( fw_dimensions.selectors.units.single ),
764
- wrapper = unit.closest( fw_dimensions.selectors.units.wrapper ),
765
- units = wrapper.find( fw_dimensions.selectors.units.single ),
766
- valueField = wrapper.find( fw_dimensions.selectors.units.value ).first(),
767
- value = unit.data( 'value' );
768
-
769
- units.removeClass( fw_dimensions.selectors.units.selectedClass );
770
- unit.addClass( fw_dimensions.selectors.units.selectedClass );
771
- valueField.val( value );
772
- },
773
- linkedChange: function () {
774
- var button = $( this ).closest( fw_dimensions.selectors.linked.button ),
775
- mainWrapper = button.closest( fw_dimensions.selectors.wrapper ),
776
- valueField = button.find( fw_dimensions.selectors.linked.value ),
777
- value = valueField.val();
778
-
779
- if ( 'yes' === value ) {
780
- mainWrapper.removeClass( fw_dimensions.selectors.linked.wrapperActiveClass );
781
- valueField.val( 'no' );
782
- } else {
783
- mainWrapper.addClass( fw_dimensions.selectors.linked.wrapperActiveClass );
784
- valueField.val( 'yes' );
785
-
786
- mainWrapper.find( fw_dimensions.selectors.dimensions.number ).first().trigger( 'change' );
787
- }
788
- },
789
- numberChange: function ( e ) {
790
- var number = $( this ).closest( fw_dimensions.selectors.dimensions.number ),
791
- mainWrapper = number.closest( fw_dimensions.selectors.wrapper );
792
- if ( mainWrapper.hasClass( fw_dimensions.selectors.linked.wrapperActiveClass ) ) {
793
- var numbers = mainWrapper.find( fw_dimensions.selectors.dimensions.number );
794
-
795
- numbers.val( number.val() );
796
- }
797
- }
798
- };
799
- fw_dimensions.init();
800
 
801
  } )( jQuery );
41
 
42
  /* Colorpicker */
43
  $colorpicker.wpColorPicker( {
44
+ palettes: false,
45
+ width : 200,
46
+ mode : 'hsl',
47
+ clear : function () {
48
+ var input = $( this );
49
+ input.val( input.data( 'default-color' ) );
50
+ input.change();
51
+ }
52
+ } );
53
 
54
 
55
  $colorpicker.each( function () {
64
 
65
  if ( !wrap1.find( '.wp-picker-clear-custom' ).length ) {
66
  var button = $( '<span/>' ).attr( {
67
+ class: "wp-picker-default-custom"
68
+ } );
69
  wrap1.find( '.wp-picker-default' ).wrap( button );
70
  }
71
 
72
  if ( !wrap2.find( '.wp-picker-clear-custom' ).length ) {
73
  var button = $( '<span/>' ).attr( {
74
+ class: "wp-picker-default-custom"
75
+ } );
76
  wrap2.find( '.wp-picker-default' ).wrap( button );
77
  }
78
  } );
84
  // preview
85
  $upload.imgUrl.change( function () {
86
  var url = $( this ).val(),
87
+ re = new RegExp( "(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)" ),
88
  preview = $( this ).parent().find( $upload.imgPreviewHandler ).first();
89
 
90
  if ( preview.length < 1 ) {
103
 
104
  var t = $( this ),
105
  custom_uploader,
106
+ id = t.attr( 'id' ).replace( /-button$/, '' ).replace(/(\[|\])/g, '\\$1');
107
 
108
  //If the uploader object has already been created, reopen the dialog
109
  if ( custom_uploader ) {
114
  var custom_uploader_states = [
115
  // Main states.
116
  new wp.media.controller.Library( {
117
+ library : wp.media.query(),
118
+ multiple : false,
119
+ title : 'Choose Image',
120
+ priority : 20,
121
+ filterable: 'uploaded'
122
+ } )
123
  ];
124
 
125
  // Create the media frame.
126
  custom_uploader = wp.media.frames.downloadable_file = wp.media( {
127
+ // Set the title of the modal.
128
+ title : 'Choose Image',
129
+ library : {
130
+ type: ''
131
+ },
132
+ button : {
133
+ text: 'Choose Image'
134
+ },
135
+ multiple: false,
136
+ states : custom_uploader_states
137
+ } );
138
 
139
  //When a file is selected, grab the URL and set it as the text field's value
140
  custom_uploader.on( 'select', function () {
154
 
155
  $( document ).on( 'click', $upload.resetButtonHandler, function ( e ) {
156
  var t = $( this ),
157
+ id = t.attr( 'id' ).replace(/(\[|\])/g, '\\$1'),
158
+ input_id = t.attr( 'id' ).replace( /-button-reset$/, '' ).replace(/(\[|\])/g, '\\$1'),
159
  default_value = $( '#' + id ).data( 'default' );
160
 
161
  $( "#" + input_id ).val( default_value );
178
 
179
  // Create the media frame.
180
  var image_gallery_frame = wp.media.frames.image_gallery = wp.media( {
181
+ // Set the title of the modal.
182
+ title : $t.data( 'choose' ),
183
+ button: {
184
+ text: $t.data( 'update' )
185
+ },
186
+ states: [
187
+ new wp.media.controller.Library( {
188
+ title : $t.data( 'choose' ),
189
+ filterable: 'all',
190
+ multiple : true
191
+ } )
192
+ ]
193
+ } );
194
 
195
  // When an image is selected, run a callback.
196
  image_gallery_frame.on( 'select', function () {
215
  $imageGallery.sliderWrapper.each( function () {
216
  var $t = $( this );
217
  $t.sortable( {
218
+ items : 'li.image',
219
+ cursor : 'move',
220
+ scrollSensitivity : 40,
221
+ forcePlaceholderSize: true,
222
+ forceHelperSize : false,
223
+ helper : 'clone',
224
+ opacity : 0.65,
225
+ start : function ( event, ui ) {
226
+ ui.item.css( 'background-color', '#f6f6f6' );
227
+ },
228
+ stop : function ( event, ui ) {
229
+ ui.item.removeAttr( 'style' );
230
+ },
231
+ update : function ( event, ui ) {
232
+ var attachment_ids = '';
233
+
234
+ $t.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
235
+ var attachment_id = $( this ).attr( 'data-attachment_id' );
236
+ attachment_ids = attachment_ids + attachment_id + ',';
237
+ } );
238
+
239
+ $t.closest( '.image-gallery' ).find( '.image_gallery_ids' ).val( attachment_ids );
240
+ }
241
+ } );
242
  } );
243
 
244
  // Remove images
304
  labels = $( this ).data( 'labels' );
305
 
306
  $( this ).slider( {
307
+ value: val,
308
+ min : minValue,
309
+ max : maxValue,
310
+ range: 'min',
311
+ step : step,
312
+
313
+ create: function () {
314
+ $( this ).find( '.ui-slider-handle' ).text( $( this ).slider( "value" ) );
315
+ },
316
+
317
+
318
+ slide: function ( event, ui ) {
319
+ $( this ).find( 'input' ).val( ui.value );
320
+ $( this ).find( '.ui-slider-handle' ).text( ui.value );
321
+ $( this ).siblings( '.feedback' ).find( 'strong' ).text( ui.value + labels );
322
+ }
323
+ } );
324
  } );
325
 
326
  /* codemirror */
459
  yit_metaboxes_nonce = $( this ).closest( 'form#post' ).find( '#yit_metaboxes_nonce' ).val();
460
  metabox_tab = $( this ).closest( '.tabs-panel' ).attr( 'id' );
461
  url = yith_framework_fw_fields.ajax_url +
462
+ '?action=' + action +
463
+ "&post_ID=" + post_id +
464
+ '&yit_metaboxes_nonce=' + yit_metaboxes_nonce +
465
+ "&toggle_id=" + id +
466
+ "&metabox_tab=" + metabox_tab;
467
  } else {
468
  url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
469
  }
470
 
471
  $.ajax( {
472
+ type : "POST",
473
+ url : url,
474
+ data : formdata,
475
+ contentType: false,
476
+ processData: false,
477
+ success : function ( result ) {
478
+ if ( spinner ) {
479
+ spinner.removeClass( 'show' );
480
+ }
481
 
482
+ $( document ).trigger( 'yith_save_toggle_element_done', [result, toggle] );
483
+ }
484
+ } );
485
  };
486
 
487
  $.fn.serializeToggleElement = function () {
696
  toggle.saveToggleElement();
697
  } );
698
 
699
+ // Radio
700
+ $( document ).on( 'click', '.yith-plugin-fw-radio input[type=radio]', function () {
701
+ var _radioContainer = $( this ).closest( '.yith-plugin-fw-radio' ),
702
+ _value = $( this ).val();
703
 
704
+ _radioContainer.val( _value ).data( 'value', _value ).trigger( 'change' );
705
+ } );
706
 
707
+ $( document.body ).on( 'yith-plugin-fw-init-radio', function () {
708
+ $( '.yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)' ).each( function () {
709
+ $( this ).val( $( this ).data( 'value' ) );
710
+ $( this ).addClass( 'yith-plugin-fw-radio--initialized' );
711
+ } );
712
+ } ).trigger( 'yith-plugin-fw-init-radio' );
713
 
714
+ // Password Eye field
715
  $( document ).on( 'click', '.yith-password-eye', function () {
716
  var $this = $( this ),
717
  inp = $( this ).closest( '.yith-password-wrapper' ).find( 'input' );
732
  $( '.select2-results' ).closest( '.select2-container' ).addClass( 'yith-plugin-fw-select2-container' );
733
  }
734
  } );
735
+ /**
736
+ * Dimensions
737
+ */
738
+ var fw_dimensions = {
739
+ selectors : {
740
+ wrapper : '.yith-plugin-fw-dimensions',
741
+ units : {
742
+ wrapper : '.yith-plugin-fw-dimensions__units',
743
+ single : '.yith-plugin-fw-dimensions__unit',
744
+ value : '.yith-plugin-fw-dimensions__unit__value',
745
+ selectedClass: 'yith-plugin-fw-dimensions__unit--selected'
746
+ },
747
+ linked : {
748
+ button : '.yith-plugin-fw-dimensions__linked',
749
+ value : '.yith-plugin-fw-dimensions__linked__value',
750
+ wrapperActiveClass: 'yith-plugin-fw-dimensions--linked-active'
751
+ },
752
+ dimensions: {
753
+ number: '.yith-plugin-fw-dimensions__dimension__number'
754
+ }
755
+ },
756
+ init : function () {
757
+ var self = fw_dimensions;
758
+ $( document ).on( 'click', self.selectors.units.single, self.unitChange );
759
+ $( document ).on( 'click', self.selectors.linked.button, self.linkedChange );
760
+ $( document ).on( 'change keyup', self.selectors.dimensions.number, self.numberChange );
761
+ },
762
+ unitChange : function ( e ) {
763
+ var unit = $( this ).closest( fw_dimensions.selectors.units.single ),
764
+ wrapper = unit.closest( fw_dimensions.selectors.units.wrapper ),
765
+ units = wrapper.find( fw_dimensions.selectors.units.single ),
766
+ valueField = wrapper.find( fw_dimensions.selectors.units.value ).first(),
767
+ value = unit.data( 'value' );
768
+
769
+ units.removeClass( fw_dimensions.selectors.units.selectedClass );
770
+ unit.addClass( fw_dimensions.selectors.units.selectedClass );
771
+ valueField.val( value );
772
+ },
773
+ linkedChange: function () {
774
+ var button = $( this ).closest( fw_dimensions.selectors.linked.button ),
775
+ mainWrapper = button.closest( fw_dimensions.selectors.wrapper ),
776
+ valueField = button.find( fw_dimensions.selectors.linked.value ),
777
+ value = valueField.val();
778
+
779
+ if ( 'yes' === value ) {
780
+ mainWrapper.removeClass( fw_dimensions.selectors.linked.wrapperActiveClass );
781
+ valueField.val( 'no' );
782
+ } else {
783
+ mainWrapper.addClass( fw_dimensions.selectors.linked.wrapperActiveClass );
784
+ valueField.val( 'yes' );
785
+
786
+ mainWrapper.find( fw_dimensions.selectors.dimensions.number ).first().trigger( 'change' );
787
+ }
788
+ },
789
+ numberChange: function ( e ) {
790
+ var number = $( this ).closest( fw_dimensions.selectors.dimensions.number ),
791
+ mainWrapper = number.closest( fw_dimensions.selectors.wrapper );
792
+ if ( mainWrapper.hasClass( fw_dimensions.selectors.linked.wrapperActiveClass ) ) {
793
+ var numbers = mainWrapper.find( fw_dimensions.selectors.dimensions.number );
794
+
795
+ numbers.val( number.val() );
796
+ }
797
+ }
798
+ };
799
+ fw_dimensions.init();
800
 
801
  } )( jQuery );
plugin-fw/assets/js/yith-fields.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("yith_fields_init",function(){var t=e(".yith-plugin-fw-datepicker"),i=e(".yith-plugin-fw-colorpicker"),a={imgPreviewHandler:".yith-plugin-fw-upload-img-preview",uploadButtonHandler:".yith-plugin-fw-upload-button",imgUrlHandler:".yith-plugin-fw-upload-img-url",resetButtonHandler:".yith-plugin-fw-upload-button-reset",imgUrl:e(".yith-plugin-fw-upload-img-url")},n=e(".add_media"),l={sliderWrapper:e(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},s=e(".yith-plugin-fw-sidebar-layout"),o=e(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=e(".codemirror"),d=e(".yit-icons-manager-wrapper");e(".yith-plugin-ui td.forminp-checkbox");t.each(function(){var t=e(this).data();t.showAnim=!1,t.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},t.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},e(this).datepicker(t)}),i.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.change()}}),i.each(function(){var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),a=e(this).closest(".yith-single-colorpicker"),n=i.find(".wp-picker-input-wrap"),l=a.find(".wp-picker-input-wrap");if(n.length&&i.find("a.wp-color-result").attr("title",t),a.length&&a.find("a.wp-color-result").attr("title",t),!n.find(".wp-picker-clear-custom").length){var s=e("<span/>").attr({"class":"wp-picker-default-custom"});n.find(".wp-picker-default").wrap(s)}l.find(".wp-picker-clear-custom").length||(s=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(s))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(a.imgUrl.change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),n=e(this).parent().find(a.imgPreviewHandler).first();n.length<1&&(n=e(this).parent().parent().find(a.imgPreviewHandler).first()),i.test(t)?n.html('<img src="'+t+'" style="max-width:100px; max-height:100px;" />'):n.html("")}).trigger("change"),e(document).on("click",a.uploadButtonHandler,function(t){t.preventDefault();var i,n=e(this).attr("id").replace(/-button$/,"");if(i)i.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+n).val(t.url),e("#"+n+"-yith-attachment-id")&&e("#"+n+"-yith-attachment-id").val(t.id),a.imgUrl.trigger("change")}),i.open()}}),e(document).on("click",a.resetButtonHandler,function(t){var i=e(this),n=i.attr("id"),l=i.attr("id").replace(/-button-reset$/,""),s=e("#"+n).data("default");e("#"+l).val(s),a.imgUrl.trigger("change")}));n.on("click",function(){}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("click",l.buttonHandler,function(t){var i=e(this),a=i.closest(".image-gallery"),n=a.find(".image_gallery_ids"),l=n.val(),s=a.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]});o.on("select",function(){o.state().get("selection").map(function(e){(e=e.toJSON()).id&&(l=l?l+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">x</a></li></ul></li>'))}),n.val(l)}),o.open()}),l.sliderWrapper.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(i,a){var n="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),t.closest(".image-gallery").find(".image_gallery_ids").val(n)}})}),l.sliderWrapper.on("click","a.delete",function(){var t=e(this).closest(".image-gallery"),i=e(this).closest(".image-gallery ul.slides-wrapper"),a=t.find(".image_gallery_ids"),n="";e(this).closest("li.image").remove(),i.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),a.val(n)})),s.each(function(){e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),a=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),n=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==n)switch(n){case"left":i.show(),a.hide();break;case"right":a.show(),i.hide();break;case"double":i.show(),a.show();break;default:i.hide(),a.hide()}})}),o.each(function(){var t=e(this).data("val"),i=e(this).data("min"),a=e(this).data("max"),n=e(this).data("step"),l=e(this).data("labels");e(this).slider({value:t,min:i,max:a,range:"min",step:n,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+l)}})}),r.each(function(t,i){var a=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",a)}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),a=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(n){var l=e(n.target).closest("li"),s=l.data("font"),o=l.data("icon"),r=l.data("key"),d=l.data("name");i.attr("data-font",s),i.attr("data-icon",o),i.attr("data-key",r),i.attr("data-name",d),a.val(s+":"+d),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),a=t.closest(".yith-plugin-fw-select-images__wrapper"),n=a.find(".yith-plugin-fw-select-images__item"),l=a.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed"),n.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document.body).trigger("wc-enhanced-select-init"),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var a=jQuery(".ui-sortable-handle"),n=0,l=new Array;for(n=0;n<a.length;n++)l[n]=e(a[n]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("checked")?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e.fn.saveToggleElement=function(t,i){var a=e(this),n="yith_plugin_fw_save_toggle_element",l=a.serializeToggleElement(),s=a.find(".yith-toggle_wrapper"),o=s.attr("id"),r=e.urlParam("tab");l.append("security",s.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),a.closest(".metaboxes-tab.yith-plugin-ui").length?(n="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+n+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+o+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+n+"&tab="+r+"&toggle_id="+o,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,a])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,a=e(t).find(":input").serializeArray();return e.each(a,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),a=t.find("span.title").data("title_format"),n=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==a)var s=a.match(l);if(void 0!==n)var o=n.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)))}),""!==a&&t.find("span.title").html(a),""!==n&&t.find(".subtitle").html(n),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),a=i.closest(".yith-toggle-row"),n=a.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;a.is(".yith-toggle-row-opened")?n.slideUp(400):n.slideDown(400),a.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),a=i.data("box_id"),n=i.data("closed_label"),l=i.data("opened_label"),s=i.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+s),""!==a&&(e("#"+a).html(template({index:"box_id"})).slideToggle(),""!==n&&(i.html()===n?i.html(l).removeClass("closed"):i.html(n).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),a=e(this).closest(".yith-toggle_wrapper").attr("id"),n=i.find(".spinner"),l=e(this).parents(".toggle-element"),s=i.find(":input"),o=l.find(".yith-toggle-row").length,r=e('<input type="hidden">');r.val(o),e(document).trigger("yith-toggle-change-counter",[r,i]),o=r.val();var d=wp.template("yith-toggle-element-item-"+a),c=e(d({index:o}));n.addClass("show"),e.each(s,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_val=e(i).val(),"radio"==e(i).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+o,e(i).is(":checked")&&e(c).find("#"+$field_id).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(c).find("#"+$field_id).html(e("#"+e(i).attr("id")).html()),e(c).find("#"+$field_id).val($field_val))}),e(c).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,c,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(c),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),a=e(this).closest(".yith-toggle-row"),n=a.find(".spinner");a.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,a,l]),"yes"===l.val()&&(n.addClass("show"),i.saveToggleElement(n))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).val(e(this).data("value")),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var t={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var i=t;e(document).on("click",i.selectors.units.single,i.unitChange),e(document).on("click",i.selectors.linked.button,i.linkedChange),e(document).on("change keyup",i.selectors.dimensions.number,i.numberChange)},unitChange:function(i){var a=e(this).closest(t.selectors.units.single),n=a.closest(t.selectors.units.wrapper),l=n.find(t.selectors.units.single),s=n.find(t.selectors.units.value).first(),o=a.data("value");l.removeClass(t.selectors.units.selectedClass),a.addClass(t.selectors.units.selectedClass),s.val(o)},linkedChange:function(){var i=e(this).closest(t.selectors.linked.button),a=i.closest(t.selectors.wrapper),n=i.find(t.selectors.linked.value);"yes"===n.val()?(a.removeClass(t.selectors.linked.wrapperActiveClass),n.val("no")):(a.addClass(t.selectors.linked.wrapperActiveClass),n.val("yes"),a.find(t.selectors.dimensions.number).first().trigger("change"))},numberChange:function(i){var a=e(this).closest(t.selectors.dimensions.number),n=a.closest(t.selectors.wrapper);n.hasClass(t.selectors.linked.wrapperActiveClass)&&n.find(t.selectors.dimensions.number).val(a.val())}};t.init()}(jQuery);
1
+ !function(e){e(document).on("yith_fields_init",function(){var t=e(".yith-plugin-fw-datepicker"),i=e(".yith-plugin-fw-colorpicker"),a={imgPreviewHandler:".yith-plugin-fw-upload-img-preview",uploadButtonHandler:".yith-plugin-fw-upload-button",imgUrlHandler:".yith-plugin-fw-upload-img-url",resetButtonHandler:".yith-plugin-fw-upload-button-reset",imgUrl:e(".yith-plugin-fw-upload-img-url")},n=e(".add_media"),l={sliderWrapper:e(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},s=e(".yith-plugin-fw-sidebar-layout"),o=e(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=e(".codemirror"),d=e(".yit-icons-manager-wrapper");e(".yith-plugin-ui td.forminp-checkbox");t.each(function(){var t=e(this).data();t.showAnim=!1,t.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},t.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},e(this).datepicker(t)}),i.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.change()}}),i.each(function(){var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),a=e(this).closest(".yith-single-colorpicker"),n=i.find(".wp-picker-input-wrap"),l=a.find(".wp-picker-input-wrap");if(n.length&&i.find("a.wp-color-result").attr("title",t),a.length&&a.find("a.wp-color-result").attr("title",t),!n.find(".wp-picker-clear-custom").length){var s=e("<span/>").attr({"class":"wp-picker-default-custom"});n.find(".wp-picker-default").wrap(s)}l.find(".wp-picker-clear-custom").length||(s=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(s))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(a.imgUrl.change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),n=e(this).parent().find(a.imgPreviewHandler).first();n.length<1&&(n=e(this).parent().parent().find(a.imgPreviewHandler).first()),i.test(t)?n.html('<img src="'+t+'" style="max-width:100px; max-height:100px;" />'):n.html("")}).trigger("change"),e(document).on("click",a.uploadButtonHandler,function(t){t.preventDefault();var i,n=e(this).attr("id").replace(/-button$/,"").replace(/(\[|\])/g,"\\$1");if(i)i.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+n).val(t.url),e("#"+n+"-yith-attachment-id")&&e("#"+n+"-yith-attachment-id").val(t.id),a.imgUrl.trigger("change")}),i.open()}}),e(document).on("click",a.resetButtonHandler,function(t){var i=e(this),n=i.attr("id").replace(/(\[|\])/g,"\\$1"),l=i.attr("id").replace(/-button-reset$/,"").replace(/(\[|\])/g,"\\$1"),s=e("#"+n).data("default");e("#"+l).val(s),a.imgUrl.trigger("change")}));n.on("click",function(){}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("click",l.buttonHandler,function(t){var i=e(this),a=i.closest(".image-gallery"),n=a.find(".image_gallery_ids"),l=n.val(),s=a.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]});o.on("select",function(){o.state().get("selection").map(function(e){(e=e.toJSON()).id&&(l=l?l+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">x</a></li></ul></li>'))}),n.val(l)}),o.open()}),l.sliderWrapper.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(i,a){var n="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),t.closest(".image-gallery").find(".image_gallery_ids").val(n)}})}),l.sliderWrapper.on("click","a.delete",function(){var t=e(this).closest(".image-gallery"),i=e(this).closest(".image-gallery ul.slides-wrapper"),a=t.find(".image_gallery_ids"),n="";e(this).closest("li.image").remove(),i.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),a.val(n)})),s.each(function(){e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),a=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),n=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==n)switch(n){case"left":i.show(),a.hide();break;case"right":a.show(),i.hide();break;case"double":i.show(),a.show();break;default:i.hide(),a.hide()}})}),o.each(function(){var t=e(this).data("val"),i=e(this).data("min"),a=e(this).data("max"),n=e(this).data("step"),l=e(this).data("labels");e(this).slider({value:t,min:i,max:a,range:"min",step:n,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+l)}})}),r.each(function(t,i){var a=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",a)}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),a=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(n){var l=e(n.target).closest("li"),s=l.data("font"),o=l.data("icon"),r=l.data("key"),d=l.data("name");i.attr("data-font",s),i.attr("data-icon",o),i.attr("data-key",r),i.attr("data-name",d),a.val(s+":"+d),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),a=t.closest(".yith-plugin-fw-select-images__wrapper"),n=a.find(".yith-plugin-fw-select-images__item"),l=a.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed"),n.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document.body).trigger("wc-enhanced-select-init"),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var a=jQuery(".ui-sortable-handle"),n=0,l=new Array;for(n=0;n<a.length;n++)l[n]=e(a[n]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("checked")?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e.fn.saveToggleElement=function(t,i){var a=e(this),n="yith_plugin_fw_save_toggle_element",l=a.serializeToggleElement(),s=a.find(".yith-toggle_wrapper"),o=s.attr("id"),r=e.urlParam("tab");l.append("security",s.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),a.closest(".metaboxes-tab.yith-plugin-ui").length?(n="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+n+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+o+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+n+"&tab="+r+"&toggle_id="+o,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,a])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,a=e(t).find(":input").serializeArray();return e.each(a,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),a=t.find("span.title").data("title_format"),n=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==a)var s=a.match(l);if(void 0!==n)var o=n.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)))}),""!==a&&t.find("span.title").html(a),""!==n&&t.find(".subtitle").html(n),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),a=i.closest(".yith-toggle-row"),n=a.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;a.is(".yith-toggle-row-opened")?n.slideUp(400):n.slideDown(400),a.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),a=i.data("box_id"),n=i.data("closed_label"),l=i.data("opened_label"),s=i.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+s),""!==a&&(e("#"+a).html(template({index:"box_id"})).slideToggle(),""!==n&&(i.html()===n?i.html(l).removeClass("closed"):i.html(n).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),a=e(this).closest(".yith-toggle_wrapper").attr("id"),n=i.find(".spinner"),l=e(this).parents(".toggle-element"),s=i.find(":input"),o=l.find(".yith-toggle-row").length,r=e('<input type="hidden">');r.val(o),e(document).trigger("yith-toggle-change-counter",[r,i]),o=r.val();var d=wp.template("yith-toggle-element-item-"+a),c=e(d({index:o}));n.addClass("show"),e.each(s,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_val=e(i).val(),"radio"==e(i).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+o,e(i).is(":checked")&&e(c).find("#"+$field_id).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(c).find("#"+$field_id).html(e("#"+e(i).attr("id")).html()),e(c).find("#"+$field_id).val($field_val))}),e(c).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,c,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(c),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),a=e(this).closest(".yith-toggle-row"),n=a.find(".spinner");a.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,a,l]),"yes"===l.val()&&(n.addClass("show"),i.saveToggleElement(n))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).val(e(this).data("value")),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var t={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var i=t;e(document).on("click",i.selectors.units.single,i.unitChange),e(document).on("click",i.selectors.linked.button,i.linkedChange),e(document).on("change keyup",i.selectors.dimensions.number,i.numberChange)},unitChange:function(i){var a=e(this).closest(t.selectors.units.single),n=a.closest(t.selectors.units.wrapper),l=n.find(t.selectors.units.single),s=n.find(t.selectors.units.value).first(),o=a.data("value");l.removeClass(t.selectors.units.selectedClass),a.addClass(t.selectors.units.selectedClass),s.val(o)},linkedChange:function(){var i=e(this).closest(t.selectors.linked.button),a=i.closest(t.selectors.wrapper),n=i.find(t.selectors.linked.value);"yes"===n.val()?(a.removeClass(t.selectors.linked.wrapperActiveClass),n.val("no")):(a.addClass(t.selectors.linked.wrapperActiveClass),n.val("yes"),a.find(t.selectors.dimensions.number).first().trigger("change"))},numberChange:function(i){var a=e(this).closest(t.selectors.dimensions.number),n=a.closest(t.selectors.wrapper);n.hasClass(t.selectors.linked.wrapperActiveClass)&&n.find(t.selectors.dimensions.number).val(a.val())}};t.init()}(jQuery);
plugin-fw/assets/js/yith-gutenberg.js CHANGED
@@ -19,7 +19,7 @@
19
  RadioControl = wp.components.RadioControl,
20
  TextControl = wp.components.TextControl,
21
  TextareaControl = wp.components.TextareaControl;
22
-
23
  const yith_icon = el('svg', {width: 22, height: 22},
24
  el('path', {d: "M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"})
25
  );
@@ -39,7 +39,7 @@
39
 
40
 
41
  $.each(sc_args.attributes, function ($v, $k) {
42
- if ($v != 'className') {
43
  sc += ' ' + $v + '=';
44
  var arg = props.attributes[$v],
45
  remove_quotes = arg.remove_quotes;
@@ -208,4 +208,4 @@
208
  }
209
  });
210
  });
211
- })(jQuery);
19
  RadioControl = wp.components.RadioControl,
20
  TextControl = wp.components.TextControl,
21
  TextareaControl = wp.components.TextareaControl;
22
+
23
  const yith_icon = el('svg', {width: 22, height: 22},
24
  el('path', {d: "M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"})
25
  );
39
 
40
 
41
  $.each(sc_args.attributes, function ($v, $k) {
42
+ if ( typeof props.attributes != 'undefined' && typeof props.attributes[$v] != 'undefined' ) {
43
  sc += ' ' + $v + '=';
44
  var arg = props.attributes[$v],
45
  remove_quotes = arg.remove_quotes;
208
  }
209
  });
210
  });
211
+ })(jQuery);
plugin-fw/assets/js/yith-gutenberg.min.js CHANGED
@@ -1 +1,6 @@
1
- !function(e){wp.i18n.__;var t=wp.element.createElement,o=wp.element.Fragment,n=(wp.components.PanelBody,wp.blocks.registerBlockType),c=(wp.editor.RichText,wp.editor.BlockControls,wp.editor.InspectorControls),r=(wp.editor.AlignmentToolbar,wp.components,wp.element.RawHTML),a=wp.components.SelectControl,s=wp.components.ToggleControl,l=wp.components.CheckboxControl,i=wp.components.RangeControl,p=wp.components.ColorPicker,u=wp.components.RadioControl,d=wp.components.TextControl,h=wp.components.TextareaControl;const C=t("svg",{width:22,height:22},t("path",{d:"M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"}));function g(o,n,c){var a="",s="";if("undefined"!=typeof n.callback&&"function"==typeof e[n.callback])a=e[n.callback](o,n);else{var l="["+n.shortcode_name;e.each(o.attributes,function(e,t){if("className"!=e){l+=" "+e+"=";var o=n.attributes[e].remove_quotes;l+=1==o?t:'"'+t+'"'}}),l+="]";var i=md5(l);s='<span class="yith_block_'+i+'">'+l+"</span>","edit"==c&&0!=n.do_shortcode&&function(t){var o=null;return e(document).trigger("yith_plugin_fw_gutenberg_before_do_shortcode",[l,t]),e.ajax({async:!0,url:yith_gutenberg_ajax.ajaxurl,method:"post",data:{action:"yith_plugin_fw_gutenberg_do_shortcode",shortcode:l},success:function(n){""!=(o=n)&&(e(".yith_block_"+t).html(o),e(document).trigger("yith_plugin_fw_gutenberg_success_do_shortcode",[l,t,o]))}}),e(document).trigger("yith_plugin_fw_gutenberg_after_do_shortcode",[l,t,o]),o}(i),a=t(r,null,s)}return a}function b(e,t,o,n){var c={};return"colorpicker"!=n&&"color"!=n||(e=e.hex),c[t]=e,o.setAttributes(c),o}e.each(yith_gutenberg,function(r,f){n("yith/"+r,{title:f.title,description:f.description,category:f.category,attributes:f.attributes,icon:"undefined"!=typeof f.icon?f.icon:C,keywords:f.keywords,edit:function(n){var r=new Array;return e.each(f.attributes,function(e,o){var c=null,C=o.blocktype;if(void 0!==C){switch(C){case"select":c=a;break;case"text":c=d;break;case"textarea":c=h;break;case"toggle":c=s;break;case"checkbox":c=l;break;case"number":case"range":c=i;break;case"color":case"colorpicker":c=p;break;case"radio":c=u}if(null!=c){var g=helpMessageUncheked="";"undefined"!=typeof o.helps&&"undefined"!=typeof o.helps.checked&&"undefined"!=typeof o.helps.unchecked?(g=o.helps.checked,helpMessageUncheked=o.helps.unchecked):"undefined"!=typeof o.help&&(g=helpMessageUncheked=o.help),r.push(t(c,{value:n.attributes[e],options:o.options,label:o.label,checked:n.attributes[e],selected:n.attributes[e],help:n.attributes[e]?g:helpMessageUncheked,disableAlpha:o.disableAlpha,min:o.min,max:o.max,multiple:o.multiple,onChange:function(t,o=e){n=b(t,o,n,C)},onChangeComplete:function(t,o=e){n=b(t,o,n,C)}}))}}}),sc=g(n,f,"edit"),[t(o,null,t(c,null,r),sc)]},save:function(e){return g(e,f,"save")}})})}(jQuery);
 
 
 
 
 
1
+ (function(h){function q(g,b,e){var f="";f="";if("undefined"!=typeof b.callback&&"function"==typeof h[b.callback])f=h[b.callback](g,b);else{var c="["+b.shortcode_name;h.each(g.attributes,function(a,d){"undefined"!=typeof b.attributes&&"undefined"!=typeof b.attributes[a]&&(c+=" "+a+"=",c=1==b.attributes[a].remove_quotes?c+d:c+('"'+d+'"'))});c+="]";g=md5(c);f='<span class="yith_block_'+g+'">'+c+"</span>";"edit"==e&&0!=b.do_shortcode&&function(a){var d=null;h(document).trigger("yith_plugin_fw_gutenberg_before_do_shortcode",
2
+ [c,a]);h.ajax({async:!0,url:yith_gutenberg_ajax.ajaxurl,method:"post",data:{action:"yith_plugin_fw_gutenberg_do_shortcode",shortcode:c},success:function(l){d=l;""!=d&&(h(".yith_block_"+a).html(d),h(document).trigger("yith_plugin_fw_gutenberg_success_do_shortcode",[c,a,d]))}});h(document).trigger("yith_plugin_fw_gutenberg_after_do_shortcode",[c,a,d]);return d}(g);f=m(t,null,f)}return f}function r(g,b,e,f){var c={};if("colorpicker"==f||"color"==f)g=g.hex;c[b]=g;e.setAttributes(c);return e}var m=wp.element.createElement,
3
+ u=wp.element.Fragment,v=wp.blocks.registerBlockType,w=wp.editor.InspectorControls,t=wp.element.RawHTML,x=wp.components.SelectControl,y=wp.components.ToggleControl,z=wp.components.CheckboxControl,A=wp.components.RangeControl,B=wp.components.ColorPicker,C=wp.components.RadioControl,D=wp.components.TextControl,E=wp.components.TextareaControl,F=m("svg",{width:22,height:22},m("path",{d:"M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"}));
4
+ h.each(yith_gutenberg,function(g,b){v("yith/"+g,{title:b.title,description:b.description,category:b.category,attributes:b.attributes,icon:"undefined"!=typeof b.icon?b.icon:F,keywords:b.keywords,edit:function(e){var f=[];h.each(b.attributes,function(c,a){var d=null,l=a.blocktype;if("undefined"!=typeof l){switch(l){case "select":d=x;break;case "text":d=D;break;case "textarea":d=E;break;case "toggle":d=y;break;case "checkbox":d=z;break;case "number":case "range":d=A;break;case "color":case "colorpicker":d=
5
+ B;break;case "radio":d=C}if(null!=d){var n=helpMessageUncheked="";"undefined"!=typeof a.helps&&"undefined"!=typeof a.helps.checked&&"undefined"!=typeof a.helps.unchecked?(n=a.helps.checked,helpMessageUncheked=a.helps.unchecked):"undefined"!=typeof a.help&&(n=helpMessageUncheked=a.help);f.push(m(d,{value:e.attributes[c],options:a.options,label:a.label,checked:e.attributes[c],selected:e.attributes[c],help:e.attributes[c]?n:helpMessageUncheked,disableAlpha:a.disableAlpha,min:a.min,max:a.max,multiple:a.multiple,
6
+ onChange:function(p,k){k=void 0===k?c:k;e=r(p,k,e,l)},onChangeComplete:function(p,k){k=void 0===k?c:k;e=r(p,k,e,l)}}))}}});sc=q(e,b,"edit");return[m(u,null,m(w,null,f),sc)]},save:function(e){return q(e,b,"save")}})})})(jQuery);
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.4.29
5
  * Author: YITH
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.4.31
5
  * Author: YITH
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -67,6 +67,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
67
  * Constructor
68
  *
69
  * @param array $args
 
70
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
71
  * @since 1.0
72
  */
@@ -84,8 +85,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
84
  );
85
 
86
  $args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
87
- if ( isset( $args['parent_page'] ) && 'yit_plugin_panel' === $args['parent_page'] )
88
  $args['parent_page'] = 'yith_plugin_panel';
 
89
 
90
  $this->settings = $args;
91
  $this->_tabs_path_files = $this->get_tabs_path_files();
@@ -113,10 +115,10 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
113
 
114
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
115
 
116
- //yith-plugin-ui
117
- add_action( 'yith_plugin_fw_before_yith_panel', array( $this, 'add_plugin_banner' ), 10, 1 );
118
- add_action( 'wp_ajax_yith_plugin_fw_save_toggle_element', array( $this, 'save_toggle_element_options' ) );
119
- }
120
 
121
  /**
122
  * Is this a custom post type page?
@@ -130,7 +132,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
130
  $excluded_post_types = array( 'product', 'page', 'post' );
131
 
132
  return in_array( $pagenow, array( 'post.php', 'post-new.php', 'edit.php' ), true ) &&
133
- ! in_array( $post_type, $excluded_post_types, true );
134
  }
135
 
136
  /**
@@ -145,7 +147,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
145
  $excluded_taxonomies = array( 'category', 'post_tag', 'product_cat', 'product_tag' );
146
 
147
  return in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) &&
148
- ! in_array( $taxonomy, $excluded_taxonomies, true );
149
  }
150
 
151
  /**
@@ -168,6 +170,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
168
  $tabs = $this->get_taxonomy_tabs( $taxonomy );
169
  }
170
 
 
 
171
  if ( $tabs ) {
172
  // tabs_in_edit
173
  $current_tab_args = array(
@@ -176,14 +180,18 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
176
  'current_sub_tab' => isset( $tabs['sub_tab'] ) ? $tabs['sub_tab'] : '',
177
  );
178
 
179
- wp_enqueue_style( 'yit-plugin-style' );
180
- wp_enqueue_style( 'yith-plugin-fw-fields' );
181
- wp_enqueue_script( 'yith-plugin-fw-wp-pages' );
 
 
182
 
183
  if ( ! self::$_panel_tabs_in_wp_pages ) {
184
  self::$_panel_tabs_in_wp_pages = $current_tab_args;
185
- add_action( 'all_admin_notices', array( $this, 'print_panel_tabs_in_wp_pages' ) );
186
- add_action( 'admin_footer', array( $this, 'print_panel_tabs_in_wp_pages_end' ) );
 
 
187
  add_filter( 'parent_file', array( $this, 'set_parent_file_to_handle_menu_for_wp_pages' ) );
188
  add_filter( 'submenu_file', array( $this, 'set_submenu_file_to_handle_menu_for_wp_pages' ), 10, 2 );
189
  }
@@ -250,14 +258,16 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
250
  * Add yith-plugin-fw-panel in body classes in Panel pages
251
  *
252
  * @param $admin_body_classes
 
253
  * @return string
254
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
255
  * @since 3.0.0
256
  */
257
  public static function add_body_class( $admin_body_classes ) {
258
  global $pagenow;
259
- if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) )
260
  $admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
 
261
 
262
  return $admin_body_classes;
263
  }
@@ -355,6 +365,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
355
  * a callback function called by Register Settings function
356
  *
357
  * @param $input
 
358
  * @return array validate input fields
359
  * @since 1.0
360
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -463,6 +474,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
463
  * Print the tabs navigation
464
  *
465
  * @param array $args
 
466
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
467
  * @since 3.4.0
468
  */
@@ -524,6 +536,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
524
  * @param string $tab
525
  * @param string $sub_tab
526
  * @param string $parent_page
 
527
  * @return string
528
  */
529
  public function get_nav_url( $page, $tab, $sub_tab = '', $parent_page = '' ) {
@@ -548,6 +561,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
548
  * Print the Sub-tabs navigation if the current tab has sub-tabs
549
  *
550
  * @param array $args
 
551
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
552
  * @since 3.4.0
553
  */
@@ -597,6 +611,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
597
 
598
  if ( $custom_tab_action ) {
599
  $this->print_custom_tab( $custom_tab_action );
 
600
  return;
601
  }
602
 
@@ -612,17 +627,17 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
612
  <p>&nbsp;</p>
613
  <?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
614
  <input type="hidden" name="<?php echo $this->get_name_field( 'option_key' ) ?>"
615
- value="<?php echo esc_attr( $option_key ) ?>"/>
616
  <input type="submit" class="button-primary"
617
- value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>"
618
- style="float:left;margin-right:10px;"/>
619
  </form>
620
  <form method="post">
621
  <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
622
  <input type="hidden" name="yit-action" value="reset"/>
623
  <input type="submit" name="yit-reset" class="button-secondary"
624
- value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>"
625
- onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');"/>
626
  </form>
627
  <p>&nbsp;</p>
628
  <?php endif ?>
@@ -637,6 +652,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
637
  *
638
  * @param array $options
639
  * @param string $option_key
 
640
  * @return bool
641
  */
642
  public function is_custom_tab( $options, $option_key ) {
@@ -655,6 +671,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
655
  $first = ! ! $tab_options && is_array( $tab_options ) ? current( $tab_options ) : array();
656
  $type = isset( $first['type'] ) ? $first['type'] : 'options';
657
  $special_types = array( 'post_type', 'taxonomy', 'custom_tab', 'multi_tab' );
 
658
  return in_array( $type, $special_types ) ? $type : 'options';
659
  }
660
 
@@ -675,6 +692,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
675
  * Fire the action to print the custom tab
676
  *
677
  * @param string $action Action to fire
 
678
  * @return void
679
  * @since 1.0
680
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
@@ -730,11 +748,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
730
  foreach ( $this->settings['admin-tabs'] as $item => $title ) {
731
 
732
  $wp_admin_bar->add_menu( array(
733
- 'parent' => $this->settings['parent'],
734
- 'title' => $title,
735
- 'id' => $this->settings['parent'] . '-' . $item,
736
- 'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings['parent_page'] . '&tab=' . $item,
737
- ) );
738
  }
739
  }
740
  }
@@ -848,6 +866,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
848
  * @param $message
849
  * @param string $type can be 'error' or 'updated'
850
  * @param bool $echo
 
851
  * @return string
852
  * @since 1.0
853
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -876,7 +895,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
876
 
877
  $tabs = array();
878
 
879
- foreach ( ( array )glob( $option_files_path . '*.php' ) as $filename ) {
880
  preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
881
 
882
  if ( ! isset( $filename_parts[1] ) ) {
@@ -915,6 +934,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
915
  * Return the sub-tabs array of a specific tab
916
  *
917
  * @param array|bool $_tab the tab; if not set it'll be the current tab
 
918
  * @since 3.4.0
919
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
920
  * @return array sub-tabs array
@@ -937,6 +957,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
937
  if ( $_first && is_array( $_first ) && isset( $_first['type'] ) && 'multi_tab' === $_first['type'] && ! empty( $_first['sub-tabs'] ) ) {
938
  return $_first['sub-tabs'];
939
  }
 
940
  return array();
941
  }
942
 
@@ -1005,6 +1026,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1005
  }
1006
  }
1007
  }
 
1008
  return '';
1009
  }
1010
 
@@ -1013,6 +1035,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1013
  * return the title of section
1014
  *
1015
  * @param $section
 
1016
  * @return string
1017
  * @since 1.0
1018
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -1026,6 +1049,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1026
  return $option['name'];
1027
  }
1028
  }
 
1029
  return '';
1030
  }
1031
 
@@ -1034,6 +1058,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1034
  * return the description of section if is set
1035
  *
1036
  * @param $section
 
1037
  * @return string
1038
  * @since 1.0
1039
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -1047,6 +1072,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1047
  return '<p>' . $option['desc'] . '</p>';
1048
  }
1049
  }
 
1050
  return '';
1051
  }
1052
 
@@ -1082,6 +1108,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1082
  * return a string with the name of the input field
1083
  *
1084
  * @param string $name
 
1085
  * @return string
1086
  * @since 1.0
1087
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -1095,6 +1122,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1095
  * return a string with the id of the input field
1096
  *
1097
  * @param string $id
 
1098
  * @return string
1099
  * @since 1.0
1100
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -1110,6 +1138,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1110
  * return a text area
1111
  *
1112
  * @param array $param
 
1113
  * @return void
1114
  * @since 1.0
1115
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
@@ -1132,11 +1161,13 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1132
  $std = isset( $option['std'] ) ? $option['std'] : '';
1133
  $db_value = ( isset( $db_options[ $option['id'] ] ) ) ? $db_options[ $option['id'] ] : $std;
1134
 
1135
- if ( isset( $option['deps'] ) )
1136
  $deps = $option['deps'];
 
1137
 
1138
- if ( 'on-off' === $option['type'] )
1139
  $option['type'] = 'onoff';
 
1140
 
1141
  if ( $field_template_path = yith_plugin_fw_get_field_template_path( $option ) ) {
1142
  $field_container_path = apply_filters( 'yith_plugin_fw_panel_field_container_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/panel-field-container.php', $option );
@@ -1169,6 +1200,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1169
  * Show a box panel with specific content in two columns as a new woocommerce type
1170
  *
1171
  * @param array $args
 
1172
  * @return void
1173
  * @since 1.0
1174
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
@@ -1184,6 +1216,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1184
  * Show a box panel with specific content in two columns as a new woocommerce type
1185
  *
1186
  * @param array $args
 
1187
  * @return void
1188
  * @deprecated 3.0.12 Do nothing! Method left to prevent Fatal Error if called directly
1189
  */
@@ -1278,11 +1311,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1278
  </div>
1279
  <div class="yith-plugin-fw-rate">
1280
  <?php printf( '<strong>%s</strong> %s <a href="%s" target="_blank"><u>%s</u> <span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a> %s',
1281
- __( 'We need your support', 'yith-plugin-fw' ),
1282
- __( 'to keep updating and improving the plugin. Please,', 'yith-plugin-fw' ),
1283
- $rate_link,
1284
- __( 'help us by leaving a five-star rating', 'yith-plugin-fw' ),
1285
- __( ':) Thanks!', 'yith-plugin-fw' ) ) ?>
1286
  </div>
1287
  <?php else: ?>
1288
  <h1 class="notice-container"></h1>
@@ -1368,72 +1401,73 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
1368
  public function maybe_redirect_to_proper_wp_page() {
1369
  global $pagenow;
1370
  if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && $this->settings['page'] === $_GET['page'] &&
1371
- ! $this->is_custom_taxonomy_page() && ! $this->is_custom_post_type_page() && ! isset( $_REQUEST['yith-plugin-fw-panel-skip-redirect'] ) ) {
1372
  $url = $this->get_nav_url( $this->settings['page'], $this->get_current_tab(), $this->get_current_sub_tab() );
1373
  if ( strpos( $url, 'edit.php' ) !== false || strpos( $url, 'edit-tags.php' ) !== false ) {
1374
  wp_safe_redirect( add_query_arg( array( 'yith-plugin-fw-panel-skip-redirect' => 1 ), $url ) );
1375
  exit;
1376
  }
1377
  }
1378
- }
1379
-
1380
- /**
1381
- * Print the Panel tabs and sub-tabs navigation in WP pages
1382
- * Important: this opens a wrapper <div> that will be closed through YIT_Plugin_Panel::print_panel_tabs_in_post_edit_page_end()
1383
- *
1384
- * @since 3.4.0
1385
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
1386
- */
1387
- public function print_panel_tabs_in_wp_pages() {
1388
- if ( self::$_panel_tabs_in_wp_pages ) {
1389
- wp_enqueue_style( 'yit-plugin-style' );
1390
- wp_enqueue_script( 'yit-plugin-panel' );
1391
-
1392
- $wrap_class = isset( $this->settings[ 'class' ] ) ? $this->settings[ 'class' ] : '';
1393
-
1394
- ?>
1395
- <div class="yith-plugin-fw-wp-page-wrapper">
1396
- <?php
1397
- echo "<div class='{$wrap_class}'>";
1398
- $this->add_plugin_banner( $this->settings[ 'page' ] );
1399
- $this->print_tabs_nav( self::$_panel_tabs_in_wp_pages );
1400
- echo "</div>";
1401
- }
1402
- }
1403
-
1404
-
1405
- /**
1406
- * Close the wrapper opened in YIT_Plugin_Panel::print_panel_tabs_in_wp_pages()
1407
- *
1408
- * @since 3.4.0
1409
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
1410
- */
1411
- public function print_panel_tabs_in_wp_pages_end() {
1412
- if ( self::$_panel_tabs_in_wp_pages ) {
1413
- echo "</div><!-- /yith-plugin-fw-wp-page-wrapper -->";
1414
- }
1415
- }
1416
-
1417
- public function set_parent_file_to_handle_menu_for_wp_pages( $parent_file ) {
1418
- if ( self::$_panel_tabs_in_wp_pages ) {
1419
- return 'yith_plugin_panel';
1420
- }
1421
-
1422
- return $parent_file;
1423
- }
1424
-
1425
- public function set_submenu_file_to_handle_menu_for_wp_pages( $submenu_file, $parent_file ) {
1426
- if ( self::$_panel_tabs_in_wp_pages ) {
1427
- return $this->settings[ 'page' ];
1428
- }
1429
- return $submenu_file;
1430
- }
1431
-
1432
- /**
1433
- *
1434
- */
1435
- public function save_toggle_element_options() {
1436
- return true;
1437
- }
1438
- }
 
1439
  }
67
  * Constructor
68
  *
69
  * @param array $args
70
+ *
71
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
72
  * @since 1.0
73
  */
85
  );
86
 
87
  $args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
88
+ if ( isset( $args['parent_page'] ) && 'yit_plugin_panel' === $args['parent_page'] ) {
89
  $args['parent_page'] = 'yith_plugin_panel';
90
+ }
91
 
92
  $this->settings = $args;
93
  $this->_tabs_path_files = $this->get_tabs_path_files();
115
 
116
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
117
 
118
+ //yith-plugin-ui
119
+ add_action( 'yith_plugin_fw_before_yith_panel', array( $this, 'add_plugin_banner' ), 10, 1 );
120
+ add_action( 'wp_ajax_yith_plugin_fw_save_toggle_element', array( $this, 'save_toggle_element_options' ) );
121
+ }
122
 
123
  /**
124
  * Is this a custom post type page?
132
  $excluded_post_types = array( 'product', 'page', 'post' );
133
 
134
  return in_array( $pagenow, array( 'post.php', 'post-new.php', 'edit.php' ), true ) &&
135
+ ! in_array( $post_type, $excluded_post_types, true );
136
  }
137
 
138
  /**
147
  $excluded_taxonomies = array( 'category', 'post_tag', 'product_cat', 'product_tag' );
148
 
149
  return in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) &&
150
+ ! in_array( $taxonomy, $excluded_taxonomies, true );
151
  }
152
 
153
  /**
170
  $tabs = $this->get_taxonomy_tabs( $taxonomy );
171
  }
172
 
173
+ $is_block_editor = function_exists( 'get_current_screen' ) && get_current_screen() && get_current_screen()->is_block_editor();
174
+
175
  if ( $tabs ) {
176
  // tabs_in_edit
177
  $current_tab_args = array(
180
  'current_sub_tab' => isset( $tabs['sub_tab'] ) ? $tabs['sub_tab'] : '',
181
  );
182
 
183
+ if ( ! $is_block_editor ) {
184
+ wp_enqueue_style( 'yit-plugin-style' );
185
+ wp_enqueue_style( 'yith-plugin-fw-fields' );
186
+ wp_enqueue_script( 'yith-plugin-fw-wp-pages' );
187
+ }
188
 
189
  if ( ! self::$_panel_tabs_in_wp_pages ) {
190
  self::$_panel_tabs_in_wp_pages = $current_tab_args;
191
+ if ( ! $is_block_editor ) {
192
+ add_action( 'all_admin_notices', array( $this, 'print_panel_tabs_in_wp_pages' ) );
193
+ add_action( 'admin_footer', array( $this, 'print_panel_tabs_in_wp_pages_end' ) );
194
+ }
195
  add_filter( 'parent_file', array( $this, 'set_parent_file_to_handle_menu_for_wp_pages' ) );
196
  add_filter( 'submenu_file', array( $this, 'set_submenu_file_to_handle_menu_for_wp_pages' ), 10, 2 );
197
  }
258
  * Add yith-plugin-fw-panel in body classes in Panel pages
259
  *
260
  * @param $admin_body_classes
261
+ *
262
  * @return string
263
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
264
  * @since 3.0.0
265
  */
266
  public static function add_body_class( $admin_body_classes ) {
267
  global $pagenow;
268
+ if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) ) {
269
  $admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
270
+ }
271
 
272
  return $admin_body_classes;
273
  }
365
  * a callback function called by Register Settings function
366
  *
367
  * @param $input
368
+ *
369
  * @return array validate input fields
370
  * @since 1.0
371
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
474
  * Print the tabs navigation
475
  *
476
  * @param array $args
477
+ *
478
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
479
  * @since 3.4.0
480
  */
536
  * @param string $tab
537
  * @param string $sub_tab
538
  * @param string $parent_page
539
+ *
540
  * @return string
541
  */
542
  public function get_nav_url( $page, $tab, $sub_tab = '', $parent_page = '' ) {
561
  * Print the Sub-tabs navigation if the current tab has sub-tabs
562
  *
563
  * @param array $args
564
+ *
565
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
566
  * @since 3.4.0
567
  */
611
 
612
  if ( $custom_tab_action ) {
613
  $this->print_custom_tab( $custom_tab_action );
614
+
615
  return;
616
  }
617
 
627
  <p>&nbsp;</p>
628
  <?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
629
  <input type="hidden" name="<?php echo $this->get_name_field( 'option_key' ) ?>"
630
+ value="<?php echo esc_attr( $option_key ) ?>"/>
631
  <input type="submit" class="button-primary"
632
+ value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>"
633
+ style="float:left;margin-right:10px;"/>
634
  </form>
635
  <form method="post">
636
  <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
637
  <input type="hidden" name="yit-action" value="reset"/>
638
  <input type="submit" name="yit-reset" class="button-secondary"
639
+ value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>"
640
+ onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');"/>
641
  </form>
642
  <p>&nbsp;</p>
643
  <?php endif ?>
652
  *
653
  * @param array $options
654
  * @param string $option_key
655
+ *
656
  * @return bool
657
  */
658
  public function is_custom_tab( $options, $option_key ) {
671
  $first = ! ! $tab_options && is_array( $tab_options ) ? current( $tab_options ) : array();
672
  $type = isset( $first['type'] ) ? $first['type'] : 'options';
673
  $special_types = array( 'post_type', 'taxonomy', 'custom_tab', 'multi_tab' );
674
+
675
  return in_array( $type, $special_types ) ? $type : 'options';
676
  }
677
 
692
  * Fire the action to print the custom tab
693
  *
694
  * @param string $action Action to fire
695
+ *
696
  * @return void
697
  * @since 1.0
698
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
748
  foreach ( $this->settings['admin-tabs'] as $item => $title ) {
749
 
750
  $wp_admin_bar->add_menu( array(
751
+ 'parent' => $this->settings['parent'],
752
+ 'title' => $title,
753
+ 'id' => $this->settings['parent'] . '-' . $item,
754
+ 'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings['parent_page'] . '&tab=' . $item,
755
+ ) );
756
  }
757
  }
758
  }
866
  * @param $message
867
  * @param string $type can be 'error' or 'updated'
868
  * @param bool $echo
869
+ *
870
  * @return string
871
  * @since 1.0
872
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
895
 
896
  $tabs = array();
897
 
898
+ foreach ( ( array ) glob( $option_files_path . '*.php' ) as $filename ) {
899
  preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
900
 
901
  if ( ! isset( $filename_parts[1] ) ) {
934
  * Return the sub-tabs array of a specific tab
935
  *
936
  * @param array|bool $_tab the tab; if not set it'll be the current tab
937
+ *
938
  * @since 3.4.0
939
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
940
  * @return array sub-tabs array
957
  if ( $_first && is_array( $_first ) && isset( $_first['type'] ) && 'multi_tab' === $_first['type'] && ! empty( $_first['sub-tabs'] ) ) {
958
  return $_first['sub-tabs'];
959
  }
960
+
961
  return array();
962
  }
963
 
1026
  }
1027
  }
1028
  }
1029
+
1030
  return '';
1031
  }
1032
 
1035
  * return the title of section
1036
  *
1037
  * @param $section
1038
+ *
1039
  * @return string
1040
  * @since 1.0
1041
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
1049
  return $option['name'];
1050
  }
1051
  }
1052
+
1053
  return '';
1054
  }
1055
 
1058
  * return the description of section if is set
1059
  *
1060
  * @param $section
1061
+ *
1062
  * @return string
1063
  * @since 1.0
1064
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
1072
  return '<p>' . $option['desc'] . '</p>';
1073
  }
1074
  }
1075
+
1076
  return '';
1077
  }
1078
 
1108
  * return a string with the name of the input field
1109
  *
1110
  * @param string $name
1111
+ *
1112
  * @return string
1113
  * @since 1.0
1114
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
1122
  * return a string with the id of the input field
1123
  *
1124
  * @param string $id
1125
+ *
1126
  * @return string
1127
  * @since 1.0
1128
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
1138
  * return a text area
1139
  *
1140
  * @param array $param
1141
+ *
1142
  * @return void
1143
  * @since 1.0
1144
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
1161
  $std = isset( $option['std'] ) ? $option['std'] : '';
1162
  $db_value = ( isset( $db_options[ $option['id'] ] ) ) ? $db_options[ $option['id'] ] : $std;
1163
 
1164
+ if ( isset( $option['deps'] ) ) {
1165
  $deps = $option['deps'];
1166
+ }
1167
 
1168
+ if ( 'on-off' === $option['type'] ) {
1169
  $option['type'] = 'onoff';
1170
+ }
1171
 
1172
  if ( $field_template_path = yith_plugin_fw_get_field_template_path( $option ) ) {
1173
  $field_container_path = apply_filters( 'yith_plugin_fw_panel_field_container_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/panel-field-container.php', $option );
1200
  * Show a box panel with specific content in two columns as a new woocommerce type
1201
  *
1202
  * @param array $args
1203
+ *
1204
  * @return void
1205
  * @since 1.0
1206
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
1216
  * Show a box panel with specific content in two columns as a new woocommerce type
1217
  *
1218
  * @param array $args
1219
+ *
1220
  * @return void
1221
  * @deprecated 3.0.12 Do nothing! Method left to prevent Fatal Error if called directly
1222
  */
1311
  </div>
1312
  <div class="yith-plugin-fw-rate">
1313
  <?php printf( '<strong>%s</strong> %s <a href="%s" target="_blank"><u>%s</u> <span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a> %s',
1314
+ __( 'We need your support', 'yith-plugin-fw' ),
1315
+ __( 'to keep updating and improving the plugin. Please,', 'yith-plugin-fw' ),
1316
+ $rate_link,
1317
+ __( 'help us by leaving a five-star rating', 'yith-plugin-fw' ),
1318
+ __( ':) Thanks!', 'yith-plugin-fw' ) ) ?>
1319
  </div>
1320
  <?php else: ?>
1321
  <h1 class="notice-container"></h1>
1401
  public function maybe_redirect_to_proper_wp_page() {
1402
  global $pagenow;
1403
  if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && $this->settings['page'] === $_GET['page'] &&
1404
+ ! $this->is_custom_taxonomy_page() && ! $this->is_custom_post_type_page() && ! isset( $_REQUEST['yith-plugin-fw-panel-skip-redirect'] ) ) {
1405
  $url = $this->get_nav_url( $this->settings['page'], $this->get_current_tab(), $this->get_current_sub_tab() );
1406
  if ( strpos( $url, 'edit.php' ) !== false || strpos( $url, 'edit-tags.php' ) !== false ) {
1407
  wp_safe_redirect( add_query_arg( array( 'yith-plugin-fw-panel-skip-redirect' => 1 ), $url ) );
1408
  exit;
1409
  }
1410
  }
1411
+ }
1412
+
1413
+ /**
1414
+ * Print the Panel tabs and sub-tabs navigation in WP pages
1415
+ * Important: this opens a wrapper <div> that will be closed through YIT_Plugin_Panel::print_panel_tabs_in_post_edit_page_end()
1416
+ *
1417
+ * @since 3.4.0
1418
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
1419
+ */
1420
+ public function print_panel_tabs_in_wp_pages() {
1421
+ if ( self::$_panel_tabs_in_wp_pages ) {
1422
+ wp_enqueue_style( 'yit-plugin-style' );
1423
+ wp_enqueue_script( 'yit-plugin-panel' );
1424
+
1425
+ $wrap_class = isset( $this->settings['class'] ) ? $this->settings['class'] : '';
1426
+
1427
+ ?>
1428
+ <div class="yith-plugin-fw-wp-page-wrapper">
1429
+ <?php
1430
+ echo "<div class='{$wrap_class}'>";
1431
+ $this->add_plugin_banner( $this->settings['page'] );
1432
+ $this->print_tabs_nav( self::$_panel_tabs_in_wp_pages );
1433
+ echo "</div>";
1434
+ }
1435
+ }
1436
+
1437
+
1438
+ /**
1439
+ * Close the wrapper opened in YIT_Plugin_Panel::print_panel_tabs_in_wp_pages()
1440
+ *
1441
+ * @since 3.4.0
1442
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
1443
+ */
1444
+ public function print_panel_tabs_in_wp_pages_end() {
1445
+ if ( self::$_panel_tabs_in_wp_pages ) {
1446
+ echo "</div><!-- /yith-plugin-fw-wp-page-wrapper -->";
1447
+ }
1448
+ }
1449
+
1450
+ public function set_parent_file_to_handle_menu_for_wp_pages( $parent_file ) {
1451
+ if ( self::$_panel_tabs_in_wp_pages ) {
1452
+ return 'yith_plugin_panel';
1453
+ }
1454
+
1455
+ return $parent_file;
1456
+ }
1457
+
1458
+ public function set_submenu_file_to_handle_menu_for_wp_pages( $submenu_file, $parent_file ) {
1459
+ if ( self::$_panel_tabs_in_wp_pages ) {
1460
+ return $this->settings['page'];
1461
+ }
1462
+
1463
+ return $submenu_file;
1464
+ }
1465
+
1466
+ /**
1467
+ *
1468
+ */
1469
+ public function save_toggle_element_options() {
1470
+ return true;
1471
+ }
1472
+ }
1473
  }
plugin-fw/templates/fields/dimensions.php CHANGED
@@ -57,25 +57,7 @@ if ( $allow_linked && 'yes' === $linked ) {
57
  <?php echo $custom_attributes ?>
58
  <?php echo isset( $data ) ? yith_plugin_fw_html_data_to_string( $data ) : ''; ?>
59
  >
60
- <div class="yith-plugin-fw-dimensions__units">
61
- <input class='yith-plugin-fw-dimensions__unit__value' type="hidden" name="<?php echo $name ?>[unit]" value="<?php echo isset( $value['unit'] ) ? $value['unit'] : current( array_keys( $units ) ) ?>">
62
- <?php foreach ( $units as $key => $label ) : ?>
63
- <?php
64
- $key = sanitize_title( $key );
65
- $classes = array(
66
- 'yith-plugin-fw-dimensions__unit',
67
- "yith-plugin-fw-dimensions__unit--{$key}-unit",
68
- );
69
- if ( $unit_value === $key ) {
70
- $classes[] = 'yith-plugin-fw-dimensions__unit--selected';
71
- }
72
- $classes = implode( ' ', $classes );
73
- ?>
74
- <span class="<?php echo $classes; ?>" data-value="<?php echo $key; ?>"><?php echo $label; ?></span>
75
- <?php endforeach ?>
76
- </div>
77
-
78
- <ul class="yith-plugin-fw-dimensions__dimensions">
79
  <?php foreach ( $dimensions as $key => $dimension ) : ?>
80
  <?php
81
  $d_id = "{$id}-dimension-" . sanitize_title( $key );
@@ -104,20 +86,37 @@ if ( $allow_linked && 'yes' === $linked ) {
104
  }
105
 
106
  ?>
107
- <li class="yith-plugin-fw-dimensions__dimension yith-plugin-fw-dimensions__dimension--<?php echo sanitize_title( $key ); ?>">
 
108
  <input id="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__number"
109
  type="number" name="<?php echo $d_name; ?>" value="<?php echo $d_value; ?>"
110
  <?php echo $d_attributes; ?>
111
  >
112
- <label for="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__label"><?php echo $d_label; ?></label>
113
- </li>
114
  <?php endforeach ?>
115
 
116
  <?php if ( $allow_linked ): ?>
117
- <li class="yith-plugin-fw-dimensions__linked" title="<?php _ex( 'Link values together', 'Tooltip in the "Dimensions" field', 'yith-plugin-fw' ); ?>">
118
  <input class='yith-plugin-fw-dimensions__linked__value' type="hidden" name="<?php echo $name ?>[linked]" value="<?php echo $linked ?>">
119
  <span class="dashicons dashicons-admin-links"></span>
120
- </li>
121
  <?php endif; ?>
122
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  </div>
57
  <?php echo $custom_attributes ?>
58
  <?php echo isset( $data ) ? yith_plugin_fw_html_data_to_string( $data ) : ''; ?>
59
  >
60
+ <div class="yith-plugin-fw-dimensions__dimensions">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  <?php foreach ( $dimensions as $key => $dimension ) : ?>
62
  <?php
63
  $d_id = "{$id}-dimension-" . sanitize_title( $key );
86
  }
87
 
88
  ?>
89
+ <div class="yith-plugin-fw-dimensions__dimension yith-plugin-fw-dimensions__dimension--<?php echo sanitize_title( $key ); ?>">
90
+ <label for="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__label"><?php echo $d_label; ?></label>
91
  <input id="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__number"
92
  type="number" name="<?php echo $d_name; ?>" value="<?php echo $d_value; ?>"
93
  <?php echo $d_attributes; ?>
94
  >
95
+ </div>
 
96
  <?php endforeach ?>
97
 
98
  <?php if ( $allow_linked ): ?>
99
+ <div class="yith-plugin-fw-dimensions__linked" title="<?php _ex( 'Link values together', 'Tooltip in the "Dimensions" field', 'yith-plugin-fw' ); ?>">
100
  <input class='yith-plugin-fw-dimensions__linked__value' type="hidden" name="<?php echo $name ?>[linked]" value="<?php echo $linked ?>">
101
  <span class="dashicons dashicons-admin-links"></span>
102
+ </div>
103
  <?php endif; ?>
104
+ </div>
105
+ <div class="yith-plugin-fw-dimensions__units">
106
+ <input class='yith-plugin-fw-dimensions__unit__value' type="hidden" name="<?php echo $name ?>[unit]" value="<?php echo isset( $value['unit'] ) ? $value['unit'] : current( array_keys( $units ) ) ?>">
107
+ <?php foreach ( $units as $key => $label ) : ?>
108
+ <?php
109
+ $key = sanitize_title( $key );
110
+ $classes = array(
111
+ 'yith-plugin-fw-dimensions__unit',
112
+ "yith-plugin-fw-dimensions__unit--{$key}-unit",
113
+ );
114
+ if ( $unit_value === $key ) {
115
+ $classes[] = 'yith-plugin-fw-dimensions__unit--selected';
116
+ }
117
+ $classes = implode( ' ', $classes );
118
+ ?>
119
+ <span class="<?php echo $classes; ?>" data-value="<?php echo $key; ?>"><?php echo $label; ?></span>
120
+ <?php endforeach ?>
121
+ </div>
122
  </div>
plugin-fw/templates/sysinfo/system-information-panel.php CHANGED
@@ -104,7 +104,7 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
104
  <?php esc_html_e( 'Site URL', 'yith-plugin-fw' ); ?>
105
  </th>
106
  <td class="requirement-value">
107
- <?php echo get_site_url(); ?>
108
  </td>
109
  </tr>
110
  <tr>
@@ -112,7 +112,7 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
112
  <?php esc_html_e( 'Output IP Address', 'yith-plugin-fw' ); ?>
113
  </th>
114
  <td class="requirement-value">
115
- <?php echo $output_ip; ?>
116
  </td>
117
  </tr>
118
  <tr>
@@ -123,6 +123,14 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
123
  <?php echo( defined( 'WP_CACHE' ) && WP_CACHE ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
124
  </td>
125
  </tr>
 
 
 
 
 
 
 
 
126
  </table>
127
 
128
  <table class="widefat striped">
104
  <?php esc_html_e( 'Site URL', 'yith-plugin-fw' ); ?>
105
  </th>
106
  <td class="requirement-value">
107
+ <?php echo esc_attr( get_site_url() ); ?>
108
  </td>
109
  </tr>
110
  <tr>
112
  <?php esc_html_e( 'Output IP Address', 'yith-plugin-fw' ); ?>
113
  </th>
114
  <td class="requirement-value">
115
+ <?php echo esc_attr( $output_ip ); ?>
116
  </td>
117
  </tr>
118
  <tr>
123
  <?php echo( defined( 'WP_CACHE' ) && WP_CACHE ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
124
  </td>
125
  </tr>
126
+ <tr>
127
+ <th>
128
+ <?php esc_html_e( 'External object cache', 'yith-plugin-fw' ); ?>
129
+ </th>
130
+ <td class="requirement-value">
131
+ <?php echo( wp_using_ext_object_cache() ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
132
+ </td>
133
+ </tr>
134
  </table>
135
 
136
  <table class="widefat striped">