YITH Essential Kit for WooCommerce #1 - Version 2.0.6

Version Description

  • Released on 12th June, 2019 =

  • Update: YITH Plugin Framework

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH Essential Kit for WooCommerce #1
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

Files changed (39) hide show
  1. README.txt +5 -2
  2. init.php +1 -1
  3. plugin-fw/assets/css/metaboxes.css +18 -1
  4. plugin-fw/assets/css/yith-fields.css +1393 -9
  5. plugin-fw/assets/fonts/yith-icon.eot +0 -0
  6. plugin-fw/assets/fonts/yith-icon.svg +26 -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 +618 -346
  15. plugin-fw/assets/js/yith-fields.min.js +1 -15
  16. plugin-fw/init.php +9 -1
  17. plugin-fw/lib/promo/black.jpg +0 -0
  18. plugin-fw/lib/promo/cyber.jpg +0 -0
  19. plugin-fw/lib/promo/halloween.jpg +0 -0
  20. plugin-fw/lib/promo/yith-promo.php +189 -0
  21. plugin-fw/lib/promo/yith-promo.xml +64 -0
  22. plugin-fw/lib/yit-assets.php +8 -3
  23. plugin-fw/lib/yit-metabox.php +127 -34
  24. plugin-fw/lib/yit-plugin-panel-wc.php +123 -4
  25. plugin-fw/lib/yit-plugin-panel.php +106 -2
  26. plugin-fw/templates/fields/date-format.php +56 -0
  27. plugin-fw/templates/fields/list-table.php +59 -0
  28. plugin-fw/templates/fields/multi-colorpicker.php +39 -0
  29. plugin-fw/templates/fields/onoff.php +1 -1
  30. plugin-fw/templates/fields/text.php +1 -0
  31. plugin-fw/templates/fields/textarea.php +3 -1
  32. plugin-fw/templates/fields/toggle-element.php +264 -0
  33. plugin-fw/templates/fields/upload.php +3 -3
  34. plugin-fw/templates/metaboxes/field-row.php +1 -0
  35. plugin-fw/templates/metaboxes/tab.php +6 -2
  36. plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php +1 -1
  37. plugin-fw/templates/panel/woocommerce/woocommerce-panel.php +7 -3
  38. plugin-fw/yit-functions.php +98 -1
  39. plugin-fw/yit-plugin.php +1 -0
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
5
  Requires at least: 3.5.1
6
  Tested up to: 5.2
7
- Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -151,10 +151,13 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
151
 
152
  == Changelog ==
153
 
154
- = 2.0.5 - Released on 07th June, 2019 =
155
 
156
  * Update: YITH Plugin Framework
157
 
 
 
 
158
 
159
  = 2.0.4 =
160
 
4
  Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
5
  Requires at least: 3.5.1
6
  Tested up to: 5.2
7
+ Stable tag: 2.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
151
 
152
  == Changelog ==
153
 
154
+ = 2.0.6 - Released on 12th June, 2019 =
155
 
156
  * Update: YITH Plugin Framework
157
 
158
+ = 2.0.5 - Released on 07th June, 2019 =
159
+
160
+ * Update: YITH Plugin Framework
161
 
162
  = 2.0.4 =
163
 
init.php CHANGED
@@ -7,7 +7,7 @@
7
  * Domain Path: /languages/
8
  * Author: YITH
9
  * Author URI: https://yithemes.com/
10
- * Version: 2.0.5
11
  * WC requires at least: 2.5.0
12
  * WC tested up to: 3.6
13
  * @author YITHEMES
7
  * Domain Path: /languages/
8
  * Author: YITH
9
  * Author URI: https://yithemes.com/
10
+ * Version: 2.0.6
11
  * WC requires at least: 2.5.0
12
  * WC tested up to: 3.6
13
  * @author YITHEMES
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,1388 @@ 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
+
497
+ .yith-plugin-fw-banner{
498
+ width: 100%;
499
+ height: 75px;
500
+ background: url('../images/banner-premium.png');
501
+ }
502
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free{
503
+ height: 290px;
504
+ background: url('../images/banner-free.png') no-repeat;
505
+ }
506
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free h1{
507
+ max-width: auto;
508
+ text-align:left;
509
+ margin-left: 110px;
510
+ padding-top: 15px;
511
+ padding-bottom: 8px;
512
+ }
513
+
514
+ .yith-plugin-fw-banner h1{
515
+ text-transform: uppercase;
516
+ color: #0c5777;
517
+ font-size: 15px;
518
+ padding-left: 150px;
519
+ font-weight: 700;
520
+ text-align: left;
521
+ display: inline-block;
522
+ box-sizing: border-box;
523
+ }
524
+
525
+ .yith-plugin-fw-banner span{
526
+ font-style:italic;
527
+ display: block;
528
+ font-size: 15px;
529
+ color:#214249;
530
+ text-transform:none;
531
+ text-align: right;
532
+ }
533
+
534
+ .yith-plugin-fw-banner a,
535
+ .yith-plugin-fw-banner a:focus{
536
+ text-decoration: none;
537
+ outline: none;
538
+ box-shadow: none;
539
+ }
540
+
541
+ .yith-banners ul{
542
+ list-style: none;
543
+ margin-left: 10px;
544
+ }
545
+
546
+ .yith-banners ul li{
547
+ display: inline-block;
548
+ margin-left: 10px;
549
+ }
550
+ .yith-plugin-ui a{
551
+ outline: none;
552
+ box-shadow: none;
553
+ }
554
+
555
+ .yith-plugin-ui{
556
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
557
+ }
558
+
559
+ .yith-plugin-ui #wpwrap h2.nav-tab-wrapper, .yith-plugin-ui #wpbody-content h2.nav-tab-wrapper{
560
+ margin-top:10px;
561
+ }
562
+
563
+ .yith-plugin-ui .nav-tab{
564
+ margin-left: 0px;
565
+ margin-right: 2px;
566
+ background-color: #336374;
567
+ color: #fff;
568
+ font-size: 13px;
569
+ padding: 7px 20px;
570
+ border: 0;
571
+ }
572
+ .yith-plugin-ui .nav-tab:first-child{
573
+ border-left: 1px solid #d9d9d9;
574
+ }
575
+
576
+ .yith-plugin-ui .nav-tab.yith-premium{
577
+ background-color: #be421c;
578
+ }
579
+ .yith-plugin-ui .nav-tab-active{
580
+ background-color: #fff;
581
+ color: #336374;
582
+ border-bottom:1px solid #fff;
583
+ }
584
+ .yith-plugin-ui .nav-tab-active.yith-premium{
585
+ background-color: #fff;
586
+ color: #be421c;
587
+ }
588
+ .yith-plugin-ui #plugin-fw-wc{
589
+ padding-top: 0px;
590
+ }
591
+
592
+ .yith-plugin-ui .form-table td{
593
+ padding: 15px 20px;
594
+ }
595
+
596
+ .yith-plugin-ui label{
597
+ color: #33373b;
598
+ font-size: 13px;
599
+ }
600
+
601
+ .yith-plugin-ui span.description{
602
+ color: #716269;
603
+ font-size: 11px;
604
+ font-style: normal;
605
+ font-weight: 400;
606
+ margin-top: 15px;
607
+ margin-left: 0;
608
+ }
609
+ #wpwrap .yith-plugin-ui h2.nav-tab-wrapper, #wpbody-content .yith-plugin-ui h2.nav-tab-wrapper {
610
+ border: 0;
611
+ border-bottom : 1px solid #ccc;
612
+ margin-right: 15px;
613
+ background-color: transparent;
614
+ padding-left: 0;
615
+ }
616
+ .yith-plugin-ui #plugin-fw-wc table.form-table,
617
+ .yith-plugin-ui #yith-plugin-fw-panel table.form-table,
618
+ .yith-plugin-ui table.form-table{
619
+ border: 1px solid #d8d8d8;
620
+ border-top: 0;
621
+ margin-bottom: 40px;
622
+ }
623
+
624
+ .yith-plugin-ui #wpwrap h2.nav-tab-wrapper, .yith-plugin-ui #wpbody-content h2.nav-tab-wrapper{
625
+ background-color: transparent;
626
+ border: 0;
627
+ text-transform: none;
628
+ border-bottom: 1px solid #ddd;
629
+ }
630
+
631
+ .yith-plugin-ui h2 {
632
+ color: #2a8db0;
633
+ font-size: 13px;
634
+ text-transform: uppercase;
635
+ border: 1px solid #d8d8d8;
636
+ border-bottom: 0;
637
+ background-color: #fff;
638
+ padding: 35px 20px;
639
+ margin: 0px;
640
+ }
641
+ .yith-plugin-ui .yith-plugin-fw-custom-tab h2{
642
+ border: 0px solid #d8d8d8;
643
+ padding-left: 0;
644
+ }
645
+
646
+ .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 {
647
+ padding: 30px 20px;
648
+ }
649
+
650
+ .yith-plugin-ui #plugin-fw-wc h2 + div {
651
+ background: #fff;
652
+ border-left: 1px solid #d9d9d9;
653
+ border-right: 1px solid #d9d9d9;
654
+ margin: -20px 0 0 0;
655
+ padding-left: 20px;
656
+ padding-bottom: 5px;
657
+ }
658
+
659
+ .yith-plugin-ui #plugin-fw-wc h2 + div p, .yith-plugin-ui p.info-box{
660
+ background: #f1f1f1;
661
+ font-size: 12px;
662
+ font-weight: 700;
663
+ width: 40%;
664
+ display:block;
665
+ padding: 15px;
666
+ margin-bottom: 0;
667
+ }
668
+
669
+ .yith-plugin-ui #plugin-fw-wc h2 + div p:before, .yith-plugin-ui p.info-box:before{
670
+ content: "\e90e";
671
+ font-family: yith-icon;
672
+ font-size: 30px;
673
+ font-weight: normal;
674
+ display: block;
675
+ margin-top: -5px;
676
+ float: left;
677
+ margin-right: 15px;
678
+ }
679
+
680
+ .yith-plugin-ui h2:first-child{
681
+ border-top: 0;
682
+ }
683
+
684
+ /*** Icon ***/
685
+ .yith-plugin-ui span.yith-icon {
686
+ margin-left: -36px;
687
+ line-height: 36px;
688
+ font-size: 20px;
689
+ }
690
+
691
+ /*** General Input Style ***/
692
+
693
+ .yith-plugin-ui .yith-plugin-fw select,
694
+ .yith-plugin-ui textarea,
695
+ .yith-plugin-ui input[type=number],
696
+ .yith-plugin-ui.metaboxes-tab input[type=number],
697
+ .yith-plugin-ui input[type=text],
698
+ .yith-plugin-ui input[type=text],
699
+ .yith-plugin-ui input[type=email],
700
+ .yith-plugin-ui input[type=password],
701
+ .yith-plugin-fw.yith-plugin-ui input[type=text]:not(.select2-search__field),
702
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text]:not(.select2-search__field),
703
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table select,
704
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table textarea,
705
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=number],
706
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text] {
707
+ border: 1px solid #d8d8d8;
708
+ border-radius: 8px;
709
+ padding: 8px 10px;
710
+ height: 38px;
711
+ min-width: 90px;
712
+ box-shadow: none;
713
+ color: #716269;
714
+ }
715
+ .yith-plugin-ui textarea,
716
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table textarea{
717
+ height: auto;
718
+ }
719
+ .yith-plugin-ui table.form-table input[type=text].wp-color-picker,
720
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].wp-color-picker{
721
+ border: 0;
722
+ height: 30px;
723
+ }
724
+
725
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].small-text,
726
+ .yith-plugin-ui input[type=text].small-text {
727
+ width: 100px;
728
+ height: 25px;
729
+ border: 1px solid #d9d9d9;
730
+ }
731
+
732
+ .yith-plugin-ui textarea {
733
+ height: auto;
734
+ padding: 8px;
735
+ }
736
+
737
+ .yith-plugin-ui select:focus,
738
+ .yith-plugin-ui input[type=text]:focus {
739
+ border-color: #a7d9ec;
740
+ }
741
+
742
+ .woocommerce .yith-plugin-ui table.form-table select,
743
+ .yith-plugin-ui select{
744
+ -webkit-appearance: none;
745
+ line-height: 1;
746
+ min-height: 35px;
747
+ background: url("../images/arrow_down.svg") no-repeat right center;
748
+ background-size: 35px 13px;
749
+ border-radius: 8px;
750
+ }
751
+
752
+ .yith-plugin-ui .form-table th{
753
+ width: 280px;
754
+ padding-right: 50px;
755
+ }
756
+
757
+ /** BUTTONS **/
758
+ .yith-plugin-ui .tablenav .button.action,
759
+ .wp-core-ui .yith-plugin-ui .button-primary,
760
+ .wp-core-ui .yith-plugin-ui .button-secondary,
761
+ .yith-plugin-ui .yith-add-button,
762
+ .yith-plugin-ui .yith-save-button,
763
+ .yith-plugin-ui .yith-edit-button,
764
+ .yith-plugin-ui .yith-update-button,
765
+ .yith-plugin-ui .yith-plugin-fw-select-all,
766
+ .yith-plugin-ui .yith-plugin-fw-deselect-all,
767
+ .yith-plugin-ui .yith-plugin-fw-upload-button,
768
+ .yith-plugin-ui .yith-plugin-fw-upload-button-reset {
769
+ border-radius: 3px;
770
+ text-transform: uppercase;
771
+ box-shadow: none;
772
+ border: 0;
773
+ font-weight: 700;
774
+ font-size: 11px;
775
+ padding: 0px 14px;
776
+ outline: none;
777
+ height: auto;
778
+ transition: all ease 0.3s;
779
+ background-color: #d6d6d6;
780
+ color: #656565;
781
+ text-shadow: none;
782
+ vertical-align: middle;
783
+ line-height: 26px;
784
+ display: inline-block;
785
+ text-decoration: none;
786
+ }
787
+ .wp-core-ui .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button-reset,
788
+ .wp-core-ui .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button,
789
+ .yith-plugin-ui .yith-plugin-fw-upload-button-reset,
790
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button-reset,
791
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button{
792
+ height: 38px;
793
+ }
794
+
795
+ .wp-core-ui .yith-plugin-ui .button:focus,
796
+ .wp-core-ui .yith-plugin-ui .button-primary:focus,
797
+ .yith-plugin-ui .yith-add-button:focus,
798
+ .yith-plugin-ui .yith-save-button:focus,
799
+ .yith-plugin-ui .yith-edit-button:focus,
800
+ .yith-plugin-ui .yith-update-button:focus,
801
+ .wp-core-ui .yith-plugin-ui .button-secondary:focus{
802
+ outline: none;
803
+ box-shadow: none;
804
+ }
805
+
806
+ /** button with inside a span with icon class */
807
+ .yith-plugin-ui .button-secondary span.yith-icon{
808
+ margin-left: 0px;
809
+ margin-right: 10px;
810
+ line-height: normal;
811
+ }
812
+
813
+ .yith-plugin-ui .button-secondary span.yith-icon:before{
814
+ color: #656565;
815
+ font-size: 15px;
816
+ }
817
+
818
+ .yith-plugin-ui .tablenav .button.action,
819
+ .wp-core-ui .yith-plugin-ui .button:focus,
820
+ .wp-core-ui .yith-plugin-ui .button-secondary:focus,
821
+ .yith-plugin-ui .yith-save-button:hover,
822
+ .wp-core-ui .yith-plugin-ui .button-secondary:hover,
823
+ .yith-plugin-ui .yith-plugin-fw-upload-button-reset:hover{
824
+ background-color: #cacaca;
825
+ color: #515151;
826
+ }
827
+
828
+ .wp-core-ui .yith-plugin-ui .button-primary,
829
+ .yith-plugin-ui .tablenav .button.action,
830
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-select-all,
831
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-upload-button{
832
+ background-color: #007694;
833
+ color: #fff;
834
+ }
835
+
836
+ .yith-plugin-ui .tablenav .button.action:active,
837
+ .yith-plugin-ui .tablenav .button.action:focus,
838
+ .yith-plugin-ui .tablenav .button.action:hover,
839
+ .yith-plugin-ui .yith-add-button,
840
+ .wp-core-ui .yith-plugin-ui .button-primary:focus,
841
+ .wp-core-ui .yith-plugin-ui .button-primary:hover{
842
+ background-color: #375f6b;
843
+ color: #fff;
844
+ }
845
+
846
+
847
+ .yith-plugin-ui .yith-add-button:hover,
848
+ .wp-core-ui .yith-plugin-ui .yith-plugin-fw-upload-button:focus,
849
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-select-all:hover,
850
+ .yith-plugin-ui .button-secondary.yith-plugin-fw-select-all:focus,
851
+ .yith-plugin-ui .yith-plugin-fw-upload-button:hover{
852
+ border-color: #007694;
853
+ background: #007694;
854
+ color: #fff;
855
+ line-height: 26px;
856
+ margin-left: 0;
857
+ }
858
+
859
+ .yith-plugin-ui .button-primary:before,
860
+ .yith-plugin-ui .yith-add-button:before,
861
+ .yith-plugin-ui .yith-save-button:before,
862
+ .yith-plugin-ui .yith-edit-button:before,
863
+ .yith-plugin-ui .yith-update-button:before,
864
+ .yith-plugin-ui .button-secondary:before{
865
+ font-family: 'yith-icon';
866
+ font-size: 10px;
867
+ font-weight: 700;
868
+ margin-right: 10px;
869
+ vertical-align: bottom;
870
+ display:inline-block;
871
+ }
872
+
873
+ /** yith-edit-button **/
874
+ .yith-plugin-ui .yith-edit-button {
875
+ background-color: #7f9298;
876
+ color: #fff;
877
+ }
878
+ .yith-plugin-ui .yith-edit-button:focus,
879
+ .yith-plugin-ui .yith-edit-button:hover {
880
+ background-color: #718085;
881
+ color: #fff;
882
+ }
883
+ .yith-plugin-ui .yith-edit-button:before{
884
+ content: "\e907";
885
+ }
886
+ /** yith-update-button **/
887
+ .yith-plugin-ui .yith-update-button {
888
+ background-color: #94aa09;
889
+ color: #fff;
890
+ }
891
+ .yith-plugin-ui .yith-update-button:focus,
892
+ .yith-plugin-ui .yith-update-button:hover {
893
+ background-color: #7a9009;
894
+ color: #fff;
895
+ }
896
+ .yith-plugin-ui .yith-update-button:before{
897
+ content: "\e90b";
898
+ font-size: 15px;
899
+ }
900
+
901
+ /** yith-save-button **/
902
+
903
+ .yith-plugin-ui .yith-save-button {
904
+ background-color: #267390;
905
+ color: #fff;
906
+ }
907
+ .yith-plugin-ui .yith-save-button:focus,
908
+ .yith-plugin-ui .yith-save-button:hover {
909
+ background-color: #1c4863;
910
+ color: #fff;
911
+ }
912
+ .yith-plugin-ui .yith-save-button:before{
913
+ content: "\e905";
914
+ }
915
+
916
+ /** yith-remove-button **/
917
+
918
+ .yith-plugin-ui .button-secondary.yith-remove-button:before{
919
+ content: "\e90d";
920
+ font-size: 15px;
921
+ }
922
+
923
+
924
+ /** yith-add-button **/
925
+
926
+ .yith-plugin-ui .yith-add-button:before{
927
+ content: "\e90a";
928
+ }
929
+
930
+ /** yith-plugin-fw-upload-button **/
931
+ .yith-plugin-ui button.yith-plugin-fw-upload-button:before{
932
+ content: "\e90c";
933
+ font-family: 'yith-icon';
934
+ font-size: 19px;
935
+ font-weight: 400;
936
+ margin-right: 10px;
937
+ vertical-align: middle;
938
+ display:inline-block;
939
+ }
940
+ /** SELECT 2 **/
941
+ .yith-plugin-ui .select2-container,
942
+ .yith-plugin-ui .select2-selection--single{
943
+ height: auto;
944
+ padding: 2px;
945
+ outline: none;
946
+ }
947
+
948
+ .yith-plugin-ui .select2-selection--single{
949
+ margin: 0;
950
+ border: 0;
951
+ }
952
+
953
+ /* old panel*/
954
+
955
+ .yith-plugin-ui span.select2.select2-container.select2-container--default{
956
+ border: 1px solid #d8d8d8;
957
+ border-radius:8px;
958
+ }
959
+ .yith-plugin-ui span.select2.select2-container.select2-container--default:hover,
960
+ .yith-plugin-ui span.select2.select2-container.select2-container--default:active,
961
+ .yith-plugin-ui span.select2.select2-container.select2-container--default:focus {
962
+ border-color: #a7d9ec;
963
+ }
964
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
965
+ color: #fff;
966
+ }
967
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].select2-search__field,
968
+ .yith-plugin-ui .yith-plugin-fw table.form-table input.select2-search__field{
969
+ border: 0;
970
+ padding: 0;
971
+ height: initial;
972
+ }
973
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice,
974
+ .yith-plugin-ui .select2-selection__choice{
975
+ color: #fff;
976
+ background-color: #4e8ba2;
977
+ border-radius: 12px;
978
+ padding: 3px 11px;
979
+ border-color: #33937e;
980
+ font-size: 12px;
981
+ }
982
+
983
+ .yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before{
984
+ content: "\e900";
985
+ font-family: 'yith-icon' !important;
986
+ line-height: 36px;
987
+ color: #d9d9d9;
988
+ }
989
+
990
+ .yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow b{
991
+ display: none;
992
+ }
993
+ .yith-plugin-ui .select2-container--open .select2-dropdown--below,
994
+ .yith-plugin-ui .select2-container--open .select2-dropdown--above,
995
+ .yith-plugin-fw-panel .select2-container--open .select2-dropdown--below,
996
+ .yith-plugin-fw-panel .select2-container--open .select2-dropdown--above {
997
+ margin-top: 10px;
998
+ border-radius: 8px;
999
+ box-shadow:0 2px 4px 0 rgba(0,0,0,0.12),0 2px 10px 0 rgba(0,0,0,0.12) !important;
1000
+ }
1001
+ .yith-plugin-ui .select2-container--open .select2-dropdown--above,
1002
+ .yith-plugin-fw-panel .select2-container--open .select2-dropdown--above{
1003
+ margin-top: -10px;
1004
+ }
1005
+ .yith-plugin-ui .select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
1006
+ .yith-plugin-ui .select2-container--default.select2-container--open.select2-container--above .select2-selection--single,
1007
+ .yith-plugin-fw-panel .select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
1008
+ .yith-plugin-fw-panel .select2-container--default.select2-container--open.select2-container--above .select2-selection--single{
1009
+ border-radius: 8px;
1010
+ }
1011
+ .yith-plugin-ui .select2-results .select2-results__group, .select2-results .select2-results__option:first-child,
1012
+ .yith-plugin-fw-panel .select2-results .select2-results__group, .select2-results .select2-results__option:first-child{
1013
+ border-top-left-radius: 8px;
1014
+ border-top-right-radius: 8px;
1015
+ }
1016
+ .yith-plugin-ui .select2-results .select2-results__group,
1017
+ .yith-plugin-ui .select2-results .select2-results__option:last-child,
1018
+ .yith-plugin-fw-panel .select2-results .select2-results__group,
1019
+ .yith-plugin-fw-panel .select2-results .select2-results__option:last-child{
1020
+ border-bottom-left-radius: 8px;
1021
+ border-bottom-right-radius: 8px;
1022
+ }
1023
+ .yith-plugin-ui .select2-container--default .select2-results__option[data-selected=true],
1024
+ .yith-plugin-ui .select2-container--default .select2-results__option[aria-selected=true],
1025
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option[data-selected=true],
1026
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option[aria-selected=true] {
1027
+ background-color: #fff;
1028
+ outline: none;
1029
+ }
1030
+ .yith-plugin-ui .select2-container--default .select2-results__option--highlighted[aria-selected],
1031
+ .yith-plugin-ui .select2-container--default .select2-results__option--highlighted[data-selected],
1032
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option--highlighted[aria-selected],
1033
+ .yith-plugin-fw-panel .select2-container--default .select2-results__option--highlighted[data-selected]{
1034
+ background-color: #e8eff1;
1035
+ color: #4e8ba2;
1036
+ outline: none;
1037
+ }
1038
+
1039
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
1040
+ .yith-plugin-fw-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
1041
+ float: right;
1042
+ padding-left: 15px;
1043
+ text-indent: -9999px;
1044
+ }
1045
+
1046
+
1047
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after,
1048
+ .woocommerce .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after,
1049
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after{
1050
+ float: right;
1051
+ color: #fff;
1052
+ content: "\e906";
1053
+ font-family: 'yith-icon' !important;
1054
+ font-size: 9px;
1055
+ line-height: 21px;
1056
+ text-indent: 0;
1057
+ }
1058
+
1059
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after{
1060
+ color: #000;
1061
+ }
1062
+
1063
+ .yith-plugin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after
1064
+ .yith-plugin-fw-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:after{
1065
+ color: #000;
1066
+ }
1067
+ .yith-plugin-ui .select2-container .select2-selection--multiple,
1068
+ .yith-plugin-ui .select2-container--default.select2-container--focus .select2-selection--multiple{
1069
+ border: 0;
1070
+ }
1071
+
1072
+ .yith-plugin-fw .select2-search input[type=text]{
1073
+ border: 0;
1074
+ padding: 0;
1075
+ height: auto;
1076
+ }
1077
+ .yith-plugin-ui .yith-plugin-fw-select-field-wrapper span.yith-icon.icon-magnifier,
1078
+ .yith-plugin-fw-panel .yith-plugin-fw-select-field-wrapper span.yith-icon.icon-magnifier {
1079
+ position: absolute;
1080
+ padding-top: 5px;
1081
+ }
1082
+
1083
+ .yith-plugin-ui input[type=text].select2-search__field{
1084
+ border: 0;
1085
+ padding: 0;
1086
+ height: 30px;
1087
+ }
1088
+ .yith-plugin-ui .select2-container--default .select2-search--dropdown .select2-search__field,
1089
+ .yith-plugin-fw-panel .select2-container--default .select2-search--dropdown .select2-search__field {
1090
+ border: 1px solid #d9d9d9;
1091
+ border-radius: 8px;
1092
+ box-shadow: none;
1093
+ }
1094
+ .yith-plugin-ui .select2-dropdown,
1095
+ .yith-plugin-fw-panel .select2-dropdown{
1096
+ border: 1px solid #d9d9d9;
1097
+ }
1098
+ /** RADIO BUTTON **/
1099
+ .yith-plugin-ui [type="radio"]:checked,
1100
+ .yith-plugin-ui [type="radio"]:not(:checked) {
1101
+ position: absolute;
1102
+ left: -9999px;
1103
+ }
1104
+ .yith-plugin-ui [type="radio"]:checked + label,
1105
+ .yith-plugin-ui [type="radio"]:not(:checked) + label
1106
+ {
1107
+ position: relative;
1108
+ padding-left: 35px;
1109
+ cursor: pointer;
1110
+ line-height: 20px;
1111
+ display: inline-block;
1112
+ color: #716269;
1113
+ font-size: 12px;
1114
+ }
1115
+ .yith-plugin-ui [type="radio"]:checked + label:before,
1116
+ .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
1117
+ content: '';
1118
+ position: absolute;
1119
+ left: 0;
1120
+ top: 0;
1121
+ width: 18px;
1122
+ height: 18px;
1123
+ border: 1px solid #d8d8d8;
1124
+ border-radius: 100%;
1125
+ background: #fff;
1126
+ }
1127
+ .yith-plugin-ui [type="radio"]:checked + label:after,
1128
+ .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
1129
+ content: '';
1130
+ width: 12px;
1131
+ height: 12px;
1132
+ background: #4e8ba2;
1133
+ position: absolute;
1134
+ top: 4px;
1135
+ left: 4px;
1136
+ border-radius: 100%;
1137
+ -webkit-transition: all 0.2s ease;
1138
+ transition: all 0.2s ease;
1139
+ }
1140
+ .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
1141
+ opacity: 0;
1142
+ -webkit-transform: scale(0);
1143
+ transform: scale(0);
1144
+ }
1145
+ .yith-plugin-ui [type="radio"]:checked + label:after {
1146
+ opacity: 1;
1147
+ -webkit-transform: scale(1);
1148
+ transform: scale(1);
1149
+ }
1150
+
1151
+ /** CHECKBOX **/
1152
+ .yith-plugin-ui input[type="checkbox"] {
1153
+ -webkit-appearance: none;
1154
+ background-color: #fff;
1155
+ border: 1px solid #d8d8d8;
1156
+ box-shadow: none;
1157
+ width: 18px;
1158
+ height: 18px;
1159
+ border-radius: 3px;
1160
+ display: inline-block;
1161
+ position: relative;
1162
+ }
1163
+ .yith-plugin-ui input[type="checkbox"]:checked{
1164
+ background-color: #4e8ba2;
1165
+ border-color: #488197;
1166
+ }
1167
+ .yith-plugin-ui .forminp-checkbox span.description.inline {
1168
+ margin-left: 10px;
1169
+ }
1170
+ .yith-plugin-ui input[type="checkbox"]:checked:before{
1171
+ display: none;
1172
+ }
1173
+
1174
+ .yith-plugin-ui input[type="checkbox"]:checked:after {
1175
+ content: "\e905";
1176
+ font-family: 'yith-icon';
1177
+ font-size: 15px;
1178
+ position: absolute;
1179
+ top: 8px;
1180
+ left: 1px;
1181
+ color: #fff;
1182
+ }
1183
+
1184
+ /** ONOFF **/
1185
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input[type="checkbox"] {
1186
+ display: none;
1187
+ }
1188
+
1189
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span{
1190
+ border: 1px solid #d8d8d8;
1191
+ background-color: #fff;
1192
+ width:50px;
1193
+ }
1194
+
1195
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before{
1196
+ background-color: #d8d8d8;
1197
+ }
1198
+
1199
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
1200
+ width: 14px;
1201
+ height: 14px;
1202
+ top: 3px;
1203
+ left: 4px;
1204
+ background-color: #d8d8d8;
1205
+ }
1206
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after{
1207
+ content: 'OFF';
1208
+ width: 14px;
1209
+ height: 14px;
1210
+ font-size: 10px;
1211
+ padding-left:24px;
1212
+ color: #979797;
1213
+ }
1214
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span,
1215
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input.onoffchecked + span{
1216
+ background-color: #fff;
1217
+ border-color: #98aa36;
1218
+ }
1219
+
1220
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
1221
+ .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before{
1222
+ background-color: #98aa36;
1223
+ left:32px;
1224
+ }
1225
+
1226
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
1227
+ .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after{
1228
+ content: 'ON';
1229
+ color: #98aa36;
1230
+ width: 14px;
1231
+ height: 14px;
1232
+ display: inline-block;
1233
+ font-size: 10px;
1234
+ padding: 0 10px;
1235
+ }
1236
+
1237
+ .yith-plugin-ui .yith-plugin-fw-onoff-container input + span{
1238
+ text-indent: 0;
1239
+ }
1240
+
1241
+
1242
+ /**
1243
+ DATEPICKER
1244
+ */
1245
+ .yith-plugin-ui div#ui-datepicker-div,
1246
+ .yith-plugin-fw-panel div#ui-datepicker-div {
1247
+ border: 0;
1248
+ box-shadow:0 2px 4px 0 rgba(0,0,0,0.12),0 2px 10px 0 rgba(0,0,0,0.12) !important;
1249
+ }
1250
+
1251
+ .yith-plugin-ui .ui-datepicker-header.ui-widget-header,
1252
+ .yith-plugin-fw-panel .ui-datepicker-header.ui-widget-header {
1253
+ background:#4e8ba2;
1254
+ color: #fff;
1255
+ font-size: 11px;
1256
+ line-height: 25px;
1257
+ border:0;
1258
+ min-height: 25px;
1259
+ }
1260
+ .yith-plugin-ui .ui-datepicker-title,
1261
+ .yith-plugin-fw-panel .ui-datepicker-title{
1262
+ line-height: 25px;
1263
+ }
1264
+ .yith-plugin-ui .ui-datepicker th,
1265
+ .yith-plugin-fw-panel .ui-datepicker th{
1266
+ color: #716269;
1267
+ }
1268
+ .yith-plugin-ui .ui-widget-header .ui-icon,
1269
+ .yith-plugin-ui .ui-widget-header .ui-state-hover,
1270
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-prev,
1271
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-next,
1272
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-w,
1273
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-e,
1274
+ .yith-plugin-fw-panel .ui-widget-header .ui-icon,
1275
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-hover,
1276
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-prev,
1277
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-next,
1278
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-w,
1279
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-e{
1280
+ background: none;
1281
+ content: "";
1282
+ border: 0;
1283
+ text-indent: 0;
1284
+ width:15px;
1285
+ height: 20px;
1286
+ display:block;
1287
+ overflow:hidden;
1288
+ }
1289
+
1290
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-w:before,
1291
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-w:before {
1292
+ content: "\e901";
1293
+ color: #fff;
1294
+ font-family: 'yith-icon';
1295
+ font-size: 12px;
1296
+ font-weight: normal;
1297
+ width:15px;
1298
+ display:block;
1299
+ }
1300
+ .yith-plugin-ui .ui-icon.ui-icon-circle-triangle-e:before,
1301
+ .yith-plugin-fw-panel .ui-icon.ui-icon-circle-triangle-e:before {
1302
+ content: "\e902";
1303
+ color: #fff;
1304
+ text-indent: 0;
1305
+ font-family: 'yith-icon';
1306
+ font-size: 12px;
1307
+ font-weight: normal;
1308
+ width:15px;
1309
+ display:block;
1310
+ }
1311
+
1312
+ /* arrow */
1313
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-prev,
1314
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-next,
1315
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-prev-hover,
1316
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-next-hover,
1317
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-prev,
1318
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-next,
1319
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-prev-hover,
1320
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-next-hover{
1321
+ top: 1px;
1322
+ cursor: pointer;
1323
+ }
1324
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-prev,
1325
+ .yith-plugin-ui .ui-datepicker-prev.ui-datepicker-prev-hover,
1326
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-prev,
1327
+ .yith-plugin-fw-panel .ui-datepicker-prev.ui-datepicker-prev-hover{
1328
+ left: 5px;
1329
+ }
1330
+ .yith-plugin-ui .ui-datepicker .ui-datepicker-next,
1331
+ .yith-plugin-ui .ui-datepicker-next.ui-datepicker-next-hover,
1332
+ .yith-plugin-fw-panel .ui-datepicker .ui-datepicker-next,
1333
+ .yith-plugin-fw-panel .ui-datepicker-next.ui-datepicker-next-hover{
1334
+ right: 1px;
1335
+ }
1336
+
1337
+ .yith-plugin-ui .ui-datepicker table,
1338
+ .yith-plugin-fw-panel .ui-datepicker table{
1339
+ font-size: 10px;
1340
+ }
1341
+
1342
+ .yith-plugin-ui .ui-state-default,
1343
+ .yith-plugin-ui .ui-widget-content .ui-state-default,
1344
+ .yith-plugin-ui .ui-widget-header .ui-state-default,
1345
+ .yith-plugin-fw-panel .ui-state-default,
1346
+ .yith-plugin-fw-panel .ui-widget-content .ui-state-default,
1347
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-default{
1348
+ background:#fff;
1349
+ border: 1px solid #d9d9d9;
1350
+
1351
+ }
1352
+ .yith-plugin-ui .ui-state-hover,
1353
+ .yith-plugin-ui .ui-widget-content .ui-state-hover,
1354
+ .yith-plugin-ui a.ui-state-default:focus,
1355
+ .yith-plugin-ui .ui-widget-content .ui-state-focus,
1356
+ .yith-plugin-ui .ui-widget-header .ui-state-focus,
1357
+ .yith-plugin-fw-panel .ui-state-hover,
1358
+ .yith-plugin-fw-panel .ui-widget-content .ui-state-hover,
1359
+ .yith-plugin-fw-panel a.ui-state-default:focus,
1360
+ .yith-plugin-fw-panel .ui-widget-content .ui-state-focus,
1361
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-focus{
1362
+ background:#ebf1f3;
1363
+ border:1px solid #bfd5dd;
1364
+ outline: none;
1365
+ box-shadow: none;
1366
+ }
1367
+ .yith-plugin-ui .ui-widget-header .ui-state-hover, .woocommerce .yith-plugin-ui .ui-state-focus,
1368
+ .yith-plugin-fw-panel .ui-widget-header .ui-state-hover, .woocommerce .yith-plugin-ui .ui-state-focus {
1369
+ background: none;
1370
+ border: 0;
1371
+ }
1372
+
1373
+ /** colorpicker **/
1374
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .iris-picker,
1375
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-holder {
1376
+ display: none !important;
1377
+ }
1378
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-input-wrap {
1379
+ display: inline !important;
1380
+ }
1381
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-active .iris-picker,
1382
+ .yith-plugin-ui .yith-plugin-fw-colorpicker-field-wrapper .wp-picker-active .wp-picker-holder {
1383
+ display: block !important;
1384
+ }
1385
+ .woocommerce .yith-plugin-ui .iris-picker{
1386
+ border:0;
1387
+ margin-top: 20px;
1388
+ }
1389
+ .yith-plugin-ui .yith-plugin-fw input[type=text].wp-color-picker {
1390
+ border:0;
1391
+ padding: 2px 5px;
1392
+ height:30px;
1393
+ }
1394
+ .yith-plugin-ui .wp-color-result-text{
1395
+ display: none;
1396
+ }
1397
+
1398
+ .yith-plugin-ui .wp-picker-container .wp-color-result.button{
1399
+ width: 30px;
1400
+ height: 30px;
1401
+ border: 0;
1402
+ box-shadow: none;
1403
+ border: 1px solid #d9d9d9;
1404
+ margin-bottom: 0;
1405
+ }
1406
+ .yith-plugin-ui .wp-picker-clear{
1407
+ display: none;
1408
+ }
1409
+ .yith-plugin-ui .wp-picker-container{
1410
+ width: auto;
1411
+ display: inline-block;
1412
+ border: 1px solid #d9d9d9;
1413
+ border-radius: 8px;
1414
+ padding: 5px;
1415
+ }
1416
+
1417
+ .yith-plugin-ui .iris-picker .iris-square-inner{
1418
+ box-shadow: none;
1419
+ border: 1px solid #d9d9d9;
1420
+ }
1421
+
1422
+ .yith-plugin-ui .yith-single-colorpicker{
1423
+ display: inline-block;
1424
+ width: 220px;
1425
+ }
1426
+
1427
+ .yith-plugin-ui .yith-single-colorpicker > label{
1428
+ display: block;
1429
+ font-size: 11px;
1430
+ font-weight: 600;
1431
+ margin-bottom: 10px;
1432
+ }
1433
+
1434
+ /* RANGE SLIDER */
1435
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle{
1436
+ top: -45px!important;
1437
+ }
1438
+
1439
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle {
1440
+ position: absolute;
1441
+ top: -33px;
1442
+ left: 0;
1443
+ width: auto !important;
1444
+ height: auto !important;
1445
+ padding: 2px 8px;
1446
+ margin-left: -15px;
1447
+ font-size: 12px;
1448
+ line-height: 20px;
1449
+ color: #4e8ba2;
1450
+ text-align: center;
1451
+ background-color: #fff;
1452
+ border: 1px solid #fff;
1453
+ border-radius: 3px;
1454
+ -webkit-transition: opacity .3s ease-in-out 0s;
1455
+ transition: opacity .3s ease-in-out 0s;
1456
+ box-shadow: 0px 1px 7px 0px rgba(1, 1, 1, 0.13);
1457
+ }
1458
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle:before {
1459
+ position: absolute;
1460
+ bottom: -3px;
1461
+ left: 50%;
1462
+ display: inline-block;
1463
+ width: 6px;
1464
+ height: 6px;
1465
+ margin-left: -3px;
1466
+ content: "";
1467
+ background-color: #fff;
1468
+ -webkit-transform: rotate(-45deg);
1469
+ -ms-transform: rotate(-45deg);
1470
+ transform: rotate(-45deg);
1471
+ }
1472
+ .yith-plugin-ui .ui-slider.ui-widget-content .ui-widget-header{
1473
+ background: #4e8ba2 ;
1474
+ }
1475
+ .yith-plugin-ui .ui-slider-horizontal .ui-slider-handle:after{
1476
+ content: '';
1477
+ width: 17px;
1478
+ height: 17px;
1479
+ display: block;
1480
+ position: absolute;
1481
+ background: #fff;
1482
+ top: 37px;
1483
+ border-radius: 50%;
1484
+ box-shadow: 0px 1px 6px 0px rgba(1, 1, 1, 0.25);
1485
+ }
1486
+ .yith-plugin-ui .ui-slider.ui-widget-content{
1487
+ height: 5px !important;
1488
+ }
1489
+
1490
+ .yith-plugin-ui .ui-slider .minCaption,
1491
+ .yith-plugin-ui .ui-slider .maxCaption {
1492
+ font-weight: 700;
1493
+ font-size: 12px;
1494
+ }
1495
+
1496
+
1497
+ /* ADD_BOX AND TOGGLE */
1498
+ .yith-plugin-ui .yith-add-box,
1499
+ .yith-plugin-ui .yith-toggle-row{
1500
+ width:70%;
1501
+ border: 1px solid #d9d9d9;
1502
+ box-shadow:none;
1503
+ border-radius: 4px;
1504
+ margin: 20px 0;
1505
+ padding: 10px;
1506
+ box-sizing: border-box;
1507
+ background: white;
1508
+ }
1509
+ .yith-plugin-ui .yith-add-box{
1510
+ padding: 30px 25px;
1511
+ display: none;
1512
+ }
1513
+ .yith-plugin-ui .yith-toggle-title{
1514
+ position: relative;
1515
+ }
1516
+ .yith-plugin-ui #plugin-fw-wc .yith-toggle-title h3,
1517
+ .yith-plugin-ui .yith-toggle-title h3{
1518
+ padding: 0px 20px 0px 25px;
1519
+ margin: 0;
1520
+ display: inline-block;
1521
+ position: relative;
1522
+ min-width: 173px;
1523
+ box-sizing: border-box;
1524
+ font-weight: 600;
1525
+ font-size: 15px;
1526
+ }
1527
+
1528
+ .yith-plugin-ui .yith-toggle-title .subtitle{
1529
+ padding-left: 0;
1530
+ padding-top:8px;
1531
+ font-size: 12px;
1532
+ }
1533
+
1534
+ .yith-plugin-ui .yith-toggle{
1535
+ position: absolute;
1536
+ width: 30px;
1537
+ height: 30px;
1538
+ display: block;
1539
+ cursor: pointer;
1540
+ left: 0px;
1541
+ top: 0;
1542
+ bottom: 0;
1543
+ }
1544
+ .yith-plugin-ui .yith-toggle > span:before{
1545
+ color: #405e69;
1546
+ }
1547
+
1548
+ .yith-plugin-ui .yith-toggle > span{
1549
+ position: absolute;
1550
+ right: 50%;
1551
+ transition: transform .3s;
1552
+ line-height: 1;
1553
+ }
1554
+
1555
+
1556
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle span{
1557
+ transform: rotateZ(90deg);
1558
+ }
1559
+
1560
+ .yith-plugin-ui .yith-toggle-content{
1561
+ display: none;
1562
+ position: relative;
1563
+ padding: 30px 25px;
1564
+ }
1565
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content{
1566
+ /* display: block;*/
1567
+ }
1568
+ .yith-plugin-ui .yith-add-box-row,
1569
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row{
1570
+ display: table;
1571
+ margin-bottom: 20px;
1572
+ }
1573
+ .yith-plugin-ui .yith-add-box-row label,
1574
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row label{
1575
+ display: table-cell;
1576
+ width: 250px;
1577
+ padding-right:40px;
1578
+ color: #33373b;
1579
+ font-size: 13px;
1580
+ vertical-align: top;
1581
+ font-weight: 600;
1582
+ }
1583
+
1584
+ .yith-plugin-ui .yith-add-box-row .yith-plugin-fw-field-wrapper:not(.yith-plugin-fw-title-field-wrapper),
1585
+ .yith-plugin-ui .yith-toggle-row-opened .yith-plugin-fw-field-wrapper:not(.yith-plugin-fw-title-field-wrapper) {
1586
+ /* display: table-cell;*/
1587
+ width: auto;
1588
+ float: none;
1589
+ vertical-align: middle;
1590
+ position: relative;
1591
+ }
1592
+ .yith-plugin-ui .yith-add-box-row span.yith-icon,
1593
+ .yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row span.yith-icon{
1594
+ position: absolute;
1595
+ right: 15px;
1596
+ top: 0;
1597
+ bottom: 0;
1598
+ }
1599
+ .yith-plugin-ui .yith-add-box-buttons,
1600
+ .yith-plugin-ui .yith-toggle-content-buttons{
1601
+ text-align: right;
1602
+ }
1603
+ .yith-plugin-ui .yith-toggle-onoff {
1604
+ position: absolute;
1605
+ cursor: pointer;
1606
+ right: 0;
1607
+ }
1608
+ .yith-plugin-ui .ui-sortable .yith-toggle-onoff{
1609
+ right: 30px;
1610
+ }
1611
+ .yith-plugin-ui .yith-toggle-row .icon-drag{
1612
+ position: absolute;
1613
+ right: 0;
1614
+ top: 25%;
1615
+ bottom: 0;
1616
+ line-height: 1;
1617
+ }
1618
+ .yith-plugin-ui .yith-toggle-row.with-subtitle .yith-toggle{
1619
+ top: auto;
1620
+ }
1621
+ .yith-plugin-ui .yith-toggle-row.with-subtitle .yith-toggle-onoff{
1622
+ top: 25%;
1623
+ }
1624
+
1625
+ /** SPINNER **/
1626
+ .yith-plugin-ui .spinner{
1627
+ vertical-align: -5px;
1628
+ float: none;
1629
+ }
1630
+
1631
+ .yith-plugin-ui .spinner.show{
1632
+ visibility: visible;
1633
+ }
1634
+
1635
+ /* LIST TABLE */
1636
+ .yith-plugin-ui .form-table .list-table td{
1637
+ padding: 15px 0px;
1638
+ }
1639
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table .bulkactions select{
1640
+ border: 1px solid #d8d8d8;
1641
+ max-width: 200px;
1642
+ max-height: 30px;
1643
+ padding: 0 10px;
1644
+ }
1645
+ .yith-plugin-ui .form-table .list-table th{
1646
+ width: initial;
1647
+ }
1648
+
1649
+ .yith-plugin-ui #plugin-fw-wc table.form-table th.check-column{
1650
+ padding-left: 3px;
1651
+ }
1652
+ .yith-plugin-ui #plugin-fw-wc table.wp-list-table tbody td{
1653
+ padding-left: 20px;
1654
+ }
1655
+ .yith-plugin-ui .yith-plugin-fw-list-table h2{
1656
+ border: 0;
1657
+ padding: 35px 0 15px;
1658
+ display: inline-block;
1659
+ margin-right: 10px;
1660
+ }
1661
+ .yith-plugin-ui .form-table .yith-plugin-fw-list-table table th{
1662
+ vertical-align: middle;
1663
+ }
1664
+ .yith-plugin-ui .yith-plugin-fw-list-table-container{
1665
+ padding: 0 20px;
1666
+ }
1667
+ .yith-plugin-ui #doaction, .yith-plugin-ui #doaction2, .yith-plugin-ui #post-query-submit{
1668
+ margin-left: 10px;
1669
+ height: 33px;
1670
+ }
1671
+ .yith-plugin-ui .bulkactions{
1672
+ margin: 10px 0;
1673
+ }
1674
+ .yith-plugin-ui .form-table td p.yith-section-description{
1675
+ color:#716269;
1676
+ margin-bottom: 20px;
1677
+ }
1678
+
1679
+ /** Time picker width*/
1680
+ .yith-plugin-ui input.ui-timepicker-input {
1681
+ width: 100px!important;
1682
+ }
1683
+ /** date format **/
1684
+ .yith-plugin-ui .yith-plugin-fw-date-format code {
1685
+ margin-left: 30px;
1686
+ }
1687
+
1688
+ .yith-plugin-ui .yith-plugin-fw-date-format input[type=text].small-text {
1689
+ margin-left: 45px;
1690
+ }
1691
+
1692
+ /** checkbox columns **/
1693
+ .yith-plugin-ui td.forminp-checkbox.two-cols fieldset {
1694
+ width: calc(50% - 20px);
1695
+ padding-right: 20px;
1696
+ float: left;
1697
+ }
1698
+
1699
+ .yith-plugin-ui td.forminp-checkbox.three-cols fieldset {
1700
+ width: calc(33% - 0px);
1701
+ padding-right: 0px;
1702
+ float: left;
1703
+ }
1704
+
1705
+
1706
+ .yith-plugin-fw-checkbox-field-wrapper {
1707
+ display: inline-block !important;
1708
+ width: 19px !important;
1709
+ margin-right: 10px;
1710
+ }
1711
+ .yith-plugin-fw-checkbox-field-wrapper + span.description {
1712
+ display: inline-block;
1713
+ vertical-align: middle;
1714
+ margin: 0;
1715
+ }
1716
+ .yith-plugin-ui span.description {
1717
+ margin-top: 10px;
1718
+ }
1719
+ .yith-plugin-fw-option-with-description {
1720
+ display: table-cell;
1721
+ width: auto;
1722
+ vertical-align: top;
1723
+ }
1724
+ /** YITH PANEL **/
1725
+ .yith-plugin-ui #yith-plugin-fw-panel{
1726
+ margin-top: -10px;
1727
+ }
1728
+ .yith-plugin-ui #plugin-fw-wc, .yith-plugin-ui #yith-plugin-fw-panel{
1729
+ padding-top: 0;
1730
+ }
1731
+ .yith-plugin-ui .plugin-option tr{
1732
+ border: 0;
1733
+ }
1734
+
1735
+ @media screen and (max-width: 1440px){
1736
+ .yith-plugin-ui .yith-add-box,
1737
+ .yith-plugin-ui .yith-toggle-row{
1738
+ width: 80%;
1739
+ }
1740
+ }
1741
+ @media screen and (max-width: 1024px){
1742
+ .yith-plugin-ui .yith-add-box,
1743
+ .yith-plugin-ui .yith-toggle-row{
1744
+ width: 90%;
1745
+ }
1746
+
1747
+ .yith-plugin-ui td.forminp-checkbox.two-cols fieldset {
1748
+ width: 100%;
1749
+ padding-right: 20px;
1750
+ float: left;
1751
+ }
1752
+
1753
+ .yith-plugin-ui td.forminp-checkbox.three-cols fieldset {
1754
+ width: calc(50% - 0px);
1755
+ padding-right: 0px;
1756
+ float: left;
1757
+ }
1758
+ }
1759
+ @media screen and (max-width: 782px){
1760
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free{
1761
+ height: auto;
1762
+ background-color: #a9c7d3;
1763
+ }
1764
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free ul{
1765
+ width: 90%;
1766
+ text-align: center;
1767
+ }
1768
+ .yith-plugin-fw-banner.yith-plugin-fw-banner-free li img{
1769
+ width: 90%;
1770
+ margin: 0 auto;
1771
+ }
1772
+ .yith-plugin-fw-banner h1{
1773
+ line-height: 1.2em;
1774
+ }
1775
+
1776
+ .yith-plugin-ui .yith-add-box,
1777
+ .yith-plugin-ui .yith-toggle-row{
1778
+ width: 100%;
1779
+ }
1780
+
1781
+ .yith-plugin-ui td.forminp-checkbox.two-cols fieldset,
1782
+ .yith-plugin-ui td.forminp-checkbox.three-cols fieldset{
1783
+ width: 100%;
1784
+ }
1785
+
1786
  }
plugin-fw/assets/fonts/yith-icon.eot ADDED
Binary file
plugin-fw/assets/fonts/yith-icon.svg ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ </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,636 @@
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
+ $colorpicker.each(function () {
44
+ var select_label = $(this).data('variations-label');
45
+ $(this).parent().parent().find('a.wp-color-result').attr('title', select_label);
46
+ });
47
+
48
+ /* Upload */
49
+ if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
50
+ var _custom_media = true;
51
+ // preview
52
+ $upload.imgUrl.change(function () {
53
+ var url = $(this).val(),
54
+ re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)"),
55
+ preview = $(this).parent().find($upload.imgPreviewHandler).first();
56
+
57
+ if (preview.length < 1)
58
+ preview = $(this).parent().parent().find($upload.imgPreviewHandler).first();
59
+
60
+ if (re.test(url)) {
61
+ preview.html('<img src="' + url + '" style="max-width:100px; max-height:100px;" />');
62
+ } else {
63
+ preview.html('');
64
+ }
65
+ }).trigger('change');
66
+
67
+ $(document).on('click', $upload.uploadButtonHandler, function (e) {
68
+ e.preventDefault();
69
 
70
+ var t = $(this),
71
+ custom_uploader,
72
+ id = t.attr('id').replace(/-button$/, '');
73
 
74
+ //If the uploader object has already been created, reopen the dialog
75
+ if (custom_uploader) {
76
+ custom_uploader.open();
77
+ return;
78
+ }
79
+
80
+ var custom_uploader_states = [
81
+ // Main states.
82
+ new wp.media.controller.Library({
83
+ library: wp.media.query(),
84
+ multiple: false,
85
+ title: 'Choose Image',
86
+ priority: 20,
87
+ filterable: 'uploaded'
88
+ })
89
+ ];
90
+
91
+ // Create the media frame.
92
+ custom_uploader = wp.media.frames.downloadable_file = wp.media({
93
+ // Set the title of the modal.
94
+ title: 'Choose Image',
95
+ library: {
96
+ type: ''
97
+ },
98
+ button: {
99
+ text: 'Choose Image'
100
+ },
101
+ multiple: false,
102
+ states: custom_uploader_states
103
+ });
104
+
105
+ //When a file is selected, grab the URL and set it as the text field's value
106
+ custom_uploader.on('select', function () {
107
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
108
+
109
+ $("#" + id).val(attachment.url);
110
+ // Save the id of the selected element to an element which name is the same with a suffix "-yith-attachment-id"
111
+ if ($("#" + id + "-yith-attachment-id")) {
112
+ $("#" + id + "-yith-attachment-id").val(attachment.id);
113
+ }
114
+ $upload.imgUrl.trigger('change');
115
+ });
116
 
117
+ //Open the uploader dialog
 
118
  custom_uploader.open();
119
+ });
120
+
121
+ $(document).on('click', $upload.resetButtonHandler, function (e) {
122
+ var t = $(this),
123
+ id = t.attr('id'),
124
+ input_id = t.attr('id').replace(/-button-reset$/, ''),
125
+ default_value = $('#' + id).data('default');
126
+
127
+ $("#" + input_id).val(default_value);
128
+ $upload.imgUrl.trigger('change');
129
+ });
130
+ }
131
 
132
+ $wpAddMedia.on('click', function () {
133
+ _custom_media = false;
134
+ });
135
+
136
+ /* Image Gallery */
137
+ if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
138
+ $(document).on('click', $imageGallery.buttonHandler, function (e) {
139
+ var $t = $(this),
140
+ $container = $t.closest('.image-gallery'),
141
+ $image_gallery_ids = $container.find('.image_gallery_ids'),
142
+ attachment_ids = $image_gallery_ids.val(),
143
+ $gallery_images_wrapper = $container.find('ul.slides-wrapper');
144
+
145
+ // Create the media frame.
146
+ var image_gallery_frame = wp.media.frames.image_gallery = wp.media({
147
+ // Set the title of the modal.
148
+ title: $t.data('choose'),
149
+ button: {
150
+ text: $t.data('update')
151
+ },
152
+ states: [
153
+ new wp.media.controller.Library({
154
+ title: $t.data('choose'),
155
+ filterable: 'all',
156
+ multiple: true
157
+ })
158
+ ]
159
+ });
160
+
161
+ // When an image is selected, run a callback.
162
+ image_gallery_frame.on('select', function () {
163
+ var selection = image_gallery_frame.state().get('selection');
164
+ selection.map(function (attachment) {
165
+ attachment = attachment.toJSON();
166
+
167
+ if (attachment.id) {
168
+ attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
169
+ $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>');
170
+ }
171
+ });
172
+
173
+ $image_gallery_ids.val(attachment_ids);
174
+ });
175
+
176
+ image_gallery_frame.open();
177
+
178
+ });
179
+
180
+ // Image ordering
181
+ $imageGallery.sliderWrapper.each(function () {
182
+ var $t = $(this);
183
+ $t.sortable({
184
+ items: 'li.image',
185
+ cursor: 'move',
186
+ scrollSensitivity: 40,
187
+ forcePlaceholderSize: true,
188
+ forceHelperSize: false,
189
+ helper: 'clone',
190
+ opacity: 0.65,
191
+ start: function (event, ui) {
192
+ ui.item.css('background-color', '#f6f6f6');
193
+ },
194
+ stop: function (event, ui) {
195
+ ui.item.removeAttr('style');
196
+ },
197
+ update: function (event, ui) {
198
+ var attachment_ids = '';
199
+
200
+ $t.find('li.image').css('cursor', 'default').each(function () {
201
+ var attachment_id = $(this).attr('data-attachment_id');
202
+ attachment_ids = attachment_ids + attachment_id + ',';
203
+ });
204
+
205
+ $t.closest('.image-gallery').find('.image_gallery_ids').val(attachment_ids);
206
+ }
207
+ });
208
+ });
209
+
210
+ // Remove images
211
+ $imageGallery.sliderWrapper.on('click', 'a.delete', function () {
212
+ var $wrapper = $(this).closest('.image-gallery'),
213
+ $gallery = $(this).closest('.image-gallery ul.slides-wrapper'),
214
+ $image_gallery_ids = $wrapper.find('.image_gallery_ids'),
215
+ attachment_ids = '';
216
+
217
+ $(this).closest('li.image').remove();
218
+
219
+ $gallery.find('li.image').css('cursor', 'default').each(function () {
220
+ var attachment_id = $(this).attr('data-attachment_id');
221
+ attachment_ids = attachment_ids + attachment_id + ',';
222
+ });
223
+
224
+ $image_gallery_ids.val(attachment_ids);
225
+ });
226
+ }
227
+
228
+
229
+ /* Sidebars */
230
+ $sidebars.each(function () {
231
+ var $images = $(this).find('img');
232
+ $images.on('click', function () {
233
+ var $container = $(this).closest('.yith-plugin-fw-sidebar-layout'),
234
+ $left = $container.find('.yith-plugin-fw-sidebar-layout-sidebar-left-container'),
235
+ $right = $container.find('.yith-plugin-fw-sidebar-layout-sidebar-right-container'),
236
+ type = $(this).data('type');
237
+
238
+ $(this).parent().children(':radio').attr('checked', false);
239
+ $(this).prev(':radio').attr('checked', true);
240
+
241
+ if (typeof type != 'undefined') {
242
+ switch (type) {
243
+ case 'left':
244
+ $left.show();
245
+ $right.hide();
246
+ break;
247
+ case 'right':
248
+ $right.show();
249
+ $left.hide();
250
+ break;
251
+ case 'double':
252
+ $left.show();
253
+ $right.show();
254
+ break;
255
+ default:
256
+ $left.hide();
257
+ $right.hide();
258
+ break;
259
+ }
260
  }
261
+ });
262
+ });
263
+
264
+ /* Slider */
265
+ $slider.each(function () {
266
+ var val = $(this).data('val'),
267
+ minValue = $(this).data('min'),
268
+ maxValue = $(this).data('max'),
269
+ step = $(this).data('step'),
270
+ labels = $(this).data('labels');
271
+
272
+ $(this).slider({
273
+ value: val,
274
+ min: minValue,
275
+ max: maxValue,
276
+ range: 'min',
277
+ step: step,
278
+
279
+ create: function () {
280
+ $(this).find('.ui-slider-handle').text($(this).slider("value"));
281
+ },
282
+
283
+
284
+ slide: function (event, ui) {
285
+ $(this).find('input').val(ui.value);
286
+ $(this).find('.ui-slider-handle').text(ui.value);
287
+ $(this).siblings('.feedback').find('strong').text(ui.value + labels);
288
+ }
289
+ });
290
+ });
291
+
292
+ /* codemirror */
293
+ $codemirror.each(function (i, v) {
294
+ var editor = CodeMirror.fromTextArea(v, {
295
+ lineNumbers: 1,
296
+ mode: 'javascript',
297
+ showCursorWhenSelecting: true
298
+ });
299
+
300
+ $(v).data('codemirrorInstance', editor);
301
+ });
302
+
303
+ /* Select All - Deselect All */
304
+ $(document).on('click', '.yith-plugin-fw-select-all', function () {
305
+ var $targetSelect = $('#' + $(this).data('select-id'));
306
+ $targetSelect.find('option').prop('selected', true).trigger('change');
307
+ });
308
+
309
+ $(document).on('click', '.yith-plugin-fw-deselect-all', function () {
310
+ var $targetSelect = $('#' + $(this).data('select-id'));
311
+ $targetSelect.find('option').prop('selected', false).trigger('change');
312
+ });
313
+
314
+
315
+ $icons.each(function () {
316
+ var $container = $(this),
317
+ $preview = $container.find('.yit-icons-manager-icon-preview').first(),
318
+ $text = $container.find('.yit-icons-manager-icon-text');
319
+
320
+ $container.on('click', '.yit-icons-manager-list li', function (event) {
321
+ var $target = $(event.target).closest('li'),
322
+ font = $target.data('font'),
323
+ icon = $target.data('icon'),
324
+ key = $target.data('key'),
325
+ name = $target.data('name');
326
+
327
+ $preview.attr('data-font', font);
328
+ $preview.attr('data-icon', icon);
329
+ $preview.attr('data-key', key);
330
+ $preview.attr('data-name', name);
331
+
332
+ $text.val(font + ':' + name);
333
+
334
+ $container.find('.yit-icons-manager-list li').removeClass('active');
335
+ $target.addClass('active');
336
+ });
337
+
338
+ $container.on('click', '.yit-icons-manager-action-set-default', function () {
339
+ $container.find('.yit-icons-manager-list li.default').trigger('click');
340
+ });
341
+ });
342
+
343
+ /** Select Images */
344
+ $(document).on('click', '.yith-plugin-fw-select-images__item', function () {
345
+ var item = $(this),
346
+ key = item.data('key'),
347
+ wrapper = item.closest('.yith-plugin-fw-select-images__wrapper'),
348
+ items = wrapper.find('.yith-plugin-fw-select-images__item'),
349
+ select = wrapper.find('select').first();
350
+
351
+ if (select.length) {
352
+ select.val(key);
353
+ items.removeClass('yith-plugin-fw-select-images__item--selected');
354
+ item.addClass('yith-plugin-fw-select-images__item--selected');
355
+ }
356
+ });
357
+
358
+ $(document.body).trigger('wc-enhanced-select-init');
359
+
360
+ $(document).find('.ui-sortable .yith-toggle-elements').sortable(
361
+ {
362
+ cursor: 'move',
363
+ axis: 'y',
364
+ scrollSensitivity: 40,
365
+ forcePlaceholderSize: true,
366
+ helper: 'clone',
367
+
368
+ stop: function (event, ui) {
369
+ var keys = jQuery('.ui-sortable-handle'),
370
+ i = 0,
371
+ array_keys = new Array();
372
+ for (i = 0; i < keys.length; i++) {
373
+ array_keys[i] = $(keys[i]).data('item_key');
374
+ }
375
+ if (array_keys.length > 0) {
376
+ var toggle = $(this).closest('.toggle-element');
377
+ toggle.saveToggleElement(null, array_keys);
378
  }
379
+ }
380
+ }
381
+ );
382
+
383
+ $.each($checkgroup, function () {
384
+ var children = $(this).find('fieldset');
385
+ if (children.length > 3 && children.length < 6) {
386
+ $(this).addClass('two-cols')
387
+ }
388
+ if (children.length > 6) {
389
+ $(this).addClass('three-cols')
390
+ }
391
+ });
392
+
393
+ $(document.body).trigger('yith-framework-enhanced-select-init');
394
+ };
395
+
396
+ yith_fields_init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
 
398
  /* on-off */
399
+ $(document).on('click', '.yith-plugin-fw-onoff-container span', function () {
400
+ var input = $(this).prev('input'),
401
+ checked = input.prop('checked');
402
 
403
+ if (checked) {
404
+ input.prop('checked', false).attr('value', 'no').removeClass('onoffchecked');
405
  } else {
406
+ input.prop('checked', true).attr('value', 'yes').addClass('onoffchecked');
407
  }
408
 
409
  input.change();
410
+ });
411
+
412
+
413
+ /** Toggle **/
414
+
415
+
416
+
417
+ //TOGGLE ELEMENT
418
+ $.fn.saveToggleElement = function (spinner, array_keys) {
419
+ var toggle = $(this),
420
+ action = 'yith_plugin_fw_save_toggle_element',
421
+ formdata = toggle.serializeToggleElement(),
422
+ id = toggle.find('.yith-toggle_wrapper').attr('id'),
423
+ current_tab = $.urlParam('tab');
424
+
425
+ if (typeof array_keys != 'undefined' && array_keys.length > 0) {
426
+ formdata.append('yith_toggle_elements_order_keys', array_keys);
427
+ }
428
+
429
+ if (toggle.closest('.metaboxes-tab.yith-plugin-ui').length) {
430
+ action = 'yith_plugin_fw_save_toggle_element_metabox';
431
+ post_id = $(this).closest('form#post').find('#post_ID').val();
432
+ yit_metaboxes_nonce = $(this).closest('form#post').find('#yit_metaboxes_nonce').val();
433
+ url = yith_framework_fw_fields.ajax_url + '?action=' + action + "&post_ID=" + post_id + '&yit_metaboxes_nonce=' + yit_metaboxes_nonce + "&toggle_id=" + id;
434
+ } else {
435
+ url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
436
+ }
437
+
438
+ $.ajax({
439
+ type: "POST",
440
+ url: url,
441
+ data: formdata,
442
+ contentType: false,
443
+ processData: false,
444
+ success: function (result) {
445
+ if (spinner) {
446
+ spinner.removeClass('show');
447
+ }
448
+
449
+ $(document).trigger('yith_save_toggle_element_done', [result, toggle]);
450
+ },
451
+ });
452
+ };
453
+
454
+ $.fn.serializeToggleElement = function () {
455
+ var obj = $(this);
456
+ /* ADD FILE TO PARAM AJAX */
457
+ var formData = new FormData();
458
+ var params = $(obj).find(":input").serializeArray();
459
+
460
+ $.each(params, function (i, val) {
461
+ el_name = val.name;
462
+ formData.append(val.name, val.value);
463
+ });
464
+
465
+ return formData;
466
+ };
467
+
468
+ $.fn.formatToggleTitle = function () {
469
+ var toggle_el = $(this),
470
+ fields = toggle_el.find(':input'),
471
+ title = toggle_el.find('span.title').data('title_format'),
472
+ subtitle = toggle_el.find('.subtitle').data('subtitle_format'),
473
+ regExp = new RegExp( "[^%%]+(?=[%%])", 'g' );
474
+
475
+ if (typeof title != 'undefined') {
476
+ var res = title.match( regExp );
477
+ }
478
+
479
+ if (typeof subtitle != 'undefined') {
480
+ var ressub = subtitle.match( regExp );
481
+ }
482
+
483
+ $.each(fields, function (i, field) {
484
+ if (typeof $(field).attr('id') != 'undefined') {
485
+ $field_id = $(field).attr('id');
486
+ $field_array = $field_id.split('_');
487
+ $field_array.pop();
488
+ $field_id = $field_array.join('_');
489
+ $field_val = $(field).val();
490
+
491
+ if (res != null && typeof res != 'undefined' && res.indexOf($field_id) !== -1) {
492
+ title = title.replace('%%' + $field_id + '%%', $field_val);
493
+ }
494
+ if (ressub != null && typeof ressub != 'undefined' && ressub.indexOf($field_id) !== -1) {
495
+ subtitle = subtitle.replace('%%' + $field_id + '%%', $field_val);
496
+ }
497
+ }
498
+ });
499
+
500
+ if ('' !== title) {
501
+ toggle_el.find('span.title').html(title);
502
+ }
503
+
504
+ if ('' !== subtitle) {
505
+ toggle_el.find('.subtitle').html(subtitle);
506
+ }
507
+
508
+ $(document).trigger('yith-toggle-element-item-title', [toggle_el]);
509
+ };
510
+
511
+ $.urlParam = function (name) {
512
+ var results = new RegExp('[\?&]' + name + '=([^&#]*)')
513
+ .exec(window.location.search);
514
+
515
+ return (results !== null) ? results[1] || 0 : false;
516
+ };
517
+
518
+ $(document).on('click', '.yith-toggle', function (event) {
519
+ var _toggle = $(event.target),
520
+ _section = _toggle.closest('.yith-toggle-row'),
521
+ _content = _section.find('.yith-toggle-content');
522
+
523
+ if (_section.is('.yith-toggle-row-opened')) {
524
+ _content.slideUp(400);
525
+ } else {
526
+ _content.slideDown(400);
527
+ }
528
+ _section.toggleClass('yith-toggle-row-opened');
529
+ });
530
+
531
+ /**Add new box toggle**/
532
+ $(document).on('click', '.yith-add-box-button', function (event) {
533
+ event.preventDefault();
534
+ var target_id = $(this).data('box_id'),
535
+ id = $(this).closest('.yith-toggle_wrapper').attr('id');
536
+ template = wp.template('yith-toggle-element-add-box-content-' + id);
537
+ if ('' !== target_id) {
538
+ $('#' + target_id).html(template({index: 'box_id'})).slideToggle();
539
+ yith_fields_init();
540
+ $(document).trigger('yith-add-box-button-toggle', [$(this)]);
541
+ }
542
+ });
543
+
544
+ $(document).on('click', '.yith-add-box-buttons .yith-save-button', function (event) {
545
+ event.preventDefault();
546
+ var add_box = $(this).parents('.yith-add-box'),
547
+ id = $(this).closest('.yith-toggle_wrapper').attr('id'),
548
+ spinner = add_box.find('.spinner'),
549
+ toggle_element = $(this).parents('.toggle-element'),
550
+ fields = add_box.find(':input'),
551
+ counter = toggle_element.find('.yith-toggle-row').length,
552
+ hidden_obj = $('<input type="hidden">');
553
+ hidden_obj.val(counter);
554
+ $(document).trigger('yith-toggle-change-counter', [hidden_obj, add_box]);
555
+
556
+ counter = hidden_obj.val();
557
+ var template = wp.template('yith-toggle-element-item-' + id),
558
+ toggle_el = $(template({index: counter}));
559
+
560
+ spinner.addClass('show');
561
+
562
+ $.each(fields, function (i, field) {
563
+ if (typeof $(field).attr('id') != 'undefined') {
564
+
565
+ $field_id = $(field).attr('id');
566
+ $field_val = $(field).val();
567
+
568
+ if ('radio' == $(field).attr('type')) {
569
+ $field_id = $field_id.replace('new_', '');
570
+ $field_id = $field_id.replace('-' + $field_val, '');
571
+ $field_id = $field_id + '_dataindex-' + $field_val;
572
+ } else {
573
+ $field_id = $field_id.replace('new_', '') + '_' + counter;
574
+ }
575
+
576
+ if ($(field).is(':checked')) {
577
+ $(toggle_el).find('#' + $field_id).prop('checked', true);
578
  }
579
+
580
+ if ($(field).hasClass('yith-post-search') || $(field).hasClass('yith-term-search')) {
581
+ $(toggle_el).find('#' + $field_id).html($('#' + $(field).attr('id')).html());
582
+ }
583
+
584
+ $(toggle_el).find('#' + $field_id).val($field_val);
585
+
586
  }
587
+
588
+ });
589
+
590
+ $(toggle_el).formatToggleTitle();
591
+ var form_is_valid = $('<input type="hidden">').val('yes');
592
+ $(document).trigger('yith-toggle-element-item-before-add', [add_box, toggle_el, form_is_valid]);
593
+
594
+
595
+ if (form_is_valid.val() === 'yes') {
596
+ $(toggle_element).find('.yith-toggle-elements').append(toggle_el);
597
+ $(add_box).find('.yith-plugin-fw-datepicker').datepicker('destroy');
598
+ $(add_box).html('').toggle();
599
+ toggle_element.saveToggleElement();
600
+ yith_fields_init();
601
+ }
602
+ });
603
+
604
+ $(document).on('click', '.yith-toggle-row .yith-save-button', function (event) {
605
+ event.preventDefault();
606
+ var toggle = $(this).closest('.toggle-element'),
607
+ toggle_row = $(this).closest('.yith-toggle-row'),
608
+ spinner = toggle_row.find('.spinner');
609
+ toggle_row.formatToggleTitle();
610
+
611
+ var form_is_valid = $('<input type="hidden">').val('yes');
612
+ $(document).trigger('yith-toggle-element-item-before-update', [toggle, toggle_row, form_is_valid]);
613
+ if (form_is_valid.val() === 'yes') {
614
+ spinner.addClass('show');
615
+ toggle.saveToggleElement(spinner);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  }
617
+ });
618
+
619
+ //register remove the dome and save the toggle
620
+ $(document).on('click', '.yith-toggle-row .yith-delete-button', function (event) {
621
+ event.preventDefault();
622
+ var toggle = $(this).closest('.toggle-element'),
623
+ toggle_row = $(this).closest('.yith-toggle-row');
624
+ toggle_row.remove();
625
+ toggle.saveToggleElement();
626
+ });
627
+
628
+ //register onoff status
629
+ $(document).on('click', '.yith-toggle-onoff', function (event) {
630
+ event.preventDefault();
631
+ var toggle = $(this).closest('.toggle-element');
632
+ toggle.saveToggleElement();
633
+ });
634
+
635
+
636
+ });
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 h(){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");g(this).parent().parent().find("a.wp-color-result").attr("title",e)}),"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")}h(),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(),h(),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(),h())}),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,7 +1,7 @@
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/
@@ -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.0
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
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/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 void
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 ( 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-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/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/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' ) ){