Version Description
Released on 02 November 2020
- New: Support for WordPress 5.6
- New: Support for WooCommerce 4.7
- Update: Plugin framework
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Compare |
Version | 2.4.2 |
Comparing to | |
See all releases |
Code changes from version 2.4.1 to 2.4.2
- README.txt +12 -5
- init.php +4 -4
- plugin-fw/assets/css/yith-fields.css +2 -2
- plugin-fw/assets/js/yit-plugin-panel.js +40 -36
- plugin-fw/assets/js/yit-plugin-panel.min.js +1 -1
- plugin-fw/assets/js/yith-fields.js +4 -4
- plugin-fw/assets/js/yith-fields.min.js +1 -1
- plugin-fw/assets/js/yith-gutenberg.min.js +1 -6
- plugin-fw/init.php +2 -2
- plugin-fw/lib/yit-plugin-licence.php +2 -2
- plugin-fw/templates/fields/radio.php +1 -1
- plugin-fw/templates/fields/select.php +1 -0
- plugin-fw/templates/fields/toggle-element.php +23 -14
- plugin-fw/yit-plugin.php +2 -2
README.txt
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
Contributors: yithemes
|
4 |
Tags: yith, woocommerce compare, compare products, product compare, product comparison
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
|
12 |
-
WooCommerce Compatible up to 4.
|
13 |
|
14 |
== Description ==
|
15 |
|
@@ -66,6 +66,12 @@ yith-woocommerce-compare-<WORDPRESS LOCALE >.mo
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 2.4.1 = Released on 13 October 2020
|
70 |
|
71 |
* New: Support for WooCommerce 4.6.x
|
@@ -413,7 +419,8 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woo
|
|
413 |
|
414 |
== Upgrade notice ==
|
415 |
|
416 |
-
= 2.4.
|
417 |
|
418 |
-
* New: Support for
|
|
|
419 |
* Update: Plugin framework
|
3 |
Contributors: yithemes
|
4 |
Tags: yith, woocommerce compare, compare products, product compare, product comparison
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 5.6
|
7 |
+
Stable tag: 2.4.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
|
12 |
+
WooCommerce Compatible up to 4.7.x
|
13 |
|
14 |
== Description ==
|
15 |
|
66 |
|
67 |
== Changelog ==
|
68 |
|
69 |
+
= 2.4.2 = Released on 02 November 2020
|
70 |
+
|
71 |
+
* New: Support for WordPress 5.6
|
72 |
+
* New: Support for WooCommerce 4.7
|
73 |
+
* Update: Plugin framework
|
74 |
+
|
75 |
= 2.4.1 = Released on 13 October 2020
|
76 |
|
77 |
* New: Support for WooCommerce 4.6.x
|
419 |
|
420 |
== Upgrade notice ==
|
421 |
|
422 |
+
= 2.4.2 = Released on 02 November 2020
|
423 |
|
424 |
+
* New: Support for WordPress 5.6
|
425 |
+
* New: Support for WooCommerce 4.7
|
426 |
* Update: Plugin framework
|
init.php
CHANGED
@@ -3,17 +3,17 @@
|
|
3 |
* Plugin Name: YITH WooCommerce Compare
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
|
5 |
* Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
|
6 |
-
* Version: 2.4.
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-compare
|
10 |
* Domain Path: /languages/
|
11 |
* WC requires at least: 3.8
|
12 |
-
* WC tested up to: 4.
|
13 |
*
|
14 |
* @author YITH
|
15 |
* @package YITH WooCommerce Compare
|
16 |
-
* @version 2.4.
|
17 |
*/
|
18 |
/* Copyright 2020 Your Inspiration Themes (email : plugins@yithemes.com)
|
19 |
|
@@ -58,7 +58,7 @@ if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
|
|
58 |
register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
|
59 |
|
60 |
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
|
61 |
-
define( 'YITH_WOOCOMPARE_VERSION', '2.4.
|
62 |
}
|
63 |
if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
|
64 |
define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
|
3 |
* Plugin Name: YITH WooCommerce Compare
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
|
5 |
* Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
|
6 |
+
* Version: 2.4.2
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-compare
|
10 |
* Domain Path: /languages/
|
11 |
* WC requires at least: 3.8
|
12 |
+
* WC tested up to: 4.7
|
13 |
*
|
14 |
* @author YITH
|
15 |
* @package YITH WooCommerce Compare
|
16 |
+
* @version 2.4.2
|
17 |
*/
|
18 |
/* Copyright 2020 Your Inspiration Themes (email : plugins@yithemes.com)
|
19 |
|
58 |
register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
|
59 |
|
60 |
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
|
61 |
+
define( 'YITH_WOOCOMPARE_VERSION', '2.4.2' );
|
62 |
}
|
63 |
if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
|
64 |
define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
|
plugin-fw/assets/css/yith-fields.css
CHANGED
@@ -1926,7 +1926,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
1926 |
margin-bottom : 40px;
|
1927 |
}
|
1928 |
|
1929 |
-
.yith-plugin-ui .yith-add-box-row label,
|
1930 |
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row > label {
|
1931 |
display : table-cell;
|
1932 |
width : 200px;
|
@@ -2121,7 +2121,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2121 |
|
2122 |
.yith-plugin-fw-option-with-description {
|
2123 |
display : table-cell;
|
2124 |
-
width :
|
2125 |
vertical-align : top;
|
2126 |
}
|
2127 |
|
1926 |
margin-bottom : 40px;
|
1927 |
}
|
1928 |
|
1929 |
+
.yith-plugin-ui .yith-add-box-row > label,
|
1930 |
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row > label {
|
1931 |
display : table-cell;
|
1932 |
width : 200px;
|
2121 |
|
2122 |
.yith-plugin-fw-option-with-description {
|
2123 |
display : table-cell;
|
2124 |
+
width : 90%;
|
2125 |
vertical-align : top;
|
2126 |
}
|
2127 |
|
plugin-fw/assets/js/yit-plugin-panel.js
CHANGED
@@ -8,52 +8,28 @@
|
|
8 |
*/
|
9 |
|
10 |
jQuery( function ( $ ) {
|
11 |
-
//dependencies
|
12 |
-
$( '[data-dep-target]' ).each( function () {
|
13 |
-
var t = $( this );
|
14 |
-
|
15 |
-
var field = '#' + t.data( 'dep-target' ),
|
16 |
-
dep = '#' + t.data( 'dep-id' ),
|
17 |
-
value = t.data( 'dep-value' ),
|
18 |
-
type = t.data( 'dep-type' ),
|
19 |
-
event = 'change',
|
20 |
-
wrapper = $( dep + '-wrapper' ),
|
21 |
-
field_type = wrapper.data( 'type' );
|
22 |
-
|
23 |
-
if( field_type === 'select-images' ){
|
24 |
-
event = 'yith_select_images_value_changed';
|
25 |
-
}
|
26 |
-
|
27 |
-
dependencies_handler( field, dep, value.toString(), type );
|
28 |
-
|
29 |
-
$( dep ).on( event, function () {
|
30 |
-
dependencies_handler( field, dep, value.toString(), type );
|
31 |
-
} ).trigger( event );
|
32 |
-
|
33 |
-
} );
|
34 |
-
|
35 |
-
//Handle dependencies.
|
36 |
function dependencies_handler( id, deps, values, type ) {
|
37 |
var result = true;
|
38 |
//Single dependency
|
39 |
if ( typeof ( deps ) == 'string' ) {
|
|
|
40 |
if ( deps.substr( 0, 6 ) == ':radio' ) {
|
41 |
deps = deps + ':checked';
|
42 |
}
|
43 |
|
44 |
-
var
|
|
|
45 |
|
46 |
-
if (
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
val = 'no';
|
52 |
-
}
|
53 |
}
|
54 |
|
55 |
if( $( deps + '-wrapper' ).data( 'type' ) === 'select-images' ){
|
56 |
-
|
57 |
}
|
58 |
|
59 |
values = values.split( ',' );
|
@@ -73,7 +49,7 @@ jQuery( function ( $ ) {
|
|
73 |
|
74 |
if ( $current_container.length < 1 ) {
|
75 |
// container for YIT Plugin Panel WooCommerce
|
76 |
-
$current_container = $current_field.closest( '.yith-plugin-fw-panel-wc-row' );
|
77 |
}
|
78 |
|
79 |
var types = type.split( '-' ), j;
|
@@ -97,7 +73,7 @@ jQuery( function ( $ ) {
|
|
97 |
$current_container.hide();
|
98 |
break;
|
99 |
default:
|
100 |
-
if (
|
101 |
$current_container.hide();
|
102 |
$current_container.css( { 'opacity': '0' } );
|
103 |
} else {
|
@@ -131,6 +107,34 @@ jQuery( function ( $ ) {
|
|
131 |
}
|
132 |
}
|
133 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
//connected list
|
136 |
$( '.rm_connectedlist' ).each( function () {
|
8 |
*/
|
9 |
|
10 |
jQuery( function ( $ ) {
|
11 |
+
// Handle dependencies.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
function dependencies_handler( id, deps, values, type ) {
|
13 |
var result = true;
|
14 |
//Single dependency
|
15 |
if ( typeof ( deps ) == 'string' ) {
|
16 |
+
// ??
|
17 |
if ( deps.substr( 0, 6 ) == ':radio' ) {
|
18 |
deps = deps + ':checked';
|
19 |
}
|
20 |
|
21 |
+
var input_type = $( deps ).data( 'type' ),
|
22 |
+
val = $( deps ).val();
|
23 |
|
24 |
+
if ( 'checkbox' === input_type ) {
|
25 |
+
val = $( deps ).is( ':checked' ) ? 'yes' : 'no';
|
26 |
+
}
|
27 |
+
else if ( 'radio' === input_type ) {
|
28 |
+
val = $( deps ).find('input[type="radio"]').filter(':checked').val();
|
|
|
|
|
29 |
}
|
30 |
|
31 |
if( $( deps + '-wrapper' ).data( 'type' ) === 'select-images' ){
|
32 |
+
val = $( deps + '-wrapper' ).find( 'select' ).first().val();
|
33 |
}
|
34 |
|
35 |
values = values.split( ',' );
|
49 |
|
50 |
if ( $current_container.length < 1 ) {
|
51 |
// container for YIT Plugin Panel WooCommerce
|
52 |
+
$current_container = $current_field.closest( '.yith-plugin-fw-panel-wc-row, .yith-toggle-content-row' );
|
53 |
}
|
54 |
|
55 |
var types = type.split( '-' ), j;
|
73 |
$current_container.hide();
|
74 |
break;
|
75 |
default:
|
76 |
+
if ( ! $current_container.hasClass( 'fade-in' ) ) {
|
77 |
$current_container.hide();
|
78 |
$current_container.css( { 'opacity': '0' } );
|
79 |
} else {
|
107 |
}
|
108 |
}
|
109 |
}
|
110 |
+
function init_dependencies() {
|
111 |
+
$( '[data-dep-target]:not( .deps-initialized )' ).each( function () {
|
112 |
+
var t = $( this );
|
113 |
+
|
114 |
+
// init field deps
|
115 |
+
t.addClass( 'deps-initialized' );
|
116 |
+
|
117 |
+
var field = '#' + t.data( 'dep-target' ),
|
118 |
+
dep = '#' + t.data( 'dep-id' ),
|
119 |
+
value = t.data( 'dep-value' ),
|
120 |
+
type = t.data( 'dep-type' ),
|
121 |
+
event = 'change',
|
122 |
+
wrapper = $( dep + '-wrapper' ),
|
123 |
+
field_type = wrapper.data( 'type' );
|
124 |
+
|
125 |
+
if( field_type === 'select-images' ){
|
126 |
+
event = 'yith_select_images_value_changed';
|
127 |
+
}
|
128 |
+
|
129 |
+
$( dep ).on( event, function () {
|
130 |
+
dependencies_handler( field, dep, value.toString(), type );
|
131 |
+
} ).trigger( event );
|
132 |
+
} );
|
133 |
+
}
|
134 |
+
|
135 |
+
init_dependencies();
|
136 |
+
// re-init deps after an add toggle action
|
137 |
+
$( document ).on( 'yith-add-box-button-toggle', init_dependencies );
|
138 |
|
139 |
//connected list
|
140 |
$( '.rm_connectedlist' ).each( function () {
|
plugin-fw/assets/js/yit-plugin-panel.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(a){function e(e,t,i,n){var
|
1 |
+
jQuery(function(a){function e(){a("[data-dep-target]:not( .deps-initialized )").each(function(){var e=a(this);e.addClass("deps-initialized");var t="#"+e.data("dep-target"),i="#"+e.data("dep-id"),n=e.data("dep-value"),d=e.data("dep-type"),s="change";"select-images"===a(i+"-wrapper").data("type")&&(s="yith_select_images_value_changed"),a(i).on(s,function(){!function(e,t,i,n){var d=!0;if("string"==typeof t){":radio"==t.substr(0,6)&&(t+=":checked");var s=a(t).data("type"),r=a(t).val();"checkbox"===s?r=a(t).is(":checked")?"yes":"no":"radio"===s&&(r=a(t).find('input[type="radio"]').filter(":checked").val()),"select-images"===a(t+"-wrapper").data("type")&&(r=a(t+"-wrapper").find("select").first().val()),i=i.split(",");for(var c=0;c<i.length;c++){if(r==i[c]){d=!0;break}d=!1}}var o=a(e),l=a(e+"-container").closest("tr");l.length<1&&(l=o.closest(".yith-plugin-fw-panel-wc-row, .yith-toggle-content-row"));var p,h=n.split("-");for(p in h){var f=h[p];if(d)switch(f){case"disable":l.removeClass("yith-disabled"),o.attr("disabled",!1);break;case"hideme":o.show();break;case"fadeInOut":case"fadeIn":l.show(500);break;case"fadeOut":l.show();break;default:l.show(),l.fadeTo("slow",1).addClass("fade-in")}else switch(f){case"disable":l.addClass("yith-disabled"),o.attr("disabled",!0);break;case"hideme":o.hide();break;case"fadeInOut":case"fadeOut":l.hide(500);break;case"fadeIn":l.hide();break;default:l.hasClass("fade-in")?l.fadeTo("slow",0,function(){a(this).hide().removeClass("fade-in")}):(l.hide(),l.css({opacity:"0"}))}}}(t,i,n.toString(),d)}).trigger(s)})}e(),a(document).on("yith-add-box-button-toggle",e),a(".rm_connectedlist").each(function(){var e=a(this).find("ul"),t=a(this).find(":hidden");e.sortable({connectWith:e,update:function(i,n){var d={};e.each(function(){var e={};a(this).children().each(function(){e[a(this).data("option")]=a(this).text()}),d[a(this).data("list")]=e}),t.val(JSON.stringify(d).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()}),a(document).ready(function(){a(".google-analytic-generate").click(function(){var e=a("#"+a(this).data("textarea")).data("codemirrorInstance"),t="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";t+="(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n",t+="m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",t+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n",t+="ga('create', '"+a("#"+a(this).data("input")).val()+"', '"+a(this).data("basename")+"');\n",t+="ga('send', 'pageview');\n",e.replaceRange(t,e.getCursor("start"),e.getCursor("end"))})}),a(".yith-plugin-fw-panel .woo-nav-tab-wrapper").removeClass("woo-nav-tab-wrapper").addClass("yith-nav-tab-wrapper");var t=a(".wrap.yith-plugin-ui").first(),i=a("div.updated, div.error, div.notice");if(i.addClass("inline"),t.length&&t.prepend(i),a(document).find(".yith-nav-sub-tab.nav-tab-active").length){var n=a(document).find(".yith-plugin-fw-wp-page-wrapper");if(n.length||(n=a(document).find("#wpbody-content > .yith-plugin-ui")),n)(t=n.find(".yit-admin-panel-content-wrap")).length?t.addClass("has-subnav"):n.find(".wrap").wrap('<div class="wrap subnav-wrap"></div>')}});
|
plugin-fw/assets/js/yith-fields.js
CHANGED
@@ -62,14 +62,14 @@
|
|
62 |
wrap1.length && wrap_main1.find( 'a.wp-color-result' ).attr( 'title', select_label );
|
63 |
wrap_main2.length && wrap_main2.find( 'a.wp-color-result' ).attr( 'title', select_label );
|
64 |
|
65 |
-
if ( !wrap1.find( '.wp-picker-
|
66 |
var button = $( '<span/>' ).attr( {
|
67 |
class: "wp-picker-default-custom"
|
68 |
} );
|
69 |
wrap1.find( '.wp-picker-default' ).wrap( button );
|
70 |
}
|
71 |
|
72 |
-
if ( !wrap2.find( '.wp-picker-
|
73 |
var button = $( '<span/>' ).attr( {
|
74 |
class: "wp-picker-default-custom"
|
75 |
} );
|
@@ -572,8 +572,8 @@
|
|
572 |
target_id = $this.data( 'box_id' ),
|
573 |
closed_label = $this.data( 'closed_label' ),
|
574 |
label = $this.data( 'opened_label' ),
|
575 |
-
id = $this.closest( '.yith-toggle_wrapper' ).attr( 'id' )
|
576 |
-
|
577 |
|
578 |
if ( '' !== target_id ) {
|
579 |
$( '#' + target_id ).html( template( { index: 'box_id' } ) ).slideToggle();
|
62 |
wrap1.length && wrap_main1.find( 'a.wp-color-result' ).attr( 'title', select_label );
|
63 |
wrap_main2.length && wrap_main2.find( 'a.wp-color-result' ).attr( 'title', select_label );
|
64 |
|
65 |
+
if ( ! wrap1.find( '.wp-picker-default-custom' ).length ) {
|
66 |
var button = $( '<span/>' ).attr( {
|
67 |
class: "wp-picker-default-custom"
|
68 |
} );
|
69 |
wrap1.find( '.wp-picker-default' ).wrap( button );
|
70 |
}
|
71 |
|
72 |
+
if ( ! wrap2.find( '.wp-picker-default-custom' ).length ) {
|
73 |
var button = $( '<span/>' ).attr( {
|
74 |
class: "wp-picker-default-custom"
|
75 |
} );
|
572 |
target_id = $this.data( 'box_id' ),
|
573 |
closed_label = $this.data( 'closed_label' ),
|
574 |
label = $this.data( 'opened_label' ),
|
575 |
+
id = $this.closest( '.yith-toggle_wrapper' ).attr( 'id' ),
|
576 |
+
template = wp.template( 'yith-toggle-element-add-box-content-' + id );
|
577 |
|
578 |
if ( '' !== target_id ) {
|
579 |
$( '#' + target_id ).html( template( { index: 'box_id' } ) ).slideToggle();
|
plugin-fw/assets/js/yith-fields.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e(document).on("yith_fields_init",function(){var t=e(".yith-plugin-fw-datepicker"),i=e(".yith-plugin-fw-colorpicker"),a={imgPreviewHandler:".yith-plugin-fw-upload-img-preview",uploadButtonHandler:".yith-plugin-fw-upload-button",imgUrlHandler:".yith-plugin-fw-upload-img-url",resetButtonHandler:".yith-plugin-fw-upload-button-reset",imgUrl:e(".yith-plugin-fw-upload-img-url")},n=e(".add_media"),l={sliderWrapper:e(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},s=e(".yith-plugin-fw-sidebar-layout"),o=e(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=e(".codemirror"),d=e(".yit-icons-manager-wrapper");e(".yith-plugin-ui td.forminp-checkbox");t.each(function(){var t=e(this).data();t.showAnim=!1,t.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},t.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},e(this).datepicker(t)}),i.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.change()}}),i.each(function(){var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),a=e(this).closest(".yith-single-colorpicker"),n=i.find(".wp-picker-input-wrap"),l=a.find(".wp-picker-input-wrap");if(n.length&&i.find("a.wp-color-result").attr("title",t),a.length&&a.find("a.wp-color-result").attr("title",t),!n.find(".wp-picker-clear-custom").length){var s=e("<span/>").attr({"class":"wp-picker-default-custom"});n.find(".wp-picker-default").wrap(s)}l.find(".wp-picker-clear-custom").length||(s=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(s))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(a.imgUrl.change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),n=e(this).parent().find(a.imgPreviewHandler).first();n.length<1&&(n=e(this).parent().parent().find(a.imgPreviewHandler).first()),i.test(t)?n.html('<img src="'+t+'" style="max-width:100px; max-height:100px;" />'):n.html("")}).trigger("change"),e(document).on("click",a.uploadButtonHandler,function(t){t.preventDefault();var i,n=e(this).attr("id").replace(/-button$/,"").replace(/(\[|\])/g,"\\$1");if(i)i.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+n).val(t.url),e("#"+n+"-yith-attachment-id")&&e("#"+n+"-yith-attachment-id").val(t.id),a.imgUrl.trigger("change")}),i.open()}}),e(document).on("click",a.resetButtonHandler,function(t){var i=e(this),n=i.attr("id").replace(/(\[|\])/g,"\\$1"),l=i.attr("id").replace(/-button-reset$/,"").replace(/(\[|\])/g,"\\$1"),s=e("#"+n).data("default");e("#"+l).val(s),a.imgUrl.trigger("change")}));n.on("click",function(){}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("click",l.buttonHandler,function(t){var i=e(this),a=i.closest(".image-gallery"),n=a.find(".image_gallery_ids"),l=n.val(),s=a.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]});o.on("select",function(){o.state().get("selection").map(function(e){(e=e.toJSON()).id&&(l=l?l+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">x</a></li></ul></li>'))}),n.val(l)}),o.open()}),l.sliderWrapper.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(i,a){var n="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),t.closest(".image-gallery").find(".image_gallery_ids").val(n)}})}),l.sliderWrapper.on("click","a.delete",function(){var t=e(this).closest(".image-gallery"),i=e(this).closest(".image-gallery ul.slides-wrapper"),a=t.find(".image_gallery_ids"),n="";e(this).closest("li.image").remove(),i.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),a.val(n)})),s.each(function(){e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),a=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),n=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==n)switch(n){case"left":i.show(),a.hide();break;case"right":a.show(),i.hide();break;case"double":i.show(),a.show();break;default:i.hide(),a.hide()}})}),o.each(function(){var t=e(this).data("val"),i=e(this).data("min"),a=e(this).data("max"),n=e(this).data("step"),l=e(this).data("labels");e(this).slider({value:t,min:i,max:a,range:"min",step:n,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+l)}})}),r.each(function(t,i){var a=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",a)}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),a=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(n){var l=e(n.target).closest("li"),s=l.data("font"),o=l.data("icon"),r=l.data("key"),d=l.data("name");i.attr("data-font",s),i.attr("data-icon",o),i.attr("data-key",r),i.attr("data-name",d),a.val(s+":"+d),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),a=t.closest(".yith-plugin-fw-select-images__wrapper"),n=a.find(".yith-plugin-fw-select-images__item"),l=a.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed"),n.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document.body).trigger("wc-enhanced-select-init"),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var a=jQuery(".ui-sortable-handle"),n=0,l=new Array;for(n=0;n<a.length;n++)l[n]=e(a[n]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("checked")?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e.fn.saveToggleElement=function(t,i){var a=e(this),n="yith_plugin_fw_save_toggle_element",l=a.serializeToggleElement(),s=a.find(".yith-toggle_wrapper"),o=s.attr("id"),r=e.urlParam("tab");l.append("security",s.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),a.closest(".metaboxes-tab.yith-plugin-ui").length?(n="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+n+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+o+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+n+"&tab="+r+"&toggle_id="+o,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,a])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,a=e(t).find(":input").serializeArray();return e.each(a,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),a=t.find("span.title").data("title_format"),n=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==a)var s=a.match(l);if(void 0!==n)var o=n.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)))}),""!==a&&t.find("span.title").html(a),""!==n&&t.find(".subtitle").html(n),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),a=i.closest(".yith-toggle-row"),n=a.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;a.is(".yith-toggle-row-opened")?n.slideUp(400):n.slideDown(400),a.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),a=i.data("box_id"),n=i.data("closed_label"),l=i.data("opened_label"),s=i.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+s),""!==a&&(e("#"+a).html(template({index:"box_id"})).slideToggle(),""!==n&&(i.html()===n?i.html(l).removeClass("closed"):i.html(n).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),a=e(this).closest(".yith-toggle_wrapper").attr("id"),n=i.find(".spinner"),l=e(this).parents(".toggle-element"),s=i.find(":input"),o=l.find(".yith-toggle-row").length,r=e('<input type="hidden">');r.val(o),e(document).trigger("yith-toggle-change-counter",[r,i]),o=r.val();var d=wp.template("yith-toggle-element-item-"+a),c=e(d({index:o}));n.addClass("show"),e.each(s,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_val=e(i).val(),"radio"==e(i).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+o,e(i).is(":checked")&&e(c).find("#"+$field_id).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(c).find("#"+$field_id).html(e("#"+e(i).attr("id")).html()),e(c).find("#"+$field_id).val($field_val))}),e(c).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,c,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(c),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),a=e(this).closest(".yith-toggle-row"),n=a.find(".spinner");a.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,a,l]),"yes"===l.val()&&(n.addClass("show"),i.saveToggleElement(n))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).val(e(this).data("value")),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var t={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var i=t;e(document).on("click",i.selectors.units.single,i.unitChange),e(document).on("click",i.selectors.linked.button,i.linkedChange),e(document).on("change keyup",i.selectors.dimensions.number,i.numberChange)},unitChange:function(i){var a=e(this).closest(t.selectors.units.single),n=a.closest(t.selectors.units.wrapper),l=n.find(t.selectors.units.single),s=n.find(t.selectors.units.value).first(),o=a.data("value");l.removeClass(t.selectors.units.selectedClass),a.addClass(t.selectors.units.selectedClass),s.val(o)},linkedChange:function(){var i=e(this).closest(t.selectors.linked.button),a=i.closest(t.selectors.wrapper),n=i.find(t.selectors.linked.value);"yes"===n.val()?(a.removeClass(t.selectors.linked.wrapperActiveClass),n.val("no")):(a.addClass(t.selectors.linked.wrapperActiveClass),n.val("yes"),a.find(t.selectors.dimensions.number).first().trigger("change"))},numberChange:function(i){var a=e(this).closest(t.selectors.dimensions.number),n=a.closest(t.selectors.wrapper);n.hasClass(t.selectors.linked.wrapperActiveClass)&&n.find(t.selectors.dimensions.number).val(a.val())}};t.init()}(jQuery);
|
1 |
+
!function(e){e(document).on("yith_fields_init",function(){var t=e(".yith-plugin-fw-datepicker"),i=e(".yith-plugin-fw-colorpicker"),a={imgPreviewHandler:".yith-plugin-fw-upload-img-preview",uploadButtonHandler:".yith-plugin-fw-upload-button",imgUrlHandler:".yith-plugin-fw-upload-img-url",resetButtonHandler:".yith-plugin-fw-upload-button-reset",imgUrl:e(".yith-plugin-fw-upload-img-url")},n=e(".add_media"),l={sliderWrapper:e(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},s=e(".yith-plugin-fw-sidebar-layout"),o=e(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=e(".codemirror"),d=e(".yit-icons-manager-wrapper");e(".yith-plugin-ui td.forminp-checkbox");t.each(function(){var t=e(this).data();t.showAnim=!1,t.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},t.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},e(this).datepicker(t)}),i.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.change()}}),i.each(function(){var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),a=e(this).closest(".yith-single-colorpicker"),n=i.find(".wp-picker-input-wrap"),l=a.find(".wp-picker-input-wrap");if(n.length&&i.find("a.wp-color-result").attr("title",t),a.length&&a.find("a.wp-color-result").attr("title",t),!n.find(".wp-picker-default-custom").length){var s=e("<span/>").attr({"class":"wp-picker-default-custom"});n.find(".wp-picker-default").wrap(s)}l.find(".wp-picker-default-custom").length||(s=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(s))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(a.imgUrl.change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),n=e(this).parent().find(a.imgPreviewHandler).first();n.length<1&&(n=e(this).parent().parent().find(a.imgPreviewHandler).first()),i.test(t)?n.html('<img src="'+t+'" style="max-width:100px; max-height:100px;" />'):n.html("")}).trigger("change"),e(document).on("click",a.uploadButtonHandler,function(t){t.preventDefault();var i,n=e(this).attr("id").replace(/-button$/,"").replace(/(\[|\])/g,"\\$1");if(i)i.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+n).val(t.url),e("#"+n+"-yith-attachment-id")&&e("#"+n+"-yith-attachment-id").val(t.id),a.imgUrl.trigger("change")}),i.open()}}),e(document).on("click",a.resetButtonHandler,function(t){var i=e(this),n=i.attr("id").replace(/(\[|\])/g,"\\$1"),l=i.attr("id").replace(/-button-reset$/,"").replace(/(\[|\])/g,"\\$1"),s=e("#"+n).data("default");e("#"+l).val(s),a.imgUrl.trigger("change")}));n.on("click",function(){}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("click",l.buttonHandler,function(t){var i=e(this),a=i.closest(".image-gallery"),n=a.find(".image_gallery_ids"),l=n.val(),s=a.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]});o.on("select",function(){o.state().get("selection").map(function(e){(e=e.toJSON()).id&&(l=l?l+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">x</a></li></ul></li>'))}),n.val(l)}),o.open()}),l.sliderWrapper.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(i,a){var n="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),t.closest(".image-gallery").find(".image_gallery_ids").val(n)}})}),l.sliderWrapper.on("click","a.delete",function(){var t=e(this).closest(".image-gallery"),i=e(this).closest(".image-gallery ul.slides-wrapper"),a=t.find(".image_gallery_ids"),n="";e(this).closest("li.image").remove(),i.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),a.val(n)})),s.each(function(){e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),a=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),n=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==n)switch(n){case"left":i.show(),a.hide();break;case"right":a.show(),i.hide();break;case"double":i.show(),a.show();break;default:i.hide(),a.hide()}})}),o.each(function(){var t=e(this).data("val"),i=e(this).data("min"),a=e(this).data("max"),n=e(this).data("step"),l=e(this).data("labels");e(this).slider({value:t,min:i,max:a,range:"min",step:n,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+l)}})}),r.each(function(t,i){var a=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",a)}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),a=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(n){var l=e(n.target).closest("li"),s=l.data("font"),o=l.data("icon"),r=l.data("key"),d=l.data("name");i.attr("data-font",s),i.attr("data-icon",o),i.attr("data-key",r),i.attr("data-name",d),a.val(s+":"+d),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),a=t.closest(".yith-plugin-fw-select-images__wrapper"),n=a.find(".yith-plugin-fw-select-images__item"),l=a.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed"),n.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document.body).trigger("wc-enhanced-select-init"),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var a=jQuery(".ui-sortable-handle"),n=0,l=new Array;for(n=0;n<a.length;n++)l[n]=e(a[n]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("checked")?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e.fn.saveToggleElement=function(t,i){var a=e(this),n="yith_plugin_fw_save_toggle_element",l=a.serializeToggleElement(),s=a.find(".yith-toggle_wrapper"),o=s.attr("id"),r=e.urlParam("tab");l.append("security",s.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),a.closest(".metaboxes-tab.yith-plugin-ui").length?(n="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+n+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+o+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+n+"&tab="+r+"&toggle_id="+o,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,a])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,a=e(t).find(":input").serializeArray();return e.each(a,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),a=t.find("span.title").data("title_format"),n=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==a)var s=a.match(l);if(void 0!==n)var o=n.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)))}),""!==a&&t.find("span.title").html(a),""!==n&&t.find(".subtitle").html(n),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),a=i.closest(".yith-toggle-row"),n=a.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;a.is(".yith-toggle-row-opened")?n.slideUp(400):n.slideDown(400),a.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),a=i.data("box_id"),n=i.data("closed_label"),l=i.data("opened_label"),s=i.closest(".yith-toggle_wrapper").attr("id"),o=wp.template("yith-toggle-element-add-box-content-"+s);""!==a&&(e("#"+a).html(o({index:"box_id"})).slideToggle(),""!==n&&(i.html()===n?i.html(l).removeClass("closed"):i.html(n).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),a=e(this).closest(".yith-toggle_wrapper").attr("id"),n=i.find(".spinner"),l=e(this).parents(".toggle-element"),s=i.find(":input"),o=l.find(".yith-toggle-row").length,r=e('<input type="hidden">');r.val(o),e(document).trigger("yith-toggle-change-counter",[r,i]),o=r.val();var d=wp.template("yith-toggle-element-item-"+a),c=e(d({index:o}));n.addClass("show"),e.each(s,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_val=e(i).val(),"radio"==e(i).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+o,e(i).is(":checked")&&e(c).find("#"+$field_id).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(c).find("#"+$field_id).html(e("#"+e(i).attr("id")).html()),e(c).find("#"+$field_id).val($field_val))}),e(c).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,c,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(c),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),a=e(this).closest(".yith-toggle-row"),n=a.find(".spinner");a.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,a,l]),"yes"===l.val()&&(n.addClass("show"),i.saveToggleElement(n))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).val(e(this).data("value")),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var t={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var i=t;e(document).on("click",i.selectors.units.single,i.unitChange),e(document).on("click",i.selectors.linked.button,i.linkedChange),e(document).on("change keyup",i.selectors.dimensions.number,i.numberChange)},unitChange:function(i){var a=e(this).closest(t.selectors.units.single),n=a.closest(t.selectors.units.wrapper),l=n.find(t.selectors.units.single),s=n.find(t.selectors.units.value).first(),o=a.data("value");l.removeClass(t.selectors.units.selectedClass),a.addClass(t.selectors.units.selectedClass),s.val(o)},linkedChange:function(){var i=e(this).closest(t.selectors.linked.button),a=i.closest(t.selectors.wrapper),n=i.find(t.selectors.linked.value);"yes"===n.val()?(a.removeClass(t.selectors.linked.wrapperActiveClass),n.val("no")):(a.addClass(t.selectors.linked.wrapperActiveClass),n.val("yes"),a.find(t.selectors.dimensions.number).first().trigger("change"))},numberChange:function(i){var a=e(this).closest(t.selectors.dimensions.number),n=a.closest(t.selectors.wrapper);n.hasClass(t.selectors.linked.wrapperActiveClass)&&n.find(t.selectors.dimensions.number).val(a.val())}};t.init()}(jQuery);
|
plugin-fw/assets/js/yith-gutenberg.min.js
CHANGED
@@ -1,6 +1 @@
|
|
1 |
-
|
2 |
-
[c,a]);h.ajax({async:!0,url:yith_gutenberg_ajax.ajaxurl,method:"post",data:{action:"yith_plugin_fw_gutenberg_do_shortcode",shortcode:c},success:function(l){d=l;""!=d&&(h(".yith_block_"+a).html(d),h(document).trigger("yith_plugin_fw_gutenberg_success_do_shortcode",[c,a,d]))}});h(document).trigger("yith_plugin_fw_gutenberg_after_do_shortcode",[c,a,d]);return d}(g);f=m(t,null,f)}return f}function r(g,b,e,f){var c={};if("colorpicker"==f||"color"==f)g=g.hex;c[b]=g;e.setAttributes(c);return e}var m=wp.element.createElement,
|
3 |
-
u=wp.element.Fragment,v=wp.blocks.registerBlockType,w=wp.editor.InspectorControls,t=wp.element.RawHTML,x=wp.components.SelectControl,y=wp.components.ToggleControl,z=wp.components.CheckboxControl,A=wp.components.RangeControl,B=wp.components.ColorPicker,C=wp.components.RadioControl,D=wp.components.TextControl,E=wp.components.TextareaControl,F=m("svg",{width:22,height:22},m("path",{d:"M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"}));
|
4 |
-
h.each(yith_gutenberg,function(g,b){v("yith/"+g,{title:b.title,description:b.description,category:b.category,attributes:b.attributes,icon:"undefined"!=typeof b.icon?b.icon:F,keywords:b.keywords,edit:function(e){var f=[];h.each(b.attributes,function(c,a){var d=null,l=a.blocktype;if("undefined"!=typeof l){switch(l){case "select":d=x;break;case "text":d=D;break;case "textarea":d=E;break;case "toggle":d=y;break;case "checkbox":d=z;break;case "number":case "range":d=A;break;case "color":case "colorpicker":d=
|
5 |
-
B;break;case "radio":d=C}if(null!=d){var n=helpMessageUncheked="";"undefined"!=typeof a.helps&&"undefined"!=typeof a.helps.checked&&"undefined"!=typeof a.helps.unchecked?(n=a.helps.checked,helpMessageUncheked=a.helps.unchecked):"undefined"!=typeof a.help&&(n=helpMessageUncheked=a.help);f.push(m(d,{value:e.attributes[c],options:a.options,label:a.label,checked:e.attributes[c],selected:e.attributes[c],help:e.attributes[c]?n:helpMessageUncheked,disableAlpha:a.disableAlpha,min:a.min,max:a.max,multiple:a.multiple,
|
6 |
-
onChange:function(p,k){k=void 0===k?c:k;e=r(p,k,e,l)},onChangeComplete:function(p,k){k=void 0===k?c:k;e=r(p,k,e,l)}}))}}});sc=q(e,b,"edit");return[m(u,null,m(w,null,f),sc)]},save:function(e){return q(e,b,"save")}})})})(jQuery);
|
1 |
+
!function(e){wp.i18n.__;var t=wp.element.createElement,o=wp.element.Fragment,n=(wp.components.PanelBody,wp.blocks.registerBlockType),c=(wp.editor.RichText,wp.editor.BlockControls,wp.editor.InspectorControls),r=(wp.editor.AlignmentToolbar,wp.components,wp.element.RawHTML),a=wp.components.SelectControl,i=wp.components.ToggleControl,s=wp.components.CheckboxControl,l=wp.components.RangeControl,p=wp.components.ColorPicker,u=wp.components.RadioControl,d=wp.components.TextControl,h=wp.components.TextareaControl;const C=t("svg",{width:22,height:22},t("path",{d:"M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"}));function b(o,n,c){var a="",i="";if("undefined"!=typeof n.callback&&"function"==typeof e[n.callback])a=e[n.callback](o,n);else{var s="["+n.shortcode_name;e.each(o.attributes,function(e,t){if("undefined"!=typeof n.attributes&&"undefined"!=typeof n.attributes[e]){s+=" "+e+"=";var o=n.attributes[e].remove_quotes;s+=1==o?t:'"'+t+'"'}}),s+="]";var l=md5(s);i='<span class="yith_block_'+l+'">'+s+"</span>","edit"==c&&0!=n.do_shortcode&&function(t){var o=null;return e(document).trigger("yith_plugin_fw_gutenberg_before_do_shortcode",[s,t]),e.ajax({async:!0,url:yith_gutenberg_ajax.ajaxurl,method:"post",data:{action:"yith_plugin_fw_gutenberg_do_shortcode",shortcode:s},success:function(n){""!=(o=n)&&(e(".yith_block_"+t).html(o),e(document).trigger("yith_plugin_fw_gutenberg_success_do_shortcode",[s,t,o]))}}),e(document).trigger("yith_plugin_fw_gutenberg_after_do_shortcode",[s,t,o]),o}(l),a=t(r,null,i)}return a}function g(e,t,o,n){var c={};return"colorpicker"!=n&&"color"!=n||(e=e.hex),c[t]=e,o.setAttributes(c),o}e.each(yith_gutenberg,function(r,f){n("yith/"+r,{title:f.title,description:f.description,category:f.category,attributes:f.attributes,icon:"undefined"!=typeof f.icon?f.icon:C,keywords:f.keywords,edit:function(n){var r=new Array;return e.each(f.attributes,function(e,o){var c=null,C=o.blocktype;if(void 0!==C){switch(C){case"select":c=a;break;case"text":c=d;break;case"textarea":c=h;break;case"toggle":c=i;break;case"checkbox":c=s;break;case"number":case"range":c=l;break;case"color":case"colorpicker":c=p;break;case"radio":c=u}if(null!=c){var b=helpMessageUncheked="";"undefined"!=typeof o.helps&&"undefined"!=typeof o.helps.checked&&"undefined"!=typeof o.helps.unchecked?(b=o.helps.checked,helpMessageUncheked=o.helps.unchecked):"undefined"!=typeof o.help&&(b=helpMessageUncheked=o.help),r.push(t(c,{value:n.attributes[e],options:o.options,label:o.label,checked:n.attributes[e],selected:n.attributes[e],help:n.attributes[e]?b:helpMessageUncheked,disableAlpha:o.disableAlpha,min:o.min,max:o.max,multiple:o.multiple,onChange:function(t,o=e){n=g(t,o,n,C)},onChangeComplete:function(t,o=e){n=g(t,o,n,C)}}))}}}),sc=b(n,f,"edit"),[t(o,null,t(c,null,r),sc)]},save:function(e){return b(e,f,"save")}})})}(jQuery);
|
|
|
|
|
|
|
|
|
|
plugin-fw/init.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
-
* Version: 3.4.
|
5 |
* Author: YITH
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
8 |
*
|
9 |
* @author Your Inspiration Themes
|
10 |
-
* @version 3.4.
|
11 |
*/
|
12 |
/**
|
13 |
* This file belongs to the YIT Plugin Framework.
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
+
* Version: 3.4.33
|
5 |
* Author: YITH
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
8 |
*
|
9 |
* @author Your Inspiration Themes
|
10 |
+
* @version 3.4.33
|
11 |
*/
|
12 |
/**
|
13 |
* This file belongs to the YIT Plugin Framework.
|
plugin-fw/lib/yit-plugin-licence.php
CHANGED
@@ -87,8 +87,8 @@ if ( ! class_exists( 'YIT_Plugin_Licence' ) ) {
|
|
87 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
88 |
* @since 3.0.17
|
89 |
*/
|
90 |
-
public static function get_license_activation_url(){
|
91 |
-
return function_exists( 'YITH_Plugin_Licence' ) ? YITH_Plugin_Licence()->get_license_activation_url() : false;
|
92 |
}
|
93 |
|
94 |
/**
|
87 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
88 |
* @since 3.0.17
|
89 |
*/
|
90 |
+
public static function get_license_activation_url( $plugin_slug = '' ){
|
91 |
+
return function_exists( 'YITH_Plugin_Licence' ) ? YITH_Plugin_Licence()->get_license_activation_url( $plugin_slug ) : false;
|
92 |
}
|
93 |
|
94 |
/**
|
plugin-fw/templates/fields/radio.php
CHANGED
@@ -21,7 +21,7 @@ $class = 'yith-plugin-fw-radio ' . $class;
|
|
21 |
?>
|
22 |
<div class="<?php echo $class ?>" id="<?php echo $id ?>"
|
23 |
<?php echo $custom_attributes ?>
|
24 |
-
<?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?> data-value="<?php echo $value ?>">
|
25 |
<?php foreach ( $options as $key => $label ) :
|
26 |
$radio_id = sanitize_key( $id . '-' . $key );
|
27 |
?>
|
21 |
?>
|
22 |
<div class="<?php echo $class ?>" id="<?php echo $id ?>"
|
23 |
<?php echo $custom_attributes ?>
|
24 |
+
<?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?> data-value="<?php echo $value ?>" data-type="radio">
|
25 |
<?php foreach ( $options as $key => $label ) :
|
26 |
$radio_id = sanitize_key( $id . '-' . $key );
|
27 |
?>
|
plugin-fw/templates/fields/select.php
CHANGED
@@ -25,6 +25,7 @@ $class = isset( $class ) ? $class : 'yith-plugin-fw-select';
|
|
25 |
id="<?php echo $id ?>"
|
26 |
name="<?php echo $name ?><?php if ( $multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>
|
27 |
data-std="<?php echo ( $multiple ) ? implode( ' ,', $std ) : $std ?>"<?php endif ?>
|
|
|
28 |
|
29 |
class="<?php echo $class ?>"
|
30 |
<?php echo $placeholder ?>
|
25 |
id="<?php echo $id ?>"
|
26 |
name="<?php echo $name ?><?php if ( $multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>
|
27 |
data-std="<?php echo ( $multiple ) ? implode( ' ,', $std ) : $std ?>"<?php endif ?>
|
28 |
+
data-value="<?php echo ( $multiple ) ? implode( ' ,', $value ) : $value; ?>"
|
29 |
|
30 |
class="<?php echo $class ?>"
|
31 |
<?php echo $placeholder ?>
|
plugin-fw/templates/fields/toggle-element.php
CHANGED
@@ -70,18 +70,21 @@ if ( empty( $values ) && !$show_add_button && $elements ) {
|
|
70 |
$element[ 'id' ] = 'new_' . $element[ 'id' ];
|
71 |
$element[ 'name' ] = $name . "[{{{data.index}}}][" . $element[ 'id' ] . "]";
|
72 |
$class_element = isset( $element[ 'class_row' ] ) ? $element[ 'class_row' ] : '';
|
|
|
|
|
|
|
|
|
73 |
|
74 |
$is_required = !empty( $element[ 'required' ] );
|
75 |
if ( $is_required ) {
|
76 |
$class_element .= ' yith-plugin-fw--required';
|
77 |
}
|
78 |
?>
|
79 |
-
<div class="yith-add-box-row <?php echo $class_element ?> <?php echo '{{{data.index}}}' ?>"
|
80 |
|
81 |
<label for="<?php echo $element[ 'id' ]; ?>"><?php echo( $element[ 'title' ] ); ?></label>
|
82 |
<div class="yith-plugin-fw-option-with-description">
|
83 |
-
<?php
|
84 |
-
echo yith_plugin_fw_get_field( $element, true ); ?>
|
85 |
<span class="description"><?php echo !empty( $element[ 'desc' ] ) ? $element[ 'desc' ] : ''; ?></span>
|
86 |
</div>
|
87 |
</div>
|
@@ -126,16 +129,14 @@ if ( empty( $values ) && !$show_add_button && $elements ) {
|
|
126 |
<?php
|
127 |
if ( !empty( $onoff_field ) && is_array( $onoff_field ) ):
|
128 |
$action = !empty( $onoff_field[ 'ajax_action' ] ) ? 'data-ajax_action="' . $onoff_field[ 'ajax_action' ] . '"' : '';
|
129 |
-
$onoff_field[ 'value' ] = isset( $value[ $onoff_id ] ) ? $value[ $onoff_id ] : $onoff_field[ 'default' ];
|
130 |
$onoff_field[ 'type' ] = 'onoff';
|
131 |
$onoff_field[ 'name' ] = $name . "[$i][" . $onoff_id . "]";
|
132 |
$onoff_field[ 'id' ] = $onoff_id . '_' . $i;
|
133 |
unset( $onoff_field[ 'yith-type' ] );
|
134 |
?>
|
135 |
<span class="yith-toggle-onoff" <?php echo $action; ?> >
|
136 |
-
<?php
|
137 |
-
echo yith_plugin_fw_get_field( $onoff_field, true );
|
138 |
-
?>
|
139 |
</span>
|
140 |
|
141 |
<?php if ( $sortable ): ?>
|
@@ -152,16 +153,21 @@ if ( empty( $values ) && !$show_add_button && $elements ) {
|
|
152 |
unset( $element[ 'yith-type' ] );
|
153 |
$element[ 'title' ] = $element[ 'name' ];
|
154 |
$element[ 'name' ] = $name . "[$i][" . $element[ 'id' ] . "]";
|
155 |
-
$element[ 'value' ] = isset( $value[ $element[ 'id' ] ] ) ? $value[ $element[ 'id' ] ] : $element[ 'default' ];
|
156 |
$element[ 'id' ] = $element[ 'id' ] . '_' . $i;
|
157 |
$element[ 'class_row' ] = isset( $element[ 'class_row' ] ) ? $element[ 'class_row' ] : '';
|
|
|
|
|
|
|
|
|
158 |
|
159 |
$is_required = !empty( $element[ 'required' ] );
|
160 |
if ( $is_required ) {
|
161 |
$element[ 'class_row' ] .= ' yith-plugin-fw--required';
|
162 |
}
|
|
|
163 |
?>
|
164 |
-
<div class="yith-toggle-content-row <?php echo $element[ 'class_row' ] . ' ' . $element[ 'type' ] ?>"
|
165 |
<label for="<?php echo $element[ 'id' ]; ?>"><?php echo $element[ 'title' ]; ?></label>
|
166 |
<div class="yith-plugin-fw-option-with-description">
|
167 |
<?php echo yith_plugin_fw_get_field( $element, true ); ?>
|
@@ -223,16 +229,14 @@ if ( empty( $values ) && !$show_add_button && $elements ) {
|
|
223 |
<?php
|
224 |
if ( !empty( $onoff_field ) && is_array( $onoff_field ) ):
|
225 |
$action = !empty( $onoff_field[ 'ajax_action' ] ) ? 'data-ajax_action="' . $onoff_field[ 'ajax_action' ] . '"' : '';
|
226 |
-
$onoff_field[ 'value' ] = $onoff_field[ 'default' ];
|
227 |
$onoff_field[ 'type' ] = 'onoff';
|
228 |
$onoff_field[ 'name' ] = $name . "[{{{data.index}}}][" . $onoff_id . "]";
|
229 |
$onoff_field[ 'id' ] = $onoff_id;
|
230 |
unset( $onoff_field[ 'yith-type' ] );
|
231 |
?>
|
232 |
<span class="yith-toggle-onoff" <?php echo $action; ?> >
|
233 |
-
<?php
|
234 |
-
echo yith_plugin_fw_get_field( $onoff_field, true );
|
235 |
-
?>
|
236 |
</span>
|
237 |
|
238 |
<?php endif; ?>
|
@@ -250,12 +254,17 @@ if ( empty( $values ) && !$show_add_button && $elements ) {
|
|
250 |
$element[ 'name' ] = $name . "[{{{data.index}}}][" . $element[ 'id' ] . "]";
|
251 |
$element[ 'id' ] = $element[ 'id' ] . '_{{{data.index}}}';
|
252 |
$class_element = isset( $element[ 'class_row' ] ) ? $element[ 'class_row' ] : '';
|
|
|
|
|
|
|
|
|
253 |
$is_required = !empty( $element[ 'required' ] );
|
254 |
if ( $is_required ) {
|
255 |
$class_element .= ' yith-plugin-fw--required';
|
256 |
}
|
|
|
257 |
?>
|
258 |
-
<div class="yith-toggle-content-row <?php echo $class_element . ' ' . $element[ 'type' ] ?>"
|
259 |
<label for="<?php echo $element[ 'id' ]; ?>"><?php echo $element[ 'title' ]; ?></label>
|
260 |
<div class="yith-plugin-fw-option-with-description">
|
261 |
<?php echo yith_plugin_fw_get_field( $element, true ); ?>
|
70 |
$element[ 'id' ] = 'new_' . $element[ 'id' ];
|
71 |
$element[ 'name' ] = $name . "[{{{data.index}}}][" . $element[ 'id' ] . "]";
|
72 |
$class_element = isset( $element[ 'class_row' ] ) ? $element[ 'class_row' ] : '';
|
73 |
+
// handle deps if any
|
74 |
+
! empty( $element[ 'deps' ]['id'] ) && $element[ 'deps' ]['id'] = 'new_' . $element[ 'deps' ]['id'];
|
75 |
+
! empty( $element[ 'deps' ]['target-id'] ) && $element[ 'deps' ]['target-id'] = 'new_' . $element[ 'deps' ]['target-id'];
|
76 |
+
$deps = yith_field_deps_data( $element );
|
77 |
|
78 |
$is_required = !empty( $element[ 'required' ] );
|
79 |
if ( $is_required ) {
|
80 |
$class_element .= ' yith-plugin-fw--required';
|
81 |
}
|
82 |
?>
|
83 |
+
<div class="yith-add-box-row yith-toggle-content-row <?php echo $class_element ?> <?php echo '{{{data.index}}}' ?>" <?php echo $deps ?>>
|
84 |
|
85 |
<label for="<?php echo $element[ 'id' ]; ?>"><?php echo( $element[ 'title' ] ); ?></label>
|
86 |
<div class="yith-plugin-fw-option-with-description">
|
87 |
+
<?php yith_plugin_fw_get_field( $element, true ); ?>
|
|
|
88 |
<span class="description"><?php echo !empty( $element[ 'desc' ] ) ? $element[ 'desc' ] : ''; ?></span>
|
89 |
</div>
|
90 |
</div>
|
129 |
<?php
|
130 |
if ( !empty( $onoff_field ) && is_array( $onoff_field ) ):
|
131 |
$action = !empty( $onoff_field[ 'ajax_action' ] ) ? 'data-ajax_action="' . $onoff_field[ 'ajax_action' ] . '"' : '';
|
132 |
+
$onoff_field[ 'value' ] = isset( $value[ $onoff_id ] ) ? $value[ $onoff_id ] : ( isset( $onoff_field[ 'default' ] ) ? $onoff_field[ 'default' ] : '' );
|
133 |
$onoff_field[ 'type' ] = 'onoff';
|
134 |
$onoff_field[ 'name' ] = $name . "[$i][" . $onoff_id . "]";
|
135 |
$onoff_field[ 'id' ] = $onoff_id . '_' . $i;
|
136 |
unset( $onoff_field[ 'yith-type' ] );
|
137 |
?>
|
138 |
<span class="yith-toggle-onoff" <?php echo $action; ?> >
|
139 |
+
<?php yith_plugin_fw_get_field( $onoff_field, true ); ?>
|
|
|
|
|
140 |
</span>
|
141 |
|
142 |
<?php if ( $sortable ): ?>
|
153 |
unset( $element[ 'yith-type' ] );
|
154 |
$element[ 'title' ] = $element[ 'name' ];
|
155 |
$element[ 'name' ] = $name . "[$i][" . $element[ 'id' ] . "]";
|
156 |
+
$element[ 'value' ] = isset( $value[ $element[ 'id' ] ] ) ? $value[ $element[ 'id' ] ] : ( isset( $element[ 'default' ] ) ? $element[ 'default' ] : '' );
|
157 |
$element[ 'id' ] = $element[ 'id' ] . '_' . $i;
|
158 |
$element[ 'class_row' ] = isset( $element[ 'class_row' ] ) ? $element[ 'class_row' ] : '';
|
159 |
+
// handle deps if any
|
160 |
+
! empty( $element[ 'deps' ]['id'] ) && $element[ 'deps' ]['id'] = $element[ 'deps' ]['id'] . '_' . $i;
|
161 |
+
! empty( $element[ 'deps' ]['target-id'] ) && $element[ 'deps' ]['target-id'] = $element[ 'deps' ]['target-id'] . '_' . $i;
|
162 |
+
$deps = yith_field_deps_data( $element );
|
163 |
|
164 |
$is_required = !empty( $element[ 'required' ] );
|
165 |
if ( $is_required ) {
|
166 |
$element[ 'class_row' ] .= ' yith-plugin-fw--required';
|
167 |
}
|
168 |
+
|
169 |
?>
|
170 |
+
<div class="yith-toggle-content-row <?php echo $element[ 'class_row' ] . ' ' . $element[ 'type' ] ?>" <?php echo $deps; ?>>
|
171 |
<label for="<?php echo $element[ 'id' ]; ?>"><?php echo $element[ 'title' ]; ?></label>
|
172 |
<div class="yith-plugin-fw-option-with-description">
|
173 |
<?php echo yith_plugin_fw_get_field( $element, true ); ?>
|
229 |
<?php
|
230 |
if ( !empty( $onoff_field ) && is_array( $onoff_field ) ):
|
231 |
$action = !empty( $onoff_field[ 'ajax_action' ] ) ? 'data-ajax_action="' . $onoff_field[ 'ajax_action' ] . '"' : '';
|
232 |
+
$onoff_field[ 'value' ] = isset( $onoff_field[ 'default' ] ) ? $onoff_field[ 'default' ] : '';
|
233 |
$onoff_field[ 'type' ] = 'onoff';
|
234 |
$onoff_field[ 'name' ] = $name . "[{{{data.index}}}][" . $onoff_id . "]";
|
235 |
$onoff_field[ 'id' ] = $onoff_id;
|
236 |
unset( $onoff_field[ 'yith-type' ] );
|
237 |
?>
|
238 |
<span class="yith-toggle-onoff" <?php echo $action; ?> >
|
239 |
+
<?php yith_plugin_fw_get_field( $onoff_field, true ); ?>
|
|
|
|
|
240 |
</span>
|
241 |
|
242 |
<?php endif; ?>
|
254 |
$element[ 'name' ] = $name . "[{{{data.index}}}][" . $element[ 'id' ] . "]";
|
255 |
$element[ 'id' ] = $element[ 'id' ] . '_{{{data.index}}}';
|
256 |
$class_element = isset( $element[ 'class_row' ] ) ? $element[ 'class_row' ] : '';
|
257 |
+
// handle deps if any
|
258 |
+
! empty( $element[ 'deps' ]['id'] ) && $element[ 'deps' ]['id'] = $element[ 'deps' ]['id'] . '_{{{data.index}}}';
|
259 |
+
! empty( $element[ 'deps' ]['target-id'] ) && $element[ 'deps' ]['target-id'] = $element[ 'deps' ]['target-id'] . '_{{{data.index}}}';
|
260 |
+
$deps = yith_field_deps_data( $element );
|
261 |
$is_required = !empty( $element[ 'required' ] );
|
262 |
if ( $is_required ) {
|
263 |
$class_element .= ' yith-plugin-fw--required';
|
264 |
}
|
265 |
+
|
266 |
?>
|
267 |
+
<div class="yith-toggle-content-row <?php echo $class_element . ' ' . $element[ 'type' ] ?>" <?php echo $deps; ?>>
|
268 |
<label for="<?php echo $element[ 'id' ]; ?>"><?php echo $element[ 'title' ]; ?></label>
|
269 |
<div class="yith-plugin-fw-option-with-description">
|
270 |
<?php echo yith_plugin_fw_get_field( $element, true ); ?>
|
plugin-fw/yit-plugin.php
CHANGED
@@ -184,14 +184,14 @@ if( ! function_exists( 'yith_add_action_links' ) ){
|
|
184 |
* @return mixed
|
185 |
* @use plugin_action_links_{$plugin_file_name}
|
186 |
*/
|
187 |
-
function yith_add_action_links( $links, $panel_page = '', $is_premium = false ) {
|
188 |
$links = is_array( $links ) ? $links : array();
|
189 |
if( ! empty( $panel_page ) ){
|
190 |
$links[] = sprintf( '<a href="%s">%s</a>', admin_url( "admin.php?page={$panel_page}" ), _x( 'Settings', 'Action links', 'yith-plugin-fw' ) );
|
191 |
}
|
192 |
|
193 |
if( $is_premium && class_exists( 'YIT_Plugin_Licence' ) ){
|
194 |
-
$links[] = sprintf( '<a href="%s">%s</a>', YIT_Plugin_Licence()->get_license_activation_url(),__( 'License', 'yith-plugin-fw' ) );
|
195 |
}
|
196 |
|
197 |
return $links;
|
184 |
* @return mixed
|
185 |
* @use plugin_action_links_{$plugin_file_name}
|
186 |
*/
|
187 |
+
function yith_add_action_links( $links, $panel_page = '', $is_premium = false, $plugin_slug = '' ) {
|
188 |
$links = is_array( $links ) ? $links : array();
|
189 |
if( ! empty( $panel_page ) ){
|
190 |
$links[] = sprintf( '<a href="%s">%s</a>', admin_url( "admin.php?page={$panel_page}" ), _x( 'Settings', 'Action links', 'yith-plugin-fw' ) );
|
191 |
}
|
192 |
|
193 |
if( $is_premium && class_exists( 'YIT_Plugin_Licence' ) ){
|
194 |
+
$links[] = sprintf( '<a href="%s">%s</a>', YIT_Plugin_Licence()->get_license_activation_url( $plugin_slug ),__( 'License', 'yith-plugin-fw' ) );
|
195 |
}
|
196 |
|
197 |
return $links;
|