YITH WooCommerce Ajax Search - Version 1.6.8

Version Description

  • Released: Jun 12, 2019 = Update: Plugin Core 3.3.1
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Search
Version 1.6.8
Comparing to
See all releases

Code changes from version 1.6.7 to 1.6.8

Files changed (47) hide show
  1. README.txt +4 -1
  2. init.php +2 -2
  3. plugin-fw/assets/css/metaboxes.css +18 -1
  4. plugin-fw/assets/css/yith-fields.css +1427 -9
  5. plugin-fw/assets/fonts/yith-icon.eot +0 -0
  6. plugin-fw/assets/fonts/yith-icon.svg +27 -0
  7. plugin-fw/assets/fonts/yith-icon.ttf +0 -0
  8. plugin-fw/assets/fonts/yith-icon.woff +0 -0
  9. plugin-fw/assets/images/arrow_down.svg +9 -0
  10. plugin-fw/assets/images/banner-free.png +0 -0
  11. plugin-fw/assets/images/banner-premium.png +0 -0
  12. plugin-fw/assets/images/rate_banner.png +0 -0
  13. plugin-fw/assets/images/upgrade_banner.png +0 -0
  14. plugin-fw/assets/js/yith-fields.js +631 -346
  15. plugin-fw/assets/js/yith-fields.min.js +1 -15
  16. plugin-fw/init.php +10 -2
  17. plugin-fw/languages/yith-plugin-fw-it_IT.mo +0 -0
  18. plugin-fw/languages/yith-plugin-fw-it_IT.po +31 -20
  19. plugin-fw/lib/promo/black.jpg +0 -0
  20. plugin-fw/lib/promo/cyber.jpg +0 -0
  21. plugin-fw/lib/promo/halloween.jpg +0 -0
  22. plugin-fw/lib/promo/yith-promo.php +189 -0
  23. plugin-fw/lib/promo/yith-promo.xml +64 -0
  24. plugin-fw/lib/yit-assets.php +8 -3
  25. plugin-fw/lib/yit-metabox.php +127 -34
  26. plugin-fw/lib/yit-plugin-licence.php +4 -1
  27. plugin-fw/lib/yit-plugin-panel-wc.php +123 -4
  28. plugin-fw/lib/yit-plugin-panel.php +106 -2
  29. plugin-fw/lib/yit-theme-licence.php +4 -1
  30. plugin-fw/lib/yit-upgrade.php +4 -1
  31. plugin-fw/templates/fields/colorpicker.php +1 -1
  32. plugin-fw/templates/fields/date-format.php +56 -0
  33. plugin-fw/templates/fields/list-table.php +59 -0
  34. plugin-fw/templates/fields/multi-colorpicker.php +39 -0
  35. plugin-fw/templates/fields/onoff.php +1 -1
  36. plugin-fw/templates/fields/select-buttons.php +3 -2
  37. plugin-fw/templates/fields/select.php +4 -2
  38. plugin-fw/templates/fields/text.php +1 -0
  39. plugin-fw/templates/fields/textarea.php +3 -1
  40. plugin-fw/templates/fields/toggle-element.php +264 -0
  41. plugin-fw/templates/fields/upload.php +3 -3
  42. plugin-fw/templates/metaboxes/field-row.php +1 -0
  43. plugin-fw/templates/metaboxes/tab.php +6 -2
  44. plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php +1 -1
  45. plugin-fw/templates/panel/woocommerce/woocommerce-panel.php +7 -3
  46. plugin-fw/yit-functions.php +98 -1
  47. plugin-fw/yit-plugin.php +1 -0
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
  Requires at least: 4.0.0
6
  Tested up to: 5.2
7
- Stable tag: 1.6.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -138,6 +138,9 @@ If you have created your own language pack for YITH WooCommerce Ajax Search, or
138
  2. YITH WooCommerce Ajax Search in operation displaying WooCommerce search results
139
 
140
  == Changelog ==
 
 
 
141
  = 1.6.7 - Released: May 29, 2019 =
142
  Update: Plugin Core 3.1.29
143
 
4
  Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
  Requires at least: 4.0.0
6
  Tested up to: 5.2
7
+ Stable tag: 1.6.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
138
  2. YITH WooCommerce Ajax Search in operation displaying WooCommerce search results
139
 
140
  == Changelog ==
141
+ = 1.6.8 - Released: Jun 12, 2019 =
142
+ Update: Plugin Core 3.3.1
143
+
144
  = 1.6.7 - Released: May 29, 2019 =
145
  Update: Plugin Core 3.1.29
146
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-ajax-search/
5
  * Description: <code><strong>YITH WooCommerce Ajax Search</strong></code> is the plugin that allows you to search for a specific product by inserting a few characters. Thanks to <strong>Ajax Search</strong>, users can quickly find the contents they are interested in without wasting time among site pages. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 1.6.7
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
@@ -67,7 +67,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
67
  if ( defined( 'YITH_WCAS_VERSION' ) ){
68
  return;
69
  }else{
70
- define( 'YITH_WCAS_VERSION', '1.6.7' );
71
  }
72
 
73
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-ajax-search/
5
  * Description: <code><strong>YITH WooCommerce Ajax Search</strong></code> is the plugin that allows you to search for a specific product by inserting a few characters. Thanks to <strong>Ajax Search</strong>, users can quickly find the contents they are interested in without wasting time among site pages. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 1.6.8
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
67
  if ( defined( 'YITH_WCAS_VERSION' ) ){
68
  return;
69
  }else{
70
+ define( 'YITH_WCAS_VERSION', '1.6.8' );
71
  }
72
 
73
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
plugin-fw/assets/css/metaboxes.css CHANGED
@@ -87,6 +87,20 @@
87
  display : block;
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  .metaboxes-tab .wp-picker-container label {
91
  font-weight : inherit;
92
  width : auto;
@@ -187,7 +201,10 @@
187
  width : 400px;
188
  max-width : 100%;
189
  }
190
-
 
 
 
191
  .metaboxes-tab .yith-plugin-fw-text-array-table input[type=text] {
192
  width : 100%;
193
  }
87
  display : block;
88
  }
89
 
90
+ .metaboxes-tab .yith-plugin-fw-radio__row{
91
+ width: 100%;
92
+ min-height: 20px;
93
+ }
94
+ .metaboxes-tab .yith-plugin-fw-radio__row label,
95
+ .metaboxes-tab .yith-toggle-elements label,
96
+ .metaboxes-tab .yith-add-box label {
97
+ margin-left:0;
98
+ font-weight:normal;
99
+ }
100
+ .metaboxes-tab.yith-plugin-ui .yith-add-box,
101
+ .metaboxes-tab.yith-plugin-ui .yith-toggle-row{
102
+ width : auto;
103
+ }
104
  .metaboxes-tab .wp-picker-container label {
105
  font-weight : inherit;
106
  width : auto;
201
  width : 400px;
202
  max-width : 100%;
203
  }
204
+ .metaboxes-tab.yith-plugin-ui input[type=number]{
205
+ width: auto;
206
+ min-width: 90px;
207
+ }
208
  .metaboxes-tab .yith-plugin-fw-text-array-table input[type=text] {
209
  width : 100%;
210
  }
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -201,15 +201,15 @@ ul.yit-icons-manager-list li.active {
201
  }
202
 
203
  .yith-plugin-fw-onoff-container input + span {
204
- cursor : pointer;
205
- text-indent : -9999px;
206
- display : block;
207
- width : 36px;
208
- height : 20px;
209
- background : #a4a4a4;
210
- border-radius : 24px;
211
- position : relative;
212
- transition : all 0.3s;
213
  }
214
 
215
  .yith-plugin-fw-onoff-container input + span:before {
@@ -399,4 +399,1422 @@ ul.yit-icons-manager-list li.active {
399
  display : block;
400
  max-width : 100%;
401
  margin : 0 auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  }
201
  }
202
 
203
  .yith-plugin-fw-onoff-container input + span {
204
+ cursor: pointer;
205
+ text-indent: -9999px;
206
+ display: block;
207
+ width: 36px;
208
+ height: 20px;
209
+ background: #a4a4a4;
210
+ border-radius: 24px;
211
+ position: relative;
212
+ transition: all 0.3s;
213
  }
214
 
215
  .yith-plugin-fw-onoff-container input + span:before {
399
  display : block;
400
  max-width : 100%;
401
  margin : 0 auto;
402
+ }
403
+
404
+ /****************
405
+ YITH UI
406
+ ****************/
407
+ @font-face {
408
+ font-family: 'yith-icon';
409
+ src: url('../fonts/yith-icon.eot?7ik896');
410
+ src: url('../fonts/yith-icon.eot?7ik896#iefix') format('embedded-opentype'),
411
+ url('../fonts/yith-icon.ttf?7ik896') format('truetype'),
412
+ url('../fonts/yith-icon.woff?7ik896') format('woff'),
413
+ url('../fonts/yith-icon.svg?7ik896#yith-icon') format('svg');
414
+ font-weight: normal;
415
+ font-style: normal;
416
+ }
417
+
418
+ [class^="icon-"], [class*=" icon-"] {
419
+ /* use !important to prevent issues with browser extensions that change fonts */
420
+ font-family: 'yith-icon' !important;
421
+ speak: none;
422
+ font-style: normal;
423
+ font-weight: normal;
424
+ font-variant: normal;
425
+ text-transform: none;
426
+ line-height: 1;
427
+
428
+ /* Better Font Rendering =========== */
429
+ -webkit-font-smoothing: antialiased;
430
+ -moz-osx-font-smoothing: grayscale;
431
+ }
432
+ .icon-drag:before {
433
+ content: "\e90f";
434
+ color: #d8d8d8;
435
+ }
436
+ .icon-arrow_down:before {
437
+ content: "\e900";
438
+ color: #d8d8d8;
439
+ }
440
+ .icon-arrow_left:before {
441
+ content: "\e901";
442
+ color: #d8d8d8;
443
+ }
444
+ .icon-arrow_right:before {
445
+ content: "\e902";
446
+ color: #d8d8d8;
447
+ }
448
+ .icon-arrow_up:before {
449
+ content: "\e903";
450
+ color: #d8d8d8;
451
+ }
452
+ .icon-calendar:before {
453
+ content: "\e904";
454
+ color: #d8d8d8;
455
+ }
456
+ .icon-check:before {
457
+ content: "\e905";
458
+ color: #d8d8d8;
459
+ }
460
+ .icon-close:before {
461
+ content: "\e906";
462
+ color: #d8d8d8;
463
+ }
464
+ .icon-edit:before {
465
+ content: "\e907";
466
+ color: #d8d8d8;
467
+ }
468
+ .icon-magnifier:before {
469
+ content: "\e908";
470
+ color: #d8d8d8;
471
+ }
472
+ .icon-pencil:before {
473
+ content: "\e909";
474
+ color: #d8d8d8;
475
+ }
476
+ .icon-plus:before {
477
+ content: "\e90a";
478
+ color: #d8d8d8;
479
+ }
480
+ .icon-update:before {
481
+ content: "\e90b";
482
+ color: #d8d8d8;
483
+ }
484
+ .icon-upload:before {
485
+ content: "\e90c";
486
+ color: #d8d8d8;
487
+ }
488
+ .icon-trash:before {
489
+ content: "\e90d";
490
+ color: #d8d8d8;
491
+ }
492
+ .icon-info:before {
493
+ content: "\e90e";
494
+ color: #d8d8d8;
495
+ }
496
+ .icon-reset:before {
497
+ content: "\e910";
498
+ color: #d8d8d8;
499
+ }
500
+ .yith-plugin-fw-banner{
501
+ width: 100%;
502
+ height: 75px;
503
+ background: url('../images/banner-premium.png');
504
+ }
505
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free{
506
+ height: 290px;
507
+ background: url('../images/banner-free.png') no-repeat;
508
+ }
509
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free h1{
510
+ max-width: auto;
511
+ text-align:left;
512
+ margin-left: 110px;
513
+ padding-top: 15px;
514
+ padding-bottom: 8px;
515
+ }
516
+
517
+ .yith-plugin-fw-banner h1{
518
+ text-transform: uppercase;
519
+ color: #0c5777;
520
+ font-size: 15px;
521
+ padding-left: 150px;
522
+ font-weight: 700;
523
+ text-align: left;
524
+ display: inline-block;
525
+ box-sizing: border-box;
526
+ }
527
+
528
+ .yith-plugin-fw-banner span{
529
+ font-style:italic;
530
+ display: block;
531
+ font-size: 15px;
532
+ color:#214249;
533
+ text-transform:none;
534
+ text-align: right;
535
+ }
536
+
537
+ .yith-plugin-fw-banner a,
538
+ .yith-plugin-fw-banner a:focus{
539
+ text-decoration: none;
540
+ outline: none;
541
+ box-shadow: none;
542
+ }
543
+
544
+ .yith-banners ul{
545
+ list-style: none;
546
+ margin-left: 10px;
547
+ }
548
+
549
+ .yith-banners ul li{
550
+ display: inline-block;
551
+ margin-left: 10px;
552
+ }
553
+ .yith-plugin-ui a{
554
+ outline: none;
555
+ box-shadow: none;
556
+ }
557
+
558
+ .yith-plugin-ui{
559
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
560
+ }
561
+
562
+ .yith-plugin-ui #wpwrap h2.nav-tab-wrapper, .yith-plugin-ui #wpbody-content h2.nav-tab-wrapper{
563
+ margin-top:10px;
564
+ }
565
+
566
+ .yith-plugin-ui .nav-tab{
567
+ margin-left: 0px;
568
+ margin-right: 2px;
569
+ background-color: #336374;
570
+ color: #fff;
571
+ font-size: 13px;
572
+ padding: 7px 20px;
573
+ border: 0;
574
+ }
575
+ .yith-plugin-ui .nav-tab:first-child{
576
+ border-left: 1px solid #d9d9d9;
577
+ }
578
+
579
+ .yith-plugin-ui .nav-tab.yith-premium{
580
+ background-color: #be421c;
581
+ }
582
+ .yith-plugin-ui .nav-tab-active{
583
+ background-color: #fff;
584
+ color: #336374;
585
+ border-bottom:1px solid #fff;
586
+ }
587
+ .yith-plugin-ui .nav-tab-active.yith-premium{
588
+ background-color: #fff;
589
+ color: #be421c;
590
+ }
591
+ .yith-plugin-ui #plugin-fw-wc{
592
+ padding-top: 0px;
593
+ }
594
+
595
+ .yith-plugin-ui .form-table td{
596
+ padding: 15px 20px;
597
+ }
598
+
599
+ .yith-plugin-ui label{
600
+ color: #33373b;
601
+ font-size: 13px;
602
+ }
603
+
604
+ .yith-plugin-ui span.description{
605
+ color: #716269;
606
+ font-size: 11px;
607
+ font-style: normal;
608
+ font-weight: 400;
609
+ margin-top: 15px;
610
+ margin-left: 0;
611
+ }
612
+ #wpwrap .yith-plugin-ui h2.nav-tab-wrapper, #wpbody-content .yith-plugin-ui h2.nav-tab-wrapper {
613
+ border: 0;
614
+ border-bottom : 1px solid #ccc;
615
+ margin-right: 15px;
616
+ background-color: transparent;
617
+ padding-left: 0;
618
+ }
619
+ .yith-plugin-ui #plugin-fw-wc table.form-table,
620
+ .yith-plugin-ui #yith-plugin-fw-panel table.form-table,
621
+ .yith-plugin-ui table.form-table{
622
+ border: 1px solid #d8d8d8;
623
+ border-top: 0;
624
+ margin-bottom: 40px;
625
+ }
626
+
627
+ .yith-plugin-ui #wpwrap h2.nav-tab-wrapper, .yith-plugin-ui #wpbody-content h2.nav-tab-wrapper{
628
+ background-color: transparent;
629
+ border: 0;
630
+ text-transform: none;
631
+ border-bottom: 1px solid #ddd;
632
+ }
633
+
634
+ .yith-plugin-ui h2 {
635
+ color: #2a8db0;
636
+ font-size: 13px;
637
+ text-transform: uppercase;
638
+ border: 1px solid #d8d8d8;
639
+ border-bottom: 0;
640
+ background-color: #fff;
641
+ padding: 35px 20px;
642
+ margin: 0px;
643
+ }
644
+ .yith-plugin-ui .yith-plugin-fw-custom-tab h2{
645
+ border: 0px solid #d8d8d8;
646
+ padding-left: 0;
647
+ }
648
+
649
+ .yith-plugin-ui #plugin-fw-wc table.form-table th, #yith-plugin-fw-panel table.form-table th.titledesc, .yith-plugin-ui #plugin-fw-wc table.form-table td, #yith-plugin-fw-panel table.form-table td.forminp {
650
+ padding: 30px 20px;
651
+ }
652
+
653
+ .yith-plugin-ui #plugin-fw-wc h2 + div {
654
+ background: #fff;
655
+ border-left: 1px solid #d9d9d9;
656
+ border-right: 1px solid #d9d9d9;
657
+ margin: -20px 0 0 0;
658
+ padding-left: 20px;
659
+ padding-bottom: 5px;
660
+ }
661
+
662
+ .yith-plugin-ui #plugin-fw-wc h2 + div p, .yith-plugin-ui p.info-box{
663
+ background: #f1f1f1;
664
+ font-size: 12px;
665
+ font-weight: 700;
666
+ width: 40%;
667
+ display:block;
668
+ padding: 15px;
669
+ margin-bottom: 0;
670
+ }
671
+
672
+ .yith-plugin-ui #plugin-fw-wc h2 + div p:before, .yith-plugin-ui p.info-box:before{
673
+ content: "\e90e";
674
+ font-family: yith-icon;
675
+ font-size: 30px;
676
+ font-weight: normal;
677
+ display: block;
678
+ margin-top: -5px;
679
+ float: left;
680
+ margin-right: 15px;
681
+ }
682
+
683
+ .yith-plugin-ui h2:first-child{
684
+ border-top: 0;
685
+ }
686
+
687
+ /*** Icon ***/
688
+ .yith-plugin-ui span.yith-icon {
689
+ margin-left: -36px;
690
+ line-height: 36px;
691
+ font-size: 20px;
692
+ }
693
+
694
+ /*** General Input Style ***/
695
+
696
+ .yith-plugin-ui .yith-plugin-fw select,
697
+ .yith-plugin-ui textarea,
698
+ .yith-plugin-ui input[type=number],
699
+ .yith-plugin-ui.metaboxes-tab input[type=number],
700
+ .yith-plugin-ui input[type=text],
701
+ .yith-plugin-ui input[type=text],
702
+ .yith-plugin-ui input[type=email],
703
+ .yith-plugin-ui input[type=password],
704
+ .yith-plugin-fw.yith-plugin-ui input[type=text]:not(.select2-search__field),
705
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text]:not(.select2-search__field),
706
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table select,
707
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table textarea,
708
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=number],
709
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text] {
710
+ border: 1px solid #d8d8d8;
711
+ border-radius: 8px;
712
+ padding: 8px 10px;
713
+ height: 38px;
714
+ min-width: 90px;
715
+ box-shadow: none;
716
+ color: #716269;
717
+ }
718
+ .yith-plugin-ui textarea,
719
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table textarea{
720
+ height: auto;
721
+ }
722
+ .yith-plugin-ui table.form-table input[type=text].wp-color-picker,
723
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].wp-color-picker{
724
+ border: 0;
725
+ height: 30px;
726
+ max-width: 60px;
727
+
728
+ }
729
+
730
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].small-text,
731
+ .yith-plugin-ui input[type=text].small-text {
732
+ width: 100px;
733
+ height: 25px;
734
+ border: 1px solid #d9d9d9;
735
+ }
736
+
737
+ .yith-plugin-ui textarea {
738
+ height: auto;
739
+ padding: 8px;
740
+ }
741
+
742
+ .yith-plugin-ui select:focus,
743
+ .yith-plugin-ui input[type=text]:focus {
744
+ border-color: #a7d9ec;
745
+ }
746
+
747
+ .woocommerce .yith-plugin-ui table.form-table select,
748
+ .yith-plugin-ui select{
749
+ -webkit-appearance: none;
750
+ line-height: 1;
751
+ min-height: 35px;
752
+ background: url("../images/arrow_down.svg") no-repeat right center;
753
+ background-size: 35px 13px;
754
+ border-radius: 8px;
755
+ }
756
+
757
+ .yith-plugin-ui .form-table th{
758
+ width: 280px;
759
+ padding-right: 50px;
760
+ }
761
+
762
+ /** BUTTONS **/
763
+ .yith-plugin-ui .tablenav .button.action,
764
+ .wp-core-ui .yith-plugin-ui .button-primary,
765
+ .wp-core-ui .yith-plugin-ui .button-secondary,
766
+ .yith-plugin-ui .yith-add-button,
767
+ .yith-plugin-ui .yith-save-button,
768
+ .yith-plugin-ui .yith-edit-button,
769
+ .yith-plugin-ui .yith-update-button,
770
+ .yith-plugin-ui .yith-plugin-fw-select-all,
771
+ .yith-plugin-ui .yith-plugin-fw-deselect-all,
772
+ .yith-plugin-ui .yith-plugin-fw-upload-button,
773
+ .yith-plugin-ui .yith-plugin-fw-upload-button-reset {
774
+ border-radius: 3px;
775
+ text-transform: uppercase;
776
+ box-shadow: none;
777
+ border: 0;
778
+ font-weight: 700;
779
+ font-size: 11px;
780
+ padding: 0px 14px;
781
+ outline: none;
782
+ height: auto;
783
+ transition: all ease 0.3s;
784
+ background-color: #d6d6d6;
785
+ color: #656565;
786
+ text-shadow: none;
787
+ vertical-align: middle;
788
+ line-height: 26px;
789
+ display: inline-block;
790
+ text-decoration: none;
791
+ }
792
+ .wp-core-ui .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button-reset,
793
+ .wp-core-ui .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button,
794
+ .yith-plugin-ui .yith-plugin-fw-upload-button-reset,
795
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button-reset,
796
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button{
797
+ height: 38px;
798
+ }
799
+
800
+ .wp-core-ui .yith-plugin-ui .button:focus,
801
+ .wp-core-ui .yith-plugin-ui .button-primary:focus,
802
+ .yith-plugin-ui .yith-add-button:focus,
803
+ .yith-plugin-ui .yith-save-button:focus,
804
+ .yith-plugin-ui .yith-edit-button:focus,
805
+ .yith-plugin-ui .yith-update-button:focus,
806
+ .wp-core-ui .yith-plugin-ui .button-secondary:focus{
807
+ outline: none;
808
+ box-shadow: none;
809
+ }
810
+
811
+ /** button with inside a span with icon class */
812
+ .yith-plugin-ui .button-secondary span.yith-icon{
813
+ margin-left: 0px;
814
+ margin-right: 10px;
815
+ line-height: normal;
816
+ }
817
+
818
+ .yith-plugin-ui .button-secondary span.yith-icon:before{
819
+ color: #656565;
820
+ font-size: 15px;
821
+ }
822
+
823
+ .yith-plugin-ui .tablenav .button.action,
824
+ .wp-core-ui .yith-plugin-ui .button:focus,
825
+ .wp-core-ui .yith-plugin-ui .button-secondary:focus,
826
+ .yith-plugin-ui .yith-save-button:hover,
827
+ .wp-core-ui .yith-plugin-ui .button-secondary:hover,
828
+ .yith-plugin-ui .yith-plugin-fw-upload-button-reset:hover{
829
+ background-color: #cacaca;
830
+ color: #515151;
831
+ }
832
+
833
+ .wp-core-ui .yith-plugin-ui .button-primary,
834
+ .yith-plugin-ui .tablenav .button.action,
835
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-select-all,
836
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button{
837
+ background-color: #007694;
838
+ color: #fff;
839
+ }
840
+
841
+ .yith-plugin-ui .tablenav .button.action:active,
842
+ .yith-plugin-ui .tablenav .button.action:focus,
843
+ .yith-plugin-ui .tablenav .button.action:hover,
844
+ .yith-plugin-ui .yith-add-button,
845
+ .wp-core-ui .yith-plugin-ui .button-primary:focus,
846
+ .wp-core-ui .yith-plugin-ui .button-primary:hover{
847
+ background-color: #375f6b;
848
+ color: #fff;
849
+ }
850
+
851
+
852
+ .yith-plugin-ui .yith-add-button:hover,
853
+ .wp-core-ui .yith-plugin-ui .yith-plugin-fw-upload-button:focus,
854
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-select-all:hover,
855
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-select-all:focus,
856
+ .yith-plugin-ui .yith-plugin-fw-upload-button:hover{
857
+ border-color: #007694;
858
+ background: #007694;
859
+ color: #fff;
860
+ line-height: 26px;
861
+ margin-left: 0;
862
+ }
863
+
864
+ .yith-plugin-ui .button-primary:before,
865
+ .yith-plugin-ui .yith-add-button:before,
866
+ .yith-plugin-ui .yith-save-button:before,
867
+ .yith-plugin-ui .yith-edit-button:before,
868
+ .yith-plugin-ui .yith-update-button:before,
869
+ .yith-plugin-ui .button-secondary:before{
870
+ font-family: 'yith-icon';
871
+ font-size: 10px;
872
+ font-weight: 700;
873
+ margin-right: 10px;
874
+ vertical-align: bottom;
875
+ display:inline-block;
876
+ }
877
+
878
+ /** yith-edit-button **/
879
+ .yith-plugin-ui .yith-edit-button {
880
+ background-color: #7f9298;
881
+ color: #fff;
882
+ }
883
+ .yith-plugin-ui .yith-edit-button:focus,
884
+ .yith-plugin-ui .yith-edit-button:hover {
885
+ background-color: #718085;
886
+ color: #fff;
887
+ }
888
+ .yith-plugin-ui .yith-edit-button:before{
889
+ content: "\e907";
890
+ }
891
+ /** yith-update-button **/
892
+ .yith-plugin-ui .yith-update-button {
893
+ background-color: #94aa09;
894
+ color: #fff;
895
+ }
896
+ .yith-plugin-ui .yith-update-button:focus,
897
+ .yith-plugin-ui .yith-update-button:hover {
898
+ background-color: #7a9009;
899
+ color: #fff;
900
+ }
901
+ .yith-plugin-ui .yith-update-button:before{
902
+ content: "\e90b";
903
+ font-size: 15px;
904
+ }
905
+
906
+ /** yith-save-button **/
907
+
908
+ .yith-plugin-ui .yith-save-button {
909
+ background-color: #267390;
910
+ color: #fff;
911
+ }
912
+ .yith-plugin-ui .yith-save-button:focus,
913
+ .yith-plugin-ui .yith-save-button:hover {
914
+ background-color: #1c4863;
915
+ color: #fff;
916
+ }
917
+
918
+
919
+ /** yith-remove-button **/
920
+
921
+ .yith-plugin-ui .button-secondary.yith-remove-button:before{
922
+ content: "\e90d";
923
+ font-size: 15px;
924
+ }
925
+
926
+
927
+ /** yith-add-button **/
928
+
929
+ .yith-plugin-ui .yith-add-button:before{
930
+ content: "\e90a";
931
+ }
932
+
933
+ /** yith-plugin-fw-upload-button **/
934
+ .yith-plugin-ui button.yith-plugin-fw-upload-button:before{
935
+ content: "\e90c";
936
+ font-family: 'yith-icon';
937
+ font-size: 19px;
938
+ font-weight: 400;
939
+ margin-right: 10px;
940
+ vertical-align: middle;
941
+ display:inline-block;
942
+ }
943
+ /** SELECT 2 **/
944
+ .yith-plugin-ui .select2-container,
945
+ .yith-plugin-ui .select2-selection--single{
946
+ height: auto;
947
+ padding: 2px;
948
+ outline: none;
949
+ }
950
+
951
+ .yith-plugin-ui .select2-selection--single{
952
+ margin: 0;
953
+ border: 0;
954
+ }
955
+
956
+ /* old panel*/
957
+
958
+ .yith-plugin-ui span.select2.select2-container.select2-container--default{
959
+ border: 1px solid #d8d8d8;
960
+ border-radius:8px;
961
+ }
962
+ .yith-plugin-ui span.select2.select2-container.select2-container--default:hover,
963
+ .yith-plugin-ui span.select2.select2-container.select2-container--default:active,
964
+ .yith-plugin-ui span.select2.select2-container.select2-container--default:focus {
965
+ border-color: #a7d9ec;
966
+ }
967
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
968
+ color: #fff;
969
+ }
970
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].select2-search__field,
971
+ .yith-plugin-ui .yith-plugin-fw table.form-table input.select2-search__field{
972
+ border: 0;
973
+ padding: 0;
974
+ height: initial;
975
+ }
976
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice,
977
+ .yith-plugin-ui .select2-selection__choice{
978
+ color: #fff;
979
+ background-color: #4e8ba2;
980
+ border-radius: 12px;
981
+ padding: 3px 11px;
982
+ border-color: #33937e;
983
+ font-size: 12px;
984
+ }
985
+
986
+ .yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before{
987
+ content: "\e900";
988
+ font-family: 'yith-icon' !important;
989
+ line-height: 36px;
990
+ color: #d9d9d9;
991
+ }
992
+
993
+ .yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow b{
994
+ display: none;
995
+ }
996
+ .yith-plugin-ui .select2-container--open .select2-dropdown--below,
997
+ .yith-plugin-ui .select2-container--open .select2-dropdown--above,
998
+ .yith-plugin-fw-panel .select2-container--open .select2-dropdown--below,
999
+ .yith-plugin-fw-panel .select2-container--open .select2-dropdown--above {
1000
+ margin-top: 10px;
1001
+ border-radius: 8px;
1002
+ box-shadow:0 2px 4px 0 rgba(0,0,0,0.12),0 2px 10px 0 rgba(0,0,0,0.12) !important;
1003
+ }
1004
+ .yith-plugin-ui .select2-container--open .select2-dropdown--above,
1005
+ .yith-plugin-fw-panel .select2-container--open .select2-dropdown--above{
1006
+ margin-top: -10px;
1007
+ }
1008
+ .yith-plugin-ui .select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
1009
+ .yith-plugin-ui .select2-container--default.select2-container--open.select2-container--above .select2-selection--single,
1010
+ .yith-plugin-fw-panel .select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
1011
+ .yith-plugin-fw-panel .select2-container--default.select2-container--open.select2-container--above .select2-selection--single{
1012
+ border-radius: 8px;
1013
+ }
1014
+ .yith-plugin-ui .select2-results .select2-results__group, .select2-results .select2-results__option:first-child,
1015
+ .yith-plugin-fw-panel .select2-results .select2-results__group, .select2-results .select2-results__option:first-child{
1016
+ border-top-left-radius: 8px;
1017
+ border-top-right-radius: 8px;
1018
+ }
1019
+ .yith-plugin-ui .select2-results .select2-results__group,
1020
+ .yith-plugin-ui .select2-results .select2-results__option:last-child,
1021
+ .yith-plugin-fw-panel .select2-results .select2-results__group,
1022
+ .yith-plugin-fw-panel .select2-results .select2-results__option:last-child{
1023
+ border-bottom-left-radius: 8px;
1024
+ border-bottom-right-radius: 8px;
1025
+ }
1026
+ .yith-plugin-ui .select2-container--default .select2-results__option[data-selected=true],
1027
+ .yith-plugin-ui .select2-container--default .select2-results__option[aria-selected=true],
1028
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option[data-selected=true],
1029
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option[aria-selected=true] {
1030
+ background-color: #fff;
1031
+ outline: none;
1032
+ }
1033
+ .yith-plugin-ui .select2-container--default .select2-results__option--highlighted[aria-selected],
1034
+ .yith-plugin-ui .select2-container--default .select2-results__option--highlighted[data-selected],
1035
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option--highlighted[aria-selected],
1036
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option--highlighted[data-selected]{
1037
+ background-color: #e8eff1;
1038
+ color: #4e8ba2;
1039
+ outline: none;
1040
+ }
1041
+
1042
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
1043
+ .yith-plugin-fw-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
1044
+ float: right;
1045
+ padding-left: 15px;
1046
+ text-indent: -9999px;
1047
+ }
1048
+
1049
+
1050
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after,
1051
+ .woocommerce .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after,
1052
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after{
1053
+ float: right;
1054
+ color: #fff;
1055
+ content: "\e906";
1056
+ font-family: 'yith-icon' !important;
1057
+ font-size: 9px;
1058
+ line-height: 21px;
1059
+ text-indent: 0;
1060
+ }
1061
+
1062
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after{
1063
+ color: #000;
1064
+ }
1065
+
1066
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after
1067
+ .yith-plugin-fw-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after{
1068
+ color: #000;
1069
+ }
1070
+ .yith-plugin-ui .select2-container .select2-selection--multiple,
1071
+ .yith-plugin-ui .select2-container--default.select2-container--focus .select2-selection--multiple{
1072
+ border: 0;
1073
+ }
1074
+
1075
+ .yith-plugin-fw .select2-search input[type=text]{
1076
+ border: 0;
1077
+ padding: 0;
1078
+ height: auto;
1079
+ }
1080
+ .yith-plugin-ui .yith-plugin-fw-select-field-wrapper span.yith-icon.icon-magnifier,
1081
+ .yith-plugin-fw-panel .yith-plugin-fw-select-field-wrapper span.yith-icon.icon-magnifier {
1082
+ position: absolute;
1083
+ padding-top: 5px;
1084
+ }
1085
+
1086
+ .yith-plugin-ui input[type=text].select2-search__field{
1087
+ border: 0;
1088
+ padding: 0;
1089
+ height: 30px;
1090
+ }
1091
+ .yith-plugin-ui .select2-container--default .select2-search--dropdown .select2-search__field,
1092
+ .yith-plugin-fw-panel .select2-container--default .select2-search--dropdown .select2-search__field {
1093
+ border: 1px solid #d9d9d9;
1094
+ border-radius: 8px;
1095
+ box-shadow: none;
1096
+ }
1097
+ .yith-plugin-ui .select2-dropdown,
1098
+ .yith-plugin-fw-panel .select2-dropdown{
1099
+ border: 1px solid #d9d9d9;
1100
+ }
1101
+ /** RADIO BUTTON **/
1102
+ .yith-plugin-ui [type="radio"]:checked,
1103
+ .yith-plugin-ui [type="radio"]:not(:checked) {
1104
+ position: absolute;
1105
+ left: -9999px;
1106
+ }
1107
+ .yith-plugin-ui [type="radio"]:checked + label,
1108
+ .yith-plugin-ui [type="radio"]:not(:checked) + label
1109
+ {
1110
+ position: relative;
1111
+ padding-left: 35px;
1112
+ cursor: pointer;
1113
+ line-height: 20px;
1114
+ display: inline-block;
1115
+ color: #716269;
1116
+ font-size: 12px;
1117
+ }
1118
+ .yith-plugin-ui [type="radio"]:checked + label:before,
1119
+ .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
1120
+ content: '';
1121
+ position: absolute;
1122
+ left: 0;
1123
+ top: 0;
1124
+ width: 18px;
1125
+ height: 18px;
1126
+ border: 1px solid #d8d8d8;
1127
+ border-radius: 100%;
1128
+ background: #fff;
1129
+ }
1130
+ .yith-plugin-ui [type="radio"]:checked + label:after,
1131
+ .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
1132
+ content: '';
1133
+ width: 12px;
1134
+ height: 12px;
1135
+ background: #4e8ba2;
1136
+ position: absolute;
1137
+ top: 4px;
1138
+ left: 4px;
1139
+ border-radius: 100%;
1140
+ -webkit-transition: all 0.2s ease;
1141
+ transition: all 0.2s ease;
1142
+ }
1143
+ .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
1144
+ opacity: 0;
1145
+ -webkit-transform: scale(0);
1146
+ transform: scale(0);
1147
+ }
1148
+ .yith-plugin-ui [type="radio"]:checked + label:after {
1149
+ opacity: 1;
1150
+ -webkit-transform: scale(1);
1151
+ transform: scale(1);
1152
+ }
1153
+
1154
+ /** CHECKBOX **/
1155
+ .yith-plugin-ui input[type="checkbox"] {
1156
+ -webkit-appearance: none;
1157
+ background-color: #fff;
1158
+ border: 1px solid #d8d8d8;
1159
+ box-shadow: none;
1160
+ width: 18px;
1161
+ height: 18px;
1162
+ border-radius: 3px;
1163
+ display: inline-block;
1164
+ position: relative;
1165
+ }
1166
+ .yith-plugin-ui input[type="checkbox"]:checked{
1167
+ background-color: #4e8ba2;
1168
+ border-color: #488197;
1169
+ }
1170
+ .yith-plugin-ui .forminp-checkbox span.description.inline {
1171
+ margin-left: 10px;
1172
+ }
1173
+ .yith-plugin-ui input[type="checkbox"]:checked:before{
1174
+ display: none;
1175
+ }
1176
+
1177
+ .yith-plugin-ui input[type="checkbox"]:checked:after {
1178
+ content: "\e905";
1179
+ font-family: 'yith-icon';
1180
+ font-size: 15px;
1181
+ position: absolute;
1182
+ top: 8px;
1183
+ left: 1px;
1184
+ color: #fff;
1185
+ }
1186
+
1187
+ /** ONOFF **/
1188
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input[type="checkbox"] {
1189
+ display: none;
1190
+ }
1191
+
1192
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span{
1193
+ border: 1px solid #d8d8d8;
1194
+ background-color: #fff;
1195
+ width:50px;
1196
+ }
1197
+
1198
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before{
1199
+ background-color: #d8d8d8;
1200
+ }
1201
+
1202
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
1203
+ width: 14px;
1204
+ height: 14px;
1205
+ top: 3px;
1206
+ left: 4px;
1207
+ background-color: #d8d8d8;
1208
+ }
1209
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after{
1210
+ content: 'OFF';
1211
+ width: 14px;
1212
+ height: 14px;
1213
+ font-size: 10px;
1214
+ padding-left:24px;
1215
+ color: #979797;
1216
+ }
1217
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span,
1218
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input.onoffchecked + span{
1219
+ background-color: #fff;
1220
+ border-color: #98aa36;
1221
+ }
1222
+
1223
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
1224
+ .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before{
1225
+ background-color: #98aa36;
1226
+ left:32px;
1227
+ }
1228
+
1229
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
1230
+ .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after{
1231
+ content: 'ON';
1232
+ color: #98aa36;
1233
+ width: 14px;
1234
+ height: 14px;
1235
+ display: inline-block;
1236
+ font-size: 10px;
1237
+ padding: 0 10px;
1238
+ }
1239
+
1240
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span{
1241
+ text-indent: 0;
1242
+ }
1243
+
1244
+
1245
+ /**
1246
+ DATEPICKER
1247
+ */
1248
+ .yith-plugin-ui div#ui-datepicker-div,
1249
+ .yith-plugin-fw-panel div#ui-datepicker-div {
1250
+ border: 0;
1251
+ box-shadow:0 2px 4px 0 rgba(0,0,0,0.12),0 2px 10px 0 rgba(0,0,0,0.12) !important;
1252
+ }
1253
+
1254
+ .yith-plugin-ui .ui-datepicker-header.ui-widget-header,
1255
+ .yith-plugin-fw-panel .ui-datepicker-header.ui-widget-header {
1256
+ background:#4e8ba2;
1257
+ color: #fff;
1258
+ font-size: 11px;
1259
+ line-height: 25px;
1260
+ border:0;
1261
+ min-height: 25px;
1262
+ }
1263
+ .yith-plugin-ui .ui-datepicker-title,
1264
+ .yith-plugin-fw-panel .ui-datepicker-title{
1265
+ line-height: 25px;
1266
+ }
1267
+ .yith-plugin-ui .ui-datepicker th,
1268
+ .yith-plugin-fw-panel .ui-datepicker th{
1269
+ color: #716269;
1270
+ }
1271
+ .yith-plugin-ui .ui-widget-header .ui-icon,
1272
+ .yith-plugin-ui .ui-widget-header .ui-state-hover,
1273
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-prev,
1274
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-next,
1275
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-w,
1276
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-e,
1277
+ .yith-plugin-fw-panel .ui-widget-header .ui-icon,
1278
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-hover,
1279
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-prev,
1280
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-next,
1281
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-w,
1282
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-e{
1283
+ background: none;
1284
+ content: "";
1285
+ border: 0;
1286
+ text-indent: 0;
1287
+ width:15px;
1288
+ height: 20px;
1289
+ display:block;
1290
+ overflow:hidden;
1291
+ }
1292
+
1293
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-w:before,
1294
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-w:before {
1295
+ content: "\e901";
1296
+ color: #fff;
1297
+ font-family: 'yith-icon';
1298
+ font-size: 12px;
1299
+ font-weight: normal;
1300
+ width:15px;
1301
+ display:block;
1302
+ }
1303
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-e:before,
1304
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-e:before {
1305
+ content: "\e902";
1306
+ color: #fff;
1307
+ text-indent: 0;
1308
+ font-family: 'yith-icon';
1309
+ font-size: 12px;
1310
+ font-weight: normal;
1311
+ width:15px;
1312
+ display:block;
1313
+ }
1314
+
1315
+ /* arrow */
1316
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-prev,
1317
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-next,
1318
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-prev-hover,
1319
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-next-hover,
1320
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-prev,
1321
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-next,
1322
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-prev-hover,
1323
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-next-hover{
1324
+ top: 1px;
1325
+ cursor: pointer;
1326
+ }
1327
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-prev,
1328
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-prev-hover,
1329
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-prev,
1330
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-prev-hover{
1331
+ left: 5px;
1332
+ }
1333
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-next,
1334
+ .yith-plugin-ui .ui-datepicker-next.ui-datepicker-next-hover,
1335
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-next,
1336
+ .yith-plugin-fw-panel .ui-datepicker-next.ui-datepicker-next-hover{
1337
+ right: 1px;
1338
+ }
1339
+
1340
+ .yith-plugin-ui .ui-datepicker table,
1341
+ .yith-plugin-fw-panel .ui-datepicker table{
1342
+ font-size: 10px;
1343
+ }
1344
+
1345
+ .yith-plugin-ui .ui-state-default,
1346
+ .yith-plugin-ui .ui-widget-content .ui-state-default,
1347
+ .yith-plugin-ui .ui-widget-header .ui-state-default,
1348
+ .yith-plugin-fw-panel .ui-state-default,
1349
+ .yith-plugin-fw-panel .ui-widget-content .ui-state-default,
1350
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-default{
1351
+ background:#fff;
1352
+ border: 1px solid #d9d9d9;
1353
+
1354
+ }
1355
+ .yith-plugin-ui .ui-state-hover,
1356
+ .yith-plugin-ui .ui-widget-content .ui-state-hover,
1357
+ .yith-plugin-ui a.ui-state-default:focus,
1358
+ .yith-plugin-ui .ui-widget-content .ui-state-focus,
1359
+ .yith-plugin-ui .ui-widget-header .ui-state-focus,
1360
+ .yith-plugin-fw-panel .ui-state-hover,
1361
+ .yith-plugin-fw-panel .ui-widget-content .ui-state-hover,
1362
+ .yith-plugin-fw-panel a.ui-state-default:focus,
1363
+ .yith-plugin-fw-panel .ui-widget-content .ui-state-focus,
1364
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-focus{
1365
+ background:#ebf1f3;
1366
+ border:1px solid #bfd5dd;
1367
+ outline: none;
1368
+ box-shadow: none;
1369
+ }
1370
+ .yith-plugin-ui .ui-widget-header .ui-state-hover, .woocommerce .yith-plugin-ui .ui-state-focus,
1371
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-hover, .woocommerce .yith-plugin-ui .ui-state-focus {
1372
+ background: none;
1373
+ border: 0;
1374
+ }
1375
+
1376
+ /** colorpicker **/
1377
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .iris-picker,
1378
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-holder {
1379
+ display: none !important;
1380
+ }
1381
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-input-wrap {
1382
+ display: inline !important;
1383
+ }
1384
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-active .iris-picker,
1385
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-active .wp-picker-holder {
1386
+ display: block !important;
1387
+ }
1388
+ .woocommerce .yith-plugin-ui .iris-picker{
1389
+ border:0;
1390
+ margin-top: 20px;
1391
+ }
1392
+ .yith-plugin-ui .yith-plugin-fw input[type=text].wp-color-picker {
1393
+ border:0;
1394
+ padding: 2px 5px;
1395
+ height:30px;
1396
+ }
1397
+ .yith-plugin-ui .wp-color-result-text{
1398
+ display: none;
1399
+ }
1400
+
1401
+ .yith-plugin-ui .wp-picker-container .wp-color-result.button{
1402
+ width: 30px;
1403
+ height: 30px;
1404
+ border: 0;
1405
+ box-shadow: none;
1406
+ border: 1px solid #d9d9d9;
1407
+ margin-bottom: 0;
1408
+ display: inline-block;
1409
+ vertical-align: middle;
1410
+ }
1411
+ .yith-plugin-ui .wp-picker-default-custom{
1412
+ cursor: pointer;
1413
+ width: 25px;
1414
+ padding: 0 5px;
1415
+ display: inline-block;
1416
+ vertical-align: middle;
1417
+ position: relative;
1418
+ }
1419
+ .yith-plugin-ui .wp-picker-default-custom input.button {
1420
+ opacity: 0;
1421
+ margin: 0;
1422
+ padding: 0;
1423
+ position: absolute;
1424
+ top: 0;
1425
+ right: 0;
1426
+ left: 0;
1427
+ bottom: 0;
1428
+ z-index: 2;
1429
+ }
1430
+ .yith-plugin-ui .wp-picker-default-custom:before{
1431
+ content: "\e910";
1432
+ text-indent: 0;
1433
+ font-family: 'yith-icon';
1434
+ font-size: 20px;
1435
+ color: #d8d8d8;
1436
+ font-weight: normal;
1437
+ width:15px;
1438
+ display:block;
1439
+ background: none;
1440
+ line-height: 20px;
1441
+ margin-left: 8px;
1442
+ }
1443
+ .yith-plugin-ui .wp-picker-container{
1444
+ width: auto;
1445
+ display: inline-block;
1446
+ border: 1px solid #d9d9d9;
1447
+ border-radius: 8px;
1448
+ padding: 5px;
1449
+ }
1450
+
1451
+ .yith-plugin-ui .iris-picker .iris-square-inner{
1452
+ box-shadow: none;
1453
+ border: 1px solid #d9d9d9;
1454
+ }
1455
+
1456
+ .yith-plugin-ui .yith-single-colorpicker{
1457
+ display: inline-block;
1458
+ width: 220px;
1459
+ }
1460
+
1461
+ .yith-plugin-ui .yith-single-colorpicker > label{
1462
+ display: block;
1463
+ font-size: 11px;
1464
+ font-weight: 600;
1465
+ margin-bottom: 10px;
1466
+ }
1467
+
1468
+ /* RANGE SLIDER */
1469
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle{
1470
+ top: -45px!important;
1471
+ }
1472
+
1473
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle {
1474
+ position: absolute;
1475
+ top: -33px;
1476
+ left: 0;
1477
+ width: auto !important;
1478
+ height: auto !important;
1479
+ padding: 2px 8px;
1480
+ margin-left: -15px;
1481
+ font-size: 12px;
1482
+ line-height: 20px;
1483
+ color: #4e8ba2;
1484
+ text-align: center;
1485
+ background-color: #fff;
1486
+ border: 1px solid #fff;
1487
+ border-radius: 3px;
1488
+ -webkit-transition: opacity .3s ease-in-out 0s;
1489
+ transition: opacity .3s ease-in-out 0s;
1490
+ box-shadow: 0px 1px 7px 0px rgba(1, 1, 1, 0.13);
1491
+ }
1492
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle:before {
1493
+ position: absolute;
1494
+ bottom: -3px;
1495
+ left: 50%;
1496
+ display: inline-block;
1497
+ width: 6px;
1498
+ height: 6px;
1499
+ margin-left: -3px;
1500
+ content: "";
1501
+ background-color: #fff;
1502
+ -webkit-transform: rotate(-45deg);
1503
+ -ms-transform: rotate(-45deg);
1504
+ transform: rotate(-45deg);
1505
+ }
1506
+ .yith-plugin-ui .ui-slider.ui-widget-content .ui-widget-header{
1507
+ background: #4e8ba2 ;
1508
+ }
1509
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle:after{
1510
+ content: '';
1511
+ width: 17px;
1512
+ height: 17px;
1513
+ display: block;
1514
+ position: absolute;
1515
+ background: #fff;
1516
+ top: 37px;
1517
+ border-radius: 50%;
1518
+ box-shadow: 0px 1px 6px 0px rgba(1, 1, 1, 0.25);
1519
+ }
1520
+ .yith-plugin-ui .ui-slider.ui-widget-content{
1521
+ height: 5px !important;
1522
+ }
1523
+
1524
+ .yith-plugin-ui .ui-slider .minCaption,
1525
+ .yith-plugin-ui .ui-slider .maxCaption {
1526
+ font-weight: 700;
1527
+ font-size: 12px;
1528
+ }
1529
+
1530
+
1531
+ /* ADD_BOX AND TOGGLE */
1532
+ .yith-plugin-ui .yith-add-box,
1533
+ .yith-plugin-ui .yith-toggle-row{
1534
+ width:70%;
1535
+ border: 1px solid #d9d9d9;
1536
+ box-shadow:none;
1537
+ border-radius: 4px;
1538
+ margin: 20px 0;
1539
+ padding: 10px;
1540
+ box-sizing: border-box;
1541
+ background: white;
1542
+ }
1543
+ .yith-plugin-ui .yith-add-box{
1544
+ padding: 30px 25px;
1545
+ display: none;
1546
+ }
1547
+ .yith-plugin-ui .yith-toggle-title{
1548
+ position: relative;
1549
+ }
1550
+ .yith-plugin-ui #plugin-fw-wc .yith-toggle-title h3,
1551
+ .yith-plugin-ui .yith-toggle-title h3{
1552
+ padding: 0px 20px 0px 25px;
1553
+ margin: 0;
1554
+ display: inline-block;
1555
+ position: relative;
1556
+ min-width: 173px;
1557
+ box-sizing: border-box;
1558
+ font-weight: 600;
1559
+ font-size: 15px;
1560
+ }
1561
+
1562
+ .yith-plugin-ui .yith-toggle-title .subtitle{
1563
+ padding-left: 0;
1564
+ padding-top:8px;
1565
+ font-size: 12px;
1566
+ }
1567
+
1568
+ .yith-plugin-ui .yith-toggle{
1569
+ position: absolute;
1570
+ width: 30px;
1571
+ height: 30px;
1572
+ display: block;
1573
+ cursor: pointer;
1574
+ left: 0px;
1575
+ top: 0;
1576
+ bottom: 0;
1577
+ }
1578
+ .yith-plugin-ui .yith-toggle > span:before{
1579
+ color: #405e69;
1580
+ }
1581
+
1582
+ .yith-plugin-ui .yith-toggle > span{
1583
+ position: absolute;
1584
+ right: 50%;
1585
+ transition: transform .3s;
1586
+ line-height: 1;
1587
+ }
1588
+
1589
+
1590
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle span{
1591
+ transform: rotateZ(90deg);
1592
+ }
1593
+
1594
+ .yith-plugin-ui .yith-toggle-content{
1595
+ display: none;
1596
+ position: relative;
1597
+ padding: 30px 25px;
1598
+ }
1599
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content{
1600
+ /* display: block;*/
1601
+ }
1602
+ .yith-plugin-ui .yith-add-box-row,
1603
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row{
1604
+ display: table;
1605
+ margin-bottom: 20px;
1606
+ }
1607
+ .yith-plugin-ui .yith-add-box-row label,
1608
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row label{
1609
+ display: table-cell;
1610
+ width: 250px;
1611
+ padding-right:40px;
1612
+ color: #33373b;
1613
+ font-size: 13px;
1614
+ vertical-align: top;
1615
+ font-weight: 600;
1616
+ }
1617
+
1618
+ .yith-plugin-ui .yith-add-box-row .yith-plugin-fw-field-wrapper:not(.yith-plugin-fw-title-field-wrapper),
1619
+ .yith-plugin-ui .yith-toggle-row-opened .yith-plugin-fw-field-wrapper:not(.yith-plugin-fw-title-field-wrapper) {
1620
+ /* display: table-cell;*/
1621
+ width: auto;
1622
+ float: none;
1623
+ vertical-align: middle;
1624
+ position: relative;
1625
+ }
1626
+ .yith-plugin-ui .yith-add-box-row span.yith-icon,
1627
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row span.yith-icon{
1628
+ position: absolute;
1629
+ right: 15px;
1630
+ top: 0;
1631
+ bottom: 0;
1632
+ }
1633
+ .yith-plugin-ui .yith-add-box-buttons,
1634
+ .yith-plugin-ui .yith-toggle-content-buttons{
1635
+ text-align: right;
1636
+ }
1637
+ .yith-plugin-ui .yith-toggle-onoff {
1638
+ position: absolute;
1639
+ cursor: pointer;
1640
+ right: 0;
1641
+ }
1642
+ .yith-plugin-ui .ui-sortable .yith-toggle-onoff{
1643
+ right: 30px;
1644
+ }
1645
+ .yith-plugin-ui .yith-toggle-row .icon-drag{
1646
+ position: absolute;
1647
+ right: 0;
1648
+ top: 25%;
1649
+ bottom: 0;
1650
+ line-height: 1;
1651
+ }
1652
+ .yith-plugin-ui .yith-toggle-row.with-subtitle .yith-toggle{
1653
+ top: auto;
1654
+ }
1655
+ .yith-plugin-ui .yith-toggle-row.with-subtitle .yith-toggle-onoff{
1656
+ top: 25%;
1657
+ }
1658
+
1659
+ /** SPINNER **/
1660
+ .yith-plugin-ui .spinner{
1661
+ vertical-align: -5px;
1662
+ float: none;
1663
+ }
1664
+
1665
+ .yith-plugin-ui .spinner.show{
1666
+ visibility: visible;
1667
+ }
1668
+
1669
+ /* LIST TABLE */
1670
+ .yith-plugin-ui .form-table .list-table td{
1671
+ padding: 15px 0px;
1672
+ }
1673
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table .bulkactions select{
1674
+ border: 1px solid #d8d8d8;
1675
+ max-width: 200px;
1676
+ max-height: 30px;
1677
+ padding: 0 10px;
1678
+ }
1679
+ .yith-plugin-ui .form-table .list-table th{
1680
+ width: initial;
1681
+ }
1682
+
1683
+ .yith-plugin-ui #plugin-fw-wc table.form-table th.check-column{
1684
+ padding-left: 3px;
1685
+ }
1686
+ .yith-plugin-ui #plugin-fw-wc table.wp-list-table tbody td{
1687
+ padding-left: 20px;
1688
+ }
1689
+ .yith-plugin-ui .yith-plugin-fw-list-table h2{
1690
+ border: 0;
1691
+ padding: 35px 0 15px;
1692
+ display: inline-block;
1693
+ margin-right: 10px;
1694
+ }
1695
+ .yith-plugin-ui .form-table .yith-plugin-fw-list-table table th{
1696
+ vertical-align: middle;
1697
+ }
1698
+ .yith-plugin-ui .yith-plugin-fw-list-table-container{
1699
+ padding: 0 20px;
1700
+ }
1701
+ .yith-plugin-ui #doaction, .yith-plugin-ui #doaction2, .yith-plugin-ui #post-query-submit{
1702
+ margin-left: 10px;
1703
+ height: 33px;
1704
+ }
1705
+ .yith-plugin-ui .bulkactions{
1706
+ margin: 10px 0;
1707
+ }
1708
+ .yith-plugin-ui .form-table td p.yith-section-description{
1709
+ color:#716269;
1710
+ margin-bottom: 20px;
1711
+ }
1712
+
1713
+ /** Time picker width*/
1714
+ .yith-plugin-ui input.ui-timepicker-input {
1715
+ width: 100px!important;
1716
+ }
1717
+ /** date format **/
1718
+ .yith-plugin-ui .yith-plugin-fw-date-format code {
1719
+ margin-left: 30px;
1720
+ }
1721
+
1722
+ .yith-plugin-ui .yith-plugin-fw-date-format input[type=text].small-text {
1723
+ margin-left: 45px;
1724
+ }
1725
+
1726
+ /** checkbox columns **/
1727
+ .yith-plugin-ui td.forminp-checkbox.two-cols fieldset {
1728
+ width: calc(50% - 20px);
1729
+ padding-right: 20px;
1730
+ float: left;
1731
+ }
1732
+
1733
+ .yith-plugin-ui td.forminp-checkbox.three-cols fieldset {
1734
+ width: calc(33% - 0px);
1735
+ padding-right: 0px;
1736
+ float: left;
1737
+ }
1738
+
1739
+
1740
+ .yith-plugin-fw-checkbox-field-wrapper {
1741
+ display: inline-block !important;
1742
+ width: 19px !important;
1743
+ margin-right: 10px;
1744
+ }
1745
+ .yith-plugin-fw-checkbox-field-wrapper + span.description {
1746
+ display: inline-block;
1747
+ vertical-align: middle;
1748
+ margin: 0;
1749
+ }
1750
+ .yith-plugin-ui span.description {
1751
+ margin-top: 10px;
1752
+ }
1753
+ .yith-plugin-fw-option-with-description {
1754
+ display: table-cell;
1755
+ width: auto;
1756
+ vertical-align: top;
1757
+ }
1758
+ /** YITH PANEL **/
1759
+ .yith-plugin-ui #yith-plugin-fw-panel{
1760
+ margin-top: -10px;
1761
+ }
1762
+ .yith-plugin-ui #plugin-fw-wc, .yith-plugin-ui #yith-plugin-fw-panel{
1763
+ padding-top: 0;
1764
+ }
1765
+ .yith-plugin-ui .plugin-option tr{
1766
+ border: 0;
1767
+ }
1768
+
1769
+ @media screen and (max-width: 1440px){
1770
+ .yith-plugin-ui .yith-add-box,
1771
+ .yith-plugin-ui .yith-toggle-row{
1772
+ width: 80%;
1773
+ }
1774
+ }
1775
+ @media screen and (max-width: 1024px){
1776
+ .yith-plugin-ui .yith-add-box,
1777
+ .yith-plugin-ui .yith-toggle-row{
1778
+ width: 90%;
1779
+ }
1780
+
1781
+ .yith-plugin-ui td.forminp-checkbox.two-cols fieldset {
1782
+ width: 100%;
1783
+ padding-right: 20px;
1784
+ float: left;
1785
+ }
1786
+
1787
+ .yith-plugin-ui td.forminp-checkbox.three-cols fieldset {
1788
+ width: calc(50% - 0px);
1789
+ padding-right: 0px;
1790
+ float: left;
1791
+ }
1792
+ }
1793
+ @media screen and (max-width: 782px){
1794
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free{
1795
+ height: auto;
1796
+ background-color: #a9c7d3;
1797
+ }
1798
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free ul{
1799
+ width: 90%;
1800
+ text-align: center;
1801
+ }
1802
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free li img{
1803
+ width: 90%;
1804
+ margin: 0 auto;
1805
+ }
1806
+ .yith-plugin-fw-banner h1{
1807
+ line-height: 1.2em;
1808
+ }
1809
+
1810
+ .yith-plugin-ui .yith-add-box,
1811
+ .yith-plugin-ui .yith-toggle-row{
1812
+ width: 100%;
1813
+ }
1814
+
1815
+ .yith-plugin-ui td.forminp-checkbox.two-cols fieldset,
1816
+ .yith-plugin-ui td.forminp-checkbox.three-cols fieldset{
1817
+ width: 100%;
1818
+ }
1819
+
1820
  }
plugin-fw/assets/fonts/yith-icon.eot ADDED
Binary file
plugin-fw/assets/fonts/yith-icon.svg ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="yith-icon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="arrow_down" d="M85.333 618.667l426.684-426.65 426.65 426.65-85.35 85.316-341.299-341.299-341.367 341.299z" />
11
+ <glyph unicode="&#xe901;" glyph-name="arrow_left" d="M767.966 106.684l-341.316 341.367 341.316 341.265-85.35 85.35-426.581-426.615 426.581-426.718z" />
12
+ <glyph unicode="&#xe902;" glyph-name="arrow_right" d="M341.385 21.333l426.581 426.718-426.581 426.615-85.35-85.35 341.316-341.265-341.316-341.367z" />
13
+ <glyph unicode="&#xe903;" glyph-name="arrow_up" d="M938.667 277.333l-426.684 426.65-426.65-426.65 85.316-85.316 341.333 341.299 341.333-341.299z" />
14
+ <glyph unicode="&#xe904;" glyph-name="calendar" d="M263.1 341.385h71.083v-71.083h-71.083v71.083zM369.766 341.385h71.083v-71.083h-71.083v71.083zM476.416 341.385h71.083v-71.083h-71.083v71.083zM583.083 341.385h71.083v-71.083h-71.083v71.083zM369.766 448.034h71.083v-71.083h-71.083v71.083zM476.416 448.034h71.083v-71.083h-71.083v71.083zM583.083 448.034h71.083v-71.083h-71.083v71.083zM263.1 234.718h71.083v-71.083h-71.083v71.083zM369.766 234.718h71.083v-71.083h-71.083v71.083zM476.416 234.718h71.083v-71.083h-71.083v71.083zM583.083 234.718h71.083v-71.083h-71.083v71.083zM689.818 341.385h71.083v-71.083h-71.083v71.083zM689.818 448.034h71.083v-71.083h-71.083v71.083zM903.134 803.584h-142.234v71.083h-71.083v-71.083h-355.55v71.083h-71.083v-71.083h-142.319v-782.251h782.251v782.251zM263.1 732.501v-71.083h71.083v71.083h355.55v-71.083h71.083v71.083h71.083v-142.234h-640.017v142.234h71.219zM191.949 92.484v426.701h640.017v-426.701h-640.017z" />
15
+ <glyph unicode="&#xe905;" glyph-name="check" d="M938.667 734.191l-56.371 56.371-566.391-566.391-168.875 207.258-61.696-50.295 224.58-275.695z" />
16
+ <glyph unicode="&#xe906;" glyph-name="close" d="M158.857 21.333l353.143 353.143 353.143-353.143 73.523 73.523-353.143 353.143 353.143 353.143-73.523 73.523-353.143-353.143-353.143 353.143-73.523-73.523 353.143-353.143-353.143-353.143z" />
17
+ <glyph unicode="&#xe907;" glyph-name="edit" d="M868.847 357.239l-517.427 517.427-193.178-193.178 517.427-517.427h193.178v193.178zM705.178 235.435l92.297 92.297v-92.297h-92.297zM654.729 285.884l-306.398 306.398 92.297 92.297 306.398-306.398-92.297-92.297zM351.42 773.786l38.775-38.775-92.297-92.297-38.775 38.775 92.297 92.297zM155.153 92.706h713.677v-71.373h-713.677v71.373z" />
18
+ <glyph unicode="&#xe908;" glyph-name="magnifier" d="M694.528 570.095c0 167.953-136.619 304.572-304.572 304.572s-304.589-136.619-304.589-304.572 136.619-304.572 304.572-304.572c70.229 0 134.895 24.115 186.419 64.239l26.18-26.18-38.076-38.076 244.19-244.173 129.963 129.963-244.173 244.19-38.076-38.076-26.18 26.18c40.124 51.695 64.341 116.258 64.341 186.505zM830.976 151.296l-22.323-22.323-136.533 136.533 22.323 22.323 136.533-136.533zM389.956 341.658c-125.952 0-228.437 102.485-228.437 228.437s102.485 228.42 228.437 228.42 228.437-102.485 228.437-228.437c-0.017-125.935-102.502-228.42-228.437-228.42z" />
19
+ <glyph unicode="&#xe909;" glyph-name="pencil" d="M669.542 874.701l-584.209-584.192 2.628-266.581 266.496-2.628 584.209 584.192-269.124 269.21zM831.010 605.577l-25.515-25.515-161.485 161.553 25.532 25.532 161.468-161.57zM323.277 97.758l-159.915 1.553-1.553 160 428.39 428.476 53.828-53.914-412.894-412.791 53.828-53.828 412.877 412.809 53.828-53.828-428.39-428.476z" />
20
+ <glyph unicode="&#xe90a;" glyph-name="plus" d="M475.409 21.333h78.029v385.229h385.229v78.029h-385.229v390.076h-78.029v-390.076h-390.076v-78.029h390.076z" />
21
+ <glyph unicode="&#xe90b;" glyph-name="update" d="M188.075 400.162c23.313-158.703 159.932-281.139 325.035-281.139 118.903 0 228.949 64.495 287.13 168.38l-63.761 35.703c-45.295-80.828-130.884-131.055-223.369-131.055-120.798 0-222.14 84.275-248.73 197.018l40.209-40.124 51.695 51.695-135.475 135.475-135.475-135.458 51.695-51.695 51.046 51.2zM513.109 703.863c121.941 0 224.017-85.828 249.549-200.141l-43.247 43.247-51.695-51.695 135.475-135.475 135.475 135.475-51.695 51.695-49.152-49.152c-24.132 157.713-160.341 279.159-324.71 279.159-117.009 0-226.236-62.942-284.911-164.369l63.266-36.591c45.705 78.78 130.56 127.846 221.645 127.846z" />
22
+ <glyph unicode="&#xe90c;" glyph-name="upload" d="M937.728 139.315v619.247c0 64-52.105 116.105-116.105 116.105h-619.247c-64 0-116.105-52.105-116.105-116.105v-619.247c0-64 52.105-116.105 116.105-116.105h190.276v77.38h-190.276c-21.333 0-38.724 17.306-38.724 38.724v619.247c0 21.333 17.306 38.724 38.724 38.724h619.247c21.333 0 38.724-17.306 38.724-38.724v-619.247c0-21.333-17.391-38.724-38.724-38.724h-193.485v-77.38h193.485c64 0.017 116.105 52.105 116.105 116.105zM550.69 21.333v412.553l88.61-89.515 54.972 54.391-180.429 182.323-183.876-181.982 54.409-55.057 88.934 87.945v-410.658z" />
23
+ <glyph unicode="&#xe90d;" glyph-name="trash" d="M734.591 132.655c0-20.48-16.696-37.101-37.101-37.101h-371.014c-20.406 0-37.101 16.621-37.101 37.101v519.42h-74.203v-519.42c0-61.403 50.087-111.304 111.304-111.304h371.014c61.217 0 111.304 49.901 111.304 111.304v519.42h-74.203v-519.42zM400.679 800.48h222.608v-37.101h-222.608v37.101zM697.49 800.48c0 40.923-33.391 74.203-74.203 74.203h-222.608c-40.812 0-74.203-33.28-74.203-74.203v-37.101h-185.507v-74.203h742.028v74.203h-185.507v37.101zM474.882 614.973h74.203v-445.217h-74.203v445.217zM363.577 614.973h74.203v-445.217h-74.203v445.217zM586.186 614.973h74.203v-445.217h-74.203v445.217z" />
24
+ <glyph unicode="&#xe90e;" glyph-name="info" d="M511.957 92.471c-196.017 0-355.555 159.466-355.555 355.555 0 196.053 159.538 355.555 355.555 355.555 196.053 0 355.555-159.502 355.555-355.555 0-196.089-159.502-355.555-355.555-355.555zM511.957 874.692c-235.271 0-426.666-191.431-426.666-426.666 0-235.271 191.395-426.666 426.666-426.666 235.306 0 426.666 191.395 426.666 426.666 0 235.235-191.36 426.666-426.666 426.666zM476.402 270.248v177.777h35.555v-177.777h-35.555zM583.068 448.026v71.111h-213.333v-71.111h35.555v-248.888h213.333v71.111h-35.555v177.777zM494.179 661.359c9.813 0 17.778-8 17.778-17.778 0-9.813-7.964-17.778-17.778-17.778-9.778 0-17.778 7.964-17.778 17.778 0 9.778 8 17.778 17.778 17.778zM494.179 554.692c49.031 0 88.889 39.858 88.889 88.889 0 48.995-39.858 88.889-88.889 88.889-48.995 0-88.889-39.893-88.889-88.889 0-49.031 39.893-88.889 88.889-88.889z" />
25
+ <glyph unicode="&#xe90f;" glyph-name="drag" d="M241.835 409.259h232.277v-232.277h-116.053l156.501-154.795 156.501 154.795h-119.467v232.277h233.813v-116.224l154.965 156.672-154.965 156.501v-119.467h-233.813v232.277h119.467l-156.501 154.795-156.501-154.795h116.053v-232.277h-232.277v119.467l-154.795-156.501 154.795-156.672z" />
26
+ <glyph unicode="&#xe910;" glyph-name="reset" d="M188.928 400.384c23.211-158.379 159.573-280.405 324.267-280.405 118.613 0 228.352 64.341 286.379 167.936l-63.488 35.499c-45.227-80.555-130.56-130.731-222.891-130.731-120.491 0-221.525 84.139-248.149 196.608l40.107-40.107 51.541 51.541-135.168 135.168-135.168-135.168 51.541-51.541 51.029 51.2zM513.195 703.317c121.685 0 223.573-85.675 249.003-199.68l-43.179 43.179-51.541-51.541 135.168-135.168 135.168 135.168-51.541 51.541-48.981-48.981c-24.064 157.355-159.915 278.528-323.925 278.528-116.736 0-225.621-62.805-284.16-164.011l63.147-36.523c45.227 78.507 129.877 127.488 220.843 127.488z" />
27
+ </font></defs></svg>
plugin-fw/assets/fonts/yith-icon.ttf ADDED
Binary file
plugin-fw/assets/fonts/yith-icon.woff ADDED
Binary file
plugin-fw/assets/images/arrow_down.svg ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 600 600" style="enable-background:new 0 0 600 600;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#d9d9d9;}
7
+ </style>
8
+ <polygon class="st0" points="50,200 300.01,449.99 550,200 499.99,150.01 300.01,349.99 99.99,150.01 "/>
9
+ </svg>
plugin-fw/assets/images/banner-free.png ADDED
Binary file
plugin-fw/assets/images/banner-premium.png ADDED
Binary file
plugin-fw/assets/images/rate_banner.png ADDED
Binary file
plugin-fw/assets/images/upgrade_banner.png ADDED
Binary file
plugin-fw/assets/js/yith-fields.js CHANGED
@@ -1,364 +1,649 @@
1
- jQuery( function ( $ ) {
2
-
3
- var $datepicker = $( '.yith-plugin-fw-datepicker' ),
4
- $colorpicker = $( '.yith-plugin-fw-colorpicker' ),
5
- $upload = {
6
- imgPreviewHandler : '.yith-plugin-fw-upload-img-preview',
7
- uploadButtonHandler: '.yith-plugin-fw-upload-button',
8
- imgUrlHandler : '.yith-plugin-fw-upload-img-url',
9
- resetButtonHandler : '.yith-plugin-fw-upload-button-reset',
10
- imgUrl : $( '.yith-plugin-fw-upload-img-url' )
11
- },
12
- $wpAddMedia = $( '.add_media' ),
13
- $imageGallery = {
14
- sliderWrapper: $( '.yith-plugin-fw .image-gallery ul.slides-wrapper' ),
15
- buttonHandler: '.yith-plugin-fw .image-gallery-button'
16
- },
17
- $onoff = $( '.yith-plugin-fw-onoff-container span' ),
18
- $sidebars = $( '.yith-plugin-fw-sidebar-layout' ),
19
- $slider = $( '.yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal' ),
20
- $codemirror = $( '.codemirror' ),
21
- $icons = $( '.yit-icons-manager-wrapper' );
22
-
23
- /* Datepicker */
24
- $datepicker.each( function () {
25
- var args = $( this ).data();
26
- $( this ).datepicker( args );
27
- } );
28
-
29
- /* Colorpicker */
30
- $colorpicker.wpColorPicker( {
31
- clear: function () {
32
- var input = $( this );
33
- input.val( input.data( 'default-color' ) );
34
- input.change();
35
- }
36
- } );
37
- $colorpicker.each( function () {
38
- var select_label = $( this ).data( 'variations-label' );
39
- $( this ).parent().parent().find( 'a.wp-color-result' ).attr( 'title', select_label );
40
- } );
41
-
42
- /* Upload */
43
- if ( typeof wp !== 'undefined' && typeof wp.media !== 'undefined' ) {
44
- var _custom_media = true;
45
- // preview
46
- $upload.imgUrl.change( function () {
47
- var url = $( this ).val(),
48
- re = new RegExp( "(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)" ),
49
- preview = $( this ).parent().find( $upload.imgPreviewHandler ).first();
50
-
51
- if ( preview.length < 1 )
52
- preview = $( this ).parent().parent().find( $upload.imgPreviewHandler ).first();
53
-
54
- if ( re.test( url ) ) {
55
- preview.html( '<img src="' + url + '" style="max-width:100px; max-height:100px;" />' );
56
- } else {
57
- preview.html( '' );
58
  }
59
- } ).trigger( 'change' );
60
 
61
- $( document ).on( 'click', $upload.uploadButtonHandler, function ( e ) {
62
- e.preventDefault();
63
 
64
- var t = $( this ),
65
- custom_uploader,
66
- id = t.attr( 'id' ).replace( /-button$/, '' );
 
67
 
68
- //If the uploader object has already been created, reopen the dialog
69
- if ( custom_uploader ) {
70
- custom_uploader.open();
71
- return;
 
 
 
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
- var custom_uploader_states = [
75
- // Main states.
76
- new wp.media.controller.Library( {
77
- library : wp.media.query(),
78
- multiple : false,
79
- title : 'Choose Image',
80
- priority : 20,
81
- filterable: 'uploaded'
82
- } )
83
- ];
84
-
85
- // Create the media frame.
86
- custom_uploader = wp.media.frames.downloadable_file = wp.media( {
87
- // Set the title of the modal.
88
- title : 'Choose Image',
89
- library : {
90
- type: ''
91
- },
92
- button : {
93
- text: 'Choose Image'
94
- },
95
- multiple: false,
96
- states : custom_uploader_states
97
- } );
98
-
99
- //When a file is selected, grab the URL and set it as the text field's value
100
- custom_uploader.on( 'select', function () {
101
- var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
102
-
103
- $( "#" + id ).val( attachment.url );
104
- // Save the id of the selected element to an element which name is the same with a suffix "-yith-attachment-id"
105
- if ( $( "#" + id + "-yith-attachment-id" ) ) {
106
- $( "#" + id + "-yith-attachment-id" ).val( attachment.id );
107
  }
108
- $upload.imgUrl.trigger( 'change' );
109
- } );
110
-
111
- //Open the uploader dialog
112
- custom_uploader.open();
113
- } );
114
-
115
- $( document ).on( 'click', $upload.resetButtonHandler, function ( e ) {
116
- var t = $( this ),
117
- id = t.attr( 'id' ),
118
- input_id = t.attr( 'id' ).replace( /-button-reset$/, '' ),
119
- default_value = $( '#' + id ).data( 'default' );
120
-
121
- $( "#" + input_id ).val( default_value );
122
- $upload.imgUrl.trigger( 'change' );
123
- } );
124
- }
125
-
126
- $wpAddMedia.on( 'click', function () {
127
- _custom_media = false;
128
- } );
129
-
130
- /* Image Gallery */
131
- if ( typeof wp !== 'undefined' && typeof wp.media !== 'undefined' ) {
132
- $( document ).on( 'click', $imageGallery.buttonHandler, function ( e ) {
133
- var $t = $( this ),
134
- $container = $t.closest( '.image-gallery' ),
135
- $image_gallery_ids = $container.find( '.image_gallery_ids' ),
136
- attachment_ids = $image_gallery_ids.val(),
137
- $gallery_images_wrapper = $container.find( 'ul.slides-wrapper' );
138
-
139
- // Create the media frame.
140
- var image_gallery_frame = wp.media.frames.image_gallery = wp.media( {
141
- // Set the title of the modal.
142
- title : $t.data( 'choose' ),
143
- button: {
144
- text: $t.data( 'update' )
145
- },
146
- states: [
147
- new wp.media.controller.Library( {
148
- title : $t.data( 'choose' ),
149
- filterable: 'all',
150
- multiple : true
151
- } )
152
- ]
153
- } );
154
-
155
- // When an image is selected, run a callback.
156
- image_gallery_frame.on( 'select', function () {
157
- var selection = image_gallery_frame.state().get( 'selection' );
158
- selection.map( function ( attachment ) {
159
- attachment = attachment.toJSON();
160
-
161
- if ( attachment.id ) {
162
- attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
163
- $gallery_images_wrapper.append( '<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment.sizes.thumbnail.url + '"/><ul class="actions"><li><a href="#" class="delete" title="' + $t.data( 'delete' ) + '">x</a></li></ul></li>' );
164
  }
165
- } );
166
-
167
- $image_gallery_ids.val( attachment_ids );
168
- } );
169
-
170
- image_gallery_frame.open();
171
-
172
- } );
173
-
174
- // Image ordering
175
- $imageGallery.sliderWrapper.each( function () {
176
- var $t = $( this );
177
- $t.sortable( {
178
- items : 'li.image',
179
- cursor : 'move',
180
- scrollSensitivity : 40,
181
- forcePlaceholderSize: true,
182
- forceHelperSize : false,
183
- helper : 'clone',
184
- opacity : 0.65,
185
- start : function ( event, ui ) {
186
- ui.item.css( 'background-color', '#f6f6f6' );
187
- },
188
- stop : function ( event, ui ) {
189
- ui.item.removeAttr( 'style' );
190
- },
191
- update : function ( event, ui ) {
192
- var attachment_ids = '';
193
-
194
- $t.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
195
- var attachment_id = $( this ).attr( 'data-attachment_id' );
196
- attachment_ids = attachment_ids + attachment_id + ',';
197
- } );
198
-
199
- $t.closest( '.image-gallery' ).find( '.image_gallery_ids' ).val( attachment_ids );
200
- }
201
- } );
202
- } );
203
-
204
- // Remove images
205
- $imageGallery.sliderWrapper.on( 'click', 'a.delete', function () {
206
- var $wrapper = $( this ).closest( '.image-gallery' ),
207
- $gallery = $( this ).closest( '.image-gallery ul.slides-wrapper' ),
208
- $image_gallery_ids = $wrapper.find( '.image_gallery_ids' ),
209
- attachment_ids = '';
210
-
211
- $( this ).closest( 'li.image' ).remove();
212
-
213
- $gallery.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
214
- var attachment_id = $( this ).attr( 'data-attachment_id' );
215
- attachment_ids = attachment_ids + attachment_id + ',';
216
- } );
217
-
218
- $image_gallery_ids.val( attachment_ids );
219
- } );
220
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
 
222
  /* on-off */
223
- $onoff.on( 'click', function () {
224
- var input = $( this ).prev( 'input' ),
225
- checked = input.prop( 'checked' );
226
 
227
- if ( checked ) {
228
- input.prop( 'checked', false ).attr( 'value', 'no' ).removeClass( 'onoffchecked' );
229
  } else {
230
- input.prop( 'checked', true ).attr( 'value', 'yes' ).addClass( 'onoffchecked' );
231
  }
232
 
233
  input.change();
234
- } );
235
-
236
- /* Sidebars */
237
- $sidebars.each( function () {
238
- var $images = $( this ).find( 'img' );
239
- $images.on( 'click', function () {
240
- var $container = $( this ).closest( '.yith-plugin-fw-sidebar-layout' ),
241
- $left = $container.find( '.yith-plugin-fw-sidebar-layout-sidebar-left-container' ),
242
- $right = $container.find( '.yith-plugin-fw-sidebar-layout-sidebar-right-container' ),
243
- type = $( this ).data( 'type' );
244
-
245
- $( this ).parent().children( ':radio' ).attr( 'checked', false );
246
- $( this ).prev( ':radio' ).attr( 'checked', true );
247
-
248
- if ( typeof type != 'undefined' ) {
249
- switch ( type ) {
250
- case 'left':
251
- $left.show();
252
- $right.hide();
253
- break;
254
- case 'right':
255
- $right.show();
256
- $left.hide();
257
- break;
258
- case 'double':
259
- $left.show();
260
- $right.show();
261
- break;
262
- default:
263
- $left.hide();
264
- $right.hide();
265
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
  }
268
- } );
269
- } );
270
-
271
- /* Slider */
272
- $slider.each( function () {
273
- var val = $( this ).data( 'val' ),
274
- minValue = $( this ).data( 'min' ),
275
- maxValue = $( this ).data( 'max' ),
276
- step = $( this ).data( 'step' ),
277
- labels = $( this ).data( 'labels' );
278
-
279
- $( this ).slider( {
280
- value: val,
281
- min : minValue,
282
- max : maxValue,
283
- range: 'min',
284
- step : step,
285
-
286
- create: function () {
287
- $( this ).find( '.ui-slider-handle' ).text( $( this ).slider( "value" ) );
288
- },
289
-
290
-
291
- slide: function ( event, ui ) {
292
- $( this ).find( 'input' ).val( ui.value );
293
- $( this ).find( '.ui-slider-handle' ).text( ui.value );
294
- $( this ).siblings( '.feedback' ).find( 'strong' ).text( ui.value + labels );
295
- }
296
- } );
297
- } );
298
-
299
- /* codemirror */
300
- $codemirror.each( function ( i, v ) {
301
- var editor = CodeMirror.fromTextArea( v, {
302
- lineNumbers : 1,
303
- mode : 'javascript',
304
- showCursorWhenSelecting: true
305
- } );
306
-
307
- $( v ).data( 'codemirrorInstance', editor );
308
- } );
309
-
310
- /* Select All - Deselect All */
311
- $( document ).on( 'click', '.yith-plugin-fw-select-all', function () {
312
- var $targetSelect = $( '#' + $( this ).data( 'select-id' ) );
313
- $targetSelect.find( 'option' ).prop( 'selected', true ).trigger( 'change' );
314
- } );
315
-
316
- $( document ).on( 'click', '.yith-plugin-fw-deselect-all', function () {
317
- var $targetSelect = $( '#' + $( this ).data( 'select-id' ) );
318
- $targetSelect.find( 'option' ).prop( 'selected', false ).trigger( 'change' );
319
- } );
320
-
321
-
322
- $icons.each( function () {
323
- var $container = $( this ),
324
- $preview = $container.find( '.yit-icons-manager-icon-preview' ).first(),
325
- $text = $container.find( '.yit-icons-manager-icon-text' );
326
-
327
- $container.on( 'click', '.yit-icons-manager-list li', function ( event ) {
328
- var $target = $( event.target ).closest( 'li' ),
329
- font = $target.data( 'font' ),
330
- icon = $target.data( 'icon' ),
331
- key = $target.data( 'key' ),
332
- name = $target.data( 'name' );
333
-
334
- $preview.attr( 'data-font', font );
335
- $preview.attr( 'data-icon', icon );
336
- $preview.attr( 'data-key', key );
337
- $preview.attr( 'data-name', name );
338
-
339
- $text.val( font + ':' + name );
340
-
341
- $container.find( '.yit-icons-manager-list li' ).removeClass( 'active' );
342
- $target.addClass( 'active' );
343
- } );
344
-
345
- $container.on( 'click', '.yit-icons-manager-action-set-default', function () {
346
- $container.find( '.yit-icons-manager-list li.default' ).trigger( 'click' );
347
- } );
348
- } );
349
-
350
- /** Select Images */
351
- $( document ).on( 'click', '.yith-plugin-fw-select-images__item', function () {
352
- var item = $( this ),
353
- key = item.data( 'key' ),
354
- wrapper = item.closest( '.yith-plugin-fw-select-images__wrapper' ),
355
- items = wrapper.find( '.yith-plugin-fw-select-images__item' ),
356
- select = wrapper.find( 'select' ).first();
357
-
358
- if ( select.length ) {
359
- select.val( key );
360
- items.removeClass( 'yith-plugin-fw-select-images__item--selected' );
361
- item.addClass( 'yith-plugin-fw-select-images__item--selected' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  }
363
- } );
364
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function ($) {
2
+ /* global yith_framework_fw_fields*/
3
+
4
+ var yith_fields_init = function () {
5
+ var $datepicker = $('.yith-plugin-fw-datepicker'),
6
+ $colorpicker = $('.yith-plugin-fw-colorpicker'),
7
+ $upload = {
8
+ imgPreviewHandler: '.yith-plugin-fw-upload-img-preview',
9
+ uploadButtonHandler: '.yith-plugin-fw-upload-button',
10
+ imgUrlHandler: '.yith-plugin-fw-upload-img-url',
11
+ resetButtonHandler: '.yith-plugin-fw-upload-button-reset',
12
+ imgUrl: $('.yith-plugin-fw-upload-img-url')
13
+ },
14
+ $wpAddMedia = $('.add_media'),
15
+ $imageGallery = {
16
+ sliderWrapper: $('.yith-plugin-fw .image-gallery ul.slides-wrapper'),
17
+ buttonHandler: '.yith-plugin-fw .image-gallery-button'
18
+ },
19
+ $sidebars = $('.yith-plugin-fw-sidebar-layout'),
20
+ $slider = $('.yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal'),
21
+ $codemirror = $('.codemirror'),
22
+ $icons = $('.yit-icons-manager-wrapper'),
23
+ $checkgroup = $(".yith-plugin-ui td.forminp-checkbox");
24
+
25
+ /* Datepicker */
26
+ $datepicker.each(function () {
27
+ var args = $(this).data();
28
+ $(this).datepicker(args);
29
+ });
30
+
31
+ /* Colorpicker */
32
+ $colorpicker.wpColorPicker({
33
+ palettes: false,
34
+ width: 200,
35
+ mode: 'hsl',
36
+ clear: function () {
37
+ var input = $(this);
38
+ input.val(input.data('default-color'));
39
+ input.change();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
+ });
42
 
 
 
43
 
44
+ $colorpicker.each(function () {
45
+ var select_label = $(this).data('variations-label'),
46
+ wrap_main = $(this).closest( '.yith-plugin-fw-field-wrapper' ),
47
+ wrap = wrap_main.find('.wp-picker-input-wrap');
48
 
49
+ wrap_main.find('a.wp-color-result').attr('title', select_label);
50
+
51
+ if( ! wrap.find( '.wp-picker-clear-custom' ).length ) {
52
+ var button = $('<span/>').attr({
53
+ class :"wp-picker-default-custom"
54
+ });
55
+ wrap.find( '.wp-picker-default' ).wrap( button );
56
  }
57
+ });
58
+
59
+
60
+
61
+ /* Upload */
62
+ if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
63
+ var _custom_media = true;
64
+ // preview
65
+ $upload.imgUrl.change(function () {
66
+ var url = $(this).val(),
67
+ re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)"),
68
+ preview = $(this).parent().find($upload.imgPreviewHandler).first();
69
+
70
+ if (preview.length < 1)
71
+ preview = $(this).parent().parent().find($upload.imgPreviewHandler).first();
72
 
73
+ if (re.test(url)) {
74
+ preview.html('<img src="' + url + '" style="max-width:100px; max-height:100px;" />');
75
+ } else {
76
+ preview.html('');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
+ }).trigger('change');
79
+
80
+ $(document).on('click', $upload.uploadButtonHandler, function (e) {
81
+ e.preventDefault();
82
+
83
+ var t = $(this),
84
+ custom_uploader,
85
+ id = t.attr('id').replace(/-button$/, '');
86
+
87
+ //If the uploader object has already been created, reopen the dialog
88
+ if (custom_uploader) {
89
+ custom_uploader.open();
90
+ return;
91
+ }
92
+
93
+ var custom_uploader_states = [
94
+ // Main states.
95
+ new wp.media.controller.Library({
96
+ library: wp.media.query(),
97
+ multiple: false,
98
+ title: 'Choose Image',
99
+ priority: 20,
100
+ filterable: 'uploaded'
101
+ })
102
+ ];
103
+
104
+ // Create the media frame.
105
+ custom_uploader = wp.media.frames.downloadable_file = wp.media({
106
+ // Set the title of the modal.
107
+ title: 'Choose Image',
108
+ library: {
109
+ type: ''
110
+ },
111
+ button: {
112
+ text: 'Choose Image'
113
+ },
114
+ multiple: false,
115
+ states: custom_uploader_states
116
+ });
117
+
118
+ //When a file is selected, grab the URL and set it as the text field's value
119
+ custom_uploader.on('select', function () {
120
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
121
+
122
+ $("#" + id).val(attachment.url);
123
+ // Save the id of the selected element to an element which name is the same with a suffix "-yith-attachment-id"
124
+ if ($("#" + id + "-yith-attachment-id")) {
125
+ $("#" + id + "-yith-attachment-id").val(attachment.id);
 
 
 
 
 
 
 
 
126
  }
127
+ $upload.imgUrl.trigger('change');
128
+ });
129
+
130
+ //Open the uploader dialog
131
+ custom_uploader.open();
132
+ });
133
+
134
+ $(document).on('click', $upload.resetButtonHandler, function (e) {
135
+ var t = $(this),
136
+ id = t.attr('id'),
137
+ input_id = t.attr('id').replace(/-button-reset$/, ''),
138
+ default_value = $('#' + id).data('default');
139
+
140
+ $("#" + input_id).val(default_value);
141
+ $upload.imgUrl.trigger('change');
142
+ });
143
+ }
144
+
145
+ $wpAddMedia.on('click', function () {
146
+ _custom_media = false;
147
+ });
148
+
149
+ /* Image Gallery */
150
+ if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
151
+ $(document).on('click', $imageGallery.buttonHandler, function (e) {
152
+ var $t = $(this),
153
+ $container = $t.closest('.image-gallery'),
154
+ $image_gallery_ids = $container.find('.image_gallery_ids'),
155
+ attachment_ids = $image_gallery_ids.val(),
156
+ $gallery_images_wrapper = $container.find('ul.slides-wrapper');
157
+
158
+ // Create the media frame.
159
+ var image_gallery_frame = wp.media.frames.image_gallery = wp.media({
160
+ // Set the title of the modal.
161
+ title: $t.data('choose'),
162
+ button: {
163
+ text: $t.data('update')
164
+ },
165
+ states: [
166
+ new wp.media.controller.Library({
167
+ title: $t.data('choose'),
168
+ filterable: 'all',
169
+ multiple: true
170
+ })
171
+ ]
172
+ });
173
+
174
+ // When an image is selected, run a callback.
175
+ image_gallery_frame.on('select', function () {
176
+ var selection = image_gallery_frame.state().get('selection');
177
+ selection.map(function (attachment) {
178
+ attachment = attachment.toJSON();
179
+
180
+ if (attachment.id) {
181
+ attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
182
+ $gallery_images_wrapper.append('<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment.sizes.thumbnail.url + '"/><ul class="actions"><li><a href="#" class="delete" title="' + $t.data('delete') + '">x</a></li></ul></li>');
183
+ }
184
+ });
185
+
186
+ $image_gallery_ids.val(attachment_ids);
187
+ });
188
+
189
+ image_gallery_frame.open();
190
+
191
+ });
192
+
193
+ // Image ordering
194
+ $imageGallery.sliderWrapper.each(function () {
195
+ var $t = $(this);
196
+ $t.sortable({
197
+ items: 'li.image',
198
+ cursor: 'move',
199
+ scrollSensitivity: 40,
200
+ forcePlaceholderSize: true,
201
+ forceHelperSize: false,
202
+ helper: 'clone',
203
+ opacity: 0.65,
204
+ start: function (event, ui) {
205
+ ui.item.css('background-color', '#f6f6f6');
206
+ },
207
+ stop: function (event, ui) {
208
+ ui.item.removeAttr('style');
209
+ },
210
+ update: function (event, ui) {
211
+ var attachment_ids = '';
212
+
213
+ $t.find('li.image').css('cursor', 'default').each(function () {
214
+ var attachment_id = $(this).attr('data-attachment_id');
215
+ attachment_ids = attachment_ids + attachment_id + ',';
216
+ });
217
+
218
+ $t.closest('.image-gallery').find('.image_gallery_ids').val(attachment_ids);
219
+ }
220
+ });
221
+ });
222
+
223
+ // Remove images
224
+ $imageGallery.sliderWrapper.on('click', 'a.delete', function () {
225
+ var $wrapper = $(this).closest('.image-gallery'),
226
+ $gallery = $(this).closest('.image-gallery ul.slides-wrapper'),
227
+ $image_gallery_ids = $wrapper.find('.image_gallery_ids'),
228
+ attachment_ids = '';
229
+
230
+ $(this).closest('li.image').remove();
231
+
232
+ $gallery.find('li.image').css('cursor', 'default').each(function () {
233
+ var attachment_id = $(this).attr('data-attachment_id');
234
+ attachment_ids = attachment_ids + attachment_id + ',';
235
+ });
236
+
237
+ $image_gallery_ids.val(attachment_ids);
238
+ });
239
+ }
240
+
241
+
242
+ /* Sidebars */
243
+ $sidebars.each(function () {
244
+ var $images = $(this).find('img');
245
+ $images.on('click', function () {
246
+ var $container = $(this).closest('.yith-plugin-fw-sidebar-layout'),
247
+ $left = $container.find('.yith-plugin-fw-sidebar-layout-sidebar-left-container'),
248
+ $right = $container.find('.yith-plugin-fw-sidebar-layout-sidebar-right-container'),
249
+ type = $(this).data('type');
250
+
251
+ $(this).parent().children(':radio').attr('checked', false);
252
+ $(this).prev(':radio').attr('checked', true);
253
+
254
+ if (typeof type != 'undefined') {
255
+ switch (type) {
256
+ case 'left':
257
+ $left.show();
258
+ $right.hide();
259
+ break;
260
+ case 'right':
261
+ $right.show();
262
+ $left.hide();
263
+ break;
264
+ case 'double':
265
+ $left.show();
266
+ $right.show();
267
+ break;
268
+ default:
269
+ $left.hide();
270
+ $right.hide();
271
+ break;
272
+ }
273
+ }
274
+ });
275
+ });
276
+
277
+ /* Slider */
278
+ $slider.each(function () {
279
+ var val = $(this).data('val'),
280
+ minValue = $(this).data('min'),
281
+ maxValue = $(this).data('max'),
282
+ step = $(this).data('step'),
283
+ labels = $(this).data('labels');
284
+
285
+ $(this).slider({
286
+ value: val,
287
+ min: minValue,
288
+ max: maxValue,
289
+ range: 'min',
290
+ step: step,
291
+
292
+ create: function () {
293
+ $(this).find('.ui-slider-handle').text($(this).slider("value"));
294
+ },
295
+
296
+
297
+ slide: function (event, ui) {
298
+ $(this).find('input').val(ui.value);
299
+ $(this).find('.ui-slider-handle').text(ui.value);
300
+ $(this).siblings('.feedback').find('strong').text(ui.value + labels);
301
+ }
302
+ });
303
+ });
304
+
305
+ /* codemirror */
306
+ $codemirror.each(function (i, v) {
307
+ var editor = CodeMirror.fromTextArea(v, {
308
+ lineNumbers: 1,
309
+ mode: 'javascript',
310
+ showCursorWhenSelecting: true
311
+ });
312
+
313
+ $(v).data('codemirrorInstance', editor);
314
+ });
315
+
316
+ /* Select All - Deselect All */
317
+ $(document).on('click', '.yith-plugin-fw-select-all', function () {
318
+ var $targetSelect = $('#' + $(this).data('select-id'));
319
+ $targetSelect.find('option').prop('selected', true).trigger('change');
320
+ });
321
+
322
+ $(document).on('click', '.yith-plugin-fw-deselect-all', function () {
323
+ var $targetSelect = $('#' + $(this).data('select-id'));
324
+ $targetSelect.find('option').prop('selected', false).trigger('change');
325
+ });
326
+
327
+
328
+ $icons.each(function () {
329
+ var $container = $(this),
330
+ $preview = $container.find('.yit-icons-manager-icon-preview').first(),
331
+ $text = $container.find('.yit-icons-manager-icon-text');
332
+
333
+ $container.on('click', '.yit-icons-manager-list li', function (event) {
334
+ var $target = $(event.target).closest('li'),
335
+ font = $target.data('font'),
336
+ icon = $target.data('icon'),
337
+ key = $target.data('key'),
338
+ name = $target.data('name');
339
+
340
+ $preview.attr('data-font', font);
341
+ $preview.attr('data-icon', icon);
342
+ $preview.attr('data-key', key);
343
+ $preview.attr('data-name', name);
344
+
345
+ $text.val(font + ':' + name);
346
+
347
+ $container.find('.yit-icons-manager-list li').removeClass('active');
348
+ $target.addClass('active');
349
+ });
350
+
351
+ $container.on('click', '.yit-icons-manager-action-set-default', function () {
352
+ $container.find('.yit-icons-manager-list li.default').trigger('click');
353
+ });
354
+ });
355
+
356
+ /** Select Images */
357
+ $(document).on('click', '.yith-plugin-fw-select-images__item', function () {
358
+ var item = $(this),
359
+ key = item.data('key'),
360
+ wrapper = item.closest('.yith-plugin-fw-select-images__wrapper'),
361
+ items = wrapper.find('.yith-plugin-fw-select-images__item'),
362
+ select = wrapper.find('select').first();
363
+
364
+ if (select.length) {
365
+ select.val(key);
366
+ items.removeClass('yith-plugin-fw-select-images__item--selected');
367
+ item.addClass('yith-plugin-fw-select-images__item--selected');
368
+ }
369
+ });
370
+
371
+ $(document.body).trigger('wc-enhanced-select-init');
372
+
373
+ $(document).find('.ui-sortable .yith-toggle-elements').sortable(
374
+ {
375
+ cursor: 'move',
376
+ axis: 'y',
377
+ scrollSensitivity: 40,
378
+ forcePlaceholderSize: true,
379
+ helper: 'clone',
380
+
381
+ stop: function (event, ui) {
382
+ var keys = jQuery('.ui-sortable-handle'),
383
+ i = 0,
384
+ array_keys = new Array();
385
+ for (i = 0; i < keys.length; i++) {
386
+ array_keys[i] = $(keys[i]).data('item_key');
387
+ }
388
+ if (array_keys.length > 0) {
389
+ var toggle = $(this).closest('.toggle-element');
390
+ toggle.saveToggleElement(null, array_keys);
391
+ }
392
+ }
393
+ }
394
+ );
395
+
396
+ $.each($checkgroup, function () {
397
+ var children = $(this).find('fieldset');
398
+ if (children.length > 3 && children.length < 6) {
399
+ $(this).addClass('two-cols')
400
+ }
401
+ if (children.length > 6) {
402
+ $(this).addClass('three-cols')
403
+ }
404
+ });
405
+
406
+ $(document.body).trigger('yith-framework-enhanced-select-init');
407
+ };
408
+
409
+ yith_fields_init();
410
 
411
  /* on-off */
412
+ $(document).on('click', '.yith-plugin-fw-onoff-container span', function () {
413
+ var input = $(this).prev('input'),
414
+ checked = input.prop('checked');
415
 
416
+ if (checked) {
417
+ input.prop('checked', false).attr('value', 'no').removeClass('onoffchecked');
418
  } else {
419
+ input.prop('checked', true).attr('value', 'yes').addClass('onoffchecked');
420
  }
421
 
422
  input.change();
423
+ });
424
+
425
+
426
+ /** Toggle **/
427
+
428
+
429
+
430
+ //TOGGLE ELEMENT
431
+ $.fn.saveToggleElement = function (spinner, array_keys) {
432
+ var toggle = $(this),
433
+ action = 'yith_plugin_fw_save_toggle_element',
434
+ formdata = toggle.serializeToggleElement(),
435
+ id = toggle.find('.yith-toggle_wrapper').attr('id'),
436
+ current_tab = $.urlParam('tab');
437
+
438
+ if (typeof array_keys != 'undefined' && array_keys.length > 0) {
439
+ formdata.append('yith_toggle_elements_order_keys', array_keys);
440
+ }
441
+
442
+ if (toggle.closest('.metaboxes-tab.yith-plugin-ui').length) {
443
+ action = 'yith_plugin_fw_save_toggle_element_metabox';
444
+ post_id = $(this).closest('form#post').find('#post_ID').val();
445
+ yit_metaboxes_nonce = $(this).closest('form#post').find('#yit_metaboxes_nonce').val();
446
+ url = yith_framework_fw_fields.ajax_url + '?action=' + action + "&post_ID=" + post_id + '&yit_metaboxes_nonce=' + yit_metaboxes_nonce + "&toggle_id=" + id;
447
+ } else {
448
+ url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
449
+ }
450
+
451
+ $.ajax({
452
+ type: "POST",
453
+ url: url,
454
+ data: formdata,
455
+ contentType: false,
456
+ processData: false,
457
+ success: function (result) {
458
+ if (spinner) {
459
+ spinner.removeClass('show');
460
+ }
461
+
462
+ $(document).trigger('yith_save_toggle_element_done', [result, toggle]);
463
+ },
464
+ });
465
+ };
466
+
467
+ $.fn.serializeToggleElement = function () {
468
+ var obj = $(this);
469
+ /* ADD FILE TO PARAM AJAX */
470
+ var formData = new FormData();
471
+ var params = $(obj).find(":input").serializeArray();
472
+
473
+ $.each(params, function (i, val) {
474
+ el_name = val.name;
475
+ formData.append(val.name, val.value);
476
+ });
477
+
478
+ return formData;
479
+ };
480
+
481
+ $.fn.formatToggleTitle = function () {
482
+ var toggle_el = $(this),
483
+ fields = toggle_el.find(':input'),
484
+ title = toggle_el.find('span.title').data('title_format'),
485
+ subtitle = toggle_el.find('.subtitle').data('subtitle_format'),
486
+ regExp = new RegExp( "[^%%]+(?=[%%])", 'g' );
487
+
488
+ if (typeof title != 'undefined') {
489
+ var res = title.match( regExp );
490
+ }
491
+
492
+ if (typeof subtitle != 'undefined') {
493
+ var ressub = subtitle.match( regExp );
494
+ }
495
+
496
+ $.each(fields, function (i, field) {
497
+ if (typeof $(field).attr('id') != 'undefined') {
498
+ $field_id = $(field).attr('id');
499
+ $field_array = $field_id.split('_');
500
+ $field_array.pop();
501
+ $field_id = $field_array.join('_');
502
+ $field_val = $(field).val();
503
+
504
+ if (res != null && typeof res != 'undefined' && res.indexOf($field_id) !== -1) {
505
+ title = title.replace('%%' + $field_id + '%%', $field_val);
506
+ }
507
+ if (ressub != null && typeof ressub != 'undefined' && ressub.indexOf($field_id) !== -1) {
508
+ subtitle = subtitle.replace('%%' + $field_id + '%%', $field_val);
509
  }
510
  }
511
+ });
512
+
513
+ if ('' !== title) {
514
+ toggle_el.find('span.title').html(title);
515
+ }
516
+
517
+ if ('' !== subtitle) {
518
+ toggle_el.find('.subtitle').html(subtitle);
519
+ }
520
+
521
+ $(document).trigger('yith-toggle-element-item-title', [toggle_el]);
522
+ };
523
+
524
+ $.urlParam = function (name) {
525
+ var results = new RegExp('[\?&]' + name + '=([^&#]*)')
526
+ .exec(window.location.search);
527
+
528
+ return (results !== null) ? results[1] || 0 : false;
529
+ };
530
+
531
+ $(document).on('click', '.yith-toggle', function (event) {
532
+ var _toggle = $(event.target),
533
+ _section = _toggle.closest('.yith-toggle-row'),
534
+ _content = _section.find('.yith-toggle-content');
535
+
536
+ if (_section.is('.yith-toggle-row-opened')) {
537
+ _content.slideUp(400);
538
+ } else {
539
+ _content.slideDown(400);
540
+ }
541
+ _section.toggleClass('yith-toggle-row-opened');
542
+ });
543
+
544
+ /**Add new box toggle**/
545
+ $(document).on('click', '.yith-add-box-button', function (event) {
546
+ event.preventDefault();
547
+ var target_id = $(this).data('box_id'),
548
+ id = $(this).closest('.yith-toggle_wrapper').attr('id');
549
+ template = wp.template('yith-toggle-element-add-box-content-' + id);
550
+ if ('' !== target_id) {
551
+ $('#' + target_id).html(template({index: 'box_id'})).slideToggle();
552
+ yith_fields_init();
553
+ $(document).trigger('yith-add-box-button-toggle', [$(this)]);
554
+ }
555
+ });
556
+
557
+ $(document).on('click', '.yith-add-box-buttons .yith-save-button', function (event) {
558
+ event.preventDefault();
559
+ var add_box = $(this).parents('.yith-add-box'),
560
+ id = $(this).closest('.yith-toggle_wrapper').attr('id'),
561
+ spinner = add_box.find('.spinner'),
562
+ toggle_element = $(this).parents('.toggle-element'),
563
+ fields = add_box.find(':input'),
564
+ counter = toggle_element.find('.yith-toggle-row').length,
565
+ hidden_obj = $('<input type="hidden">');
566
+ hidden_obj.val(counter);
567
+ $(document).trigger('yith-toggle-change-counter', [hidden_obj, add_box]);
568
+
569
+ counter = hidden_obj.val();
570
+ var template = wp.template('yith-toggle-element-item-' + id),
571
+ toggle_el = $(template({index: counter}));
572
+
573
+ spinner.addClass('show');
574
+
575
+ $.each(fields, function (i, field) {
576
+ if (typeof $(field).attr('id') != 'undefined') {
577
+
578
+ $field_id = $(field).attr('id');
579
+ $field_val = $(field).val();
580
+
581
+ if ('radio' == $(field).attr('type')) {
582
+ $field_id = $field_id.replace('new_', '');
583
+ $field_id = $field_id.replace('-' + $field_val, '');
584
+ $field_id = $field_id + '_dataindex-' + $field_val;
585
+ } else {
586
+ $field_id = $field_id.replace('new_', '') + '_' + counter;
587
+ }
588
+
589
+ if ($(field).is(':checked')) {
590
+ $(toggle_el).find('#' + $field_id).prop('checked', true);
591
+ }
592
+
593
+ if ($(field).hasClass('yith-post-search') || $(field).hasClass('yith-term-search')) {
594
+ $(toggle_el).find('#' + $field_id).html($('#' + $(field).attr('id')).html());
595
+ }
596
+
597
+ $(toggle_el).find('#' + $field_id).val($field_val);
598
+
599
+ }
600
+
601
+ });
602
+
603
+ $(toggle_el).formatToggleTitle();
604
+ var form_is_valid = $('<input type="hidden">').val('yes');
605
+ $(document).trigger('yith-toggle-element-item-before-add', [add_box, toggle_el, form_is_valid]);
606
+
607
+
608
+ if (form_is_valid.val() === 'yes') {
609
+ $(toggle_element).find('.yith-toggle-elements').append(toggle_el);
610
+ $(add_box).find('.yith-plugin-fw-datepicker').datepicker('destroy');
611
+ $(add_box).html('').toggle();
612
+ toggle_element.saveToggleElement();
613
+ yith_fields_init();
614
+ }
615
+ });
616
+
617
+ $(document).on('click', '.yith-toggle-row .yith-save-button', function (event) {
618
+ event.preventDefault();
619
+ var toggle = $(this).closest('.toggle-element'),
620
+ toggle_row = $(this).closest('.yith-toggle-row'),
621
+ spinner = toggle_row.find('.spinner');
622
+ toggle_row.formatToggleTitle();
623
+
624
+ var form_is_valid = $('<input type="hidden">').val('yes');
625
+ $(document).trigger('yith-toggle-element-item-before-update', [toggle, toggle_row, form_is_valid]);
626
+ if (form_is_valid.val() === 'yes') {
627
+ spinner.addClass('show');
628
+ toggle.saveToggleElement(spinner);
629
  }
630
+ });
631
+
632
+ //register remove the dome and save the toggle
633
+ $(document).on('click', '.yith-toggle-row .yith-delete-button', function (event) {
634
+ event.preventDefault();
635
+ var toggle = $(this).closest('.toggle-element'),
636
+ toggle_row = $(this).closest('.yith-toggle-row');
637
+ toggle_row.remove();
638
+ toggle.saveToggleElement();
639
+ });
640
+
641
+ //register onoff status
642
+ $(document).on('click', '.yith-toggle-onoff', function (event) {
643
+ event.preventDefault();
644
+ var toggle = $(this).closest('.toggle-element');
645
+ toggle.saveToggleElement();
646
+ });
647
+
648
+
649
+ });
plugin-fw/assets/js/yith-fields.min.js CHANGED
@@ -1,15 +1 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,g,d){a instanceof String&&(a=String(a));for(var e=a.length,h=0;h<e;h++){var l=a[h];if(g.call(d,l,h,a))return{i:h,v:l}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,g,d){a!=Array.prototype&&a!=Object.prototype&&(a[g]=d.value)};
2
- $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,g,d,e){if(g){d=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var h=a[e];h in d||(d[h]={});d=d[h]}a=a[a.length-1];e=d[a];g=g(e);g!=e&&null!=g&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:g})}};
3
- $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,d){return $jscomp.findInternal(this,a,d).v}},"es6","es3");
4
- jQuery(function(a){var g=a(".yith-plugin-fw-datepicker"),d=a(".yith-plugin-fw-colorpicker"),e=a(".yith-plugin-fw-upload-img-url"),h=a(".add_media"),l=a(".yith-plugin-fw .image-gallery ul.slides-wrapper"),m=a(".yith-plugin-fw-onoff-container span"),n=a(".yith-plugin-fw-sidebar-layout"),p=a(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),q=a(".codemirror"),r=a(".yit-icons-manager-wrapper");g.each(function(){var b=a(this).data();a(this).datepicker(b)});d.wpColorPicker({clear:function(){var b=
5
- a(this);b.val(b.data("default-color"));b.change()}});d.each(function(){var b=a(this).data("variations-label");a(this).parent().parent().find("a.wp-color-result").attr("title",b)});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(e.change(function(){var b=a(this).val(),c=a(this).parent().find(".yith-plugin-fw-upload-img-preview").first();1>c.length&&(c=a(this).parent().parent().find(".yith-plugin-fw-upload-img-preview").first());/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?
6
- c.html('<img src="'+b+'" style="max-width:100px; max-height:100px;" />'):c.html("")}).trigger("change"),a(document).on("click",".yith-plugin-fw-upload-button",function(b){b.preventDefault();var c=a(this).attr("id").replace(/-button$/,"");if(!f){b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];var f=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,
7
- states:b});f.on("select",function(){var b=f.state().get("selection").first().toJSON();a("#"+c).val(b.url);a("#"+c+"-yith-attachment-id")&&a("#"+c+"-yith-attachment-id").val(b.id);e.trigger("change")})}f.open()}),a(document).on("click",".yith-plugin-fw-upload-button-reset",function(b){var c=a(this);b=c.attr("id");c=c.attr("id").replace(/-button-reset$/,"");b=a("#"+b).data("default");a("#"+c).val(b);e.trigger("change")}));h.on("click",function(){});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&
8
- (a(document).on("click",".yith-plugin-fw .image-gallery-button",function(b){var c=a(this);b=c.closest(".image-gallery");var f=b.find(".image_gallery_ids"),k=f.val(),d=b.find("ul.slides-wrapper"),e=wp.media.frames.image_gallery=wp.media({title:c.data("choose"),button:{text:c.data("update")},states:[new wp.media.controller.Library({title:c.data("choose"),filterable:"all",multiple:!0})]});e.on("select",function(){e.state().get("selection").map(function(a){a=a.toJSON();a.id&&(k=k?k+","+a.id:a.id,d.append('<li class="image" data-attachment_id="'+
9
- a.id+'"><img src="'+a.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+c.data("delete")+'">x</a></li></ul></li>'))});f.val(k)});e.open()}),l.each(function(){var b=a(this);b.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")},update:function(c,f){var k="";b.find("li.image").css("cursor",
10
- "default").each(function(){var b=a(this).attr("data-attachment_id");k=k+b+","});b.closest(".image-gallery").find(".image_gallery_ids").val(k)}})}),l.on("click","a.delete",function(){var b=a(this).closest(".image-gallery"),c=a(this).closest(".image-gallery ul.slides-wrapper");b=b.find(".image_gallery_ids");var f="";a(this).closest("li.image").remove();c.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");f=f+b+","});b.val(f)}));m.on("click",function(){var b=
11
- a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});n.each(function(){a(this).find("img").on("click",function(){var b=a(this).closest(".yith-plugin-fw-sidebar-layout"),c=b.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container");b=b.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container");var f=a(this).data("type");a(this).parent().children(":radio").attr("checked",
12
- !1);a(this).prev(":radio").attr("checked",!0);if("undefined"!=typeof f)switch(f){case "left":c.show();b.hide();break;case "right":b.show();c.hide();break;case "double":c.show();b.show();break;default:c.hide(),b.hide()}})});p.each(function(){var b=a(this).data("val"),c=a(this).data("min"),f=a(this).data("max"),k=a(this).data("step"),d=a(this).data("labels");a(this).slider({value:b,min:c,max:f,range:"min",step:k,create:function(){a(this).find(".ui-slider-handle").text(a(this).slider("value"))},slide:function(b,
13
- c){a(this).find("input").val(c.value);a(this).find(".ui-slider-handle").text(c.value);a(this).siblings(".feedback").find("strong").text(c.value+d)}})});q.each(function(b,c){b=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",b)});a(document).on("click",".yith-plugin-fw-select-all",function(){a("#"+a(this).data("select-id")).find("option").prop("selected",!0).trigger("change")});a(document).on("click",".yith-plugin-fw-deselect-all",
14
- function(){a("#"+a(this).data("select-id")).find("option").prop("selected",!1).trigger("change")});r.each(function(){var b=a(this),c=b.find(".yit-icons-manager-icon-preview").first(),f=b.find(".yit-icons-manager-icon-text");b.on("click",".yit-icons-manager-list li",function(d){d=a(d.target).closest("li");var e=d.data("font"),g=d.data("icon"),k=d.data("key"),h=d.data("name");c.attr("data-font",e);c.attr("data-icon",g);c.attr("data-key",k);c.attr("data-name",h);f.val(e+":"+h);b.find(".yit-icons-manager-list li").removeClass("active");
15
- d.addClass("active")});b.on("click",".yit-icons-manager-action-set-default",function(){b.find(".yit-icons-manager-list li.default").trigger("click")})});a(document).on("click",".yith-plugin-fw-select-images__item",function(){var b=a(this),c=b.data("key"),d=b.closest(".yith-plugin-fw-select-images__wrapper"),e=d.find(".yith-plugin-fw-select-images__item");d=d.find("select").first();d.length&&(d.val(c),e.removeClass("yith-plugin-fw-select-images__item--selected"),b.addClass("yith-plugin-fw-select-images__item--selected"))})});
1
+ jQuery(function(g){function f(){var e=g(".yith-plugin-fw-datepicker"),t=g(".yith-plugin-fw-colorpicker"),n={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:g(".yith-plugin-fw-upload-img-url")},i=g(".add_media"),a={sliderWrapper:g(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},l=g(".yith-plugin-fw-sidebar-layout"),o=g(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=g(".codemirror"),d=g(".yit-icons-manager-wrapper"),s=g(".yith-plugin-ui td.forminp-checkbox");if(e.each(function(){var e=g(this).data();g(this).datepicker(e)}),t.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var e=g(this);e.val(e.data("default-color")),e.change()}}),t.each(function(){var e=g(this).data("variations-label"),t=g(this).closest(".yith-plugin-fw-field-wrapper"),i=t.find(".wp-picker-input-wrap");if(t.find("a.wp-color-result").attr("title",e),!i.find(".wp-picker-clear-custom").length){var a=g("<span/>").attr({class:"wp-picker-default-custom"});i.find(".wp-picker-default").wrap(a)}}),"undefined"!=typeof wp&&void 0!==wp.media){n.imgUrl.change(function(){var e=g(this).val(),t=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)"),i=g(this).parent().find(n.imgPreviewHandler).first();i.length<1&&(i=g(this).parent().parent().find(n.imgPreviewHandler).first()),t.test(e)?i.html('<img src="'+e+'" style="max-width:100px; max-height:100px;" />'):i.html("")}).trigger("change"),g(document).on("click",n.uploadButtonHandler,function(e){e.preventDefault();var t,i=g(this).attr("id").replace(/-button$/,"");if(t)t.open();else{var a=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(t=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:a})).on("select",function(){var e=t.state().get("selection").first().toJSON();g("#"+i).val(e.url),g("#"+i+"-yith-attachment-id")&&g("#"+i+"-yith-attachment-id").val(e.id),n.imgUrl.trigger("change")}),t.open()}}),g(document).on("click",n.resetButtonHandler,function(e){var t=g(this),i=t.attr("id"),a=t.attr("id").replace(/-button-reset$/,""),l=g("#"+i).data("default");g("#"+a).val(l),n.imgUrl.trigger("change")})}i.on("click",function(){!1}),"undefined"!=typeof wp&&void 0!==wp.media&&(g(document).on("click",a.buttonHandler,function(e){var t=g(this),i=t.closest(".image-gallery"),a=i.find(".image_gallery_ids"),l=a.val(),n=i.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:t.data("choose"),button:{text:t.data("update")},states:[new wp.media.controller.Library({title:t.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,n.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+t.data("delete")+'">x</a></li></ul></li>'))}),a.val(l)}),o.open()}),a.sliderWrapper.each(function(){var a=g(this);a.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(e,t){var i="";a.find("li.image").css("cursor","default").each(function(){var e=g(this).attr("data-attachment_id");i=i+e+","}),a.closest(".image-gallery").find(".image_gallery_ids").val(i)}})}),a.sliderWrapper.on("click","a.delete",function(){var e=g(this).closest(".image-gallery"),t=g(this).closest(".image-gallery ul.slides-wrapper"),i=e.find(".image_gallery_ids"),a="";g(this).closest("li.image").remove(),t.find("li.image").css("cursor","default").each(function(){var e=g(this).attr("data-attachment_id");a=a+e+","}),i.val(a)})),l.each(function(){g(this).find("img").on("click",function(){var e=g(this).closest(".yith-plugin-fw-sidebar-layout"),t=e.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),i=e.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),a=g(this).data("type");if(g(this).parent().children(":radio").attr("checked",!1),g(this).prev(":radio").attr("checked",!0),void 0!==a)switch(a){case"left":t.show(),i.hide();break;case"right":i.show(),t.hide();break;case"double":t.show(),i.show();break;default:t.hide(),i.hide()}})}),o.each(function(){var e=g(this).data("val"),t=g(this).data("min"),i=g(this).data("max"),a=g(this).data("step"),l=g(this).data("labels");g(this).slider({value:e,min:t,max:i,range:"min",step:a,create:function(){g(this).find(".ui-slider-handle").text(g(this).slider("value"))},slide:function(e,t){g(this).find("input").val(t.value),g(this).find(".ui-slider-handle").text(t.value),g(this).siblings(".feedback").find("strong").text(t.value+l)}})}),r.each(function(e,t){var i=CodeMirror.fromTextArea(t,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});g(t).data("codemirrorInstance",i)}),g(document).on("click",".yith-plugin-fw-select-all",function(){g("#"+g(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),g(document).on("click",".yith-plugin-fw-deselect-all",function(){g("#"+g(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var o=g(this),r=o.find(".yit-icons-manager-icon-preview").first(),d=o.find(".yit-icons-manager-icon-text");o.on("click",".yit-icons-manager-list li",function(e){var t=g(e.target).closest("li"),i=t.data("font"),a=t.data("icon"),l=t.data("key"),n=t.data("name");r.attr("data-font",i),r.attr("data-icon",a),r.attr("data-key",l),r.attr("data-name",n),d.val(i+":"+n),o.find(".yit-icons-manager-list li").removeClass("active"),t.addClass("active")}),o.on("click",".yit-icons-manager-action-set-default",function(){o.find(".yit-icons-manager-list li.default").trigger("click")})}),g(document).on("click",".yith-plugin-fw-select-images__item",function(){var e=g(this),t=e.data("key"),i=e.closest(".yith-plugin-fw-select-images__wrapper"),a=i.find(".yith-plugin-fw-select-images__item"),l=i.find("select").first();l.length&&(l.val(t),a.removeClass("yith-plugin-fw-select-images__item--selected"),e.addClass("yith-plugin-fw-select-images__item--selected"))}),g(document.body).trigger("wc-enhanced-select-init"),g(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(e,t){var i=jQuery(".ui-sortable-handle"),a=0,l=new Array;for(a=0;a<i.length;a++)l[a]=g(i[a]).data("item_key");0<l.length&&g(this).closest(".toggle-element").saveToggleElement(null,l)}}),g.each(s,function(){var e=g(this).find("fieldset");3<e.length&&e.length<6&&g(this).addClass("two-cols"),6<e.length&&g(this).addClass("three-cols")}),g(document.body).trigger("yith-framework-enhanced-select-init")}f(),g(document).on("click",".yith-plugin-fw-onoff-container span",function(){var e=g(this).prev("input");e.prop("checked")?e.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):e.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),e.change()}),g.fn.saveToggleElement=function(t,e){var i=g(this),a="yith_plugin_fw_save_toggle_element",l=i.serializeToggleElement(),n=i.find(".yith-toggle_wrapper").attr("id"),o=g.urlParam("tab");void 0!==e&&0<e.length&&l.append("yith_toggle_elements_order_keys",e),i.closest(".metaboxes-tab.yith-plugin-ui").length?(a="yith_plugin_fw_save_toggle_element_metabox",post_id=g(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=g(this).closest("form#post").find("#yit_metaboxes_nonce").val(),url=yith_framework_fw_fields.ajax_url+"?action="+a+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+n):url=yith_framework_fw_fields.admin_url+"?action="+a+"&tab="+o+"&toggle_id="+n,g.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(e){t&&t.removeClass("show"),g(document).trigger("yith_save_toggle_element_done",[e,i])}})},g.fn.serializeToggleElement=function(){var e=g(this),i=new FormData,t=g(e).find(":input").serializeArray();return g.each(t,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},g.fn.formatToggleTitle=function(){var e=g(this),t=e.find(":input"),i=e.find("span.title").data("title_format"),a=e.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==i)var n=i.match(l);if(void 0!==a)var o=a.match(l);g.each(t,function(e,t){void 0!==g(t).attr("id")&&($field_id=g(t).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=g(t).val(),null!=n&&void 0!==n&&-1!==n.indexOf($field_id)&&(i=i.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)))}),""!==i&&e.find("span.title").html(i),""!==a&&e.find(".subtitle").html(a),g(document).trigger("yith-toggle-element-item-title",[e])},g.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},g(document).on("click",".yith-toggle",function(e){var t=g(e.target).closest(".yith-toggle-row"),i=t.find(".yith-toggle-content");t.is(".yith-toggle-row-opened")?i.slideUp(400):i.slideDown(400),t.toggleClass("yith-toggle-row-opened")}),g(document).on("click",".yith-add-box-button",function(e){e.preventDefault();var t=g(this).data("box_id"),i=g(this).closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+i),""!==t&&(g("#"+t).html(template({index:"box_id"})).slideToggle(),f(),g(document).trigger("yith-add-box-button-toggle",[g(this)]))}),g(document).on("click",".yith-add-box-buttons .yith-save-button",function(e){e.preventDefault();var t=g(this).parents(".yith-add-box"),i=g(this).closest(".yith-toggle_wrapper").attr("id"),a=t.find(".spinner"),l=g(this).parents(".toggle-element"),n=t.find(":input"),o=l.find(".yith-toggle-row").length,r=g('<input type="hidden">');r.val(o),g(document).trigger("yith-toggle-change-counter",[r,t]),o=r.val();var d=wp.template("yith-toggle-element-item-"+i),s=g(d({index:o}));a.addClass("show"),g.each(n,function(e,t){void 0!==g(t).attr("id")&&($field_id=g(t).attr("id"),$field_val=g(t).val(),"radio"==g(t).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,g(t).is(":checked")&&g(s).find("#"+$field_id).prop("checked",!0),(g(t).hasClass("yith-post-search")||g(t).hasClass("yith-term-search"))&&g(s).find("#"+$field_id).html(g("#"+g(t).attr("id")).html()),g(s).find("#"+$field_id).val($field_val))}),g(s).formatToggleTitle();var c=g('<input type="hidden">').val("yes");g(document).trigger("yith-toggle-element-item-before-add",[t,s,c]),"yes"===c.val()&&(g(l).find(".yith-toggle-elements").append(s),g(t).find(".yith-plugin-fw-datepicker").datepicker("destroy"),g(t).html("").toggle(),l.saveToggleElement(),f())}),g(document).on("click",".yith-toggle-row .yith-save-button",function(e){e.preventDefault();var t=g(this).closest(".toggle-element"),i=g(this).closest(".yith-toggle-row"),a=i.find(".spinner");i.formatToggleTitle();var l=g('<input type="hidden">').val("yes");g(document).trigger("yith-toggle-element-item-before-update",[t,i,l]),"yes"===l.val()&&(a.addClass("show"),t.saveToggleElement(a))}),g(document).on("click",".yith-toggle-row .yith-delete-button",function(e){e.preventDefault();var t=g(this).closest(".toggle-element");g(this).closest(".yith-toggle-row").remove(),t.saveToggleElement()}),g(document).on("click",".yith-toggle-onoff",function(e){e.preventDefault(),g(this).closest(".toggle-element").saveToggleElement()})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.2.1
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.1.26
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
@@ -22,6 +22,8 @@ if ( ! defined ( 'ABSPATH' ) ) {
22
  exit;
23
  } // Exit if accessed directly
24
 
 
 
25
  if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
26
  /**
27
  * yit_maybe_plugin_fw_loader
@@ -53,6 +55,12 @@ if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
53
  $plugin_fw_data = array ( $framework_data[ 'Version' ] => $plugin_fw_main_file );
54
  }
55
 
 
 
 
 
 
 
56
  //Check for license & upgrade classes
57
  $upgrade_fw_init_file = $plugin_path . 'plugin-upgrade/init.php';
58
  $framework_data = file_exists( $upgrade_fw_init_file ) ? get_file_data( $upgrade_fw_init_file, $default_headers ) : $framework_data;
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.3.1
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.3.1
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
22
  exit;
23
  } // Exit if accessed directly
24
 
25
+
26
+
27
  if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
28
  /**
29
  * yit_maybe_plugin_fw_loader
55
  $plugin_fw_data = array ( $framework_data[ 'Version' ] => $plugin_fw_main_file );
56
  }
57
 
58
+ if ( ! defined( 'YITH_PLUGIN_FW_VERSION' ) ) {
59
+ $keys = array_keys( $plugin_fw_data );
60
+ $version = empty( $plugin_fw_data ) ? '1.0.0' : array_pop( $keys );
61
+ define( 'YITH_PLUGIN_FW_VERSION', $version );
62
+ }
63
+
64
  //Check for license & upgrade classes
65
  $upgrade_fw_init_file = $plugin_path . 'plugin-upgrade/init.php';
66
  $framework_data = file_exists( $upgrade_fw_init_file ) ? get_file_data( $upgrade_fw_init_file, $default_headers ) : $framework_data;
plugin-fw/languages/yith-plugin-fw-it_IT.mo CHANGED
Binary file
plugin-fw/languages/yith-plugin-fw-it_IT.po CHANGED
@@ -5,14 +5,14 @@ msgstr ""
5
  "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
6
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
7
  "POT-Creation-Date: 2019-02-04 16:06+0100\n"
8
- "PO-Revision-Date: 2019-02-04 16:07+0100\n"
9
  "Last-Translator: \n"
10
  "Language-Team: YIThemes <plugins@yithemes.com>\n"
11
  "Language: it_IT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 2.2.1\n"
16
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
17
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
18
  "esc_html_x:1,2c\n"
@@ -428,10 +428,15 @@ msgid ""
428
  "\">Downloads page</a>. This is the only way to be sure the version you are "
429
  "using is 100% malware-free."
430
  msgstr ""
 
 
 
 
 
 
 
431
 
432
  #: lib/yit-upgrade.php:303
433
- #, fuzzy
434
- #| msgid "You have to activate the plugin to benefit from automatic updates."
435
  msgctxt "[Update Plugin Message: License not enabled]"
436
  msgid "You have to activate the plugin to benefit from automatic updates."
437
  msgstr "Devi attivare il plugin per usufruire degli update automatici."
@@ -509,6 +514,13 @@ msgid ""
509
  "\">Downloads page</a>. This is the only way to be sure the version you are "
510
  "using is 100%% malware-free."
511
  msgstr ""
 
 
 
 
 
 
 
512
 
513
  #: lib/yit-upgrade.php:635
514
  msgid "You can't update the plugins for this site."
@@ -527,16 +539,16 @@ msgstr "Aggiorna plugin"
527
 
528
  #: lib/yith-dashboard.php:40
529
  msgid "New YITH products"
530
- msgstr ""
531
 
532
  #: lib/yith-dashboard.php:41
533
  msgid "News from the YITH Blog"
534
- msgstr ""
535
 
536
  #: lib/yith-gutenberg.php:134
537
  msgctxt "[gutenberg]: Category Name"
538
  msgid "YITH"
539
- msgstr ""
540
 
541
  #: licence/lib/yit-licence.php:180
542
  #, php-format
@@ -625,7 +637,7 @@ msgctxt ""
625
  "[Plugins List] which means you're missing out on updates and support. Enter "
626
  "your license key, please."
627
  msgid "Warning!"
628
- msgstr ""
629
 
630
  #: licence/lib/yit-plugin-licence.php:142
631
  msgctxt ""
@@ -633,7 +645,7 @@ msgctxt ""
633
  "[Plugins List] which means you're missing out on updates and support. Enter "
634
  "your license key, please."
635
  msgid "You didn't set license key for the following products"
636
- msgstr ""
637
 
638
  #: licence/lib/yit-plugin-licence.php:145
639
  msgctxt ""
@@ -641,17 +653,15 @@ msgctxt ""
641
  "[Plugins List] which means you're missing out on updates and support. Enter "
642
  "your license key, please."
643
  msgid "which means you're missing out on updates and support"
644
- msgstr ""
645
 
646
  #: licence/lib/yit-plugin-licence.php:147
647
- #, fuzzy
648
- #| msgid "license key"
649
  msgctxt ""
650
  "[Part of]: Warning! You didn't set license key for the following products:"
651
  "[Plugins List] which means you're missing out on updates and support. Enter "
652
  "your license key, please."
653
  msgid "Enter your license key"
654
- msgstr "chiave di licenza"
655
 
656
  #: licence/lib/yit-plugin-licence.php:148
657
  msgctxt ""
@@ -659,7 +669,7 @@ msgctxt ""
659
  "[Plugins List] which means you're missing out on updates and support. Enter "
660
  "your license key, please."
661
  msgid "please"
662
- msgstr ""
663
 
664
  #: licence/lib/yit-theme-licence.php:117 licence/lib/yit-theme-licence.php:118
665
  #, php-format
@@ -703,10 +713,8 @@ msgid "YITH License Activation"
703
  msgstr "Attivazione licenza YITH"
704
 
705
  #: licence/templates/panel/activation/activation-panel.php:27
706
- #, fuzzy
707
- #| msgid "License key has expired"
708
  msgid "License expiry date"
709
- msgstr "La chiave di licenza è scaduta"
710
 
711
  #: licence/templates/panel/activation/activation-panel.php:30
712
  msgid ""
@@ -714,10 +722,13 @@ msgid ""
714
  "appear up-to-date, please, click on the button <em>Check Expiry Date</em> "
715
  "below and it will update."
716
  msgstr ""
 
 
 
717
 
718
  #: licence/templates/panel/activation/activation-panel.php:33
719
  msgid "Check expiry date"
720
- msgstr ""
721
 
722
  #: licence/templates/panel/activation/activation-panel.php:47
723
  msgid "Product to activate"
@@ -727,11 +738,11 @@ msgstr[1] "Prodotti da attivare"
727
 
728
  #: licence/templates/panel/activation/activation-panel.php:50
729
  msgid "Are you having issues with the license activation?"
730
- msgstr ""
731
 
732
  #: licence/templates/panel/activation/activation-panel.php:50
733
  msgid "Read this article"
734
- msgstr ""
735
 
736
  #: licence/templates/panel/activation/activation-panel.php:70
737
  msgid "Activate"
5
  "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
6
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
7
  "POT-Creation-Date: 2019-02-04 16:06+0100\n"
8
+ "PO-Revision-Date: 2019-05-29 22:44+0200\n"
9
  "Last-Translator: \n"
10
  "Language-Team: YIThemes <plugins@yithemes.com>\n"
11
  "Language: it_IT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 2.2.3\n"
16
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
17
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
18
  "esc_html_x:1,2c\n"
428
  "\">Downloads page</a>. This is the only way to be sure the version you are "
429
  "using is 100% malware-free."
430
  msgstr ""
431
+ "<br/><b>Attenzione:</b> Stai utilizzando una versione superiore all'ultima "
432
+ "disponibile. </em>Per favore assicurati di aver scaricato la versione più "
433
+ "recente di <em>%1$s</em> dall'unico <a href=\"https://yithemes.com\" target="
434
+ "\"_blank\">sito ufficiale YITH</a>, nello specifico dalla tua <a href="
435
+ "\"https://yithemes.com/my-account/recent-downloads/\" target=\"_blank"
436
+ "\">pagina Downloads</a>. Questo è l'unico modo per essere sicuri che la "
437
+ "versione in uso sia al 100% priva di malware."
438
 
439
  #: lib/yit-upgrade.php:303
 
 
440
  msgctxt "[Update Plugin Message: License not enabled]"
441
  msgid "You have to activate the plugin to benefit from automatic updates."
442
  msgstr "Devi attivare il plugin per usufruire degli update automatici."
514
  "\">Downloads page</a>. This is the only way to be sure the version you are "
515
  "using is 100%% malware-free."
516
  msgstr ""
517
+ "<br/><b>Attenzione:</b> Stai utilizzando una versione superiore all'ultima "
518
+ "disponibile. </em>Per favore assicurati di aver scaricato la versione più "
519
+ "recente di <em>%1$s</em> dall'unico <a href=\"https://yithemes.com\" target="
520
+ "\"_blank\">sito ufficiale YITH</a>, nello specifico dalla tua <a href="
521
+ "\"https://yithemes.com/my-account/recent-downloads/\" target=\"_blank"
522
+ "\">pagina Downloads</a>. Questo è l'unico modo per essere sicuri che la "
523
+ "versione in uso sia al 100%% priva di malware."
524
 
525
  #: lib/yit-upgrade.php:635
526
  msgid "You can't update the plugins for this site."
539
 
540
  #: lib/yith-dashboard.php:40
541
  msgid "New YITH products"
542
+ msgstr "Nuovi prodotti YITH"
543
 
544
  #: lib/yith-dashboard.php:41
545
  msgid "News from the YITH Blog"
546
+ msgstr "Novità dal blog YITH"
547
 
548
  #: lib/yith-gutenberg.php:134
549
  msgctxt "[gutenberg]: Category Name"
550
  msgid "YITH"
551
+ msgstr "YITH"
552
 
553
  #: licence/lib/yit-licence.php:180
554
  #, php-format
637
  "[Plugins List] which means you're missing out on updates and support. Enter "
638
  "your license key, please."
639
  msgid "Warning!"
640
+ msgstr "Attenzione!"
641
 
642
  #: licence/lib/yit-plugin-licence.php:142
643
  msgctxt ""
645
  "[Plugins List] which means you're missing out on updates and support. Enter "
646
  "your license key, please."
647
  msgid "You didn't set license key for the following products"
648
+ msgstr "Non hai impostato la chiave di licenza per i seguenti prodotti"
649
 
650
  #: licence/lib/yit-plugin-licence.php:145
651
  msgctxt ""
653
  "[Plugins List] which means you're missing out on updates and support. Enter "
654
  "your license key, please."
655
  msgid "which means you're missing out on updates and support"
656
+ msgstr "il che significa che ti stai perdendo aggiornamenti e supporto"
657
 
658
  #: licence/lib/yit-plugin-licence.php:147
 
 
659
  msgctxt ""
660
  "[Part of]: Warning! You didn't set license key for the following products:"
661
  "[Plugins List] which means you're missing out on updates and support. Enter "
662
  "your license key, please."
663
  msgid "Enter your license key"
664
+ msgstr "Inserisci la tua chiave di licenza"
665
 
666
  #: licence/lib/yit-plugin-licence.php:148
667
  msgctxt ""
669
  "[Plugins List] which means you're missing out on updates and support. Enter "
670
  "your license key, please."
671
  msgid "please"
672
+ msgstr "per favore"
673
 
674
  #: licence/lib/yit-theme-licence.php:117 licence/lib/yit-theme-licence.php:118
675
  #, php-format
713
  msgstr "Attivazione licenza YITH"
714
 
715
  #: licence/templates/panel/activation/activation-panel.php:27
 
 
716
  msgid "License expiry date"
717
+ msgstr "Data di scadenza della licenza"
718
 
719
  #: licence/templates/panel/activation/activation-panel.php:30
720
  msgid ""
722
  "appear up-to-date, please, click on the button <em>Check Expiry Date</em> "
723
  "below and it will update."
724
  msgstr ""
725
+ "Se hai rinnovato la chiave di licenza del tuo prodotto e la data di scadenza "
726
+ "non risulta aggiornata, ti invitiamo a fare clic sul pulsante <em>Check "
727
+ "Expiry Date</em> in modo da aggiornarla."
728
 
729
  #: licence/templates/panel/activation/activation-panel.php:33
730
  msgid "Check expiry date"
731
+ msgstr "Controlla la data di scadenza"
732
 
733
  #: licence/templates/panel/activation/activation-panel.php:47
734
  msgid "Product to activate"
738
 
739
  #: licence/templates/panel/activation/activation-panel.php:50
740
  msgid "Are you having issues with the license activation?"
741
+ msgstr "Stai riscontrando problemi con l'attivazione della licenza?"
742
 
743
  #: licence/templates/panel/activation/activation-panel.php:50
744
  msgid "Read this article"
745
+ msgstr "Leggi questo articolo"
746
 
747
  #: licence/templates/panel/activation/activation-panel.php:70
748
  msgid "Activate"
plugin-fw/lib/promo/black.jpg ADDED
Binary file
plugin-fw/lib/promo/cyber.jpg ADDED
Binary file
plugin-fw/lib/promo/halloween.jpg ADDED
Binary file
plugin-fw/lib/promo/yith-promo.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if( ! function_exists( 'simplexml_load_string' ) ){
12
+ return false;
13
+ }
14
+
15
+ add_action( 'admin_notices', 'yith_plugin_fw_promo_notices', 15 );
16
+ add_action( 'admin_enqueue_scripts', 'yith_plugin_fw_notice_dismiss', 20 );
17
+
18
+ if( ! function_exists( 'yith_plugin_fw_promo_notices' ) ){
19
+ function yith_plugin_fw_promo_notices(){
20
+ if( function_exists( 'current_user_can' ) && ! current_user_can( 'administrator' ) ){
21
+ return false;
22
+ }
23
+
24
+ $base_url = apply_filters( 'yith_plugin_fw_promo_base_url', YIT_CORE_PLUGIN_URL . '/lib/promo/' );
25
+ $xml = apply_filters( 'yith_plugin_fw_promo_xml_url', $base_url . 'yith-promo.xml' );
26
+ $transient = "yith_promo_message";
27
+ $remote_data = get_site_transient( $transient );
28
+ $regenerate_promo_transient = isset( $_GET['yith_regenerate_promo_transient'] ) && 'yes' == $_GET['yith_regenerate_promo_transient'] ? $_GET['yith_regenerate_promo_transient'] : '';
29
+ $promo_data = false;
30
+ $create_transient = false;
31
+
32
+ if( false === $remote_data || apply_filters( 'yith_plugin_fw_force_regenerate_promo_transient', false ) || 'yes' == $regenerate_promo_transient ){
33
+ $remote_data = file_get_contents( $xml );
34
+ $create_transient = true;
35
+ }
36
+
37
+ if ( ! is_wp_error( $remote_data ) && ! empty( $remote_data ) ) {
38
+ $promo_data = @simplexml_load_string( $remote_data );
39
+ if( true === $create_transient ){
40
+ $is_membership_user = false;
41
+ $license = function_exists( 'YITH_Plugin_Licence' ) ? YITH_Plugin_Licence()->get_licence() : array();
42
+ $xml_expiry_date = '';
43
+
44
+ if( is_array( $license ) && apply_filters( 'yith_plugin_fw_check_for_membership_user', true ) ){
45
+ /* === Check is the user have the YITH Club === */
46
+ foreach( $license as $plugin => $data ){
47
+ if( ! empty( $data['is_membership'] ) ){
48
+ $is_membership_user = true;
49
+ $xml_expiry_date = $data['licence_expires'];
50
+ $remote_data = $promo_data = array();
51
+ break;
52
+ }
53
+ }
54
+ }
55
+
56
+ if( empty( $is_membership_user ) && ! empty( $promo_data->expiry_date ) ){
57
+ $xml_expiry_date = $promo_data->expiry_date;
58
+ }
59
+
60
+ //Set Site Transient
61
+ set_site_transient( $transient, $remote_data, yith_plugin_fw_get_promo_transient_expiry_date( $xml_expiry_date ) );
62
+ }
63
+
64
+ if ( $promo_data && ! empty( $promo_data->promo ) ) {
65
+ $now = strtotime( current_time( 'mysql' ) );
66
+
67
+ foreach ($promo_data->promo as $promo ){
68
+ $show_promo = true;
69
+ /* === Check for Special Promo === */
70
+ if( ! empty( $promo->show_promo_in ) ){
71
+ $show_promo_in = explode( ',', $promo->show_promo_in );
72
+ $show_promo_in = array_map( 'trim', $show_promo_in );
73
+ if( ! empty( $show_promo_in ) ){
74
+ $show_promo = false;
75
+ foreach( $show_promo_in as $plugin ){
76
+ $plugin_slug = constant( $plugin );
77
+ $plugin_is_activated = ! empty( $license[ $plugin_slug ]['activated'] );
78
+ if( defined( $plugin ) && ! apply_filters( 'yith_plugin_fw_promo_plugin_is_activated', $plugin_is_activated ) ){
79
+ $show_promo = true;
80
+ break;
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ $start_date = isset( $promo->start_date ) ? $promo->start_date : '';
87
+ $end_date = isset( $promo->end_date ) ? $promo->end_date : '';
88
+
89
+ if( $show_promo && ! empty( $start_date ) && ! empty( $end_date ) ){
90
+ $start_date = strtotime( $start_date );
91
+ $end_date = strtotime( $end_date );
92
+
93
+ if( $end_date >= $start_date && $now >= $start_date && $now <= $end_date ){
94
+ //is valid promo
95
+ $title = isset( $promo->title ) ? $promo->title : '';
96
+ $description = isset( $promo->description ) ? $promo->description : '';
97
+ $url = isset( $promo->link->url ) ? $promo->link->url : '';
98
+ $url_label = isset( $promo->link->label ) ? $promo->link->label : '';
99
+ $image_bg_color = isset( $promo->style->image_bg_color ) ? $promo->style->image_bg_color : '';
100
+ $border_color = isset( $promo->style->border_color ) ? $promo->style->border_color : '';
101
+ $background_color = isset( $promo->style->background_color ) ? $promo->style->background_color : '';
102
+ $promo_id = isset( $promo->promo_id ) ? $promo->promo_id : '';
103
+ $banner = isset( $promo->banner ) ? $promo->banner : '';
104
+ $style = $link = '';
105
+ $show_notice = false;
106
+
107
+ if( ! empty( $border_color ) ){
108
+ $style .= "border-left-color: {$border_color};";
109
+ }
110
+
111
+ if( ! empty( $background_color ) ){
112
+ $style .= "background-color: {$background_color};";
113
+ }
114
+
115
+ if( ! empty( $image_bg_color ) ){
116
+ $image_bg_color = "background-color: {$image_bg_color};";
117
+ }
118
+
119
+ if( ! empty( $title ) ) {
120
+ $promo_id .= $title;
121
+ $title = sprintf( '%s: ', $title );
122
+ $show_notice = true;
123
+ }
124
+
125
+ if( ! empty( $description ) ) {
126
+ $promo_id .= $description;
127
+ $description = sprintf( '%s', $description );
128
+ $show_notice = true;
129
+ }
130
+
131
+ if( ! empty( $url ) && ! empty( $url_label )) {
132
+ $promo_id .= $url . $url_label;
133
+ $link = sprintf( '<a href="%s" target="_blank">%s</a>', $url, $url_label );
134
+ $show_notice = true;
135
+ }
136
+
137
+ if( ! empty( $banner ) ){
138
+ $banner = sprintf( '<img src="%s" class="yith-promo-banner-image">', $base_url . $banner );
139
+
140
+ if( ! empty( $url ) ){
141
+ $banner = sprintf( '<a class="yith-promo-banner-image-link" href="%s" target="_blank" style="%s">%s</a>', $url, $image_bg_color, $banner);
142
+ }
143
+ }
144
+
145
+ $unique_promo_id = "yith-notice-" . md5 ( $promo_id );
146
+
147
+ if( ! empty( $_COOKIE[ 'hide_' . $unique_promo_id ] ) && 'yes' == $_COOKIE[ 'hide_' . $unique_promo_id ] ){
148
+ $show_notice = false;
149
+ }
150
+
151
+ if ( true === $show_notice ) :
152
+ wp_enqueue_script( 'yith-promo' );
153
+ ?>
154
+ <div id="<?php echo $unique_promo_id; ?>" class="yith-notice-is-dismissible notice notice-yith notice-alt is-dismissible" style="<?php echo $style; ?>" data-expiry= <?php echo $promo->end_date; ?>>
155
+ <p>
156
+ <?php if( ! empty( $banner ) ) { printf( '%s', $banner ); } ?>
157
+ <?php printf( "%s %s %s", $title, $description, $link ); ?>
158
+ </p>
159
+ </div>
160
+ <?php endif;
161
+ }
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+
169
+ if( ! function_exists( 'yith_plugin_fw_notice_dismiss' ) ){
170
+ function yith_plugin_fw_notice_dismiss(){
171
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
172
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
173
+ wp_register_script( 'yith-promo', $script_path . '/assets/js/yith-promo' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
174
+ }
175
+ }
176
+
177
+ if( ! function_exists( 'yith_plugin_fw_get_promo_transient_expiry_date' ) ){
178
+ function yith_plugin_fw_get_promo_transient_expiry_date( $expiry_date ) {
179
+ $xml_expiry_date = ! empty( $expiry_date ) ? $expiry_date : '+24 hours';
180
+ $current = strtotime( current_time( 'Y-m-d H:i:s' ) );
181
+ $expiry_date = strtotime( $xml_expiry_date, $current );
182
+
183
+ if( $expiry_date <= $current ){
184
+ $expiry_date = strtotime( '+24 hours', $current );
185
+ }
186
+
187
+ return $expiry_date;
188
+ }
189
+ }
plugin-fw/lib/promo/yith-promo.xml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Default border color: #acc327 -->
3
+ <!-- Default background color: #ecf7ed -->
4
+
5
+ <promotions>
6
+ <expiry_date>2019-12-10</expiry_date>
7
+ <promo>
8
+ <promo_id>yithhalloween2019</promo_id>
9
+ <banner>halloween.jpg</banner>
10
+ <title><![CDATA[<strong>YITH Halloween</strong>]]></title>
11
+ <description><![CDATA[
12
+ Don't miss our <strong>30% discount</strong> on all our products! No coupon needed in cart. Valid only on <strong>31st October</strong>.
13
+ ]]></description>
14
+ <link>
15
+ <label>Get your deals now!</label>
16
+ <url><![CDATA[https://yithemes.com]]></url>
17
+ </link>
18
+ <style>
19
+ <image_bg_color>#005c7d</image_bg_color>
20
+ <border_color>#ea5105</border_color>
21
+ <background_color>#ffffff</background_color>
22
+ </style>
23
+ <start_date>2019-10-30 16:00:00</start_date>
24
+ <end_date>2019-11-01 08:00:00</end_date>
25
+ </promo>
26
+ <promo>
27
+ <promo_id>yithcybermonday2019</promo_id>
28
+ <banner>cyber.jpg</banner>
29
+ <title><![CDATA[<strong>YITH Cyber Monday</strong>]]></title>
30
+ <description><![CDATA[
31
+ Don't miss our <strong>30% discount</strong> on all our products! No coupon needed in cart. Valid from <strong>28th November</strong> to <strong>30th November</strong>.
32
+ ]]></description>
33
+ <link>
34
+ <label>Get your deals now!</label>
35
+ <url><![CDATA[https://yithemes.com]]></url>
36
+ </link>
37
+ <style>
38
+ <image_bg_color>#12fdd4</image_bg_color>
39
+ <border_color>#181d7b</border_color>
40
+ <background_color>#ffffff</background_color>
41
+ </style>
42
+ <start_date>2019-12-01 00:00:00</start_date>
43
+ <end_date>2019-12-03 08:00:00</end_date>
44
+ </promo>
45
+ <promo>
46
+ <promo_id>yithblackfriday2019</promo_id>
47
+ <banner>black.jpg</banner>
48
+ <title><![CDATA[<strong>YITH Black Friday</strong>]]></title>
49
+ <description><![CDATA[
50
+ Don't miss our <strong>30% discount</strong> on all our products! No coupon needed in cart. Valid from <strong>1st December</strong> to <strong>2nd December</strong>.
51
+ ]]></description>
52
+ <link>
53
+ <label>Get your deals now!</label>
54
+ <url><![CDATA[https://yithemes.com]]></url>
55
+ </link>
56
+ <style>
57
+ <image_bg_color>#272121</image_bg_color>
58
+ <border_color>#272121</border_color>
59
+ <background_color>#ffffff</background_color>
60
+ </style>
61
+ <start_date>2019-11-27 23:59:59</start_date>
62
+ <end_date>2019-11-30 23:59:59</end_date>
63
+ </promo>
64
+ </promotions>
plugin-fw/lib/yit-assets.php CHANGED
@@ -38,6 +38,7 @@ if ( !class_exists( 'YIT_Assets' ) ) {
38
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
39
  */
40
  private function __construct() {
 
41
  add_action( 'admin_enqueue_scripts', array( $this, 'register_styles_and_scripts' ) );
42
  }
43
 
@@ -50,8 +51,8 @@ if ( !class_exists( 'YIT_Assets' ) ) {
50
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
51
 
52
  //scripts
53
- wp_register_script( 'yith-plugin-fw-fields', YIT_CORE_PLUGIN_URL . '/assets/js/yith-fields' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker', 'codemirror', 'codemirror-javascript', 'jquery-ui-slider' ), $this->version, true );
54
- wp_register_script( 'yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox' . $suffix . '.js', array( 'jquery', 'wp-color-picker' ), '1.0.0', true );
55
  wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel' . $suffix . '.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-sortable' ), $this->version, true );
56
  wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
57
  wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
@@ -66,7 +67,7 @@ if ( !class_exists( 'YIT_Assets' ) ) {
66
  wp_register_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
67
  wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
68
  wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
69
- wp_register_style( 'yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css' );
70
  wp_register_style( 'yith-plugin-fw-fields', YIT_CORE_PLUGIN_URL . '/assets/css/yith-fields.css', false, $this->version );
71
 
72
  $wc_version_suffix = '';
@@ -87,6 +88,10 @@ if ( !class_exists( 'YIT_Assets' ) ) {
87
  'search_terms_nonce' => wp_create_nonce( 'search-terms' ),
88
  ) );
89
 
 
 
 
 
90
  wp_enqueue_style( 'yith-plugin-fw-admin', YIT_CORE_PLUGIN_URL . '/assets/css/admin.css', array(), $this->version );
91
  }
92
  }
38
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
39
  */
40
  private function __construct() {
41
+ defined('YITH_PLUGIN_FW_VERSION') && $this->version = YITH_PLUGIN_FW_VERSION;
42
  add_action( 'admin_enqueue_scripts', array( $this, 'register_styles_and_scripts' ) );
43
  }
44
 
51
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
52
 
53
  //scripts
54
+ wp_register_script( 'yith-plugin-fw-fields', YIT_CORE_PLUGIN_URL . '/assets/js/yith-fields' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker', 'codemirror', 'codemirror-javascript', 'jquery-ui-slider','jquery-ui-sortable' ), $this->version, true );
55
+ wp_register_script( 'yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox' . $suffix . '.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
56
  wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel' . $suffix . '.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-sortable' ), $this->version, true );
57
  wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
58
  wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
67
  wp_register_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
68
  wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
69
  wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
70
+ wp_register_style( 'yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css', array(), $this->version );
71
  wp_register_style( 'yith-plugin-fw-fields', YIT_CORE_PLUGIN_URL . '/assets/css/yith-fields.css', false, $this->version );
72
 
73
  $wc_version_suffix = '';
88
  'search_terms_nonce' => wp_create_nonce( 'search-terms' ),
89
  ) );
90
 
91
+ wp_localize_script('yith-plugin-fw-fields','yith_framework_fw_fields', array(
92
+ 'admin_url' => admin_url( 'admin.php' ),
93
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
94
+ ));
95
  wp_enqueue_style( 'yith-plugin-fw-admin', YIT_CORE_PLUGIN_URL . '/assets/css/admin.css', array(), $this->version );
96
  }
97
  }
plugin-fw/lib/yit-metabox.php CHANGED
@@ -134,6 +134,9 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
134
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ), 15 );
135
 
136
  add_filter( 'yit_icons_screen_ids', array( $this, 'add_screen_ids_for_icons' ) );
 
 
 
137
  }
138
 
139
  /**
@@ -486,56 +489,87 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
486
  return $post_id;
487
  }*/
488
 
489
- $this->reorder_tabs();
490
-
491
  if ( isset( $_POST[ 'yit_metaboxes' ] ) ) {
492
  $yit_metabox_data = $_POST[ 'yit_metaboxes' ];
493
 
494
  if ( is_array( $yit_metabox_data ) ) {
495
-
496
  foreach ( $yit_metabox_data as $field_name => $field_value ) {
497
-
498
  if ( !add_post_meta( $post_id, $field_name, $field_value, true ) ) {
499
  update_post_meta( $post_id, $field_name, $field_value );
500
  }
501
-
502
-
503
  }
504
-
505
  }
506
-
507
-
508
  }
509
 
510
- foreach ( $this->tabs as $tab ) {
511
-
512
- foreach ( $tab[ 'fields' ] as $field ) {
513
 
514
- if ( in_array( $field[ 'type' ], array( 'title' ) ) ) {
515
- continue;
516
- }
517
-
518
- if ( isset( $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ] ) ) {
519
-
520
- if ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
521
- update_post_meta( $post_id, $field[ 'id' ], '1' );
522
- } else {
523
- $value = $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ];
524
- if ( !empty( $field[ 'yith-sanitize-callback' ] ) && is_callable( $field[ 'yith-sanitize-callback' ] ) ) {
525
- $value = call_user_func( $field[ 'yith-sanitize-callback' ], $value );
526
- }
527
- add_post_meta( $post_id, $field[ 'id' ], $value, true ) || update_post_meta( $post_id, $field[ 'id' ], $value );
528
- }
529
- } elseif ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
530
- update_post_meta( $post_id, $field[ 'id' ], '0' );
531
- } else {
532
- delete_post_meta( $post_id, $field[ 'id' ] );
533
- }
534
- }
535
- }
536
 
537
  }
538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  /**
540
  * Remove Fields
541
  *
@@ -552,6 +586,65 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
552
  $this->remove_field( $field );
553
  }
554
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  }
556
  }
557
 
134
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ), 15 );
135
 
136
  add_filter( 'yit_icons_screen_ids', array( $this, 'add_screen_ids_for_icons' ) );
137
+
138
+ add_action( 'wp_ajax_yith_plugin_fw_save_toggle_element_metabox', array( $this, 'save_toggle_element' ) );
139
+ add_filter( 'admin_body_class', array( $this, 'add_body_class' ), 10, 1 );
140
  }
141
 
142
  /**
489
  return $post_id;
490
  }*/
491
 
 
 
492
  if ( isset( $_POST[ 'yit_metaboxes' ] ) ) {
493
  $yit_metabox_data = $_POST[ 'yit_metaboxes' ];
494
 
495
  if ( is_array( $yit_metabox_data ) ) {
 
496
  foreach ( $yit_metabox_data as $field_name => $field_value ) {
 
497
  if ( !add_post_meta( $post_id, $field_name, $field_value, true ) ) {
498
  update_post_meta( $post_id, $field_name, $field_value );
499
  }
 
 
500
  }
 
501
  }
 
 
502
  }
503
 
504
+ $this->sanitize_fields( $post_id );
 
 
505
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
 
507
  }
508
 
509
+ /**
510
+ * Sanitize the fields of metabox.
511
+ *
512
+ * @return void
513
+ * @since 3.2.1
514
+ * @author Emanuela Castorina
515
+ */
516
+ public function sanitize_fields( $post_id ) {
517
+
518
+ $this->reorder_tabs();
519
+
520
+ foreach ( $this->tabs as $tab ) {
521
+
522
+ foreach ( $tab['fields'] as $field ) {
523
+
524
+ if ( in_array( $field['type'], array( 'title' ) ) ) {
525
+ continue;
526
+ }
527
+
528
+ if ( isset( $_POST['yit_metaboxes'][ $field['id'] ] ) ) {
529
+ if ( in_array( $field['type'], array( 'onoff', 'checkbox' ) ) ) {
530
+ update_post_meta( $post_id, $field['id'], '1' );
531
+ }elseif( in_array( $field['type'], array( 'toggle-element' ) ) ){
532
+ if ( isset( $field['elements'] ) && $field['elements'] ) {
533
+ $elements_value = $_POST['yit_metaboxes'][ $field['id'] ];
534
+ if ( $elements_value ) {
535
+ if( isset( $elements_value['box_id'])){
536
+ unset( $elements_value['box_id']);
537
+ }
538
+
539
+ foreach ( $field['elements'] as $element ) {
540
+ foreach ( $elements_value as $key => $element_value ) {
541
+ if ( isset( $field['onoff_field'] ) ) {
542
+ $elements_value[ $key ][ $field['onoff_field']['id'] ] = ! isset( $element_value[ $field['onoff_field']['id'] ] ) ? 0 : $element_value[ $field['onoff_field']['id'] ];
543
+ }
544
+ if ( in_array( $element['type'], array( 'onoff', 'checkbox' ) ) ) {
545
+ $elements_value[ $key ][ $element['id'] ] = ! isset( $element_value[ $element['id'] ] ) ? 0 : 1;
546
+ }
547
+
548
+ if ( ! empty( $element['yith-sanitize-callback'] ) && is_callable( $element['yith-sanitize-callback'] ) ) {
549
+ $elements_value[ $key ][ $element['id'] ] = call_user_func( $element['yith-sanitize-callback'], $elements_value[ $key ][ $element['id'] ] );
550
+ }
551
+ }
552
+ }
553
+ }
554
+
555
+ update_post_meta( $post_id, $field['id'], maybe_serialize( $elements_value ) );
556
+ }
557
+ } else {
558
+ $value = $_POST['yit_metaboxes'][ $field['id'] ];
559
+ if ( ! empty( $field['yith-sanitize-callback'] ) && is_callable( $field['yith-sanitize-callback'] ) ) {
560
+ $value = call_user_func( $field['yith-sanitize-callback'], $value );
561
+ }
562
+ add_post_meta( $post_id, $field['id'], $value, true ) || update_post_meta( $post_id, $field['id'], $value );
563
+ }
564
+ } elseif ( in_array( $field['type'], array( 'onoff', 'checkbox' ) ) ) {
565
+ update_post_meta( $post_id, $field['id'], '0' );
566
+ } else {
567
+ delete_post_meta( $post_id, $field['id'] );
568
+ }
569
+ }
570
+ }
571
+ }
572
+
573
  /**
574
  * Remove Fields
575
  *
586
  $this->remove_field( $field );
587
  }
588
  }
589
+
590
+
591
+ /**
592
+ * Add custom class to body
593
+ *
594
+ * It is necessary to add new style to the metaboxes
595
+ *
596
+ * @param $classes
597
+ *
598
+ * @return string
599
+ * @author Emanuela Castorina
600
+ */
601
+ public function add_body_class( $classes ) {
602
+ global $post;
603
+
604
+ $exclude_post_types = apply_filters( 'yith_plugin_fw_exclude_post_types_to_additional_classes', array( 'product' ) );
605
+
606
+ if ( $post && in_array( $post->post_type, $exclude_post_types ) ) {
607
+ return $classes;
608
+ }
609
+
610
+ $new_class = apply_filters( 'yith_plugin_fw_metabox_class', '', $post );
611
+
612
+ if ( empty( $new_class ) ) {
613
+ return $classes;
614
+ }
615
+
616
+ $classes = yith_plugin_fw_remove_duplicate_classes( $classes. ' '. $new_class);
617
+
618
+ return $classes;
619
+ }
620
+
621
+ /**
622
+ * Save the element toggle via Ajax.
623
+ *
624
+ * @return void
625
+ * @since 3.2.1
626
+ * @author Emanuela Castorina
627
+ */
628
+ public function save_toggle_element() {
629
+ if ( ! isset( $_REQUEST['post_ID'] ) ) {
630
+ return;
631
+ }
632
+
633
+ if ( !isset( $_REQUEST[ 'yit_metaboxes_nonce' ] ) || !wp_verify_nonce( $_REQUEST[ 'yit_metaboxes_nonce' ], 'metaboxes-fields-nonce' ) ) {
634
+ return;
635
+ }
636
+ $post_id = $_REQUEST['post_ID'];
637
+
638
+ if ( isset( $_REQUEST['yit_metaboxes'] ) ) {
639
+ $yit_metabox_data = $_REQUEST['yit_metaboxes'];
640
+
641
+ if ( is_array( $yit_metabox_data ) ) {
642
+ $this->sanitize_fields( $post_id );
643
+ }
644
+ } elseif ( ! isset( $_REQUEST['yit_metaboxes'] ) || ! isset( $_REQUEST['yit_metaboxes'][ $_REQUEST['toggle_id'] ] ) ) {
645
+ delete_post_meta( $post_id, $_REQUEST['toggle_id'] );
646
+ }
647
+ }
648
  }
649
  }
650
 
plugin-fw/lib/yit-plugin-licence.php CHANGED
@@ -58,7 +58,10 @@ if ( ! class_exists( 'YIT_Plugin_Licence' ) ) {
58
  yith_plugin_fw_load_update_and_licence_files();
59
  }
60
 
61
- YITH_Plugin_Licence()->register( $init, $secret_key, $product_id );
 
 
 
62
  }
63
 
64
  /**
58
  yith_plugin_fw_load_update_and_licence_files();
59
  }
60
 
61
+ try {
62
+ YITH_Plugin_Licence()->register( $init, $secret_key, $product_id );
63
+ } catch( Error $e ){
64
+ }
65
  }
66
 
67
  /**
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -41,6 +41,13 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
41
  */
42
  public static $wc_type = array( 'checkbox', 'textarea', 'multiselect', 'multi_select_countries', 'image_width' );
43
 
 
 
 
 
 
 
 
44
  /**
45
  * @var array
46
  */
@@ -59,6 +66,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
59
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
60
  */
61
  public function __construct( $args = array() ) {
 
62
  $args = apply_filters( 'yit_plugin_fw_wc_panel_option_args', $args );
63
  if ( !empty( $args ) ) {
64
  if ( isset( $args[ 'parent_page' ] ) && 'yit_plugin_panel' === $args[ 'parent_page' ] )
@@ -75,7 +83,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
75
  $this->links = $this->settings[ 'links' ];
76
  }
77
 
78
- add_action( 'admin_init', array( $this, 'set_default_options' ) );
79
  add_action( 'admin_menu', array( $this, 'add_setting_page' ) );
80
  add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
81
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
@@ -85,6 +93,12 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
85
 
86
  add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
87
 
 
 
 
 
 
 
88
 
89
  // init actions once to prevent multiple actions
90
  static::_init_actions();
@@ -130,9 +144,11 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
130
  'current_tab' => $this->get_current_tab(),
131
  'available_tabs' => $this->settings[ 'admin-tabs' ],
132
  'default_tab' => $this->get_available_tabs( true ), //get default tabs
133
- 'page' => $this->settings[ 'page' ]
 
134
  );
135
 
 
136
  $additional_info = apply_filters( 'yith_admin_tab_params', $additional_info );
137
  $additional_info[ 'additional_info' ] = $additional_info;
138
 
@@ -242,6 +258,8 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
242
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
243
  */
244
  public function add_fields() {
 
 
245
  $yit_options = $this->get_main_array_options();
246
  $current_tab = $this->get_current_tab();
247
 
@@ -462,7 +480,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
462
  global $pagenow;
463
 
464
  if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) )
465
- $admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
466
 
467
  return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
468
  }
@@ -511,6 +529,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
511
  * @since 3.0.0
512
  */
513
  public static function sanitize_option( $value, $option, $raw_value ) {
 
514
  if ( isset( $option[ 'type' ] ) && 'yith-field' === $option[ 'type' ] ) {
515
  // set empty array if is multiple
516
  if ( !empty( $option[ 'multiple' ] ) && is_null( $value ) ) {
@@ -526,7 +545,42 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
526
  $value = $raw_value;
527
  }
528
 
529
- if ( !empty( $option[ 'yith-sanitize-callback' ] ) && is_callable( $option[ 'yith-sanitize-callback' ] ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  $value = call_user_func( $option[ 'yith-sanitize-callback' ], $value );
531
  }
532
  }
@@ -561,5 +615,70 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
561
  require( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-option-row.php' );
562
  }
563
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
  }
565
  }
41
  */
42
  public static $wc_type = array( 'checkbox', 'textarea', 'multiselect', 'multi_select_countries', 'image_width' );
43
 
44
+ /**
45
+ * @var array a setting list of parameters
46
+ */
47
+ public static $body_class = ' yith-plugin-fw-panel ';
48
+
49
+
50
+
51
  /**
52
  * @var array
53
  */
66
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
67
  */
68
  public function __construct( $args = array() ) {
69
+
70
  $args = apply_filters( 'yit_plugin_fw_wc_panel_option_args', $args );
71
  if ( !empty( $args ) ) {
72
  if ( isset( $args[ 'parent_page' ] ) && 'yit_plugin_panel' === $args[ 'parent_page' ] )
83
  $this->links = $this->settings[ 'links' ];
84
  }
85
 
86
+ add_action( 'admin_init', array( $this, 'set_default_options' ) );
87
  add_action( 'admin_menu', array( $this, 'add_setting_page' ) );
88
  add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
89
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
93
 
94
  add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
95
 
96
+ //yith-plugin-ui
97
+ add_action('yith_plugin_fw_get_field_after', array($this, 'add_yith_ui') );
98
+ add_action('yith_plugin_fw_before_woocommerce_panel', array($this, 'add_plugin_banner'), 10, 1 );
99
+ add_action( 'admin_action_yith_plugin_fw_save_toggle_element', array( $this, 'save_toggle_element_options' ) );
100
+ add_filter( 'yith_plugin_fw_wc_panel_pre_field_value', array( $this, 'get_toggle_element_option' ), 10, 2 );
101
+
102
 
103
  // init actions once to prevent multiple actions
104
  static::_init_actions();
144
  'current_tab' => $this->get_current_tab(),
145
  'available_tabs' => $this->settings[ 'admin-tabs' ],
146
  'default_tab' => $this->get_available_tabs( true ), //get default tabs
147
+ 'page' => $this->settings[ 'page' ],
148
+ 'wrap_class' => isset($this->settings[ 'class' ]) ? $this->settings[ 'class' ] : '',
149
  );
150
 
151
+
152
  $additional_info = apply_filters( 'yith_admin_tab_params', $additional_info );
153
  $additional_info[ 'additional_info' ] = $additional_info;
154
 
258
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
259
  */
260
  public function add_fields() {
261
+
262
+
263
  $yit_options = $this->get_main_array_options();
264
  $current_tab = $this->get_current_tab();
265
 
480
  global $pagenow;
481
 
482
  if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) )
483
+ $admin_body_classes = substr_count( $admin_body_classes, self::$body_class ) == 0 ? $admin_body_classes . self::$body_class : $admin_body_classes;
484
 
485
  return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
486
  }
529
  * @since 3.0.0
530
  */
531
  public static function sanitize_option( $value, $option, $raw_value ) {
532
+
533
  if ( isset( $option[ 'type' ] ) && 'yith-field' === $option[ 'type' ] ) {
534
  // set empty array if is multiple
535
  if ( !empty( $option[ 'multiple' ] ) && is_null( $value ) ) {
545
  $value = $raw_value;
546
  }
547
 
548
+ // sanitize the option date-format when the user choose the custom option
549
+ if ( isset( $option['yith-type'] ) && in_array( $option['yith-type'], array( 'date-format' ) ) && '\c\u\s\t\o\m' == $raw_value ) {
550
+ $custom = isset( $_REQUEST[ $option['id'] . '_text' ] ) ? $_REQUEST[ $option['id'] . '_text' ] : $option['default'];
551
+ $value = $custom;
552
+ }
553
+
554
+ if ( isset( $option['yith-type'] ) && in_array( $option['yith-type'], array( 'toggle-element' ) ) ) {
555
+
556
+ // error_log( print_r( $raw_value, true ) );
557
+
558
+ if ( $value && isset( $option['elements'] ) && ! empty( $option['elements'] ) ) {
559
+
560
+ foreach ( $value as $index => $single_toggle ) {
561
+
562
+ if ( $value && isset( $option['onoff_field'] ) && ! empty( $option['onoff_field'] ) ) {
563
+ $onoff = $option['onoff_field'];
564
+ $onoff['type'] = 'yith-field';
565
+ $onoff['yith-type'] = 'onoff';
566
+ $onoff_id = $onoff['id'];
567
+
568
+ $value[ $index ][ $onoff_id ] = isset( $single_toggle[ $onoff_id ] ) ? self::sanitize_option( $single_toggle[ $onoff_id ], $onoff, $single_toggle[ $onoff_id ] ) : 'no';
569
+ }
570
+
571
+ foreach ( $option['elements'] as $element ) {
572
+ $value[ $index ][ $element['id'] ] = self::sanitize_option( $value[ $index ][ $element['id'] ], $element, $value[ $index ][ $element['id'] ] );
573
+ }
574
+ }
575
+ }
576
+
577
+
578
+ // error_log('sanitizes value');
579
+ // error_log( print_r( $value, true ) );
580
+ }
581
+
582
+
583
+ if ( !empty( $option[ 'yith-sanitize-callback' ] ) && is_callable( $option[ 'yith-sanitize-callback' ] ) ) {
584
  $value = call_user_func( $option[ 'yith-sanitize-callback' ], $value );
585
  }
586
  }
615
  require( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-option-row.php' );
616
  }
617
  }
618
+
619
+
620
+ /**
621
+ * Return the option value for the toggle element to the filter 'yith_plugin_fw_wc_panel_pre_field_value',
622
+ * it is an array of arrays and could trigger warning if recovered using
623
+ * WC_Admin_Settings::get_option
624
+ *
625
+ * @param $value mixed
626
+ * @param $field array
627
+ *
628
+ * @return $value mixed
629
+ *
630
+ * @author Emanuela Castorina
631
+ */
632
+ public function get_toggle_element_option( $value, $field ) {
633
+ return get_option( $field[ 'id' ], $field[ 'default' ] );
634
+ }
635
+
636
+ /**
637
+ * Save the content of the toggle element present inside the panel.
638
+ * Called by the action 'admin_action_yith_plugin_fw_save_toggle_element'
639
+ * via Ajax
640
+ *
641
+ * @author Emanuela Castorina
642
+ */
643
+ public function save_toggle_element_options() {
644
+ $posted = $_POST;
645
+ $tabs = $this->get_available_tabs();
646
+ $yit_options = $this->get_main_array_options();
647
+ $current_tab = isset( $_REQUEST['tab'] ) && in_array( $_REQUEST['tab'], $tabs ) ? $_REQUEST['tab'] : $tabs[0];
648
+ $option_id = isset( $_REQUEST['toggle_id'] ) ? $_REQUEST['toggle_id'] : '';
649
+ $updated = false;
650
+
651
+ if ( ! empty( $yit_options[ $current_tab ] ) && ! empty( $option_id ) ) {
652
+
653
+ $tab_options = $yit_options[ $current_tab ];
654
+ foreach ( $tab_options as $key => $item ) {
655
+ if ( ! isset( $item['id'] ) ) {
656
+ unset( $tab_options[ $key ] );
657
+ }
658
+ }
659
+
660
+ $option_array = array_combine( wp_list_pluck( $tab_options, 'id' ), $tab_options );
661
+ if ( isset( $option_array[ $option_id ] ) ) {
662
+ $value = isset( $posted[ $option_id ] ) ? $posted[ $option_id ] : '';
663
+
664
+ //drag and drop
665
+ $order_elements = isset( $posted['yith_toggle_elements_order_keys'] ) ? explode( ',', $posted['yith_toggle_elements_order_keys'] ) : false;
666
+ if ( $order_elements ) {
667
+ $i = 0;
668
+ $new_value = array();
669
+ foreach ( $order_elements as $key ) {
670
+ $index = apply_filters('yith_toggle_elements_index', $i++, $key );
671
+ $new_value[ $index ] = $value[ $key ];
672
+ }
673
+
674
+ $value = $new_value;
675
+ }
676
+ $value = self::sanitize_option( $value, $option_array[ $option_id ], $value );
677
+ $updated = update_option( $option_id, $value );
678
+ }
679
+ }
680
+
681
+ return $updated;
682
+ }
683
  }
684
  }
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -102,6 +102,11 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
102
  }
103
 
104
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
 
 
 
 
 
105
  }
106
 
107
  /**
@@ -358,10 +363,16 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
358
  $tabs = '';
359
  $current_tab = $this->get_current_tab();
360
  $yit_options = $this->get_main_array_options();
361
-
 
 
 
 
 
362
  // tabs
363
  foreach ( $this->settings[ 'admin-tabs' ] as $tab => $tab_value ) {
364
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
 
365
  $tabs .= '<a class="nav-tab' . $active_class . '" href="?' . $this->settings[ 'parent_page' ] . '&page=' . $this->settings[ 'page' ] . '&tab=' . $tab . '">' . $tab_value . '</a>';
366
  }
367
  ?>
@@ -402,6 +413,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
402
  <?php endif ?>
403
  </div>
404
  </div>
 
405
  <?php
406
  }
407
 
@@ -476,7 +488,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
476
  return;
477
  }
478
 
479
- if ( !empty( $this->settings[ 'admin_tabs' ] ) ) {
480
  foreach ( $this->settings[ 'admin-tabs' ] as $item => $title ) {
481
 
482
  $wp_admin_bar->add_menu( array(
@@ -938,5 +950,97 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
938
 
939
  return $menu;
940
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
941
  }
 
 
942
  }
102
  }
103
 
104
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
105
+
106
+ //yith-plugin-ui
107
+ add_action('yith_plugin_fw_before_yith_panel', array($this, 'add_plugin_banner'), 10, 1 );
108
+ add_action( 'wp_ajax_yith_plugin_fw_save_toggle_element', array( $this, 'save_toggle_element_options' ) );
109
+
110
  }
111
 
112
  /**
363
  $tabs = '';
364
  $current_tab = $this->get_current_tab();
365
  $yit_options = $this->get_main_array_options();
366
+ $premium_class = isset( $this->settings['class'] ) ? 'yith-premium' : 'premium';
367
+ $wrap_class = isset( $this->settings['class'] ) ? $this->settings['class'] : '';
368
+ ?>
369
+ <div class="wrap <?php echo $wrap_class?>">
370
+ <?php
371
+ do_action('yith_plugin_fw_before_yith_panel', $this->settings[ 'page' ] );
372
  // tabs
373
  foreach ( $this->settings[ 'admin-tabs' ] as $tab => $tab_value ) {
374
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
375
+ $active_class .= 'premium' == $tab ? ' '.$premium_class: '';
376
  $tabs .= '<a class="nav-tab' . $active_class . '" href="?' . $this->settings[ 'parent_page' ] . '&page=' . $this->settings[ 'page' ] . '&tab=' . $tab . '">' . $tab_value . '</a>';
377
  }
378
  ?>
413
  <?php endif ?>
414
  </div>
415
  </div>
416
+ </div>
417
  <?php
418
  }
419
 
488
  return;
489
  }
490
 
491
+ if ( ! empty( $this->settings[ 'admin_tabs' ] ) ) {
492
  foreach ( $this->settings[ 'admin-tabs' ] as $item => $title ) {
493
 
494
  $wp_admin_bar->add_menu( array(
950
 
951
  return $menu;
952
  }
953
+
954
+ /**
955
+ * Check if inside the admin tab there's the premium tab to
956
+ * check if the plugin is a free or not
957
+ *
958
+ * @author Emanuela Castorina
959
+ */
960
+ function is_free() {
961
+ return ( ! empty( $this->settings['admin-tabs'] ) && isset($this->settings['admin-tabs']['premium']));
962
+ }
963
+
964
+ /**
965
+ * Add plugin banner
966
+ */
967
+ public function add_plugin_banner( $page ) {
968
+
969
+ if ( $page != $this->settings['page'] || ! isset( $this->settings['class'] ) ) {
970
+ return;
971
+ }
972
+
973
+ if( $this->is_free() && isset( $this->settings['plugin_slug'] ) ):
974
+ $banners = apply_filters( 'yith_plugin_fw_banners_free', array(
975
+ 'upgrade' => array(
976
+ 'image' => YIT_CORE_PLUGIN_URL. '/assets/images/upgrade_banner.png',
977
+ 'link' => 'https://yithemes.com/themes/plugins/'.$this->settings['plugin_slug'],
978
+ ),
979
+ 'rate' => array(
980
+ 'image' => YIT_CORE_PLUGIN_URL. '/assets/images/rate_banner.png',
981
+ 'link' => 'https://wordpress.org/plugins/'.$this->settings['plugin_slug'].'/reviews/#new-post',
982
+ ),
983
+ ), $page );
984
+ ?>
985
+ <h1 class="notice-container"></h1>
986
+ <div class="yith-plugin-fw-banner yith-plugin-fw-banner-free">
987
+ <h1><?php echo esc_html( $this->settings['page_title'] ) ?></h1>
988
+ <?php if( $banners ) : ?>
989
+ <div class="yith-banners">
990
+ <ul>
991
+ <?php foreach ( $banners as $banner ): ?>
992
+ <li><a href="<?php echo esc_url( $banner['link'])?>" target="_blank"><img src="<?php echo esc_url( $banner['image'])?>"></a></li>
993
+ <?php endforeach; ?>
994
+ </ul>
995
+ </div>
996
+
997
+ <?php endif ?>
998
+ </div>
999
+ <?php else: ?>
1000
+ <h1 class="notice-container"></h1>
1001
+ <div class="yith-plugin-fw-banner">
1002
+ <h1><?php echo esc_html( $this->settings['page_title'] ) ?>
1003
+ <?php if ( isset( $this->settings['plugin_description'] ) ): ?>
1004
+ <span><?php echo esc_html( $this->settings['plugin_description'] ) ?></span>
1005
+ <?php endif ?>
1006
+ </h1>
1007
+ </div>
1008
+
1009
+ <?php endif ?>
1010
+ <?php
1011
+ }
1012
+
1013
+ /**
1014
+ * Add additional element after print the field.
1015
+ *
1016
+ *@since 3.2
1017
+ *@author Emanuela Castorina
1018
+ */
1019
+ public function add_yith_ui( $field ) {
1020
+
1021
+ global $pagenow;
1022
+
1023
+ if ( ! isset( $this->settings['class'] ) || empty( $this->settings['class'] ) || ! isset( $field['type'] ) ) {
1024
+ return;
1025
+ }
1026
+ if ( 'admin.php' === $pagenow && strpos( get_current_screen()->id, $this->settings['page'] ) !== false ) {
1027
+ switch ( $field['type'] ) {
1028
+ case 'datepicker':
1029
+ echo '<span class="yith-icon icon-calendar"></span>';
1030
+ break;
1031
+ default:
1032
+ break;
1033
+ }
1034
+ }
1035
+ }
1036
+
1037
+ /**
1038
+ *
1039
+ */
1040
+ public function save_toggle_element_options( ) {
1041
+ return true;
1042
+ }
1043
  }
1044
+
1045
+
1046
  }
plugin-fw/lib/yit-theme-licence.php CHANGED
@@ -58,7 +58,10 @@ if ( ! class_exists( 'YIT_Theme_Licence' ) ) {
58
  yith_plugin_fw_load_update_and_licence_files();
59
  }
60
 
61
- YITH_Theme_Licence()->register( $init, $secret_key, $product_id );
 
 
 
62
  }
63
 
64
  /**
58
  yith_plugin_fw_load_update_and_licence_files();
59
  }
60
 
61
+ try {
62
+ YITH_Theme_Licence()->register( $init, $secret_key, $product_id );
63
+ } catch( Error $e ){
64
+ }
65
  }
66
 
67
  /**
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -56,7 +56,10 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
56
  yith_plugin_fw_load_update_and_licence_files();
57
  }
58
 
59
- YITH_Plugin_Upgrade()->register( $plugin_slug, $plugin_init );
 
 
 
60
  }
61
 
62
  /**
56
  yith_plugin_fw_load_update_and_licence_files();
57
  }
58
 
59
+ try {
60
+ YITH_Plugin_Upgrade()->register( $plugin_slug, $plugin_init );
61
+ } catch( Error $e ){
62
+ }
63
  }
64
 
65
  /**
plugin-fw/templates/fields/colorpicker.php CHANGED
@@ -21,7 +21,7 @@ $class = !empty( $class ) ? $class : 'yith-plugin-fw-colorpicker';
21
 
22
  <input type="text" name="<?php echo $name ?>"
23
  id="<?php echo $id ?>" value="<?php echo esc_attr( $value ) ?>"
24
- <?php if ( isset( $std ) ) : ?>data-default-color="<?php echo $std ?>"<?php endif ?>
25
  class="<?php echo $class ?>"
26
  <?php echo $custom_attributes ?>
27
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
21
 
22
  <input type="text" name="<?php echo $name ?>"
23
  id="<?php echo $id ?>" value="<?php echo esc_attr( $value ) ?>"
24
+ <?php if ( isset( $default ) ) : ?> data-default-color="<?php echo $default ?>"<?php endif ?>
25
  class="<?php echo $class ?>"
26
  <?php echo $custom_attributes ?>
27
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
plugin-fw/templates/fields/date-format.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ /** @since 3.1.30 */
14
+
15
+ ! defined( 'ABSPATH' ) && exit; // Exit if accessed directly
16
+
17
+ extract( $field );
18
+
19
+ $class = isset( $class ) ? $class : '';
20
+ $js = isset( $js ) ? $js : false;
21
+ $class = 'yith-plugin-fw-radio ' . $class;
22
+
23
+ $options = yith_get_date_format( $js );
24
+ $custom = true;
25
+ ?>
26
+ <div class="<?php echo $class ?> yith-plugin-fw-date-format" id="<?php echo $id ?>"
27
+ <?php echo $custom_attributes ?>
28
+ <?php if ( isset( $data ) ) {
29
+ echo yith_plugin_fw_html_data_to_string( $data );
30
+ } ?> value="<?php echo $value ?>">
31
+ <?php foreach ( $options as $key => $label ) :
32
+ $checked = '';
33
+ $radio_id = sanitize_key( $id . '-' . $key );
34
+ if ( $value === $key ) { // checked() uses "==" rather than "==="
35
+ $checked = " checked='checked'";
36
+ $custom = false;
37
+ }
38
+ ?>
39
+ <div class="yith-plugin-fw-radio__row">
40
+ <input type="radio" id="<?php echo esc_attr( $radio_id ) ?>" name="<?php echo $name ?>"
41
+ value="<?php echo esc_attr( $key ) ?>" <?php echo $checked ?> />
42
+ <label for="<?php echo esc_attr( $radio_id ) ?>"><?php echo date_i18n( $label ) ?>
43
+ <code><?php echo esc_html( $key ) ?></code></label>
44
+ </div>
45
+ <?php endforeach; ?>
46
+ <?php $radio_id = sanitize_key( $id . '-custom' ); ?>
47
+ <div class="yith-plugin-fw-radio__row">
48
+ <input type="radio" id="<?php echo esc_attr( $radio_id ) ?>" name="<?php echo esc_attr( $name ) ?>"
49
+ value="\c\u\s\t\o\m" <?php checked( $custom ); ?> />
50
+ <label for="<?php echo esc_attr( $radio_id ) ?>"> <?php _e( 'Custom:', 'yith-plugin-fw' ) ?></label>
51
+ <input type="text" name="<?php echo esc_attr( $name . '_text' ) ?>"
52
+ id="<?php echo esc_attr( $radio_id ) ?>_text" value="<?php echo esc_attr( $value ) ?>"
53
+ class="small-text"/>
54
+ </div>
55
+
56
+ </div>
plugin-fw/templates/fields/list-table.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
+
13
+ extract( $field );
14
+
15
+ $show_button = false;
16
+ if ( isset( $add_new_button ) && isset( $post_type ) ) {
17
+ $show_button = true;
18
+ $admin_url = admin_url( 'post-new.php' );
19
+ $params['post_type'] = $post_type;
20
+ $add_new_url = esc_url( add_query_arg( $params, $admin_url ) );
21
+ }
22
+
23
+ if ( isset( $list_table_class ) && ! class_exists( $list_table_class ) && isset( $list_table_class_dir ) ) {
24
+ include_once( $list_table_class_dir );
25
+ }
26
+
27
+ if ( class_exists( $list_table_class ) ):
28
+ $list_table = new $list_table_class();
29
+ ?>
30
+
31
+ <div id="<?php echo $id ?>" class="yith-plugin-fw-list-table <?php echo $class ?>">
32
+ <div class="yith-plugin-fw-list-table-container yith-plugin-fw yit-admin-panel-container">
33
+ <div class="list-table-title">
34
+ <h2>
35
+ <?php echo isset( $title ) ? $title : '' ?>
36
+ </h2>
37
+ <?php if( $show_button ): ?>
38
+ <a href="<?php echo $add_new_url; ?>" class="yith-add-button">
39
+ <?php echo $add_new_button ?>
40
+ </a>
41
+ <?php endif ?>
42
+ </div>
43
+
44
+ <?php if( isset( $desc) && !empty( $desc ) ) :?>
45
+ <p class="yith-section-description"><?php echo $desc ?></p>
46
+ <?php
47
+ endif;
48
+ $list_table->prepare_items();
49
+ $list_table->views();
50
+ ?>
51
+ <form method="post">
52
+ <?php
53
+ $list_table->display();
54
+ ?>
55
+ </form>
56
+ </div>
57
+ </div>
58
+
59
+ <?php endif; ?>
plugin-fw/templates/fields/multi-colorpicker.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ wp_enqueue_style( 'wp-color-picker' );
16
+
17
+ extract( $field );
18
+ if ( ! isset( $colorpickers ) ){
19
+ return;
20
+ }
21
+ $class = !empty( $class ) ? $class : 'yith-plugin-fw-multi-colorpicker';
22
+ ?>
23
+ <div class="<?php echo esc_attr( $class )?>">
24
+
25
+ <?php
26
+ foreach ( $colorpickers as $colorpicker ):
27
+ $colorpicker['type'] = 'colorpicker';
28
+ $colorpicker['title'] = $colorpicker['name'];
29
+ $colorpicker['name'] = $name."[{$colorpicker['id']}]";
30
+ $colorpicker['value'] = isset( $value[$colorpicker['id']] ) ? $value[$colorpicker['id']] : $colorpicker['default'];
31
+ $colorpicker['id'] = $name."_".$colorpicker['id'];
32
+ ?>
33
+ <div class="yith-single-colorpicker colorpicker">
34
+ <label for="<?php echo esc_attr($colorpicker['id'] )?>"><?php echo esc_html($colorpicker['title']) ?></label>
35
+ <?php echo yith_plugin_fw_get_field( $colorpicker, true, false ); ?>
36
+ </div>
37
+
38
+ <?php endforeach;?>
39
+ </div>
plugin-fw/templates/fields/onoff.php CHANGED
@@ -17,7 +17,7 @@ extract( $field );
17
 
18
  <div class="yith-plugin-fw-onoff-container">
19
  <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php checked( yith_plugin_fw_is_true( $value ) ) ?> class="on_off" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
20
- <span class="yith-plugin-fw-onoff">&nbsp;</span>
21
  </div>
22
  <?php
23
  if ( isset( $field[ 'desc-inline' ] ) ) {
17
 
18
  <div class="yith-plugin-fw-onoff-container">
19
  <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php checked( yith_plugin_fw_is_true( $value ) ) ?> class="on_off" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
20
+ <span class="yith-plugin-fw-onoff"></span>
21
  </div>
22
  <?php
23
  if ( isset( $field[ 'desc-inline' ] ) ) {
plugin-fw/templates/fields/select-buttons.php CHANGED
@@ -18,19 +18,20 @@ $field[ 'type' ] = 'select';
18
 
19
  if ( empty( $field[ 'class' ] ) ) unset( $field[ 'class' ] );
20
 
 
21
  $default_args = array(
22
  'multiple' => true,
23
  'class' => 'wc-enhanced-select',
24
  'buttons' => array(
25
  array(
26
- 'name' => __( 'Select All', 'yith-plugin-fw' ),
27
  'class' => 'yith-plugin-fw-select-all',
28
  'data' => array(
29
  'select-id' => $field[ 'id' ]
30
  ),
31
  ),
32
  array(
33
- 'name' => __( 'Deselect All', 'yith-plugin-fw' ),
34
  'class' => 'yith-plugin-fw-deselect-all',
35
  'data' => array(
36
  'select-id' => $field[ 'id' ]
18
 
19
  if ( empty( $field[ 'class' ] ) ) unset( $field[ 'class' ] );
20
 
21
+ $add_label = isset( $field['add_all_button_label'] ) ? $field['add_all_button_label'] : __( 'Add All', 'yith-plugin-fw' );
22
  $default_args = array(
23
  'multiple' => true,
24
  'class' => 'wc-enhanced-select',
25
  'buttons' => array(
26
  array(
27
+ 'name' => $add_label,
28
  'class' => 'yith-plugin-fw-select-all',
29
  'data' => array(
30
  'select-id' => $field[ 'id' ]
31
  ),
32
  ),
33
  array(
34
+ 'name' => __( 'Remove All', 'yith-plugin-fw' ),
35
  'class' => 'yith-plugin-fw-deselect-all',
36
  'data' => array(
37
  'select-id' => $field[ 'id' ]
plugin-fw/templates/fields/select.php CHANGED
@@ -15,17 +15,19 @@
15
  extract( $field );
16
  $multiple = isset( $multiple ) && $multiple;
17
  $multiple_html = ( $multiple ) ? ' multiple' : '';
18
-
19
  if ( $multiple && !is_array( $value ) )
20
  $value = array();
21
 
22
  $class = isset( $class ) ? $class : 'yith-plugin-fw-select';
23
  ?>
24
  <select<?php echo $multiple_html ?>
25
- id="<?php echo $id ?>"
26
  name="<?php echo $name ?><?php if ( $multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>
27
  data-std="<?php echo ( $multiple ) ? implode( ' ,', $std ) : $std ?>"<?php endif ?>
 
28
  class="<?php echo $class ?>"
 
29
  <?php echo $custom_attributes ?>
30
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>>
31
  <?php foreach ( $options as $key => $item ) : ?>
15
  extract( $field );
16
  $multiple = isset( $multiple ) && $multiple;
17
  $multiple_html = ( $multiple ) ? ' multiple' : '';
18
+ $placeholder = isset( $placeholder ) ? ' data-placeholder = "' . $placeholder .'" ': '';
19
  if ( $multiple && !is_array( $value ) )
20
  $value = array();
21
 
22
  $class = isset( $class ) ? $class : 'yith-plugin-fw-select';
23
  ?>
24
  <select<?php echo $multiple_html ?>
25
+ id="<?php echo $id ?>"
26
  name="<?php echo $name ?><?php if ( $multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>
27
  data-std="<?php echo ( $multiple ) ? implode( ' ,', $std ) : $std ?>"<?php endif ?>
28
+
29
  class="<?php echo $class ?>"
30
+ <?php echo $placeholder ?>
31
  <?php echo $custom_attributes ?>
32
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>>
33
  <?php foreach ( $options as $key => $item ) : ?>
plugin-fw/templates/fields/text.php CHANGED
@@ -24,3 +24,4 @@ $class = isset( $class ) ? $class : 'yith-plugin-fw-text-input';
24
  <?php echo $custom_attributes ?>
25
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
26
 
 
24
  <?php echo $custom_attributes ?>
25
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
26
 
27
+
plugin-fw/templates/fields/textarea.php CHANGED
@@ -15,10 +15,12 @@
15
  extract( $field );
16
 
17
  $class = isset( $class ) ? $class : 'yith-plugin-fw-textarea';
 
 
18
  ?>
19
  <textarea id="<?php echo $id ?>"
20
  name="<?php echo $name ?>"
21
  class="<?php echo $class ?>"
22
- rows="5" cols="50" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
23
  <?php echo $custom_attributes ?>
24
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php echo $value ?></textarea>
15
  extract( $field );
16
 
17
  $class = isset( $class ) ? $class : 'yith-plugin-fw-textarea';
18
+ $rows = isset( $rows ) ? $rows : 5;
19
+ $cols = isset( $cols ) ? $cols : 50;
20
  ?>
21
  <textarea id="<?php echo $id ?>"
22
  name="<?php echo $name ?>"
23
  class="<?php echo $class ?>"
24
+ rows="<?php echo $rows ?>" cols="<?php echo $cols ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
25
  <?php echo $custom_attributes ?>
26
  <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php echo $value ?></textarea>
plugin-fw/templates/fields/toggle-element.php ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ //delete_option('ywraq_toggle_element');
7
+ $defaults = array(
8
+ 'id' => '',
9
+ 'add_button' => '',
10
+ 'name' => '',
11
+ 'class' => '',
12
+ 'custom_attributes' => '',
13
+ 'elements' => array(),
14
+ 'title' => '',
15
+ 'subtitle' => '',
16
+ 'onoff_field' => array(),
17
+ //is an array to print a onoff field, if need to call an ajax action, add 'ajax_action' => 'myaction' in the array args,
18
+ 'sortable' => false,
19
+ 'save_button' => array(),
20
+ 'delete_button' => array()
21
+
22
+ );
23
+ $field = wp_parse_args( $field, $defaults );
24
+
25
+ extract( $field );
26
+
27
+ $show_add_button = isset( $add_button ) && $add_button;
28
+ $values = isset( $value ) ? $value : get_option( $name, array() );
29
+ $values = maybe_unserialize( $values );
30
+ $sortable = isset( $sortable ) ? $sortable : false;
31
+ $class_wrapper = $sortable ? 'ui-sortable' : '';
32
+ $onoff_id = isset( $onoff_field['id'] ) ? $onoff_field['id'] : '';
33
+
34
+ if ( empty( $values ) && ! $show_add_button && $elements ) {
35
+ //populate a toggle element with the default
36
+ foreach ( $elements as $element ) {
37
+ $values[0][ $element['id'] ] = $element['default'];
38
+ }
39
+ }
40
+ ?>
41
+ <div class="yith-toggle_wrapper <?php echo $class_wrapper ?>" id="<?php echo $id ?>">
42
+ <?php
43
+
44
+ if ( $show_add_button ):
45
+
46
+ ?>
47
+ <button class="yith-add-button yith-add-box-button"
48
+ data-box_id="<?php echo $id; ?>_add_box"><?php echo $add_button; ?></button>
49
+ <div id="<?php echo $id; ?>_add_box" class="yith-add-box">
50
+ </div>
51
+ <script type="text/template" id="tmpl-yith-toggle-element-add-box-content-<?php echo $id ?>">
52
+ <?php foreach ( $elements as $element ):
53
+ $element['title'] = $element['name'];
54
+ $element['type'] = isset( $element['yith-type'] ) ? $element['yith-type'] : $element['type'];
55
+ unset( $element['yith-type'] );
56
+ $element['value'] = isset($element['default']) ? $element['default'] : '';
57
+ $element['id'] = 'new_'.$element['id'];
58
+ $element['name'] = $name. "[{{{data.index}}}][" . $element['id'] . "]";
59
+
60
+ ?>
61
+ <div class="yith-add-box-row <?php echo '{{{data.index}}}'?>">
62
+
63
+ <label for="<?php echo $element['id']; ?>"><?php echo esc_html( $element['title'] ); ?></label>
64
+ <div class="yith-plugin-fw-option-with-description">
65
+ <?php
66
+ echo yith_plugin_fw_get_field( $element, true ); ?>
67
+ <span class="description"><?php echo ! empty( $element['desc'] ) ? $element['desc'] : ''; ?></span>
68
+ </div>
69
+ </div>
70
+ <?php endforeach; ?>
71
+
72
+ <div class="yith-add-box-buttons">
73
+ <button class="yith-save-button">
74
+ <?php echo $save_button['name'] ; ?>
75
+ </button>
76
+ </div>
77
+ </script>
78
+ <?php endif; ?>
79
+
80
+ <div class="yith-toggle-elements">
81
+ <?php
82
+ if ($values ):
83
+ //print toggle elements
84
+ foreach ( $values as $i => $value ):
85
+ $title_element = yith_format_toggle_title( $title, $value );
86
+ $title_element = apply_filters( 'yith_plugin_fw_toggle_element_title_' . $id, $title_element, $elements, $value );
87
+ $subtitle_element = yith_format_toggle_title( $subtitle, $value );
88
+ $subtitle_element = apply_filters( 'yith_plugin_fw_toggle_element_subtitle_' . $id, $subtitle_element, $elements, $value );
89
+ ?>
90
+
91
+ <div id="<?php echo $id; ?>_<?php echo $i; ?>"
92
+ class="yith-toggle-row <?php echo ! empty( $subtitle ) ? 'with-subtitle' : ''; ?> <?php echo $class; ?>" <?php echo $custom_attributes; ?>
93
+ data-item_key="<?php echo esc_attr( $i ) ?>">
94
+ <div class="yith-toggle-title">
95
+ <h3>
96
+ <span class="title"
97
+ data-title_format="<?php echo esc_attr( $title ) ?>"><?php echo $title_element ?></span>
98
+ <?php if ( ! empty( $subtitle_element ) ): ?>
99
+ <div class="subtitle"
100
+ data-subtitle_format="<?php echo esc_attr( $subtitle ) ?>"><?php echo $subtitle_element; ?></div>
101
+ <?php endif; ?>
102
+ </h3>
103
+ <span class="yith-toggle">
104
+ <span class="yith-icon icon-arrow_right ui-sortable-handle"></span>
105
+ </span>
106
+ <?php
107
+ if ( ! empty( $onoff_field ) && is_array( $onoff_field ) ):
108
+ $action = ! empty( $onoff_field['ajax_action'] ) ? 'data-ajax_action="' . $onoff_field['ajax_action'] . '"' : '';
109
+ $onoff_field['value'] = isset( $value[ $onoff_id ] ) ? $value[ $onoff_id ] : $onoff_field['default'];
110
+ $onoff_field['type'] = 'onoff';
111
+ $onoff_field['name'] = $name. "[$i][" . $onoff_id . "]";
112
+ $onoff_field['id'] = $onoff_id.'_'.$i;
113
+ unset( $onoff_field['yith-type'] );
114
+ ?>
115
+ <span class="yith-toggle-onoff" <?php echo $action; ?> >
116
+ <?php
117
+ echo yith_plugin_fw_get_field( $onoff_field, true );
118
+ ?>
119
+ </span>
120
+
121
+ <?php if ( $sortable ): ?>
122
+ <span class="yith-icon icon-drag"></span>
123
+ <?php endif ?>
124
+
125
+ <?php endif; ?>
126
+ </div>
127
+ <div class="yith-toggle-content">
128
+ <?php
129
+ if ( $elements && count( $elements ) > 0 ) {
130
+ foreach ( $elements as $element ):
131
+ $element['type'] = isset( $element['yith-type'] ) ? $element['yith-type'] : $element['type'];
132
+ unset( $element['yith-type'] );
133
+ $element['title'] = $element['name'];
134
+ $element['name'] = $name . "[$i][" . $element['id'] . "]";
135
+ $element['value'] = isset( $value[ $element['id'] ] ) ? $value[ $element['id'] ] : $element['default'];
136
+ $element['id'] = $element['id'].'_'.$i;
137
+ ?>
138
+ <div class="yith-toggle-content-row <?php echo $element['type'] ?>">
139
+ <label for="<?php echo $element['id']; ?>"><?php echo $element['title']; ?></label>
140
+ <div class="yith-plugin-fw-option-with-description">
141
+ <?php echo yith_plugin_fw_get_field( $element, true ); ?>
142
+ <span class="description"><?php echo ! empty( $element['desc'] ) ? $element['desc'] : ''; ?></span>
143
+ </div>
144
+ </div>
145
+ <?php endforeach;
146
+ }
147
+ ?>
148
+ <div class="yith-toggle-content-buttons">
149
+ <div class="spinner"></div>
150
+ <?php
151
+ if ( $save_button && ! empty( $save_button['id'] ) ):
152
+ $save_button_class = isset( $save_button['class'] ) ? $save_button['class'] : '';
153
+ $save_button_name = isset( $save_button['name'] ) ? $save_button['name'] : '';
154
+ ?>
155
+ <button id="<?php echo $save_button['id']; ?>"
156
+ class="yith-save-button <?php echo $save_button_class; ?>">
157
+ <?php echo $save_button_name; ?>
158
+ </button>
159
+ <?php endif; ?>
160
+ <?php
161
+ if ( $delete_button && ! empty( $delete_button['id'] ) ):
162
+ $delete_button_class = isset( $delete_button['class'] ) ? $delete_button['class'] : '';
163
+ $delete_button_name = isset( $delete_button['name'] ) ? $delete_button['name'] : '';
164
+ ?>
165
+ <button id="<?php echo $delete_button['id']; ?>"
166
+ class="button-secondary yith-delete-button <?php echo $delete_button_class; ?>">
167
+ <?php echo $delete_button_name; ?>
168
+ </button>
169
+ <?php endif; ?>
170
+ </div>
171
+ </div>
172
+
173
+ </div>
174
+ <?php endforeach;
175
+ endif;
176
+ ?>
177
+
178
+
179
+ </div>
180
+ <!-- Schedule Item template -->
181
+ <script type="text/template" id="tmpl-yith-toggle-element-item-<?php echo $id ?>">
182
+ <div id="<?php echo $id; ?>_{{{data.index}}}"
183
+ class="yith-toggle-row <?php echo ! empty( $subtitle ) ? 'with-subtitle' : ''; ?> <?php echo $class; ?>"
184
+ data-item_key="{{{data.index}}}" <?php echo $custom_attributes; ?>
185
+ data-item_key="{{{data.index}}}">
186
+ <div class="yith-toggle-title">
187
+ <h3>
188
+ <span class="title" data-title_format="<?php echo esc_attr( $title ) ?>"><?php echo $title ?></span>
189
+
190
+ <div class="subtitle"
191
+ data-subtitle_format="<?php echo esc_attr( $subtitle ) ?>"><?php echo $subtitle ?></div>
192
+
193
+ </h3>
194
+ <span class="yith-toggle">
195
+ <span class="yith-icon icon-arrow_right"></span>
196
+ </span>
197
+ <?php
198
+ if ( ! empty( $onoff_field ) && is_array( $onoff_field ) ):
199
+ $action = ! empty( $onoff_field['ajax_action'] ) ? 'data-ajax_action="' . $onoff_field['ajax_action'] . '"' : '';
200
+ $onoff_field['value'] = $onoff_field['default'];
201
+ $onoff_field['type'] = 'onoff';
202
+ $onoff_field['name'] = $name . "[{{{data.index}}}][" . $onoff_id . "]";
203
+ $onoff_field['id'] = $onoff_id;
204
+ unset( $onoff_field['yith-type'] );
205
+ ?>
206
+ <span class="yith-toggle-onoff" <?php echo $action; ?> >
207
+ <?php
208
+ echo yith_plugin_fw_get_field( $onoff_field, true );
209
+ ?>
210
+ </span>
211
+
212
+ <?php endif; ?>
213
+ <?php if ( $sortable ): ?>
214
+ <span class="yith-icon icon-drag ui-sortable-handle"></span>
215
+ <?php endif ?>
216
+ </div>
217
+ <div class="yith-toggle-content">
218
+ <?php
219
+ if ( $elements && count( $elements ) > 0 ) {
220
+ foreach ( $elements as $element ):
221
+ $element['type'] = isset( $element['yith-type'] ) ? $element['yith-type'] : $element['type'];
222
+ unset( $element['yith-type'] );
223
+ $element['title'] = $element['name'];
224
+ $element['name'] = $name . "[{{{data.index}}}][" . $element['id'] . "]";
225
+ $element['id'] = $element['id'].'_{{{data.index}}}';
226
+ ?>
227
+ <div class="yith-toggle-content-row <?php echo $element['type'] ?>">
228
+ <label for="<?php echo $element['id']; ?>"><?php echo $element['title']; ?></label>
229
+ <div class="yith-plugin-fw-option-with-description">
230
+ <?php echo yith_plugin_fw_get_field( $element, true ); ?>
231
+ <span class="description"><?php echo ! empty( $element['desc'] ) ? $element['desc'] : ''; ?></span>
232
+ </div>
233
+ </div>
234
+ <?php endforeach;
235
+ }
236
+ ?>
237
+ <div class="yith-toggle-content-buttons">
238
+ <div class="spinner"></div>
239
+ <?php
240
+ if ( $save_button && ! empty( $save_button['id'] ) ):
241
+ $save_button_class = isset( $save_button['class'] ) ? $save_button['class'] : '';
242
+ $save_button_name = isset( $save_button['name'] ) ? $save_button['name'] : '';
243
+ ?>
244
+ <button id="<?php echo $save_button['id']; ?>"
245
+ class="yith-save-button <?php echo $save_button_class; ?>">
246
+ <?php echo $save_button_name; ?>
247
+ </button>
248
+ <?php endif; ?>
249
+ <?php
250
+ if ( $delete_button && ! empty( $delete_button['id'] ) ):
251
+ $delete_button_class = isset( $delete_button['class'] ) ? $delete_button['class'] : '';
252
+ $delete_button_name = isset( $delete_button['name'] ) ? $delete_button['name'] : '';
253
+ ?>
254
+ <button id="<?php echo $delete_button['id']; ?>"
255
+ class="button-secondary yith-delete-button <?php echo $delete_button_class; ?>">
256
+ <?php echo $delete_button_name; ?>
257
+ </button>
258
+ <?php endif; ?>
259
+ </div>
260
+ </div>
261
+ </div>
262
+ </script>
263
+
264
+ </div>
plugin-fw/templates/fields/upload.php CHANGED
@@ -15,9 +15,9 @@
15
  extract( $field );
16
  ?>
17
  <input type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php if ( isset( $default ) ) : ?>data-std="<?php echo $default ?>"<?php endif ?> class="yith-plugin-fw-upload-img-url"/>
18
- <input type="button" class="button-secondary yith-plugin-fw-upload-button" id="<?php echo $id ?>-button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>"/>
19
- <input type="button" value="<?php _e( 'Reset', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>-button-reset" class="yith-plugin-fw-upload-button-reset button"
20
- data-default="<?php echo isset( $default ) ? $default : '' ?>"/>
21
  <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
22
  <?php
23
  $file = $value;
15
  extract( $field );
16
  ?>
17
  <input type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php if ( isset( $default ) ) : ?>data-std="<?php echo $default ?>"<?php endif ?> class="yith-plugin-fw-upload-img-url"/>
18
+ <button class="button-secondary yith-plugin-fw-upload-button" id="<?php echo $id ?>-button"><?php _e( 'Upload', 'yith-plugin-fw' ) ?></button>
19
+ <button type="button" id="<?php echo $id ?>-button-reset" class="yith-plugin-fw-upload-button-reset button"
20
+ data-default="<?php echo isset( $default ) ? $default : '' ?>"><?php _e( 'Reset', 'yith-plugin-fw' ) ?></button>
21
  <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
22
  <?php
23
  $file = $value;
plugin-fw/templates/metaboxes/field-row.php CHANGED
@@ -31,6 +31,7 @@ $default_field = array(
31
  $field = wp_parse_args( $field, $default_field );
32
 
33
  $display_field_only = isset( $field[ 'display-field-only' ] ) ? $field[ 'display-field-only' ] : false;
 
34
  ?>
35
  <div id="<?php echo $field[ 'id' ] ?>-container" <?php echo yith_field_deps_data( $field ); ?> class="yith-plugin-fw-metabox-field-row">
36
  <?php if ( $display_field_only ) :
31
  $field = wp_parse_args( $field, $default_field );
32
 
33
  $display_field_only = isset( $field[ 'display-field-only' ] ) ? $field[ 'display-field-only' ] : false;
34
+
35
  ?>
36
  <div id="<?php echo $field[ 'id' ] ?>-container" <?php echo yith_field_deps_data( $field ); ?> class="yith-plugin-fw-metabox-field-row">
37
  <?php if ( $display_field_only ) :
plugin-fw/templates/metaboxes/tab.php CHANGED
@@ -13,9 +13,11 @@ if ( !defined( 'ABSPATH' ) ) {
13
  } // Exit if accessed directly
14
 
15
  global $post;
 
 
16
 
17
  do_action( 'yit_before_metaboxes_tab' ) ?>
18
- <div class="yith-plugin-fw metaboxes-tab">
19
  <?php do_action( 'yit_before_metaboxes_labels' ) ?>
20
  <ul class="metaboxes-tabs clearfix"<?php if ( count( $tabs ) <= 1 ) : ?> style="display:none;"<?php endif; ?>>
21
  <?php
@@ -81,12 +83,14 @@ do_action( 'yit_before_metaboxes_tab' ) ?>
81
  if ( $field_template_path = yith_plugin_fw_get_field_template_path( $field ) ) {
82
  $display_row = 'hidden' !== $field[ 'type' ];
83
  $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
84
- $field[ 'display-field-only' ] = in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title' ) );
85
 
86
  if ( $display_row ) {
 
87
  $field_row_path = apply_filters( 'yith_plugin_fw_metabox_field_row_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/metaboxes/field-row.php', $field );
88
  file_exists( $field_row_path ) && include( $field_row_path );
89
  } else {
 
90
  yith_plugin_fw_get_field( $field, true );
91
  }
92
  } else {
13
  } // Exit if accessed directly
14
 
15
  global $post;
16
+ $classes = apply_filters('yith_plugin_fw_metabox_class', '', $post );
17
+ $classes = yith_plugin_fw_remove_duplicate_classes( $classes );
18
 
19
  do_action( 'yit_before_metaboxes_tab' ) ?>
20
+ <div class="yith-plugin-fw metaboxes-tab <?php echo esc_attr($classes )?>">
21
  <?php do_action( 'yit_before_metaboxes_labels' ) ?>
22
  <ul class="metaboxes-tabs clearfix"<?php if ( count( $tabs ) <= 1 ) : ?> style="display:none;"<?php endif; ?>>
23
  <?php
83
  if ( $field_template_path = yith_plugin_fw_get_field_template_path( $field ) ) {
84
  $display_row = 'hidden' !== $field[ 'type' ];
85
  $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
86
+ $field[ 'display-field-only' ] = in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title') );
87
 
88
  if ( $display_row ) {
89
+
90
  $field_row_path = apply_filters( 'yith_plugin_fw_metabox_field_row_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/metaboxes/field-row.php', $field );
91
  file_exists( $field_row_path ) && include( $field_row_path );
92
  } else {
93
+
94
  yith_plugin_fw_get_field( $field, true );
95
  }
96
  } else {
plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php CHANGED
@@ -10,7 +10,7 @@ $default_field = array(
10
  );
11
  $field = wp_parse_args( $field, $default_field );
12
 
13
- $display_row = !in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title' ) );
14
  $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
15
 
16
  $extra_row_classes = apply_filters( 'yith_plugin_fw_panel_wc_extra_row_classes', array(), $field );
10
  );
11
  $field = wp_parse_args( $field, $default_field );
12
 
13
+ $display_row = !in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title', 'list-table' ) );
14
  $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
15
 
16
  $extra_row_classes = apply_filters( 'yith_plugin_fw_panel_wc_extra_row_classes', array(), $field );
plugin-fw/templates/panel/woocommerce/woocommerce-panel.php CHANGED
@@ -1,10 +1,14 @@
1
  <?php add_thickbox();?>
2
- <div class="wrap">
3
  <div id="icon-users" class="icon32"><br/></div>
 
4
  <?php if( ! empty( $available_tabs ) ): ?>
5
  <h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
6
- <?php foreach( $available_tabs as $id => $label ): ?>
7
- <a href="?page=<?php echo $page ?>&tab=<?php echo $id ?>" class="nav-tab <?php echo ( $current_tab == $id ) ? 'nav-tab-active' : '' ?>"><?php echo $label ?></a>
 
 
 
8
  <?php endforeach; ?>
9
  </h2>
10
  <?php $this->print_panel_content() ?>
1
  <?php add_thickbox();?>
2
+ <div class="wrap <?php echo $wrap_class?>">
3
  <div id="icon-users" class="icon32"><br/></div>
4
+ <?php do_action('yith_plugin_fw_before_woocommerce_panel', $page )?>
5
  <?php if( ! empty( $available_tabs ) ): ?>
6
  <h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
7
+ <?php foreach( $available_tabs as $id => $label ):
8
+ $active_class = ( $current_tab == $id ) ? ' nav-tab-active' : '';
9
+ $active_class .= 'premium' == $id ? ' yith-premium ': '';
10
+ ?>
11
+ <a href="?page=<?php echo $page ?>&tab=<?php echo $id ?>" class="nav-tab <?php echo $active_class ?>"><?php echo $label ?></a>
12
  <?php endforeach; ?>
13
  </h2>
14
  <?php $this->print_panel_content() ?>
plugin-fw/yit-functions.php CHANGED
@@ -1007,6 +1007,7 @@ if ( !function_exists( 'yith_plugin_fw_get_field' ) ) {
1007
 
1008
 
1009
  $field_template = yith_plugin_fw_get_field_template_path( $field );
 
1010
  if ( $field_template ) {
1011
  if ( !$echo )
1012
  ob_start();
@@ -1035,6 +1036,7 @@ if ( !function_exists( 'yith_plugin_fw_get_field_template_path' ) ) {
1035
  return false;
1036
 
1037
  $field_template = YIT_CORE_PLUGIN_TEMPLATE_PATH . '/fields/' . sanitize_title( $field[ 'type' ] ) . '.php';
 
1038
  $field_template = apply_filters( 'yith_plugin_fw_get_field_template_path', $field_template, $field );
1039
 
1040
  return file_exists( $field_template ) ? $field_template : false;
@@ -1240,6 +1242,79 @@ if( ! function_exists( 'yith_plugin_fw_get_default_logo' ) ){
1240
  }
1241
  }
1242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1243
  if( ! function_exists( 'yith_plugin_fw_load_update_and_licence_files' ) ){
1244
  /**
1245
  * Load premium file for license and update system
@@ -1269,7 +1344,7 @@ if( ! function_exists( 'yith_plugin_fw_load_update_and_licence_files' ) ){
1269
  }
1270
  }
1271
 
1272
- if( ! empty( $plugin_upgrade_fw_data && is_array( $plugin_upgrade_fw_data )) ){
1273
  foreach ( $plugin_upgrade_fw_data as $fw_version=> $core_files ){
1274
  foreach ( $core_files as $core_file ){
1275
  if( file_exists( $core_file ) ){
@@ -1279,4 +1354,26 @@ if( ! function_exists( 'yith_plugin_fw_load_update_and_licence_files' ) ){
1279
  }
1280
  }
1281
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1282
  }
1007
 
1008
 
1009
  $field_template = yith_plugin_fw_get_field_template_path( $field );
1010
+
1011
  if ( $field_template ) {
1012
  if ( !$echo )
1013
  ob_start();
1036
  return false;
1037
 
1038
  $field_template = YIT_CORE_PLUGIN_TEMPLATE_PATH . '/fields/' . sanitize_title( $field[ 'type' ] ) . '.php';
1039
+
1040
  $field_template = apply_filters( 'yith_plugin_fw_get_field_template_path', $field_template, $field );
1041
 
1042
  return file_exists( $field_template ) ? $field_template : false;
1242
  }
1243
  }
1244
 
1245
+ if ( ! function_exists( 'yith_set_wrapper_class' ) ) {
1246
+ /**
1247
+ * Return the class for the new plugin panel style.
1248
+ *
1249
+ * @param $class array|string the list of additional classes to add inside the panel wrapper.
1250
+ *
1251
+ * @return string
1252
+ *
1253
+ * @author Emanuela Castorina
1254
+ */
1255
+ function yith_set_wrapper_class( $class = '' ) {
1256
+ $new_class = 'yith-plugin-ui';
1257
+ $class = ( ! empty( $class ) && is_array( $class ) ) ? implode( ' ', $class ) : $class;
1258
+
1259
+ return $new_class . ' ' . $class;
1260
+ }
1261
+ }
1262
+
1263
+ if( ! function_exists('yith_get_date_format') ){
1264
+ /**
1265
+ * get all available date format
1266
+ * @since 3.1
1267
+ * @author Salvatore Strano
1268
+ * @return array
1269
+ */
1270
+
1271
+ function yith_get_date_format( $js = true ){
1272
+
1273
+ $date_formats = array(
1274
+ 'F j, Y' => 'F j, Y',
1275
+ 'Y-m-d' => 'Y-m-d',
1276
+ 'm/d/Y' => 'm/d/Y',
1277
+ 'd/m/Y' => 'd/m/Y',
1278
+ );
1279
+
1280
+ if( $js ){
1281
+ $date_formats = array(
1282
+ 'MM d, yy' => 'F j, Y',
1283
+ 'yy-mm-dd' => 'Y-m-d',
1284
+ 'mm/dd/yy' => 'm/d/Y',
1285
+ 'dd/mm/yy' => 'd/m/Y',
1286
+ );
1287
+ }
1288
+
1289
+ return apply_filters( 'yith_plugin_fw_date_formats', $date_formats, $js) ;
1290
+ }
1291
+ }
1292
+
1293
+
1294
+ if( ! function_exists('yith_format_toggle_title') ) {
1295
+ /**
1296
+ * replace the placeholders with the values of the element id
1297
+ * for toggle element field.
1298
+ *
1299
+ * @return array
1300
+ * @author Salvatore Strano
1301
+ * @since 3.1
1302
+ */
1303
+
1304
+ function yith_format_toggle_title( $title, $value ) {
1305
+ preg_match_all( '/(?<=\%%).+?(?=\%%)/', $title, $matches );
1306
+ if ( isset( $matches[0] ) ) {
1307
+ foreach ( $matches[0] as $element_id ) {
1308
+ if ( isset( $value[ $element_id ] ) ) {
1309
+ $title = str_replace( '%%' . $element_id . '%%', $value[ $element_id ], $title );
1310
+ }
1311
+ }
1312
+ }
1313
+
1314
+ return $title;
1315
+ }
1316
+ }
1317
+
1318
  if( ! function_exists( 'yith_plugin_fw_load_update_and_licence_files' ) ){
1319
  /**
1320
  * Load premium file for license and update system
1344
  }
1345
  }
1346
 
1347
+ if( ! empty( $plugin_upgrade_fw_data ) && is_array( $plugin_upgrade_fw_data ) ){
1348
  foreach ( $plugin_upgrade_fw_data as $fw_version=> $core_files ){
1349
  foreach ( $core_files as $core_file ){
1350
  if( file_exists( $core_file ) ){
1354
  }
1355
  }
1356
  }
1357
+ }
1358
+
1359
+ if ( ! function_exists( 'yith_plugin_fw_remove_duplicate_classes' ) ) {
1360
+ /**
1361
+ * Remove the duplicate classes from a string.
1362
+ *
1363
+ * @param $classes string
1364
+ *
1365
+ * @return string
1366
+ *
1367
+ * @since 3.2.2
1368
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
1369
+ */
1370
+ function yith_plugin_fw_remove_duplicate_classes( $classes ) {
1371
+ $class_array = explode( ' ', $classes );
1372
+ $class_unique = array_unique( array_filter( $class_array ) );
1373
+ if ( $class_unique ) {
1374
+ $classes = implode( ' ', $class_unique );
1375
+ }
1376
+
1377
+ return $classes;
1378
+ }
1379
  }
plugin-fw/yit-plugin.php CHANGED
@@ -39,6 +39,7 @@ include_once( 'lib/yit-debug.php');
39
  include_once( 'lib/yith-dashboard.php' );
40
  include_once( 'lib/privacy/yit-privacy.php' );
41
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
 
42
 
43
  /* === Gutenberg Support === */
44
  if( class_exists( 'WP_Block_Type_Registry' ) ){
39
  include_once( 'lib/yith-dashboard.php' );
40
  include_once( 'lib/privacy/yit-privacy.php' );
41
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
42
+ include_once( 'lib/promo/yith-promo.php' );
43
 
44
  /* === Gutenberg Support === */
45
  if( class_exists( 'WP_Block_Type_Registry' ) ){