Version Description
Released on 16 October 2020 =
New: support for WooCommerce 4.6
Update: plugin framework
Tweak: return product price as float in item class
Fix: prevent possible fatal error when printing ATW button
Fix: original price being sent to database as int instead of float
Dev: added new filter yith_wcwl_set_session_cookie
Dev: added new filter yith_wcwl_privacy_value
Dev: added new parameter to yith_wcwl_{privacy}_wishlist_visibility filter
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Wishlist |
Version | 3.0.15 |
Comparing to | |
See all releases |
Code changes from version 3.0.14 to 3.0.15
- README.md +8 -5
- README.txt +14 -3
- assets/js/jquery.yith-wcwl.js +1 -1
- assets/js/unminified/jquery.yith-wcwl.js +2 -2
- includes/class.yith-wcwl-frontend.php +1 -1
- includes/class.yith-wcwl-session.php +1 -1
- includes/class.yith-wcwl-shortcode.php +2 -2
- includes/class.yith-wcwl-wishlist-item.php +3 -3
- includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php +10 -6
- includes/functions.yith-wcwl.php +2 -2
- init.php +2 -2
- languages/yith-woocommerce-wishlist-da_DK.mo +0 -0
- languages/yith-woocommerce-wishlist-da_DK.po +1 -1
- languages/yith-woocommerce-wishlist-de_DE.mo +0 -0
- languages/yith-woocommerce-wishlist-de_DE.po +1 -1
- languages/yith-woocommerce-wishlist-es_AR.mo +0 -0
- languages/yith-woocommerce-wishlist-es_AR.po +1 -1
- languages/yith-woocommerce-wishlist-es_ES.mo +0 -0
- languages/yith-woocommerce-wishlist-es_ES.po +1 -1
- languages/yith-woocommerce-wishlist-es_MX.mo +0 -0
- languages/yith-woocommerce-wishlist-es_MX.po +1 -1
- languages/yith-woocommerce-wishlist-fa_IR.mo +0 -0
- languages/yith-woocommerce-wishlist-fa_IR.po +1 -1
- languages/yith-woocommerce-wishlist-fr_FR.mo +0 -0
- languages/yith-woocommerce-wishlist-fr_FR.po +1 -1
- languages/yith-woocommerce-wishlist-he_IL.mo +0 -0
- languages/yith-woocommerce-wishlist-he_IL.po +1 -1
- languages/yith-woocommerce-wishlist-hr.mo +0 -0
- languages/yith-woocommerce-wishlist-hr.po +1 -1
- languages/yith-woocommerce-wishlist-it_IT.mo +0 -0
- languages/yith-woocommerce-wishlist-it_IT.po +1 -1
- languages/yith-woocommerce-wishlist-ko_KR.mo +0 -0
- languages/yith-woocommerce-wishlist-ko_KR.po +1 -1
- languages/yith-woocommerce-wishlist-nl_NL.mo +0 -0
- languages/yith-woocommerce-wishlist-nl_NL.po +1 -1
- languages/yith-woocommerce-wishlist-pl_PL.mo +0 -0
- languages/yith-woocommerce-wishlist-pl_PL.po +1 -1
- languages/yith-woocommerce-wishlist-pt_BR.mo +0 -0
- languages/yith-woocommerce-wishlist-pt_BR.po +1 -1
- languages/yith-woocommerce-wishlist-pt_PT.mo +0 -0
- languages/yith-woocommerce-wishlist-pt_PT.po +1 -1
- languages/yith-woocommerce-wishlist-ru_RU.mo +0 -0
- languages/yith-woocommerce-wishlist-ru_RU.po +1 -1
- languages/yith-woocommerce-wishlist-sv_SE.mo +0 -0
- languages/yith-woocommerce-wishlist-sv_SE.po +1 -1
- languages/yith-woocommerce-wishlist-tr_TR.mo +0 -0
- languages/yith-woocommerce-wishlist-tr_TR.po +1 -1
- languages/yith-woocommerce-wishlist-uk_UA.mo +0 -0
- languages/yith-woocommerce-wishlist-uk_UA.po +1 -1
- languages/yith-woocommerce-wishlist-zh_CN.mo +0 -0
- languages/yith-woocommerce-wishlist-zh_CN.po +1 -1
- languages/yith-woocommerce-wishlist-zh_TW.mo +0 -0
- languages/yith-woocommerce-wishlist-zh_TW.po +1 -1
- plugin-fw/Gruntfile.js +65 -17
- plugin-fw/assets/css/yith-fields.css +138 -64
- plugin-fw/assets/js/yith-fields.js +183 -183
- plugin-fw/assets/js/yith-fields.min.js +1 -1
- plugin-fw/assets/js/yith-gutenberg.js +211 -211
- plugin-fw/assets/js/yith-gutenberg.min.js +6 -1
- plugin-fw/bin/clean-language-files.js +36 -0
- plugin-fw/bin/download-translations-config.json +27 -0
- plugin-fw/bin/download-translations.js +57 -0
- plugin-fw/init.php +1 -1
- plugin-fw/lib/yit-plugin-panel.php +127 -93
- plugin-fw/package.json +7 -1
- plugin-fw/templates/fields/dimensions.php +24 -25
- plugin-fw/templates/sysinfo/system-information-panel.php +10 -2
README.md
CHANGED
@@ -151,13 +151,16 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h
|
|
151 |
|
152 |
## Changelog
|
153 |
|
154 |
-
### 3.0.
|
155 |
|
156 |
-
* New: support for WooCommerce 4.
|
157 |
* Update: plugin framework
|
158 |
-
* Tweak:
|
159 |
-
*
|
160 |
-
* Fix:
|
|
|
|
|
|
|
161 |
|
162 |
## Support
|
163 |
|
151 |
|
152 |
## Changelog
|
153 |
|
154 |
+
### 3.0.15 - Released on 16 October 2020
|
155 |
|
156 |
+
* New: support for WooCommerce 4.6
|
157 |
* Update: plugin framework
|
158 |
+
* Tweak: return product price as float in item class
|
159 |
+
* Fix: prevent possible fatal error when printing ATW button
|
160 |
+
* Fix: original price being sent to database as int instead of float
|
161 |
+
* Dev: added new filter yith_wcwl_set_session_cookie
|
162 |
+
* Dev: added new filter yith_wcwl_privacy_value
|
163 |
+
* Dev: added new parameter to yith_wcwl_{privacy}_wishlist_visibility filter
|
164 |
|
165 |
## Support
|
166 |
|
README.txt
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
|
3 |
Contributors: yithemes
|
4 |
Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
|
5 |
-
Requires at least:
|
6 |
Tested up to: 5.5
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
YITH WooCommerce Wishlist add all Wishlist features to your website. Needs WooCommerce to work.
|
12 |
-
WooCommerce 4.
|
13 |
|
14 |
== Description ==
|
15 |
|
@@ -113,6 +113,17 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= 3.0.14 - Released on 19 September 2020 =
|
117 |
|
118 |
* New: support for WooCommerce 4.5
|
2 |
|
3 |
Contributors: yithemes
|
4 |
Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
|
5 |
+
Requires at least: 5.3
|
6 |
Tested up to: 5.5
|
7 |
+
Stable tag: 3.0.15
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
YITH WooCommerce Wishlist add all Wishlist features to your website. Needs WooCommerce to work.
|
12 |
+
WooCommerce 4.6.x compatible.
|
13 |
|
14 |
== Description ==
|
15 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 3.0.15 - Released on 16 October 2020 =
|
117 |
+
|
118 |
+
* New: support for WooCommerce 4.6
|
119 |
+
* Update: plugin framework
|
120 |
+
* Tweak: return product price as float in item class
|
121 |
+
* Fix: prevent possible fatal error when printing ATW button
|
122 |
+
* Fix: original price being sent to database as int instead of float
|
123 |
+
* Dev: added new filter yith_wcwl_set_session_cookie
|
124 |
+
* Dev: added new filter yith_wcwl_privacy_value
|
125 |
+
* Dev: added new parameter to yith_wcwl_{privacy}_wishlist_visibility filter
|
126 |
+
|
127 |
= 3.0.14 - Released on 19 September 2020 =
|
128 |
|
129 |
* New: support for WooCommerce 4.5
|
assets/js/jquery.yith-wcwl.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready((function(t){function i(){void 0!==t.fn.selectBox&&t("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){if(void 0!==t.prettyPhoto){var e={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){i(),t(".wishlist-select").filter(":visible").change(),t(document).trigger("yith_wcwl_popup_opened",[this])},markup:'<div class="pp_pic_holder"><div class="ppt"> </div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay yith-wcwl-overlay"></div>'};t('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').unbind("click").prettyPhoto(e),t('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",(function(){var i=t(this),e=t("#move_to_another_wishlist").find("form"),a=e.find(".row-id"),n=i.closest("[data-row-id]").data("row-id");a.length&&a.remove(),e.append('<input type="hidden" name="row_id" class="row-id" value="'+n+'"/>')})).prettyPhoto(e);var a=function(i,e){if(void 0!==i.classList&&i.classList.contains("yith-wcwl-overlay")){var a="remove"===e?"removeClass":"addClass";t("body")[a]("yith-wcwl-with-pretty-photo")}},n=function(t){a(t,"add")},o=function(t){a(t,"remove")};new MutationObserver((function(t){for(var i in t){var e=t[i];"childList"===e.type&&(void 0!==e.addedNodes&&e.addedNodes.forEach(n),void 0!==e.removedNodes&&e.removedNodes.forEach(o))}})).observe(document.body,{childList:!0})}}function a(){t(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",(function(){var i=t(this);i.parent().removeClass("checked").removeClass("unchecked").addClass(i.is(":checked")?"checked":"unchecked")})).trigger("change")}function n(){t(".add_to_cart").filter("[data-icon]").not(".icon-added").each((function(){var i,e=t(this),a=e.data("icon");i=a.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?t("<img/>",{src:a}):t("<i/>",{class:"fa "+a}),e.prepend(i).addClass("icon-added")}))}function o(){i(),e(),a(),n(),d(),s(),_(),l(),c(),r(),t(document).trigger("yith_wcwl_init_after_ajax")}function s(){yith_wcwl_l10n.enable_tooltip&&t(".yith-wcwl-add-to-wishlist").find("[data-title]").each((function(){var i=t(this);i.hasClass("tooltip-added")||(i.on("mouseenter",(function(){var i,e=t(this),a=null,n=e.outerWidth(),o=0;a=t("<span>",{class:"yith-wcwl-tooltip",text:e.data("title")}),e.append(a),i=a.outerWidth()+6,a.outerWidth(i),o=(n-i)/2,a.css({left:o.toFixed(0)+"px"}).fadeIn(200),e.addClass("with-tooltip")})).on("mouseleave",(function(){var i=t(this);i.find(".yith-wcwl-tooltip").fadeOut(200,(function(){i.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()}))})),i.addClass("tooltip-added"))}))}function d(){t(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",(function(){var i=t(this).find(".yith-wcwl-dropdown");i.length&&i.fadeOut(200)})).children("a").on("mouseenter",(function(){var i=t(this).closest(".with-dropdown"),e=i.find(".yith-wcwl-dropdown");e.length&&e.children().length&&i.find(".yith-wcwl-dropdown").fadeIn(200)}))}function l(){void 0!==yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&t(".wishlist_table").filter(".sortable").not(".no-interactions").each((function(){var i=t(this),e=!1;i.sortable({items:"[data-row-id]",scroll:!0,helper:function(i,e){return e.children().each((function(){t(this).width(t(this).width())})),e},update:function(){var a=i.find("[data-row-id]"),n=[],o=0;a.length&&(e&&e.abort(),a.each((function(){var i=t(this);i.find('input[name*="[position]"]').val(o++),n.push(i.data("row-id"))})),e=t.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,context:"frontend",positions:n,wishlist_token:i.data("token"),page:i.data("page"),per_page:i.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})}))}function c(){var i,e;t(".wishlist_table").on("change",".product-quantity :input",(function(){var a=t(this),n=a.closest("[data-row-id]"),o=n.data("row-id"),s=a.closest(".wishlist_table"),d=s.data("token");clearTimeout(e),n.find(".add_to_cart").attr("data-quantity",a.val()),e=setTimeout((function(){i&&i.abort(),i=t.ajax({beforeSend:function(){b(s)},complete:function(){x(s)},data:{action:yith_wcwl_l10n.actions.update_item_quantity,context:"frontend",product_id:o,wishlist_token:d,quantity:a.val()},method:"POST",url:yith_wcwl_l10n.ajax_url})}),1e3)}))}function r(){t(".copy-trigger").on("click",(function(){var i=t(".copy-target");if(i.length>0)if(i.is("input"))S()?i[0].setSelectionRange(0,9999):i.select(),document.execCommand("copy");else{var e=t("<input/>",{val:i.text(),type:"text"});t("body").append(e),S()?e[0].setSelectionRange(0,9999):e.select(),document.execCommand("copy"),e.remove()}}))}function _(){t(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",(function(i){var e=t(this).closest("[data-row-id]"),a=e.siblings("[data-row-id]"),n=e.find(".item-details");i.preventDefault(),n.length&&(a.removeClass("show"),e.toggleClass("show"))})).on("click","[data-row-id] a.close",(function(i){var e=t(this).closest("[data-row-id]"),a=e.find(".item-details");i.preventDefault(),a.length&&e.removeClass("show")})).on("click","[data-row-id] a.remove_from_wishlist",(function(i){var e=t(this);return i.stopPropagation(),w(e),!1})).addClass("enhanced"),t(document).on("click",(function(i){t(i.target).closest("[data-row-id]").length||t(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})).on("added_to_cart",(function(){t(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}))}function h(i,e,a){i.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,i.context="frontend",""!==i.wishlist_token&&""!==i.destination_wishlist_token&&""!==i.item_id&&t.ajax({beforeSend:e,url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",method:"post",success:function(e){a(e),o(),t("body").trigger("moved_to_another_wishlist",[t(this),i.item_id])}})}function w(i){var e=i.parents(".cart.wishlist_table"),a=i.parents("[data-row-id]"),n=a.data("row-id"),s=e.data("id"),d=e.data("token"),l={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,context:"frontend",remove_from_wishlist:n,wishlist_id:s,wishlist_token:d,fragments:j(n)};t.ajax({beforeSend:function(){b(e)},complete:function(){x(e)},data:l,method:"post",success:function(e){void 0!==e.fragments&&T(e.fragments),o(),t("body").trigger("removed_from_wishlist",[i,a])},url:yith_wcwl_l10n.ajax_url})}function f(i){var e=t(this),a=e.closest(".wishlist_table"),n=null;i.preventDefault(),(n=a.length?e.closest("[data-wishlist-id]").find(".wishlist-title"):e.parents(".wishlist-title")).next().show().find('input[type="text"]').focus(),n.hide()}function p(i){var e=t(this);i.preventDefault(),e.parents(".hidden-title-form").hide(),e.parents(".hidden-title-form").prev().show()}function u(i){var e,a=t(this),n=a.closest(".hidden-title-form"),o=a.closest("[data-wishlist-id]").data("wishlist-id"),s=n.find('input[type="text"]'),d=s.val();if(i.preventDefault(),!d)return n.addClass("woocommerce-invalid"),void s.focus();e={action:yith_wcwl_l10n.actions.save_title_action,context:"frontend",wishlist_id:o,title:d,fragments:j()},t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){b(n)},complete:function(){x(n)},success:function(t){var i=t.fragments;t.result?(n.hide(),n.prev().find(".wishlist-anchor").text(d).end().show()):(n.addClass("woocommerce-invalid"),s.focus()),void 0!==i&&T(i)}})}function m(){var i=t(this),e=i.val(),a=i.closest("[data-wishlist-id]").data("wishlist-id"),n={action:yith_wcwl_l10n.actions.save_privacy_action,context:"frontend",wishlist_id:a,privacy:e,fragments:j()};t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:n,dataType:"json",success:function(t){var i=t.fragments;void 0!==i&&T(i)}})}function v(i){if(void 0!==t.prettyPhoto&&void 0!==t.prettyPhoto.close)if(void 0!==i){var e=t(".pp_content_container"),a=e.find(".pp_content"),n=e.find(".yith-wcwl-popup-form"),o=n.closest(".pp_pic_holder");if(n.length){var s=t("<div/>",{class:"yith-wcwl-popup-feedback"});s.append(t("<i/>",{class:"fa fa-check heading-icon"})),s.append(t("<p/>",{class:"feedback",html:i})),s.css("display","none"),a.css("height","auto"),n.after(s),n.fadeOut(200,(function(){s.fadeIn()})),o.addClass("feedback"),o.css("left",t(window).innerWidth()/2-o.outerWidth()/2+"px"),(void 0===yith_wcwl_l10n.auto_close_popup||yith_wcwl_l10n.auto_close_popup)&&setTimeout(v,yith_wcwl_l10n.popup_timeout)}}else try{t.prettyPhoto.close()}catch(t){}}function g(i){var e=t("#yith-wcwl-popup-message"),a=t("#yith-wcwl-message"),n=void 0!==yith_wcwl_l10n.popup_timeout?yith_wcwl_l10n.popup_timeout:3e3;(void 0===yith_wcwl_l10n.enable_notices||yith_wcwl_l10n.enable_notices)&&(a.html(i),e.css("margin-left","-"+t(e).width()+"px").fadeIn(),window.setTimeout((function(){e.fadeOut()}),n))}function y(i){var e=t("select.wishlist-select"),a=t("ul.yith-wcwl-dropdown");e.each((function(){var e=t(this),a=e.find("option"),n=a.filter('[value="new"]');a.not(n).remove(),t.each(i,(function(i,a){t("<option>",{value:a.id,html:a.wishlist_name}).appendTo(e)})),e.append(n)})),a.each((function(){var e=t(this),a=e.find("li"),n=e.closest(".yith-wcwl-add-button").children("a.add_to_wishlist"),o=n.attr("data-product-id"),s=n.attr("data-product-type");a.remove(),t.each(i,(function(i,a){a.default||t("<li>").append(t("<a>",{rel:"nofollow",html:a.wishlist_name,class:"add_to_wishlist",href:a.add_to_this_wishlist_url,"data-product-id":o,"data-product-type":s,"data-wishlist-id":a.id})).appendTo(e)}))}))}function b(i){void 0!==t.fn.block&&i.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function x(i){void 0!==t.fn.unblock&&i.stop(!0).css("opacity","1").unblock()}function k(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function j(i){var e={},a=null;return i?"object"==typeof i?(a=(i=t.extend({fragments:null,s:"",container:t(document),firstLoad:!1},i)).fragments?i.fragments:i.container.find(".wishlist-fragment"),i.s&&(a=a.not("[data-fragment-ref]").add(a.filter('[data-fragment-ref="'+i.s+'"]'))),i.firstLoad&&(a=a.filter(".on-first-load"))):(a=t(".wishlist-fragment"),"string"!=typeof i&&"number"!=typeof i||(a=a.not("[data-fragment-ref]").add(a.filter('[data-fragment-ref="'+i+'"]')))):a=t(".wishlist-fragment"),a.each((function(){var i=t(this),a=i.attr("class").split(" ").filter(t=>t.length&&"exists"!==t).join(yith_wcwl_l10n.fragments_index_glue);e[a]=i.data("fragment-options")})),e}function C(i){var e=j(i=t.extend({firstLoad:!0},i));e&&t.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,context:"frontend",fragments:e},method:"post",success:function(a){void 0!==a.fragments&&(T(a.fragments),o(),t(document).trigger("yith_wcwl_fragments_loaded",[e,a.fragments,i.firstLoad]))},url:yith_wcwl_l10n.ajax_url})}function T(i){t.each(i,(function(i,e){var a="."+i.split(yith_wcwl_l10n.fragments_index_glue).filter(t=>t.length&&"exists"!==t).join("."),n=t(a),o=t(e).filter(a);o.length||(o=t(e).find(a)),n.length&&o.length&&n.replaceWith(o)}))}function S(){return navigator.userAgent.match(/ipad|iphone/i)}function P(t){return!0===t||"yes"===t||"1"===t||1===t}t(document).on("yith_wcwl_init",(function(){var S=t(this),O="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";S.on("click",".add_to_wishlist",(function(i){var e,a=t(this),n=a.attr("data-product-id"),s=t(".add-to-wishlist-"+n),d={action:yith_wcwl_l10n.actions.add_to_wishlist_action,context:"frontend",add_to_wishlist:n,product_type:a.data("product-type"),wishlist_id:a.data("wishlist-id"),fragments:j(n)};if((e=t(document).triggerHandler("yith_wcwl_add_to_wishlist_data",[a,d]))&&(d=e),i.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var l=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),c=l.find(".wishlist-select"),r=l.find(".wishlist-name"),_=l.find(".wishlist-visibility").filter(":checked");if(d.wishlist_id=c.is(":visible")?c.val():"new",d.wishlist_name=r.val(),d.wishlist_visibility=_.val(),"new"===d.wishlist_id&&!d.wishlist_name)return r.closest("p").addClass("woocommerce-invalid"),!1;r.closest("p").removeClass("woocommerce-invalid")}if(k())return t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:d,dataType:"json",beforeSend:function(){b(a)},complete:function(){x(a)},success:function(i){var e=i.result,n=i.message;yith_wcwl_l10n.multi_wishlist?(v(n),void 0!==i.user_wishlists&&y(i.user_wishlists)):g(n),"true"!==e&&"exists"!==e||(void 0!==i.fragments&&T(i.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||s.find(".yith-wcwl-add-button").remove(),s.addClass("exists")),o(),t("body").trigger("added_to_wishlist",[a,s])}}),!1;window.alert(yith_wcwl_l10n.labels.cookie_disabled)})),S.on("click",".wishlist_table .remove_from_wishlist",(function(i){var e=t(this);return i.preventDefault(),w(e),!1})),S.on("adding_to_cart","body",(function(t,i,e){void 0!==i&&void 0!==e&&i.closest(".wishlist_table").length&&(e.remove_from_wishlist_after_add_to_cart=i.closest("[data-row-id]").data("row-id"),e.wishlist_id=i.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=P(yith_wcwl_l10n.redirect_to_cart)))})),S.on("added_to_cart","body",(function(t,i,e,a){if(void 0!==a&&a.closest(".wishlist_table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=O),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=P(O));var n=a.closest("[data-row-id]"),o=n.closest(".wishlist-fragment").data("fragment-options");a.removeClass("added"),n.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&o.is_user_owner&&n.remove()}})),S.on("added_to_cart","body",(function(){var i=t(".woocommerce-message");0===i.length?t("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):i.fadeOut(300,(function(){t(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()}))})),S.on("cart_page_refreshed","body",o),S.on("click",".show-title-form",f),S.on("click",".wishlist-title-with-form h2",f),S.on("click",".remove_from_all_wishlists",(function(i){var e=t(this),a=e.attr("data-product-id"),n=e.data("wishlist-id"),s=e.closest(".content"),d={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,context:"frontend",prod_id:a,wishlist_id:n,fragments:j(a)};i.preventDefault(),t.ajax({beforeSend:function(){b(s)},complete:function(){x(s)},data:d,dataType:"json",method:"post",success:function(t){void 0!==t.fragments&&T(t.fragments),o()},url:yith_wcwl_l10n.ajax_url})})),S.on("click",".hide-title-form",p),S.on("click",".save-title-form",u),S.on("change",".wishlist_manage_table .wishlist-visibility",m),S.on("change",".change-wishlist",(function(){var i=t(this),e=i.parents(".cart.wishlist_table"),a=e.data("token"),n=i.parents("[data-row-id]").data("row-id");h({wishlist_token:a,destination_wishlist_token:i.val(),item_id:n,fragments:j()},(function(){b(e)}),(function(t){void 0!==t.fragments&&T(t.fragments),x(e)}))})),S.on("click",".yith-wcwl-popup-footer .move_to_wishlist",(function(){var i=t(this),e=i.attr("data-product-id"),a=i.data("origin-wishlist-id"),n=i.closest("form"),s=n.find(".wishlist-select").val(),d=n.find(".wishlist-name"),l=d.val(),c=n.find(".wishlist-visibility").filter(":checked").val();if("new"===s&&!l)return d.closest("p").addClass("woocommerce-invalid"),!1;d.closest("p").removeClass("woocommerce-invalid"),h({wishlist_token:a,destination_wishlist_token:s,item_id:e,wishlist_name:l,wishlist_visibility:c,fragments:j(e)},(function(){b(i)}),(function(t){var e=t.message;yith_wcwl_l10n.multi_wishlist?(v(e),void 0!==t.user_wishlists&&y(t.user_wishlists)):g(e),void 0!==t.fragments&&T(t.fragments),o(),x(i)}))})),S.on("click",".delete_item",(function(){var i=t(this),e=i.attr("data-product-id"),a=i.data("item-id"),n=t(".add-to-wishlist-"+e),s={action:yith_wcwl_l10n.actions.delete_item_action,context:"frontend",item_id:a,fragments:j(e)};return t.ajax({url:yith_wcwl_l10n.ajax_url,data:s,dataType:"json",beforeSend:function(){b(i)},complete:function(){x(i)},method:"post",success:function(e){var a=e.fragments,s=e.message;yith_wcwl_l10n.multi_wishlist&&v(s),i.closest(".yith-wcwl-remove-button").length||g(s),void 0!==a&&T(a),o(),t("body").trigger("removed_from_wishlist",[i,n])}}),!1})),S.on("change",".yith-wcwl-popup-content .wishlist-select",(function(){var i=t(this);"new"===i.val()?i.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():i.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()})),S.on("change","#bulk_add_to_cart",(function(){var i=t(this),e=i.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');i.is(":checked")?e.attr("checked","checked").change():e.removeAttr("checked").change()})),S.on("submit",".wishlist-ask-an-estimate-popup",(function(){var i=t(this),e=i.closest("form"),a=i.closest(".pp_content"),n=e.serializeArray().reduce((t,i)=>(t[i.name]=i.value,t),{});return n.action=yith_wcwl_l10n.actions.ask_an_estimate,n.context="frontend",t.ajax({beforeSend:function(){b(e)},complete:function(){x(e)},data:n,dataType:"json",method:"post",success:function(i){if(void 0!==i.result&&i.result){var n=i.template;void 0!==n&&(e.replaceWith(n),a.css("height","auto"),setTimeout(v,yith_wcwl_l10n.time_to_close_prettyphoto))}else void 0!==i.message&&(e.find(".woocommerce-error").remove(),e.find(".popup-description").after(t("<div>",{text:i.message,class:"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1})),S.on("click",".yith-wfbt-add-wishlist",(function(i){i.preventDefault();var e=t(this),a=t("#yith-wcwl-form");t("html, body").animate({scrollTop:a.offset().top},500),function(i,e){var a=i.attr("data-product-id"),n=t(document).find(".cart.wishlist_table"),s=n.data("pagination"),d=n.data("per-page"),l=n.data("id"),c=n.data("token"),r={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,context:"frontend",pagination:s,per_page:d,wishlist_id:l,wishlist_token:c,add_to_wishlist:a,product_type:i.data("product-type")};if(!k())return void window.alert(yith_wcwl_l10n.labels.cookie_disabled);t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:r,dataType:"html",beforeSend:function(){b(n)},complete:function(){x(n)},success:function(i){var a=t(i),n=a.find("#yith-wcwl-form"),s=a.find(".yith-wfbt-slider-wrapper");e.replaceWith(n),t(".yith-wfbt-slider-wrapper").replaceWith(s),o(),t(document).trigger("yith_wcwl_reload_wishlist_from_frequently")}})}(e,a)})),S.on("submit",".yith-wcwl-popup-form",(function(){return!1})),S.on("yith_infs_added_elem",(function(){e()})),S.on("found_variation",(function(i,e){var a=t(i.target).data("product_id"),n=e.variation_id,o=t('[data-product-id="'+a+'"]').add('[data-original-product-id="'+a+'"]'),s=o.closest(".wishlist-fragment").filter(":visible");a&&n&&o.length&&(o.each((function(){var i,e=t(this),o=e.closest(".yith-wcwl-add-to-wishlist");e.attr("data-original-product-id",a),e.attr("data-product-id",n),o.length&&(void 0!==(i=o.data("fragment-options"))&&(i.product_id=n,o.data("fragment-options",i)),o.removeClass((function(t,i){return i.match(/add-to-wishlist-\S+/g).join(" ")})).addClass("add-to-wishlist-"+n).attr("data-fragment-ref",n))})),b(s),C({fragments:s,firstLoad:!1}))})),S.on("reset_data",(function(i){var e=t(i.target).data("product_id"),a=t('[data-original-product-id="'+e+'"]'),n=a.closest(".wishlist-fragment").filter(":visible");e&&a.length&&(a.each((function(){var i,a=t(this),n=a.closest(".yith-wcwl-add-to-wishlist"),o=a.attr("data-product-id");a.attr("data-product-id",e),a.attr("data-original-product-id",""),n.length&&(void 0!==(i=n.data("fragment-options"))&&(i.product_id=e,n.data("fragment-options",i)),n.removeClass("add-to-wishlist-"+o).addClass("add-to-wishlist-"+e).attr("data-fragment-ref",e))})),b(n),C({fragments:n,firstLoad:!1}))})),S.on("yith_wcwl_reload_fragments",C),S.on("yith_infs_added_elem",(function(t,i){C({container:i,firstLoad:!1})})),S.on("yith_wcwl_fragments_loaded",(function(i,e,a,n){n&&t(".variations_form").find(".variations select").last().change()})),S.on("click",".yith-wcwl-popup-feedback .close-popup",(function(t){t.preventDefault(),v()})),function(){if(void 0!==yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices)return;if(t(".yith-wcwl-add-to-wishlist").length&&!t("#yith-wcwl-popup-message").length){var i=t("<div>").attr("id","yith-wcwl-message"),e=t("<div>").attr("id","yith-wcwl-popup-message").html(i).hide();t("body").prepend(e)}}(),s(),d(),l(),c(),_(),t(document).on("click",".show-tab",(function(i){var e=t(this),a=e.closest(".yith-wcwl-popup-content"),n=e.data("tab"),o=a.find(".tab").filter("."+n);if(i.preventDefault(),!o.length)return!1;e.addClass("active").siblings(".show-tab").removeClass("active"),o.show().siblings(".tab").hide(),"create"===n?a.prepend('<input type="hidden" id="new_wishlist_selector" class="wishlist-select" value="new">'):a.find("#new_wishlist_selector").remove()})),t(document).on("change",".wishlist-select",(function(){var i=t(this),e=i.closest(".yith-wcwl-popup-content"),a=i.closest(".tab"),n=e.find(".tab.create"),o=e.find(".show-tab"),s=o.filter('[data-tab="create"]');"new"===i.val()&&n.length&&(a.hide(),n.show(),o.removeClass("active"),s.addClass("active"),i.find("option").removeProp("selected"),i.change())})),i(),a(),e(),n(),function(){var i=!1;if(!yith_wcwl_l10n.is_wishlist_responsive)return;t(window).on("resize",(function(){var e=t(".wishlist_table.responsive"),a=e.is(".mobile"),n=window.matchMedia("(max-width: 768px)"),s=e.closest("form"),d=s.attr("class"),l=s.data("fragment-options"),c={},r=!1;e.length&&(n.matches&&e&&!a?(l.is_mobile="yes",r=!0):!n.matches&&e&&a&&(l.is_mobile="no",r=!0),r&&(i&&i.abort(),c[d.split(" ").join(yith_wcwl_l10n.fragments_index_glue)]=l,i=t.ajax({beforeSend:function(){b(e)},complete:function(){x(e)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,context:"frontend",fragments:c},method:"post",success:function(i){void 0!==i.fragments&&(T(i.fragments),o(),t(document).trigger("yith_wcwl_responsive_template",[a,i.fragments]))},url:yith_wcwl_l10n.ajax_url})))}))}(),r(),yith_wcwl_l10n.enable_ajax_loading&&C()})).trigger("yith_wcwl_init")}));
|
1 |
+
jQuery(document).ready((function(t){function i(){void 0!==t.fn.selectBox&&t("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){if(void 0!==t.prettyPhoto){var e={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){i(),t(".wishlist-select").filter(":visible").change(),t(document).trigger("yith_wcwl_popup_opened",[this])},markup:'<div class="pp_pic_holder"><div class="ppt"> </div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay yith-wcwl-overlay"></div>'};t('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').unbind("click").prettyPhoto(e),t('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",(function(){var i=t(this),e=t("#move_to_another_wishlist").find("form"),a=e.find(".row-id"),n=i.closest("[data-row-id]").data("row-id");a.length&&a.remove(),e.append('<input type="hidden" name="row_id" class="row-id" value="'+n+'"/>')})).prettyPhoto(e);var a=function(i,e){if(void 0!==i.classList&&i.classList.contains("yith-wcwl-overlay")){var a="remove"===e?"removeClass":"addClass";t("body")[a]("yith-wcwl-with-pretty-photo")}},n=function(t){a(t,"add")},o=function(t){a(t,"remove")};new MutationObserver((function(t){for(var i in t){var e=t[i];"childList"===e.type&&(void 0!==e.addedNodes&&e.addedNodes.forEach(n),void 0!==e.removedNodes&&e.removedNodes.forEach(o))}})).observe(document.body,{childList:!0})}}function a(){t(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",(function(){var i=t(this);i.parent().removeClass("checked").removeClass("unchecked").addClass(i.is(":checked")?"checked":"unchecked")})).trigger("change")}function n(){t(".add_to_cart").filter("[data-icon]").not(".icon-added").each((function(){var i,e=t(this),a=e.data("icon");i=a.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?t("<img/>",{src:a}):t("<i/>",{class:"fa "+a}),e.prepend(i).addClass("icon-added")}))}function o(){i(),e(),a(),n(),d(),s(),_(),l(),c(),r(),t(document).trigger("yith_wcwl_init_after_ajax")}function s(){yith_wcwl_l10n.enable_tooltip&&t(".yith-wcwl-add-to-wishlist").find("[data-title]").each((function(){var i=t(this);i.hasClass("tooltip-added")||(i.on("mouseenter",(function(){var i,e=t(this),a=null,n=e.outerWidth(),o=0;a=t("<span>",{class:"yith-wcwl-tooltip",text:e.data("title")}),e.append(a),i=a.outerWidth()+6,a.outerWidth(i),o=(n-i)/2,a.css({left:o.toFixed(0)+"px"}).fadeIn(200),e.addClass("with-tooltip")})).on("mouseleave",(function(){var i=t(this);i.find(".yith-wcwl-tooltip").fadeOut(200,(function(){i.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()}))})),i.addClass("tooltip-added"))}))}function d(){t(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",(function(){var i=t(this).find(".yith-wcwl-dropdown");i.length&&i.fadeOut(200)})).children("a").on("mouseenter",(function(){var i=t(this).closest(".with-dropdown"),e=i.find(".yith-wcwl-dropdown");e.length&&e.children().length&&i.find(".yith-wcwl-dropdown").fadeIn(200)}))}function l(){void 0!==yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&t(".wishlist_table").filter(".sortable").not(".no-interactions").each((function(){var i=t(this),e=!1;i.sortable({items:"[data-row-id]",scroll:!0,helper:function(i,e){return e.children().each((function(){t(this).width(t(this).width())})),e},update:function(){var a=i.find("[data-row-id]"),n=[],o=0;a.length&&(e&&e.abort(),a.each((function(){var i=t(this);i.find('input[name*="[position]"]').val(o++),n.push(i.data("row-id"))})),e=t.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,context:"frontend",positions:n,wishlist_token:i.data("token"),page:i.data("page"),per_page:i.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})}))}function c(){var i,e;t(".wishlist_table").on("change",".product-quantity :input",(function(){var a=t(this),n=a.closest("[data-row-id]"),o=n.data("row-id"),s=a.closest(".wishlist_table"),d=s.data("token");clearTimeout(e),n.find(".add_to_cart").attr("data-quantity",a.val()),e=setTimeout((function(){i&&i.abort(),i=t.ajax({beforeSend:function(){b(s)},complete:function(){x(s)},data:{action:yith_wcwl_l10n.actions.update_item_quantity,context:"frontend",product_id:o,wishlist_token:d,quantity:a.val()},method:"POST",url:yith_wcwl_l10n.ajax_url})}),1e3)}))}function r(){t(".copy-trigger").on("click",(function(){var i=t(".copy-target");if(i.length>0)if(i.is("input"))S()?i[0].setSelectionRange(0,9999):i.select(),document.execCommand("copy");else{var e=t("<input/>",{val:i.text(),type:"text"});t("body").append(e),S()?e[0].setSelectionRange(0,9999):e.select(),document.execCommand("copy"),e.remove()}}))}function _(){t(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",(function(i){var e=t(this).closest("[data-row-id]"),a=e.siblings("[data-row-id]"),n=e.find(".item-details");i.preventDefault(),n.length&&(a.removeClass("show"),e.toggleClass("show"))})).on("click","[data-row-id] a.close",(function(i){var e=t(this).closest("[data-row-id]"),a=e.find(".item-details");i.preventDefault(),a.length&&e.removeClass("show")})).on("click","[data-row-id] a.remove_from_wishlist",(function(i){var e=t(this);return i.stopPropagation(),w(e),!1})).addClass("enhanced"),t(document).on("click",(function(i){t(i.target).closest("[data-row-id]").length||t(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})).on("added_to_cart",(function(){t(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}))}function h(i,e,a){i.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,i.context="frontend",""!==i.wishlist_token&&""!==i.destination_wishlist_token&&""!==i.item_id&&t.ajax({beforeSend:e,url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",method:"post",success:function(e){a(e),o(),t("body").trigger("moved_to_another_wishlist",[t(this),i.item_id])}})}function w(i){var e=i.parents(".cart.wishlist_table"),a=i.parents("[data-row-id]"),n=a.data("row-id"),s=e.data("id"),d=e.data("token"),l={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,context:"frontend",remove_from_wishlist:n,wishlist_id:s,wishlist_token:d,fragments:j(n)};t.ajax({beforeSend:function(){b(e)},complete:function(){x(e)},data:l,method:"post",success:function(e){void 0!==e.fragments&&T(e.fragments),o(),t("body").trigger("removed_from_wishlist",[i,a])},url:yith_wcwl_l10n.ajax_url})}function f(i){var e=t(this),a=e.closest(".wishlist_table"),n=null;i.preventDefault(),(n=a.length?e.closest("[data-wishlist-id]").find(".wishlist-title"):e.parents(".wishlist-title")).next().show().find('input[type="text"]').focus(),n.hide()}function p(i){var e=t(this);i.preventDefault(),e.parents(".hidden-title-form").hide(),e.parents(".hidden-title-form").prev().show()}function u(i){var e,a=t(this),n=a.closest(".hidden-title-form"),o=a.closest("[data-wishlist-id]").data("wishlist-id"),s=n.find('input[type="text"]'),d=s.val();if(i.preventDefault(),!d)return n.addClass("woocommerce-invalid"),void s.focus();e={action:yith_wcwl_l10n.actions.save_title_action,context:"frontend",wishlist_id:o,title:d,fragments:j()},t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){b(n)},complete:function(){x(n)},success:function(t){var i=t.fragments;t.result?(n.hide(),n.prev().find(".wishlist-anchor").text(d).end().show()):(n.addClass("woocommerce-invalid"),s.focus()),void 0!==i&&T(i)}})}function m(){var i=t(this),e=i.val(),a=i.closest("[data-wishlist-id]").data("wishlist-id"),n={action:yith_wcwl_l10n.actions.save_privacy_action,context:"frontend",wishlist_id:a,privacy:e,fragments:j()};t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:n,dataType:"json",success:function(t){var i=t.fragments;void 0!==i&&T(i)}})}function v(i){if(void 0!==t.prettyPhoto&&void 0!==t.prettyPhoto.close)if(void 0!==i){var e=t(".pp_content_container"),a=e.find(".pp_content"),n=e.find(".yith-wcwl-popup-form"),o=n.closest(".pp_pic_holder");if(n.length){var s=t("<div/>",{class:"yith-wcwl-popup-feedback"});s.append(t("<i/>",{class:"fa fa-check heading-icon"})),s.append(t("<p/>",{class:"feedback",html:i})),s.css("display","none"),a.css("height","auto"),n.after(s),n.fadeOut(200,(function(){s.fadeIn()})),o.addClass("feedback"),o.css("left",t(window).innerWidth()/2-o.outerWidth()/2+"px"),(void 0===yith_wcwl_l10n.auto_close_popup||yith_wcwl_l10n.auto_close_popup)&&setTimeout(v,yith_wcwl_l10n.popup_timeout)}}else try{t.prettyPhoto.close()}catch(t){}}function g(i){var e=t("#yith-wcwl-popup-message"),a=t("#yith-wcwl-message"),n=void 0!==yith_wcwl_l10n.popup_timeout?yith_wcwl_l10n.popup_timeout:3e3;(void 0===yith_wcwl_l10n.enable_notices||yith_wcwl_l10n.enable_notices)&&(a.html(i),e.css("margin-left","-"+t(e).width()+"px").fadeIn(),window.setTimeout((function(){e.fadeOut()}),n))}function y(i){var e=t("select.wishlist-select"),a=t("ul.yith-wcwl-dropdown");e.each((function(){var e=t(this),a=e.find("option"),n=a.filter('[value="new"]');a.not(n).remove(),t.each(i,(function(i,a){t("<option>",{value:a.id,html:a.wishlist_name}).appendTo(e)})),e.append(n)})),a.each((function(){var e=t(this),a=e.find("li"),n=e.closest(".yith-wcwl-add-button").children("a.add_to_wishlist"),o=n.attr("data-product-id"),s=n.attr("data-product-type");a.remove(),t.each(i,(function(i,a){a.default||t("<li>").append(t("<a>",{rel:"nofollow",html:a.wishlist_name,class:"add_to_wishlist",href:a.add_to_this_wishlist_url,"data-product-id":o,"data-product-type":s,"data-wishlist-id":a.id})).appendTo(e)}))}))}function b(i){void 0!==t.fn.block&&i.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function x(i){void 0!==t.fn.unblock&&i.stop(!0).css("opacity","1").unblock()}function k(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function j(i){var e={},a=null;return i?"object"==typeof i?(a=(i=t.extend({fragments:null,s:"",container:t(document),firstLoad:!1},i)).fragments?i.fragments:i.container.find(".wishlist-fragment"),i.s&&(a=a.not("[data-fragment-ref]").add(a.filter('[data-fragment-ref="'+i.s+'"]'))),i.firstLoad&&(a=a.filter(".on-first-load"))):(a=t(".wishlist-fragment"),"string"!=typeof i&&"number"!=typeof i||(a=a.not("[data-fragment-ref]").add(a.filter('[data-fragment-ref="'+i+'"]')))):a=t(".wishlist-fragment"),a.each((function(){var i=t(this),a=i.attr("class").split(" ").filter(t=>t.length&&"exists"!==t).join(yith_wcwl_l10n.fragments_index_glue);e[a]=i.data("fragment-options")})),e}function C(i){var e=j(i=t.extend({firstLoad:!0},i));e&&t.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,context:"frontend",fragments:e},method:"post",success:function(a){void 0!==a.fragments&&(T(a.fragments),o(),t(document).trigger("yith_wcwl_fragments_loaded",[e,a.fragments,i.firstLoad]))},url:yith_wcwl_l10n.ajax_url})}function T(i){t.each(i,(function(i,e){var a="."+i.split(yith_wcwl_l10n.fragments_index_glue).filter(t=>t.length&&"exists"!==t).join("."),n=t(a),o=t(e).filter(a);o.length||(o=t(e).find(a)),n.length&&o.length&&n.replaceWith(o)}))}function S(){return navigator.userAgent.match(/ipad|iphone/i)}function P(t){return!0===t||"yes"===t||"1"===t||1===t}t(document).on("yith_wcwl_init",(function(){var S=t(this),O="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";S.on("click",".add_to_wishlist",(function(i){var e,a=t(this),n=a.attr("data-product-id"),s=t(".add-to-wishlist-"+n),d={action:yith_wcwl_l10n.actions.add_to_wishlist_action,context:"frontend",add_to_wishlist:n,product_type:a.data("product-type"),wishlist_id:a.data("wishlist-id"),fragments:j(n)};if((e=t(document).triggerHandler("yith_wcwl_add_to_wishlist_data",[a,d]))&&(d=e),i.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var l=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),c=l.find(".wishlist-select"),r=l.find(".wishlist-name"),_=l.find(".wishlist-visibility").filter(":checked");if(d.wishlist_id=c.is(":visible")?c.val():"new",d.wishlist_name=r.val(),d.wishlist_visibility=_.val(),"new"===d.wishlist_id&&!d.wishlist_name)return r.closest("p").addClass("woocommerce-invalid"),!1;r.closest("p").removeClass("woocommerce-invalid")}if(k())return t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:d,dataType:"json",beforeSend:function(){b(a)},complete:function(){x(a)},success:function(i){var e=i.result,n=i.message;yith_wcwl_l10n.multi_wishlist?(v(n),void 0!==i.user_wishlists&&y(i.user_wishlists)):g(n),"true"!==e&&"exists"!==e||(void 0!==i.fragments&&T(i.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||s.find(".yith-wcwl-add-button").remove(),s.addClass("exists")),o(),t("body").trigger("added_to_wishlist",[a,s])}}),!1;window.alert(yith_wcwl_l10n.labels.cookie_disabled)})),S.on("click",".wishlist_table .remove_from_wishlist",(function(i){var e=t(this);return i.preventDefault(),w(e),!1})),S.on("adding_to_cart","body",(function(t,i,e){void 0!==i&&void 0!==e&&i.closest(".wishlist_table").length&&(e.remove_from_wishlist_after_add_to_cart=i.closest("[data-row-id]").data("row-id"),e.wishlist_id=i.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=P(yith_wcwl_l10n.redirect_to_cart)))})),S.on("added_to_cart","body",(function(t,i,e,a){if(void 0!==a&&a.closest(".wishlist_table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=O),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=P(O));var n=a.closest("[data-row-id]"),o=n.closest(".wishlist-fragment").data("fragment-options");a.removeClass("added"),n.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&o.is_user_owner&&n.remove()}})),S.on("added_to_cart","body",(function(){var i=t(".woocommerce-message");0===i.length?t("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):i.fadeOut(300,(function(){t(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()}))})),S.on("cart_page_refreshed","body",o),S.on("click",".show-title-form",f),S.on("click",".wishlist-title-with-form h2",f),S.on("click",".remove_from_all_wishlists",(function(i){var e=t(this),a=e.attr("data-product-id"),n=e.data("wishlist-id"),s=e.closest(".content"),d={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,context:"frontend",prod_id:a,wishlist_id:n,fragments:j(a)};i.preventDefault(),t.ajax({beforeSend:function(){b(s)},complete:function(){x(s)},data:d,dataType:"json",method:"post",success:function(t){void 0!==t.fragments&&T(t.fragments),o()},url:yith_wcwl_l10n.ajax_url})})),S.on("click",".hide-title-form",p),S.on("click",".save-title-form",u),S.on("change",".wishlist_manage_table .wishlist-visibility",m),S.on("change",".change-wishlist",(function(){var i=t(this),e=i.parents(".cart.wishlist_table"),a=e.data("token"),n=i.parents("[data-row-id]").data("row-id");h({wishlist_token:a,destination_wishlist_token:i.val(),item_id:n,fragments:j()},(function(){b(e)}),(function(t){void 0!==t.fragments&&T(t.fragments),x(e)}))})),S.on("click",".yith-wcwl-popup-footer .move_to_wishlist",(function(){var i=t(this),e=i.attr("data-product-id"),a=i.data("origin-wishlist-id"),n=i.closest("form"),s=n.find(".wishlist-select").val(),d=n.find(".wishlist-name"),l=d.val(),c=n.find(".wishlist-visibility").filter(":checked").val();if("new"===s&&!l)return d.closest("p").addClass("woocommerce-invalid"),!1;d.closest("p").removeClass("woocommerce-invalid"),h({wishlist_token:a,destination_wishlist_token:s,item_id:e,wishlist_name:l,wishlist_visibility:c,fragments:j(e)},(function(){b(i)}),(function(t){var e=t.message;yith_wcwl_l10n.multi_wishlist?(v(e),void 0!==t.user_wishlists&&y(t.user_wishlists)):g(e),void 0!==t.fragments&&T(t.fragments),o(),x(i)}))})),S.on("click",".delete_item",(function(){var i=t(this),e=i.attr("data-product-id"),a=i.data("item-id"),n=t(".add-to-wishlist-"+e),s={action:yith_wcwl_l10n.actions.delete_item_action,context:"frontend",item_id:a,fragments:j(e)};return t.ajax({url:yith_wcwl_l10n.ajax_url,data:s,dataType:"json",beforeSend:function(){b(i)},complete:function(){x(i)},method:"post",success:function(e){var a=e.fragments,s=e.message;yith_wcwl_l10n.multi_wishlist&&v(s),i.closest(".yith-wcwl-remove-button").length||g(s),void 0!==a&&T(a),o(),t("body").trigger("removed_from_wishlist",[i,n])}}),!1})),S.on("change",".yith-wcwl-popup-content .wishlist-select",(function(){var i=t(this);"new"===i.val()?i.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():i.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()})),S.on("change","#bulk_add_to_cart",(function(){var i=t(this),e=i.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');i.is(":checked")?e.prop("checked","checked").change():e.removeProp("checked").change()})),S.on("submit",".wishlist-ask-an-estimate-popup",(function(){var i=t(this),e=i.closest("form"),a=i.closest(".pp_content"),n=e.serializeArray().reduce((t,i)=>(t[i.name]=i.value,t),{});return n.action=yith_wcwl_l10n.actions.ask_an_estimate,n.context="frontend",t.ajax({beforeSend:function(){b(e)},complete:function(){x(e)},data:n,dataType:"json",method:"post",success:function(i){if(void 0!==i.result&&i.result){var n=i.template;void 0!==n&&(e.replaceWith(n),a.css("height","auto"),setTimeout(v,yith_wcwl_l10n.time_to_close_prettyphoto))}else void 0!==i.message&&(e.find(".woocommerce-error").remove(),e.find(".popup-description").after(t("<div>",{text:i.message,class:"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1})),S.on("click",".yith-wfbt-add-wishlist",(function(i){i.preventDefault();var e=t(this),a=t("#yith-wcwl-form");t("html, body").animate({scrollTop:a.offset().top},500),function(i,e){var a=i.attr("data-product-id"),n=t(document).find(".cart.wishlist_table"),s=n.data("pagination"),d=n.data("per-page"),l=n.data("id"),c=n.data("token"),r={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,context:"frontend",pagination:s,per_page:d,wishlist_id:l,wishlist_token:c,add_to_wishlist:a,product_type:i.data("product-type")};if(!k())return void window.alert(yith_wcwl_l10n.labels.cookie_disabled);t.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:r,dataType:"html",beforeSend:function(){b(n)},complete:function(){x(n)},success:function(i){var a=t(i),n=a.find("#yith-wcwl-form"),s=a.find(".yith-wfbt-slider-wrapper");e.replaceWith(n),t(".yith-wfbt-slider-wrapper").replaceWith(s),o(),t(document).trigger("yith_wcwl_reload_wishlist_from_frequently")}})}(e,a)})),S.on("submit",".yith-wcwl-popup-form",(function(){return!1})),S.on("yith_infs_added_elem",(function(){e()})),S.on("found_variation",(function(i,e){var a=t(i.target).data("product_id"),n=e.variation_id,o=t('[data-product-id="'+a+'"]').add('[data-original-product-id="'+a+'"]'),s=o.closest(".wishlist-fragment").filter(":visible");a&&n&&o.length&&(o.each((function(){var i,e=t(this),o=e.closest(".yith-wcwl-add-to-wishlist");e.attr("data-original-product-id",a),e.attr("data-product-id",n),o.length&&(void 0!==(i=o.data("fragment-options"))&&(i.product_id=n,o.data("fragment-options",i)),o.removeClass((function(t,i){return i.match(/add-to-wishlist-\S+/g).join(" ")})).addClass("add-to-wishlist-"+n).attr("data-fragment-ref",n))})),b(s),C({fragments:s,firstLoad:!1}))})),S.on("reset_data",(function(i){var e=t(i.target).data("product_id"),a=t('[data-original-product-id="'+e+'"]'),n=a.closest(".wishlist-fragment").filter(":visible");e&&a.length&&(a.each((function(){var i,a=t(this),n=a.closest(".yith-wcwl-add-to-wishlist"),o=a.attr("data-product-id");a.attr("data-product-id",e),a.attr("data-original-product-id",""),n.length&&(void 0!==(i=n.data("fragment-options"))&&(i.product_id=e,n.data("fragment-options",i)),n.removeClass("add-to-wishlist-"+o).addClass("add-to-wishlist-"+e).attr("data-fragment-ref",e))})),b(n),C({fragments:n,firstLoad:!1}))})),S.on("yith_wcwl_reload_fragments",C),S.on("yith_infs_added_elem",(function(t,i){C({container:i,firstLoad:!1})})),S.on("yith_wcwl_fragments_loaded",(function(i,e,a,n){n&&t(".variations_form").find(".variations select").last().change()})),S.on("click",".yith-wcwl-popup-feedback .close-popup",(function(t){t.preventDefault(),v()})),function(){if(void 0!==yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices)return;if(t(".yith-wcwl-add-to-wishlist").length&&!t("#yith-wcwl-popup-message").length){var i=t("<div>").attr("id","yith-wcwl-message"),e=t("<div>").attr("id","yith-wcwl-popup-message").html(i).hide();t("body").prepend(e)}}(),s(),d(),l(),c(),_(),t(document).on("click",".show-tab",(function(i){var e=t(this),a=e.closest(".yith-wcwl-popup-content"),n=e.data("tab"),o=a.find(".tab").filter("."+n);if(i.preventDefault(),!o.length)return!1;e.addClass("active").siblings(".show-tab").removeClass("active"),o.show().siblings(".tab").hide(),"create"===n?a.prepend('<input type="hidden" id="new_wishlist_selector" class="wishlist-select" value="new">'):a.find("#new_wishlist_selector").remove()})),t(document).on("change",".wishlist-select",(function(){var i=t(this),e=i.closest(".yith-wcwl-popup-content"),a=i.closest(".tab"),n=e.find(".tab.create"),o=e.find(".show-tab"),s=o.filter('[data-tab="create"]');"new"===i.val()&&n.length&&(a.hide(),n.show(),o.removeClass("active"),s.addClass("active"),i.find("option").removeProp("selected"),i.change())})),i(),a(),e(),n(),function(){var i=!1;if(!yith_wcwl_l10n.is_wishlist_responsive)return;t(window).on("resize",(function(){var e=t(".wishlist_table.responsive"),a=e.is(".mobile"),n=window.matchMedia("(max-width: 768px)"),s=e.closest("form"),d=s.attr("class"),l=s.data("fragment-options"),c={},r=!1;e.length&&(n.matches&&e&&!a?(l.is_mobile="yes",r=!0):!n.matches&&e&&a&&(l.is_mobile="no",r=!0),r&&(i&&i.abort(),c[d.split(" ").join(yith_wcwl_l10n.fragments_index_glue)]=l,i=t.ajax({beforeSend:function(){b(e)},complete:function(){x(e)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,context:"frontend",fragments:c},method:"post",success:function(i){void 0!==i.fragments&&(T(i.fragments),o(),t(document).trigger("yith_wcwl_responsive_template",[a,i.fragments]))},url:yith_wcwl_l10n.ajax_url})))}))}(),r(),yith_wcwl_l10n.enable_ajax_loading&&C()})).trigger("yith_wcwl_init")}));
|
assets/js/unminified/jquery.yith-wcwl.js
CHANGED
@@ -357,10 +357,10 @@ jQuery( document ).ready( function( $ ){
|
|
357 |
checkboxes = t.closest( '.wishlist_table' ).find( '[data-row-id]' ).find( 'input[type="checkbox"]:not(:disabled)' );
|
358 |
|
359 |
if( t.is( ':checked' ) ){
|
360 |
-
checkboxes.
|
361 |
}
|
362 |
else{
|
363 |
-
checkboxes.
|
364 |
}
|
365 |
} );
|
366 |
|
357 |
checkboxes = t.closest( '.wishlist_table' ).find( '[data-row-id]' ).find( 'input[type="checkbox"]:not(:disabled)' );
|
358 |
|
359 |
if( t.is( ':checked' ) ){
|
360 |
+
checkboxes.prop( 'checked','checked').change();
|
361 |
}
|
362 |
else{
|
363 |
+
checkboxes.removeProp( 'checked').change();
|
364 |
}
|
365 |
} );
|
366 |
|
includes/class.yith-wcwl-frontend.php
CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
|
|
33 |
* @var string
|
34 |
* @since 1.0.0
|
35 |
*/
|
36 |
-
public $version = '3.0.
|
37 |
|
38 |
/**
|
39 |
* Plugin database version
|
33 |
* @var string
|
34 |
* @since 1.0.0
|
35 |
*/
|
36 |
+
public $version = '3.0.15';
|
37 |
|
38 |
/**
|
39 |
* Plugin database version
|
includes/class.yith-wcwl-session.php
CHANGED
@@ -111,7 +111,7 @@ if ( ! class_exists( 'YITH_WCWL_Session' ) ) {
|
|
111 |
* @return void
|
112 |
*/
|
113 |
public function set_session_cookie() {
|
114 |
-
if ( headers_sent() ) {
|
115 |
return;
|
116 |
}
|
117 |
|
111 |
* @return void
|
112 |
*/
|
113 |
public function set_session_cookie() {
|
114 |
+
if ( headers_sent() || ! apply_filters( 'yith_wcwl_set_session_cookie', true ) ) {
|
115 |
return;
|
116 |
}
|
117 |
|
includes/class.yith-wcwl-shortcode.php
CHANGED
@@ -513,7 +513,7 @@ if( ! class_exists( 'YITH_WCWL_Shortcode' ) ) {
|
|
513 |
}
|
514 |
|
515 |
// filter params.
|
516 |
-
$additional_params = apply_filters( 'yith_wcwl_wishlist_params', $additional_params, $action, $action_params, $pagination, $per_page );
|
517 |
|
518 |
$atts = array_merge(
|
519 |
$atts,
|
@@ -555,7 +555,7 @@ if( ! class_exists( 'YITH_WCWL_Shortcode' ) ) {
|
|
555 |
$current_product = ( isset( $atts['product_id'] ) ) ? wc_get_product( $atts['product_id'] ) : false;
|
556 |
$current_product = $current_product ? $current_product : $product;
|
557 |
|
558 |
-
if ( ! $current_product ) {
|
559 |
return '';
|
560 |
}
|
561 |
|
513 |
}
|
514 |
|
515 |
// filter params.
|
516 |
+
$additional_params = apply_filters( 'yith_wcwl_wishlist_params', $additional_params, $action, $action_params, $pagination, $per_page, $atts );
|
517 |
|
518 |
$atts = array_merge(
|
519 |
$atts,
|
555 |
$current_product = ( isset( $atts['product_id'] ) ) ? wc_get_product( $atts['product_id'] ) : false;
|
556 |
$current_product = $current_product ? $current_product : $product;
|
557 |
|
558 |
+
if ( ! $current_product || ! $current_product instanceof WC_Product ) {
|
559 |
return '';
|
560 |
}
|
561 |
|
includes/class.yith-wcwl-wishlist-item.php
CHANGED
@@ -151,7 +151,7 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist_Item' ) ) {
|
|
151 |
* Return price of the produce related to current item
|
152 |
*
|
153 |
* @param $context string Context
|
154 |
-
* @return
|
155 |
*/
|
156 |
public function get_product_price( $context = 'view' ) {
|
157 |
$product = $this->get_product( $context );
|
@@ -165,10 +165,10 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist_Item' ) ) {
|
|
165 |
/**
|
166 |
* @var $product \WC_Product_Variable
|
167 |
*/
|
168 |
-
return $product->get_variation_price( 'min' );
|
169 |
default:
|
170 |
$sale_price = $product->get_sale_price();
|
171 |
-
return $sale_price ? $sale_price : $product->get_price();
|
172 |
}
|
173 |
}
|
174 |
|
151 |
* Return price of the produce related to current item
|
152 |
*
|
153 |
* @param $context string Context
|
154 |
+
* @return float
|
155 |
*/
|
156 |
public function get_product_price( $context = 'view' ) {
|
157 |
$product = $this->get_product( $context );
|
165 |
/**
|
166 |
* @var $product \WC_Product_Variable
|
167 |
*/
|
168 |
+
return (float) $product->get_variation_price( 'min' );
|
169 |
default:
|
170 |
$sale_price = $product->get_sale_price();
|
171 |
+
return $sale_price ? (float) $sale_price : (float) $product->get_price();
|
172 |
}
|
173 |
}
|
174 |
|
includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php
CHANGED
@@ -44,7 +44,7 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist_Item_Data_Store' ) ) {
|
|
44 |
'quantity' => '%d',
|
45 |
'wishlist_id' => '%d',
|
46 |
'position' => '%d',
|
47 |
-
'original_price' => '%
|
48 |
'original_currency' => '%s',
|
49 |
'on_sale' => '%s'
|
50 |
);
|
@@ -391,7 +391,9 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist_Item_Data_Store' ) ) {
|
|
391 |
*
|
392 |
* @param $args mixed Arguments array; it may contains any of the following:<br/>
|
393 |
* [<br/>
|
|
|
394 |
* 'search' => '', // search string; will be matched against product name<br/>
|
|
|
395 |
* 'orderby' => 'ID', // order param; a valid column in the result set<br/>
|
396 |
* 'order' => 'desc', // order param; asc or desc<br/>
|
397 |
* 'limit' => false, // pagination param; number of items per page. 0 to get all items<br/>
|
@@ -403,11 +405,13 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist_Item_Data_Store' ) ) {
|
|
403 |
global $wpdb;
|
404 |
|
405 |
$default = array(
|
406 |
-
'
|
407 |
-
'
|
408 |
-
'
|
409 |
-
'
|
410 |
-
'
|
|
|
|
|
411 |
);
|
412 |
|
413 |
$args = wp_parse_args( $args, $default );
|
44 |
'quantity' => '%d',
|
45 |
'wishlist_id' => '%d',
|
46 |
'position' => '%d',
|
47 |
+
'original_price' => '%f',
|
48 |
'original_currency' => '%s',
|
49 |
'on_sale' => '%s'
|
50 |
);
|
391 |
*
|
392 |
* @param $args mixed Arguments array; it may contains any of the following:<br/>
|
393 |
* [<br/>
|
394 |
+
* 'product_id' // Product to search in the wishlist<br/>
|
395 |
* 'search' => '', // search string; will be matched against product name<br/>
|
396 |
+
* 'interval' => '', // Interval of dates; this should be an associative array, that may contain start_date or end_date<br/>
|
397 |
* 'orderby' => 'ID', // order param; a valid column in the result set<br/>
|
398 |
* 'order' => 'desc', // order param; asc or desc<br/>
|
399 |
* 'limit' => false, // pagination param; number of items per page. 0 to get all items<br/>
|
405 |
global $wpdb;
|
406 |
|
407 |
$default = array(
|
408 |
+
'product_id' => '',
|
409 |
+
'search' => '',
|
410 |
+
'interval' => [],
|
411 |
+
'limit' => false,
|
412 |
+
'offset' => 0,
|
413 |
+
'orderby' => 'ID',
|
414 |
+
'order' => 'DESC',
|
415 |
);
|
416 |
|
417 |
$args = wp_parse_args( $args, $default );
|
includes/functions.yith-wcwl.php
CHANGED
@@ -464,7 +464,7 @@ if ( ! function_exists( 'yith_wcwl_get_privacy_label' ) ) {
|
|
464 |
break;
|
465 |
}
|
466 |
|
467 |
-
return apply_filters( "yith_wcwl_{$privacy_label}_wishlist_visibility", $privacy_text, $extended );
|
468 |
}
|
469 |
}
|
470 |
|
@@ -491,7 +491,7 @@ if ( ! function_exists( 'yith_wcwl_get_privacy_value' ) ) {
|
|
491 |
break;
|
492 |
}
|
493 |
|
494 |
-
return $privacy_value;
|
495 |
}
|
496 |
}
|
497 |
|
464 |
break;
|
465 |
}
|
466 |
|
467 |
+
return apply_filters( "yith_wcwl_{$privacy_label}_wishlist_visibility", $privacy_text, $extended, $privacy );
|
468 |
}
|
469 |
}
|
470 |
|
491 |
break;
|
492 |
}
|
493 |
|
494 |
+
return apply_filters( 'yith_wcwl_privacy_value', $privacy_value, $privacy_label );
|
495 |
}
|
496 |
}
|
497 |
|
init.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
* Plugin Name: YITH WooCommerce Wishlist
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-wishlist/
|
5 |
* Description: <code><strong>YITH WooCommerce Wishlist</strong></code> gives your users the possibility to create, fill, manage and share their wishlists allowing you to analyze their interests and needs to improve your marketing strategies. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce on <strong>YITH</strong></a>
|
6 |
-
* Version: 3.0.
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-wishlist
|
10 |
* Domain Path: /languages/
|
11 |
* WC requires at least: 4.2.0
|
12 |
-
* WC tested up to: 4.
|
13 |
*
|
14 |
* @author YITHEMES
|
15 |
* @package YITH WooCommerce Wishlist
|
3 |
* Plugin Name: YITH WooCommerce Wishlist
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-wishlist/
|
5 |
* Description: <code><strong>YITH WooCommerce Wishlist</strong></code> gives your users the possibility to create, fill, manage and share their wishlists allowing you to analyze their interests and needs to improve your marketing strategies. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce on <strong>YITH</strong></a>
|
6 |
+
* Version: 3.0.15
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-wishlist
|
10 |
* Domain Path: /languages/
|
11 |
* WC requires at least: 4.2.0
|
12 |
+
* WC tested up to: 4.6
|
13 |
*
|
14 |
* @author YITHEMES
|
15 |
* @package YITH WooCommerce Wishlist
|
languages/yith-woocommerce-wishlist-da_DK.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-da_DK.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WCWL\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Morten Ruus <altombasketball@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
|
11 |
"Language: da_DK\n"
|
5 |
"Project-Id-Version: YITH WCWL\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:04+0200\n"
|
9 |
"Last-Translator: Morten Ruus <altombasketball@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
|
11 |
"Language: da_DK\n"
|
languages/yith-woocommerce-wishlist-de_DE.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-de_DE.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: de_DE\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:04+0200\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: de_DE\n"
|
languages/yith-woocommerce-wishlist-es_AR.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-es_AR.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: YIThemes <support@yithemes.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: es_AR\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:04+0200\n"
|
9 |
"Last-Translator: YIThemes <support@yithemes.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: es_AR\n"
|
languages/yith-woocommerce-wishlist-es_ES.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-es_ES.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: es_ES\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:04+0200\n"
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: es_ES\n"
|
languages/yith-woocommerce-wishlist-es_MX.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-es_MX.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Gabriel Azarias Dzul Cocom <gabrieldzul@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: es_MX\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:04+0200\n"
|
9 |
"Last-Translator: Gabriel Azarias Dzul Cocom <gabrieldzul@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: es_MX\n"
|
languages/yith-woocommerce-wishlist-fa_IR.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-fa_IR.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Am!n <amin.pe94@gmail.com>\n"
|
10 |
"Language-Team: YITH - translated to persian by dornaweb <info@dornaweb.com>\n"
|
11 |
"Language: fa\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:05+0200\n"
|
9 |
"Last-Translator: Am!n <amin.pe94@gmail.com>\n"
|
10 |
"Language-Team: YITH - translated to persian by dornaweb <info@dornaweb.com>\n"
|
11 |
"Language: fa\n"
|
languages/yith-woocommerce-wishlist-fr_FR.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-fr_FR.po
CHANGED
@@ -4,7 +4,7 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"POT-Creation-Date: \n"
|
7 |
-
"PO-Revision-Date: 2020-
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"Language: fr\n"
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"POT-Creation-Date: \n"
|
7 |
+
"PO-Revision-Date: 2020-10-16 14:05+0200\n"
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"Language: fr\n"
|
languages/yith-woocommerce-wishlist-he_IL.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-he_IL.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: he_IL\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:05+0200\n"
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: he_IL\n"
|
languages/yith-woocommerce-wishlist-hr.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-hr.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: hr_HR\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:05+0200\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: hr_HR\n"
|
languages/yith-woocommerce-wishlist-it_IT.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-it_IT.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: it_IT\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:05+0200\n"
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: it_IT\n"
|
languages/yith-woocommerce-wishlist-ko_KR.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-ko_KR.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Valentyn Zubenko <valentyn.zubenko@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: uk_UA\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:05+0200\n"
|
9 |
"Last-Translator: Valentyn Zubenko <valentyn.zubenko@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: uk_UA\n"
|
languages/yith-woocommerce-wishlist-nl_NL.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-nl_NL.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: nl_NL\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: nl_NL\n"
|
languages/yith-woocommerce-wishlist-pl_PL.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-pl_PL.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: pl_PL\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: pl_PL\n"
|
languages/yith-woocommerce-wishlist-pt_BR.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-pt_BR.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: YIThemes <support@yithemes.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: pt_BR\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: YIThemes <support@yithemes.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: pt_BR\n"
|
languages/yith-woocommerce-wishlist-pt_PT.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-pt_PT.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: YIThemes <support@yithemes.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: pt_PT\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: YIThemes <support@yithemes.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: pt_PT\n"
|
languages/yith-woocommerce-wishlist-ru_RU.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-ru_RU.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WCWL\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Valentyn Zubenko <valentyn.zubenko@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
|
11 |
"Language: ru\n"
|
5 |
"Project-Id-Version: YITH WCWL\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: Valentyn Zubenko <valentyn.zubenko@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
|
11 |
"Language: ru\n"
|
languages/yith-woocommerce-wishlist-sv_SE.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-sv_SE.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WCWL\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
|
11 |
"Language: sv\n"
|
5 |
"Project-Id-Version: YITH WCWL\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
|
10 |
"Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
|
11 |
"Language: sv\n"
|
languages/yith-woocommerce-wishlist-tr_TR.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-tr_TR.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Caner Öncel <caneroncel@gmail.com>\n"
|
10 |
"Language-Team: Caner Öncel (@egonomik) <caneroncel@gmail.com>\n"
|
11 |
"Language: tr_TR\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:06+0200\n"
|
9 |
"Last-Translator: Caner Öncel <caneroncel@gmail.com>\n"
|
10 |
"Language-Team: Caner Öncel (@egonomik) <caneroncel@gmail.com>\n"
|
11 |
"Language: tr_TR\n"
|
languages/yith-woocommerce-wishlist-uk_UA.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-uk_UA.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: Valentyn Zubenko <valentyn.zubenko@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: uk_UA\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:07+0200\n"
|
9 |
"Last-Translator: Valentyn Zubenko <valentyn.zubenko@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: uk_UA\n"
|
languages/yith-woocommerce-wishlist-zh_CN.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-zh_CN.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: 李明軒 <eggeggxuan@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: zh_CN\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:07+0200\n"
|
9 |
"Last-Translator: 李明軒 <eggeggxuan@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: zh_CN\n"
|
languages/yith-woocommerce-wishlist-zh_TW.mo
CHANGED
Binary file
|
languages/yith-woocommerce-wishlist-zh_TW.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: 2020-
|
9 |
"Last-Translator: 李明軒 <eggeggxuan@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: zh_TW\n"
|
5 |
"Project-Id-Version: YITH WooCommerce Wishlist\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/init\n"
|
7 |
"POT-Creation-Date: \n"
|
8 |
+
"PO-Revision-Date: 2020-10-16 14:07+0200\n"
|
9 |
"Last-Translator: 李明軒 <eggeggxuan@gmail.com>\n"
|
10 |
"Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
|
11 |
"Language: zh_TW\n"
|
plugin-fw/Gruntfile.js
CHANGED
@@ -1,12 +1,7 @@
|
|
1 |
-
/**
|
2 |
-
* in vagrant ssh, launch:
|
3 |
-
* - npm install
|
4 |
-
* - grunt (or use npm scripts in package.json)
|
5 |
-
*/
|
6 |
-
|
7 |
const potInfo = {
|
8 |
-
|
9 |
-
|
|
|
10 |
poedit : true, // Includes common Poedit headers.
|
11 |
'x-poedit-keywordslist': true, // Include a list of all possible gettext functions.
|
12 |
'report-msgid-bugs-to' : 'YITH <plugins@yithemes.com>',
|
@@ -63,23 +58,81 @@ module.exports = function ( grunt ) {
|
|
63 |
type : 'wp-plugin',
|
64 |
domainPath : 'languages',
|
65 |
domain : 'yith-plugin-fw',
|
66 |
-
potHeaders : potInfo.
|
67 |
-
updatePoFiles:
|
68 |
},
|
69 |
dist : {
|
70 |
options: {
|
71 |
-
potFilename: potInfo.
|
72 |
exclude : [
|
|
|
73 |
'node_modules/.*',
|
74 |
'tests/.*',
|
75 |
-
'tmp/.*'
|
|
|
76 |
]
|
77 |
}
|
78 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
|
81 |
} );
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
// Load NPM tasks to be used here.
|
84 |
grunt.loadNpmTasks( 'grunt-wp-i18n' );
|
85 |
|
@@ -88,9 +141,4 @@ module.exports = function ( grunt ) {
|
|
88 |
|
89 |
// Register tasks.
|
90 |
grunt.registerTask( 'js', ['uglify'] );
|
91 |
-
grunt.registerTask( 'i18n', ['makepot'] );
|
92 |
-
grunt.registerTask( 'default', [
|
93 |
-
'js',
|
94 |
-
'i18n'
|
95 |
-
] );
|
96 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
const potInfo = {
|
2 |
+
languageFolderPath: './languages/',
|
3 |
+
filename : 'yith-plugin-fw.pot',
|
4 |
+
headers : {
|
5 |
poedit : true, // Includes common Poedit headers.
|
6 |
'x-poedit-keywordslist': true, // Include a list of all possible gettext functions.
|
7 |
'report-msgid-bugs-to' : 'YITH <plugins@yithemes.com>',
|
58 |
type : 'wp-plugin',
|
59 |
domainPath : 'languages',
|
60 |
domain : 'yith-plugin-fw',
|
61 |
+
potHeaders : potInfo.headers,
|
62 |
+
updatePoFiles: false
|
63 |
},
|
64 |
dist : {
|
65 |
options: {
|
66 |
+
potFilename: potInfo.filename,
|
67 |
exclude : [
|
68 |
+
'bin/.*',
|
69 |
'node_modules/.*',
|
70 |
'tests/.*',
|
71 |
+
'tmp/.*',
|
72 |
+
'vendor/.*'
|
73 |
]
|
74 |
}
|
75 |
}
|
76 |
+
},
|
77 |
+
update_po: {
|
78 |
+
options: {
|
79 |
+
template: potInfo.languageFolderPath + potInfo.filename
|
80 |
+
},
|
81 |
+
build : {
|
82 |
+
src: potInfo.languageFolderPath + '*.po'
|
83 |
+
}
|
84 |
}
|
85 |
|
86 |
} );
|
87 |
|
88 |
+
grunt.registerMultiTask( 'update_po', 'This task update .po strings by .pot', function () {
|
89 |
+
grunt.log.writeln( 'Updating .po files.' );
|
90 |
+
|
91 |
+
var done = this.async(),
|
92 |
+
options = this.options(),
|
93 |
+
template = options.template;
|
94 |
+
this.files.forEach( function ( file ) {
|
95 |
+
if ( file.src.length ) {
|
96 |
+
var counter = file.src.length;
|
97 |
+
|
98 |
+
grunt.log.writeln( 'Processing ' + file.src.length + ' files.' );
|
99 |
+
|
100 |
+
file.src.forEach( function ( fileSrc ) {
|
101 |
+
grunt.util.spawn( {
|
102 |
+
cmd : 'msgmerge',
|
103 |
+
args: ['-U', fileSrc, template]
|
104 |
+
}, function ( error, result, code ) {
|
105 |
+
const output = fileSrc.replace( '.po', '.mo' );
|
106 |
+
grunt.log.writeln( 'Updating: ' + fileSrc + ' ...' );
|
107 |
+
|
108 |
+
if ( error ) {
|
109 |
+
grunt.verbose.error();
|
110 |
+
} else {
|
111 |
+
grunt.verbose.ok();
|
112 |
+
}
|
113 |
+
|
114 |
+
// Updating also the .mo files
|
115 |
+
grunt.util.spawn( {
|
116 |
+
cmd : 'msgfmt',
|
117 |
+
args: [fileSrc, '-o', output]
|
118 |
+
}, function ( moError, moResult, moCode ) {
|
119 |
+
grunt.log.writeln( 'Updating MO for: ' + fileSrc + ' ...' );
|
120 |
+
counter--;
|
121 |
+
if ( moError || counter === 0 ) {
|
122 |
+
done( moError );
|
123 |
+
}
|
124 |
+
} );
|
125 |
+
if ( error ) {
|
126 |
+
done( error );
|
127 |
+
}
|
128 |
+
} );
|
129 |
+
} );
|
130 |
+
} else {
|
131 |
+
grunt.log.writeln( 'No file to process.' );
|
132 |
+
}
|
133 |
+
} );
|
134 |
+
} );
|
135 |
+
|
136 |
// Load NPM tasks to be used here.
|
137 |
grunt.loadNpmTasks( 'grunt-wp-i18n' );
|
138 |
|
141 |
|
142 |
// Register tasks.
|
143 |
grunt.registerTask( 'js', ['uglify'] );
|
|
|
|
|
|
|
|
|
|
|
144 |
};
|
plugin-fw/assets/css/yith-fields.css
CHANGED
@@ -23,9 +23,9 @@
|
|
23 |
}
|
24 |
|
25 |
.yith-plugin-fw-field-wrapper .yith-inline-fields > div {
|
26 |
-
display: inline-block;
|
27 |
-
vertical-align: middle;
|
28 |
-
margin-right: 5px;
|
29 |
}
|
30 |
|
31 |
.yith-plugin-fw-field-wrapper span.desc {
|
@@ -286,7 +286,7 @@ ul.yit-icons-manager-list li.active {
|
|
286 |
|
287 |
.yith-plugin-fw-checkbox-array__row {
|
288 |
margin-bottom : 10px;
|
289 |
-
display:flex;
|
290 |
}
|
291 |
|
292 |
.yith-plugin-fw-checkbox-array__row label {
|
@@ -298,10 +298,11 @@ ul.yit-icons-manager-list li.active {
|
|
298 |
font-weight : 400 !important;
|
299 |
}
|
300 |
|
301 |
-
.yith-plugin-fw-checkbox-array__row label small{
|
302 |
-
display:block;
|
303 |
-
line-height: 2em;
|
304 |
}
|
|
|
305 |
/* ------- Sidebar Layout ------- */
|
306 |
.yith-plugin-fw-sidebar-layout input[type="radio"] {
|
307 |
display : none;
|
@@ -735,7 +736,7 @@ YITH UI
|
|
735 |
font-size : 15px;
|
736 |
padding : 7px 20px;
|
737 |
border : 0;
|
738 |
-
transition: background-color 0.3s linear;
|
739 |
}
|
740 |
|
741 |
.yith-plugin-ui .nav-tab:first-child {
|
@@ -745,9 +746,10 @@ YITH UI
|
|
745 |
.yith-plugin-ui .nav-tab.yith-premium {
|
746 |
background-color : #be421c;
|
747 |
}
|
|
|
748 |
.yith-plugin-ui .yith-nav-tab-wrapper .yith-plugin-fw-tab-element:hover > a.nav-tab:not(.nav-tab-active),
|
749 |
-
.yith-plugin-ui .yith-nav-tab-wrapper .nav-tab:not(.nav-tab-active):hover{
|
750 |
-
background-color
|
751 |
}
|
752 |
|
753 |
.yith-plugin-ui .nav-tab-active {
|
@@ -1225,8 +1227,8 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
|
|
1225 |
font-size : 13px;
|
1226 |
}
|
1227 |
|
1228 |
-
.wc-wp-version-gte-53 .yith-plugin-ui .select2-container .select2-selection--single .select2-selection__arrow{
|
1229 |
-
background-image: none;
|
1230 |
}
|
1231 |
|
1232 |
.yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before {
|
@@ -1438,7 +1440,7 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
|
|
1438 |
background-color : #fff;
|
1439 |
width : 58px;
|
1440 |
height : 24px;
|
1441 |
-
line-height :14px;
|
1442 |
}
|
1443 |
|
1444 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
@@ -1475,7 +1477,7 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
|
|
1475 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
|
1476 |
.yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
1477 |
background-color : #98aa36;
|
1478 |
-
left: 38px;
|
1479 |
}
|
1480 |
|
1481 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
|
@@ -2114,6 +2116,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2114 |
margin-top : 10px;
|
2115 |
line-height : 20px;
|
2116 |
max-width : 40%;
|
|
|
2117 |
}
|
2118 |
|
2119 |
.yith-plugin-fw-option-with-description {
|
@@ -2174,17 +2177,23 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2174 |
*/
|
2175 |
|
2176 |
.yith-plugin-fw-dimensions {
|
2177 |
-
|
|
|
2178 |
}
|
2179 |
|
2180 |
.yith-plugin-fw-dimensions__units {
|
2181 |
-
|
2182 |
-
|
|
|
|
|
|
|
|
|
|
|
2183 |
}
|
2184 |
|
2185 |
.yith-plugin-fw-dimensions__unit {
|
2186 |
display : inline-block;
|
2187 |
-
padding :
|
2188 |
cursor : pointer;
|
2189 |
font-weight : 700;
|
2190 |
}
|
@@ -2195,38 +2204,60 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2195 |
}
|
2196 |
|
2197 |
.yith-plugin-fw-dimensions__dimensions {
|
2198 |
-
display
|
2199 |
-
margin
|
|
|
|
|
2200 |
}
|
2201 |
|
2202 |
.yith-plugin-fw-dimensions__dimension {
|
2203 |
text-align : center;
|
|
|
2204 |
}
|
2205 |
|
2206 |
-
.yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
border-
|
2212 |
-
|
|
|
|
|
2213 |
text-align : center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2214 |
}
|
2215 |
|
2216 |
-
.yith-plugin-fw-dimensions__dimension:
|
2217 |
-
|
2218 |
-
|
|
|
2219 |
}
|
2220 |
|
2221 |
-
.
|
2222 |
-
|
|
|
|
|
|
|
|
|
|
|
2223 |
}
|
2224 |
|
2225 |
-
.yith-plugin-fw-dimensions__dimension__label
|
|
|
|
|
2226 |
text-transform : uppercase;
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
|
|
2230 |
}
|
2231 |
|
2232 |
.yith-plugin-fw-dimensions__linked {
|
@@ -2264,9 +2295,41 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2264 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2265 |
width : 80%;
|
2266 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2267 |
}
|
2268 |
|
2269 |
@media screen and (max-width : 1024px) {
|
|
|
2270 |
.yith-plugin-ui .yith-add-box,
|
2271 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2272 |
width : 90%;
|
@@ -2291,6 +2354,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2291 |
.yith-plugin-ui td.forminp-checkbox.three-cols fieldset:nth-child(3n+1) {
|
2292 |
clear : initial;
|
2293 |
}
|
|
|
2294 |
}
|
2295 |
|
2296 |
@media screen and (max-width : 782px) {
|
@@ -2322,76 +2386,86 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2322 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2323 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2324 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2325 |
-
padding: 20px 20px;
|
2326 |
}
|
2327 |
|
2328 |
.yith-plugin-ui #plugin-fw-wc table.form-table th.titledesc,
|
2329 |
#yith-plugin-fw-panel table.form-table th.titledesc {
|
2330 |
-
padding-bottom: 0;
|
2331 |
}
|
2332 |
}
|
2333 |
|
2334 |
-
@media (max-width: 480px) {
|
2335 |
.yith-plugin-ui .nav-tab {
|
2336 |
-
font-size: 12px;
|
2337 |
}
|
|
|
2338 |
.yith-plugin-ui h2 {
|
2339 |
-
padding: 20px 20px;
|
2340 |
}
|
|
|
2341 |
.yith-plugin-ui [type="radio"]:checked + label:before, .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
|
2342 |
-
width: 14px;
|
2343 |
-
height: 14px;
|
2344 |
}
|
|
|
2345 |
.yith-plugin-ui [type="radio"]:checked + label:after, .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
|
2346 |
-
width: 10px;
|
2347 |
-
height: 10px;
|
2348 |
-
top: 3px;
|
2349 |
-
left: 3px;
|
2350 |
}
|
|
|
2351 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2352 |
-
padding-left: 25px;
|
2353 |
}
|
2354 |
|
2355 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2356 |
-
font-size: 13px;
|
2357 |
}
|
|
|
2358 |
.yith-plugin-ui span.description {
|
2359 |
-
font-size: 12px;
|
2360 |
}
|
|
|
2361 |
.yith-plugin-ui #plugin-fw-wc table.form-table th,
|
2362 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2363 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2364 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2365 |
-
padding: 15px 20px;
|
2366 |
}
|
2367 |
|
2368 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span {
|
2369 |
-
width: 48px;
|
2370 |
-
height: 20px;
|
2371 |
}
|
|
|
2372 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
2373 |
-
top: 3px;
|
2374 |
-
left: 3px;
|
2375 |
}
|
|
|
2376 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
2377 |
-
left: 30px;
|
2378 |
}
|
|
|
2379 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after {
|
2380 |
-
font-size: 11px;
|
2381 |
-
padding: 0px 6px;
|
2382 |
-
margin-top: 3px;
|
2383 |
}
|
|
|
2384 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after {
|
2385 |
-
font-size: 11px;
|
2386 |
-
padding-left: 24px;
|
2387 |
-
margin-top: 3px;
|
2388 |
}
|
2389 |
|
2390 |
.yith-plugin-fw .select2-container .select2-selection--single .select2-selection__rendered {
|
2391 |
-
font-size: 14px;
|
2392 |
}
|
2393 |
|
2394 |
.yith-plugin-ui input {
|
2395 |
-
font-size: 14px;
|
2396 |
}
|
2397 |
}
|
23 |
}
|
24 |
|
25 |
.yith-plugin-fw-field-wrapper .yith-inline-fields > div {
|
26 |
+
display : inline-block;
|
27 |
+
vertical-align : middle;
|
28 |
+
margin-right : 5px;
|
29 |
}
|
30 |
|
31 |
.yith-plugin-fw-field-wrapper span.desc {
|
286 |
|
287 |
.yith-plugin-fw-checkbox-array__row {
|
288 |
margin-bottom : 10px;
|
289 |
+
display : flex;
|
290 |
}
|
291 |
|
292 |
.yith-plugin-fw-checkbox-array__row label {
|
298 |
font-weight : 400 !important;
|
299 |
}
|
300 |
|
301 |
+
.yith-plugin-fw-checkbox-array__row label small {
|
302 |
+
display : block;
|
303 |
+
line-height : 2em;
|
304 |
}
|
305 |
+
|
306 |
/* ------- Sidebar Layout ------- */
|
307 |
.yith-plugin-fw-sidebar-layout input[type="radio"] {
|
308 |
display : none;
|
736 |
font-size : 15px;
|
737 |
padding : 7px 20px;
|
738 |
border : 0;
|
739 |
+
transition : background-color 0.3s linear;
|
740 |
}
|
741 |
|
742 |
.yith-plugin-ui .nav-tab:first-child {
|
746 |
.yith-plugin-ui .nav-tab.yith-premium {
|
747 |
background-color : #be421c;
|
748 |
}
|
749 |
+
|
750 |
.yith-plugin-ui .yith-nav-tab-wrapper .yith-plugin-fw-tab-element:hover > a.nav-tab:not(.nav-tab-active),
|
751 |
+
.yith-plugin-ui .yith-nav-tab-wrapper .nav-tab:not(.nav-tab-active):hover {
|
752 |
+
background-color : #207a92;
|
753 |
}
|
754 |
|
755 |
.yith-plugin-ui .nav-tab-active {
|
1227 |
font-size : 13px;
|
1228 |
}
|
1229 |
|
1230 |
+
.wc-wp-version-gte-53 .yith-plugin-ui .select2-container .select2-selection--single .select2-selection__arrow {
|
1231 |
+
background-image : none;
|
1232 |
}
|
1233 |
|
1234 |
.yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before {
|
1440 |
background-color : #fff;
|
1441 |
width : 58px;
|
1442 |
height : 24px;
|
1443 |
+
line-height : 14px;
|
1444 |
}
|
1445 |
|
1446 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
1477 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
|
1478 |
.yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
1479 |
background-color : #98aa36;
|
1480 |
+
left : 38px;
|
1481 |
}
|
1482 |
|
1483 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
|
2116 |
margin-top : 10px;
|
2117 |
line-height : 20px;
|
2118 |
max-width : 40%;
|
2119 |
+
min-width : min(100%, 360px);
|
2120 |
}
|
2121 |
|
2122 |
.yith-plugin-fw-option-with-description {
|
2177 |
*/
|
2178 |
|
2179 |
.yith-plugin-fw-dimensions {
|
2180 |
+
display : flex;
|
2181 |
+
align-items : flex-end;
|
2182 |
}
|
2183 |
|
2184 |
.yith-plugin-fw-dimensions__units {
|
2185 |
+
flex : 1;
|
2186 |
+
display : flex;
|
2187 |
+
margin-left : 5px;
|
2188 |
+
width : calc(100% - 105px);
|
2189 |
+
flex-wrap : wrap;
|
2190 |
+
min-height : 38px;
|
2191 |
+
margin-bottom : -8px;
|
2192 |
}
|
2193 |
|
2194 |
.yith-plugin-fw-dimensions__unit {
|
2195 |
display : inline-block;
|
2196 |
+
padding : 0 3px;
|
2197 |
cursor : pointer;
|
2198 |
font-weight : 700;
|
2199 |
}
|
2204 |
}
|
2205 |
|
2206 |
.yith-plugin-fw-dimensions__dimensions {
|
2207 |
+
display : flex;
|
2208 |
+
margin : 0;
|
2209 |
+
align-items : flex-end;
|
2210 |
+
max-width : 400px;
|
2211 |
}
|
2212 |
|
2213 |
.yith-plugin-fw-dimensions__dimension {
|
2214 |
text-align : center;
|
2215 |
+
flex : 1;
|
2216 |
}
|
2217 |
|
2218 |
+
.yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2219 |
+
.woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2220 |
+
.yith-plugin-ui .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number {
|
2221 |
+
width : 100%;
|
2222 |
+
min-width : 0;
|
2223 |
+
border-radius : 0;
|
2224 |
+
border : 1px solid #d8d8d8;
|
2225 |
+
border-left : none;
|
2226 |
+
height : 38px;
|
2227 |
text-align : center;
|
2228 |
+
padding-right : 0;
|
2229 |
+
}
|
2230 |
+
|
2231 |
+
.yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2232 |
+
.woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2233 |
+
.yith-plugin-ui .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
|
2234 |
+
border-left : 1px solid #d8d8d8;
|
2235 |
+
border-radius : 6px 0 0 6px;
|
2236 |
}
|
2237 |
|
2238 |
+
.yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2239 |
+
.woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2240 |
+
.yith-plugin-ui .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
|
2241 |
+
border-radius : 0 6px 6px 0;
|
2242 |
}
|
2243 |
|
2244 |
+
.metaboxes-tab .yith-plugin-fw-dimensions__dimension__label,
|
2245 |
+
.yith-plugin-ui.metaboxes-tab label.yith-plugin-fw-dimensions__dimension__label {
|
2246 |
+
float : none;
|
2247 |
+
margin : 0;
|
2248 |
+
width : auto;
|
2249 |
+
font-weight : inherit;
|
2250 |
+
line-height : inherit;
|
2251 |
}
|
2252 |
|
2253 |
+
.yith-plugin-fw-dimensions__dimension__label,
|
2254 |
+
.metaboxes-tab .yith-plugin-fw-dimensions__dimension__label,
|
2255 |
+
.yith-plugin-ui.metaboxes-tab label.yith-plugin-fw-dimensions__dimension__label {
|
2256 |
text-transform : uppercase;
|
2257 |
+
letter-spacing : 2px;
|
2258 |
+
font-size : 11px;
|
2259 |
+
margin-bottom : 5px;
|
2260 |
+
display : inline-block;
|
2261 |
}
|
2262 |
|
2263 |
.yith-plugin-fw-dimensions__linked {
|
2295 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2296 |
width : 80%;
|
2297 |
}
|
2298 |
+
|
2299 |
+
|
2300 |
+
.yith-plugin-ui .yith-add-box-row,
|
2301 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row,
|
2302 |
+
.yith-plugin-ui .yith-add-box-row label {
|
2303 |
+
display : block;
|
2304 |
+
}
|
2305 |
+
|
2306 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row > label {
|
2307 |
+
display : block;
|
2308 |
+
}
|
2309 |
+
|
2310 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-plugin-fw-option-with-description {
|
2311 |
+
width : 100%;
|
2312 |
+
}
|
2313 |
+
|
2314 |
+
.yith-plugin-ui .yith-add-box-row,
|
2315 |
+
.yith-plugin-ui .yith-add-box-row label {
|
2316 |
+
display : block;
|
2317 |
+
}
|
2318 |
+
|
2319 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-plugin-fw-option-with-description,
|
2320 |
+
.yith-plugin-ui .yith-add-box-row .yith-plugin-fw-option-with-description {
|
2321 |
+
display : block;
|
2322 |
+
padding-top : 20px;
|
2323 |
+
}
|
2324 |
+
|
2325 |
+
|
2326 |
+
.yith-plugin-ui .yith-add-box-row .yith-plugin-fw-option-with-description span.description {
|
2327 |
+
max-width : 100%;
|
2328 |
+
}
|
2329 |
}
|
2330 |
|
2331 |
@media screen and (max-width : 1024px) {
|
2332 |
+
|
2333 |
.yith-plugin-ui .yith-add-box,
|
2334 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2335 |
width : 90%;
|
2354 |
.yith-plugin-ui td.forminp-checkbox.three-cols fieldset:nth-child(3n+1) {
|
2355 |
clear : initial;
|
2356 |
}
|
2357 |
+
|
2358 |
}
|
2359 |
|
2360 |
@media screen and (max-width : 782px) {
|
2386 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2387 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2388 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2389 |
+
padding : 20px 20px;
|
2390 |
}
|
2391 |
|
2392 |
.yith-plugin-ui #plugin-fw-wc table.form-table th.titledesc,
|
2393 |
#yith-plugin-fw-panel table.form-table th.titledesc {
|
2394 |
+
padding-bottom : 0;
|
2395 |
}
|
2396 |
}
|
2397 |
|
2398 |
+
@media (max-width : 480px) {
|
2399 |
.yith-plugin-ui .nav-tab {
|
2400 |
+
font-size : 12px;
|
2401 |
}
|
2402 |
+
|
2403 |
.yith-plugin-ui h2 {
|
2404 |
+
padding : 20px 20px;
|
2405 |
}
|
2406 |
+
|
2407 |
.yith-plugin-ui [type="radio"]:checked + label:before, .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
|
2408 |
+
width : 14px;
|
2409 |
+
height : 14px;
|
2410 |
}
|
2411 |
+
|
2412 |
.yith-plugin-ui [type="radio"]:checked + label:after, .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
|
2413 |
+
width : 10px;
|
2414 |
+
height : 10px;
|
2415 |
+
top : 3px;
|
2416 |
+
left : 3px;
|
2417 |
}
|
2418 |
+
|
2419 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2420 |
+
padding-left : 25px;
|
2421 |
}
|
2422 |
|
2423 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2424 |
+
font-size : 13px;
|
2425 |
}
|
2426 |
+
|
2427 |
.yith-plugin-ui span.description {
|
2428 |
+
font-size : 12px;
|
2429 |
}
|
2430 |
+
|
2431 |
.yith-plugin-ui #plugin-fw-wc table.form-table th,
|
2432 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2433 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2434 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2435 |
+
padding : 15px 20px;
|
2436 |
}
|
2437 |
|
2438 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span {
|
2439 |
+
width : 48px;
|
2440 |
+
height : 20px;
|
2441 |
}
|
2442 |
+
|
2443 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
2444 |
+
top : 3px;
|
2445 |
+
left : 3px;
|
2446 |
}
|
2447 |
+
|
2448 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
2449 |
+
left : 30px;
|
2450 |
}
|
2451 |
+
|
2452 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after {
|
2453 |
+
font-size : 11px;
|
2454 |
+
padding : 0px 6px;
|
2455 |
+
margin-top : 3px;
|
2456 |
}
|
2457 |
+
|
2458 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after {
|
2459 |
+
font-size : 11px;
|
2460 |
+
padding-left : 24px;
|
2461 |
+
margin-top : 3px;
|
2462 |
}
|
2463 |
|
2464 |
.yith-plugin-fw .select2-container .select2-selection--single .select2-selection__rendered {
|
2465 |
+
font-size : 14px;
|
2466 |
}
|
2467 |
|
2468 |
.yith-plugin-ui input {
|
2469 |
+
font-size : 14px;
|
2470 |
}
|
2471 |
}
|
plugin-fw/assets/js/yith-fields.js
CHANGED
@@ -41,15 +41,15 @@
|
|
41 |
|
42 |
/* Colorpicker */
|
43 |
$colorpicker.wpColorPicker( {
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
|
55 |
$colorpicker.each( function () {
|
@@ -64,15 +64,15 @@
|
|
64 |
|
65 |
if ( !wrap1.find( '.wp-picker-clear-custom' ).length ) {
|
66 |
var button = $( '<span/>' ).attr( {
|
67 |
-
|
68 |
-
|
69 |
wrap1.find( '.wp-picker-default' ).wrap( button );
|
70 |
}
|
71 |
|
72 |
if ( !wrap2.find( '.wp-picker-clear-custom' ).length ) {
|
73 |
var button = $( '<span/>' ).attr( {
|
74 |
-
|
75 |
-
|
76 |
wrap2.find( '.wp-picker-default' ).wrap( button );
|
77 |
}
|
78 |
} );
|
@@ -84,7 +84,7 @@
|
|
84 |
// preview
|
85 |
$upload.imgUrl.change( function () {
|
86 |
var url = $( this ).val(),
|
87 |
-
|
88 |
preview = $( this ).parent().find( $upload.imgPreviewHandler ).first();
|
89 |
|
90 |
if ( preview.length < 1 ) {
|
@@ -103,7 +103,7 @@
|
|
103 |
|
104 |
var t = $( this ),
|
105 |
custom_uploader,
|
106 |
-
id = t.attr( 'id' ).replace( /-button$/, '' );
|
107 |
|
108 |
//If the uploader object has already been created, reopen the dialog
|
109 |
if ( custom_uploader ) {
|
@@ -114,27 +114,27 @@
|
|
114 |
var custom_uploader_states = [
|
115 |
// Main states.
|
116 |
new wp.media.controller.Library( {
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
];
|
124 |
|
125 |
// Create the media frame.
|
126 |
custom_uploader = wp.media.frames.downloadable_file = wp.media( {
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
|
139 |
//When a file is selected, grab the URL and set it as the text field's value
|
140 |
custom_uploader.on( 'select', function () {
|
@@ -154,8 +154,8 @@
|
|
154 |
|
155 |
$( document ).on( 'click', $upload.resetButtonHandler, function ( e ) {
|
156 |
var t = $( this ),
|
157 |
-
id = t.attr( 'id' ),
|
158 |
-
input_id = t.attr( 'id' ).replace( /-button-reset$/, '' ),
|
159 |
default_value = $( '#' + id ).data( 'default' );
|
160 |
|
161 |
$( "#" + input_id ).val( default_value );
|
@@ -178,19 +178,19 @@
|
|
178 |
|
179 |
// Create the media frame.
|
180 |
var image_gallery_frame = wp.media.frames.image_gallery = wp.media( {
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
|
195 |
// When an image is selected, run a callback.
|
196 |
image_gallery_frame.on( 'select', function () {
|
@@ -215,30 +215,30 @@
|
|
215 |
$imageGallery.sliderWrapper.each( function () {
|
216 |
var $t = $( this );
|
217 |
$t.sortable( {
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
} );
|
243 |
|
244 |
// Remove images
|
@@ -304,23 +304,23 @@
|
|
304 |
labels = $( this ).data( 'labels' );
|
305 |
|
306 |
$( this ).slider( {
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
} );
|
325 |
|
326 |
/* codemirror */
|
@@ -459,29 +459,29 @@
|
|
459 |
yit_metaboxes_nonce = $( this ).closest( 'form#post' ).find( '#yit_metaboxes_nonce' ).val();
|
460 |
metabox_tab = $( this ).closest( '.tabs-panel' ).attr( 'id' );
|
461 |
url = yith_framework_fw_fields.ajax_url +
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
} else {
|
468 |
url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
|
469 |
}
|
470 |
|
471 |
$.ajax( {
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
};
|
486 |
|
487 |
$.fn.serializeToggleElement = function () {
|
@@ -696,22 +696,22 @@
|
|
696 |
toggle.saveToggleElement();
|
697 |
} );
|
698 |
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
|
704 |
-
|
705 |
-
|
706 |
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
|
714 |
-
|
715 |
$( document ).on( 'click', '.yith-password-eye', function () {
|
716 |
var $this = $( this ),
|
717 |
inp = $( this ).closest( '.yith-password-wrapper' ).find( 'input' );
|
@@ -732,70 +732,70 @@
|
|
732 |
$( '.select2-results' ).closest( '.select2-container' ).addClass( 'yith-plugin-fw-select2-container' );
|
733 |
}
|
734 |
} );
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
|
801 |
} )( jQuery );
|
41 |
|
42 |
/* Colorpicker */
|
43 |
$colorpicker.wpColorPicker( {
|
44 |
+
palettes: false,
|
45 |
+
width : 200,
|
46 |
+
mode : 'hsl',
|
47 |
+
clear : function () {
|
48 |
+
var input = $( this );
|
49 |
+
input.val( input.data( 'default-color' ) );
|
50 |
+
input.change();
|
51 |
+
}
|
52 |
+
} );
|
53 |
|
54 |
|
55 |
$colorpicker.each( function () {
|
64 |
|
65 |
if ( !wrap1.find( '.wp-picker-clear-custom' ).length ) {
|
66 |
var button = $( '<span/>' ).attr( {
|
67 |
+
class: "wp-picker-default-custom"
|
68 |
+
} );
|
69 |
wrap1.find( '.wp-picker-default' ).wrap( button );
|
70 |
}
|
71 |
|
72 |
if ( !wrap2.find( '.wp-picker-clear-custom' ).length ) {
|
73 |
var button = $( '<span/>' ).attr( {
|
74 |
+
class: "wp-picker-default-custom"
|
75 |
+
} );
|
76 |
wrap2.find( '.wp-picker-default' ).wrap( button );
|
77 |
}
|
78 |
} );
|
84 |
// preview
|
85 |
$upload.imgUrl.change( function () {
|
86 |
var url = $( this ).val(),
|
87 |
+
re = new RegExp( "(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)" ),
|
88 |
preview = $( this ).parent().find( $upload.imgPreviewHandler ).first();
|
89 |
|
90 |
if ( preview.length < 1 ) {
|
103 |
|
104 |
var t = $( this ),
|
105 |
custom_uploader,
|
106 |
+
id = t.attr( 'id' ).replace( /-button$/, '' ).replace(/(\[|\])/g, '\\$1');
|
107 |
|
108 |
//If the uploader object has already been created, reopen the dialog
|
109 |
if ( custom_uploader ) {
|
114 |
var custom_uploader_states = [
|
115 |
// Main states.
|
116 |
new wp.media.controller.Library( {
|
117 |
+
library : wp.media.query(),
|
118 |
+
multiple : false,
|
119 |
+
title : 'Choose Image',
|
120 |
+
priority : 20,
|
121 |
+
filterable: 'uploaded'
|
122 |
+
} )
|
123 |
];
|
124 |
|
125 |
// Create the media frame.
|
126 |
custom_uploader = wp.media.frames.downloadable_file = wp.media( {
|
127 |
+
// Set the title of the modal.
|
128 |
+
title : 'Choose Image',
|
129 |
+
library : {
|
130 |
+
type: ''
|
131 |
+
},
|
132 |
+
button : {
|
133 |
+
text: 'Choose Image'
|
134 |
+
},
|
135 |
+
multiple: false,
|
136 |
+
states : custom_uploader_states
|
137 |
+
} );
|
138 |
|
139 |
//When a file is selected, grab the URL and set it as the text field's value
|
140 |
custom_uploader.on( 'select', function () {
|
154 |
|
155 |
$( document ).on( 'click', $upload.resetButtonHandler, function ( e ) {
|
156 |
var t = $( this ),
|
157 |
+
id = t.attr( 'id' ).replace(/(\[|\])/g, '\\$1'),
|
158 |
+
input_id = t.attr( 'id' ).replace( /-button-reset$/, '' ).replace(/(\[|\])/g, '\\$1'),
|
159 |
default_value = $( '#' + id ).data( 'default' );
|
160 |
|
161 |
$( "#" + input_id ).val( default_value );
|
178 |
|
179 |
// Create the media frame.
|
180 |
var image_gallery_frame = wp.media.frames.image_gallery = wp.media( {
|
181 |
+
// Set the title of the modal.
|
182 |
+
title : $t.data( 'choose' ),
|
183 |
+
button: {
|
184 |
+
text: $t.data( 'update' )
|
185 |
+
},
|
186 |
+
states: [
|
187 |
+
new wp.media.controller.Library( {
|
188 |
+
title : $t.data( 'choose' ),
|
189 |
+
filterable: 'all',
|
190 |
+
multiple : true
|
191 |
+
} )
|
192 |
+
]
|
193 |
+
} );
|
194 |
|
195 |
// When an image is selected, run a callback.
|
196 |
image_gallery_frame.on( 'select', function () {
|
215 |
$imageGallery.sliderWrapper.each( function () {
|
216 |
var $t = $( this );
|
217 |
$t.sortable( {
|
218 |
+
items : 'li.image',
|
219 |
+
cursor : 'move',
|
220 |
+
scrollSensitivity : 40,
|
221 |
+
forcePlaceholderSize: true,
|
222 |
+
forceHelperSize : false,
|
223 |
+
helper : 'clone',
|
224 |
+
opacity : 0.65,
|
225 |
+
start : function ( event, ui ) {
|
226 |
+
ui.item.css( 'background-color', '#f6f6f6' );
|
227 |
+
},
|
228 |
+
stop : function ( event, ui ) {
|
229 |
+
ui.item.removeAttr( 'style' );
|
230 |
+
},
|
231 |
+
update : function ( event, ui ) {
|
232 |
+
var attachment_ids = '';
|
233 |
+
|
234 |
+
$t.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
|
235 |
+
var attachment_id = $( this ).attr( 'data-attachment_id' );
|
236 |
+
attachment_ids = attachment_ids + attachment_id + ',';
|
237 |
+
} );
|
238 |
+
|
239 |
+
$t.closest( '.image-gallery' ).find( '.image_gallery_ids' ).val( attachment_ids );
|
240 |
+
}
|
241 |
+
} );
|
242 |
} );
|
243 |
|
244 |
// Remove images
|
304 |
labels = $( this ).data( 'labels' );
|
305 |
|
306 |
$( this ).slider( {
|
307 |
+
value: val,
|
308 |
+
min : minValue,
|
309 |
+
max : maxValue,
|
310 |
+
range: 'min',
|
311 |
+
step : step,
|
312 |
+
|
313 |
+
create: function () {
|
314 |
+
$( this ).find( '.ui-slider-handle' ).text( $( this ).slider( "value" ) );
|
315 |
+
},
|
316 |
+
|
317 |
+
|
318 |
+
slide: function ( event, ui ) {
|
319 |
+
$( this ).find( 'input' ).val( ui.value );
|
320 |
+
$( this ).find( '.ui-slider-handle' ).text( ui.value );
|
321 |
+
$( this ).siblings( '.feedback' ).find( 'strong' ).text( ui.value + labels );
|
322 |
+
}
|
323 |
+
} );
|
324 |
} );
|
325 |
|
326 |
/* codemirror */
|
459 |
yit_metaboxes_nonce = $( this ).closest( 'form#post' ).find( '#yit_metaboxes_nonce' ).val();
|
460 |
metabox_tab = $( this ).closest( '.tabs-panel' ).attr( 'id' );
|
461 |
url = yith_framework_fw_fields.ajax_url +
|
462 |
+
'?action=' + action +
|
463 |
+
"&post_ID=" + post_id +
|
464 |
+
'&yit_metaboxes_nonce=' + yit_metaboxes_nonce +
|
465 |
+
"&toggle_id=" + id +
|
466 |
+
"&metabox_tab=" + metabox_tab;
|
467 |
} else {
|
468 |
url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
|
469 |
}
|
470 |
|
471 |
$.ajax( {
|
472 |
+
type : "POST",
|
473 |
+
url : url,
|
474 |
+
data : formdata,
|
475 |
+
contentType: false,
|
476 |
+
processData: false,
|
477 |
+
success : function ( result ) {
|
478 |
+
if ( spinner ) {
|
479 |
+
spinner.removeClass( 'show' );
|
480 |
+
}
|
481 |
|
482 |
+
$( document ).trigger( 'yith_save_toggle_element_done', [result, toggle] );
|
483 |
+
}
|
484 |
+
} );
|
485 |
};
|
486 |
|
487 |
$.fn.serializeToggleElement = function () {
|
696 |
toggle.saveToggleElement();
|
697 |
} );
|
698 |
|
699 |
+
// Radio
|
700 |
+
$( document ).on( 'click', '.yith-plugin-fw-radio input[type=radio]', function () {
|
701 |
+
var _radioContainer = $( this ).closest( '.yith-plugin-fw-radio' ),
|
702 |
+
_value = $( this ).val();
|
703 |
|
704 |
+
_radioContainer.val( _value ).data( 'value', _value ).trigger( 'change' );
|
705 |
+
} );
|
706 |
|
707 |
+
$( document.body ).on( 'yith-plugin-fw-init-radio', function () {
|
708 |
+
$( '.yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)' ).each( function () {
|
709 |
+
$( this ).val( $( this ).data( 'value' ) );
|
710 |
+
$( this ).addClass( 'yith-plugin-fw-radio--initialized' );
|
711 |
+
} );
|
712 |
+
} ).trigger( 'yith-plugin-fw-init-radio' );
|
713 |
|
714 |
+
// Password Eye field
|
715 |
$( document ).on( 'click', '.yith-password-eye', function () {
|
716 |
var $this = $( this ),
|
717 |
inp = $( this ).closest( '.yith-password-wrapper' ).find( 'input' );
|
732 |
$( '.select2-results' ).closest( '.select2-container' ).addClass( 'yith-plugin-fw-select2-container' );
|
733 |
}
|
734 |
} );
|
735 |
+
/**
|
736 |
+
* Dimensions
|
737 |
+
*/
|
738 |
+
var fw_dimensions = {
|
739 |
+
selectors : {
|
740 |
+
wrapper : '.yith-plugin-fw-dimensions',
|
741 |
+
units : {
|
742 |
+
wrapper : '.yith-plugin-fw-dimensions__units',
|
743 |
+
single : '.yith-plugin-fw-dimensions__unit',
|
744 |
+
value : '.yith-plugin-fw-dimensions__unit__value',
|
745 |
+
selectedClass: 'yith-plugin-fw-dimensions__unit--selected'
|
746 |
+
},
|
747 |
+
linked : {
|
748 |
+
button : '.yith-plugin-fw-dimensions__linked',
|
749 |
+
value : '.yith-plugin-fw-dimensions__linked__value',
|
750 |
+
wrapperActiveClass: 'yith-plugin-fw-dimensions--linked-active'
|
751 |
+
},
|
752 |
+
dimensions: {
|
753 |
+
number: '.yith-plugin-fw-dimensions__dimension__number'
|
754 |
+
}
|
755 |
+
},
|
756 |
+
init : function () {
|
757 |
+
var self = fw_dimensions;
|
758 |
+
$( document ).on( 'click', self.selectors.units.single, self.unitChange );
|
759 |
+
$( document ).on( 'click', self.selectors.linked.button, self.linkedChange );
|
760 |
+
$( document ).on( 'change keyup', self.selectors.dimensions.number, self.numberChange );
|
761 |
+
},
|
762 |
+
unitChange : function ( e ) {
|
763 |
+
var unit = $( this ).closest( fw_dimensions.selectors.units.single ),
|
764 |
+
wrapper = unit.closest( fw_dimensions.selectors.units.wrapper ),
|
765 |
+
units = wrapper.find( fw_dimensions.selectors.units.single ),
|
766 |
+
valueField = wrapper.find( fw_dimensions.selectors.units.value ).first(),
|
767 |
+
value = unit.data( 'value' );
|
768 |
+
|
769 |
+
units.removeClass( fw_dimensions.selectors.units.selectedClass );
|
770 |
+
unit.addClass( fw_dimensions.selectors.units.selectedClass );
|
771 |
+
valueField.val( value );
|
772 |
+
},
|
773 |
+
linkedChange: function () {
|
774 |
+
var button = $( this ).closest( fw_dimensions.selectors.linked.button ),
|
775 |
+
mainWrapper = button.closest( fw_dimensions.selectors.wrapper ),
|
776 |
+
valueField = button.find( fw_dimensions.selectors.linked.value ),
|
777 |
+
value = valueField.val();
|
778 |
+
|
779 |
+
if ( 'yes' === value ) {
|
780 |
+
mainWrapper.removeClass( fw_dimensions.selectors.linked.wrapperActiveClass );
|
781 |
+
valueField.val( 'no' );
|
782 |
+
} else {
|
783 |
+
mainWrapper.addClass( fw_dimensions.selectors.linked.wrapperActiveClass );
|
784 |
+
valueField.val( 'yes' );
|
785 |
+
|
786 |
+
mainWrapper.find( fw_dimensions.selectors.dimensions.number ).first().trigger( 'change' );
|
787 |
+
}
|
788 |
+
},
|
789 |
+
numberChange: function ( e ) {
|
790 |
+
var number = $( this ).closest( fw_dimensions.selectors.dimensions.number ),
|
791 |
+
mainWrapper = number.closest( fw_dimensions.selectors.wrapper );
|
792 |
+
if ( mainWrapper.hasClass( fw_dimensions.selectors.linked.wrapperActiveClass ) ) {
|
793 |
+
var numbers = mainWrapper.find( fw_dimensions.selectors.dimensions.number );
|
794 |
+
|
795 |
+
numbers.val( number.val() );
|
796 |
+
}
|
797 |
+
}
|
798 |
+
};
|
799 |
+
fw_dimensions.init();
|
800 |
|
801 |
} )( jQuery );
|
plugin-fw/assets/js/yith-fields.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e(document).on("yith_fields_init",function(){var t=e(".yith-plugin-fw-datepicker"),i=e(".yith-plugin-fw-colorpicker"),a={imgPreviewHandler:".yith-plugin-fw-upload-img-preview",uploadButtonHandler:".yith-plugin-fw-upload-button",imgUrlHandler:".yith-plugin-fw-upload-img-url",resetButtonHandler:".yith-plugin-fw-upload-button-reset",imgUrl:e(".yith-plugin-fw-upload-img-url")},n=e(".add_media"),l={sliderWrapper:e(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},s=e(".yith-plugin-fw-sidebar-layout"),o=e(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=e(".codemirror"),d=e(".yit-icons-manager-wrapper");e(".yith-plugin-ui td.forminp-checkbox");t.each(function(){var t=e(this).data();t.showAnim=!1,t.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},t.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},e(this).datepicker(t)}),i.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.change()}}),i.each(function(){var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),a=e(this).closest(".yith-single-colorpicker"),n=i.find(".wp-picker-input-wrap"),l=a.find(".wp-picker-input-wrap");if(n.length&&i.find("a.wp-color-result").attr("title",t),a.length&&a.find("a.wp-color-result").attr("title",t),!n.find(".wp-picker-clear-custom").length){var s=e("<span/>").attr({"class":"wp-picker-default-custom"});n.find(".wp-picker-default").wrap(s)}l.find(".wp-picker-clear-custom").length||(s=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(s))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(a.imgUrl.change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),n=e(this).parent().find(a.imgPreviewHandler).first();n.length<1&&(n=e(this).parent().parent().find(a.imgPreviewHandler).first()),i.test(t)?n.html('<img src="'+t+'" style="max-width:100px; max-height:100px;" />'):n.html("")}).trigger("change"),e(document).on("click",a.uploadButtonHandler,function(t){t.preventDefault();var i,n=e(this).attr("id").replace(/-button$/,"");if(i)i.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+n).val(t.url),e("#"+n+"-yith-attachment-id")&&e("#"+n+"-yith-attachment-id").val(t.id),a.imgUrl.trigger("change")}),i.open()}}),e(document).on("click",a.resetButtonHandler,function(t){var i=e(this),n=i.attr("id"),l=i.attr("id").replace(/-button-reset$/,""),s=e("#"+n).data("default");e("#"+l).val(s),a.imgUrl.trigger("change")}));n.on("click",function(){}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("click",l.buttonHandler,function(t){var i=e(this),a=i.closest(".image-gallery"),n=a.find(".image_gallery_ids"),l=n.val(),s=a.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]});o.on("select",function(){o.state().get("selection").map(function(e){(e=e.toJSON()).id&&(l=l?l+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">x</a></li></ul></li>'))}),n.val(l)}),o.open()}),l.sliderWrapper.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(i,a){var n="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),t.closest(".image-gallery").find(".image_gallery_ids").val(n)}})}),l.sliderWrapper.on("click","a.delete",function(){var t=e(this).closest(".image-gallery"),i=e(this).closest(".image-gallery ul.slides-wrapper"),a=t.find(".image_gallery_ids"),n="";e(this).closest("li.image").remove(),i.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),a.val(n)})),s.each(function(){e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),a=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),n=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==n)switch(n){case"left":i.show(),a.hide();break;case"right":a.show(),i.hide();break;case"double":i.show(),a.show();break;default:i.hide(),a.hide()}})}),o.each(function(){var t=e(this).data("val"),i=e(this).data("min"),a=e(this).data("max"),n=e(this).data("step"),l=e(this).data("labels");e(this).slider({value:t,min:i,max:a,range:"min",step:n,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+l)}})}),r.each(function(t,i){var a=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",a)}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),a=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(n){var l=e(n.target).closest("li"),s=l.data("font"),o=l.data("icon"),r=l.data("key"),d=l.data("name");i.attr("data-font",s),i.attr("data-icon",o),i.attr("data-key",r),i.attr("data-name",d),a.val(s+":"+d),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),a=t.closest(".yith-plugin-fw-select-images__wrapper"),n=a.find(".yith-plugin-fw-select-images__item"),l=a.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed"),n.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document.body).trigger("wc-enhanced-select-init"),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var a=jQuery(".ui-sortable-handle"),n=0,l=new Array;for(n=0;n<a.length;n++)l[n]=e(a[n]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("checked")?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e.fn.saveToggleElement=function(t,i){var a=e(this),n="yith_plugin_fw_save_toggle_element",l=a.serializeToggleElement(),s=a.find(".yith-toggle_wrapper"),o=s.attr("id"),r=e.urlParam("tab");l.append("security",s.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),a.closest(".metaboxes-tab.yith-plugin-ui").length?(n="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+n+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+o+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+n+"&tab="+r+"&toggle_id="+o,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,a])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,a=e(t).find(":input").serializeArray();return e.each(a,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),a=t.find("span.title").data("title_format"),n=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==a)var s=a.match(l);if(void 0!==n)var o=n.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)))}),""!==a&&t.find("span.title").html(a),""!==n&&t.find(".subtitle").html(n),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),a=i.closest(".yith-toggle-row"),n=a.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;a.is(".yith-toggle-row-opened")?n.slideUp(400):n.slideDown(400),a.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),a=i.data("box_id"),n=i.data("closed_label"),l=i.data("opened_label"),s=i.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+s),""!==a&&(e("#"+a).html(template({index:"box_id"})).slideToggle(),""!==n&&(i.html()===n?i.html(l).removeClass("closed"):i.html(n).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),a=e(this).closest(".yith-toggle_wrapper").attr("id"),n=i.find(".spinner"),l=e(this).parents(".toggle-element"),s=i.find(":input"),o=l.find(".yith-toggle-row").length,r=e('<input type="hidden">');r.val(o),e(document).trigger("yith-toggle-change-counter",[r,i]),o=r.val();var d=wp.template("yith-toggle-element-item-"+a),c=e(d({index:o}));n.addClass("show"),e.each(s,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_val=e(i).val(),"radio"==e(i).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+o,e(i).is(":checked")&&e(c).find("#"+$field_id).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(c).find("#"+$field_id).html(e("#"+e(i).attr("id")).html()),e(c).find("#"+$field_id).val($field_val))}),e(c).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,c,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(c),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),a=e(this).closest(".yith-toggle-row"),n=a.find(".spinner");a.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,a,l]),"yes"===l.val()&&(n.addClass("show"),i.saveToggleElement(n))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).val(e(this).data("value")),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var t={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var i=t;e(document).on("click",i.selectors.units.single,i.unitChange),e(document).on("click",i.selectors.linked.button,i.linkedChange),e(document).on("change keyup",i.selectors.dimensions.number,i.numberChange)},unitChange:function(i){var a=e(this).closest(t.selectors.units.single),n=a.closest(t.selectors.units.wrapper),l=n.find(t.selectors.units.single),s=n.find(t.selectors.units.value).first(),o=a.data("value");l.removeClass(t.selectors.units.selectedClass),a.addClass(t.selectors.units.selectedClass),s.val(o)},linkedChange:function(){var i=e(this).closest(t.selectors.linked.button),a=i.closest(t.selectors.wrapper),n=i.find(t.selectors.linked.value);"yes"===n.val()?(a.removeClass(t.selectors.linked.wrapperActiveClass),n.val("no")):(a.addClass(t.selectors.linked.wrapperActiveClass),n.val("yes"),a.find(t.selectors.dimensions.number).first().trigger("change"))},numberChange:function(i){var a=e(this).closest(t.selectors.dimensions.number),n=a.closest(t.selectors.wrapper);n.hasClass(t.selectors.linked.wrapperActiveClass)&&n.find(t.selectors.dimensions.number).val(a.val())}};t.init()}(jQuery);
|
1 |
+
!function(e){e(document).on("yith_fields_init",function(){var t=e(".yith-plugin-fw-datepicker"),i=e(".yith-plugin-fw-colorpicker"),a={imgPreviewHandler:".yith-plugin-fw-upload-img-preview",uploadButtonHandler:".yith-plugin-fw-upload-button",imgUrlHandler:".yith-plugin-fw-upload-img-url",resetButtonHandler:".yith-plugin-fw-upload-button-reset",imgUrl:e(".yith-plugin-fw-upload-img-url")},n=e(".add_media"),l={sliderWrapper:e(".yith-plugin-fw .image-gallery ul.slides-wrapper"),buttonHandler:".yith-plugin-fw .image-gallery-button"},s=e(".yith-plugin-fw-sidebar-layout"),o=e(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),r=e(".codemirror"),d=e(".yit-icons-manager-wrapper");e(".yith-plugin-ui td.forminp-checkbox");t.each(function(){var t=e(this).data();t.showAnim=!1,t.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},t.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},e(this).datepicker(t)}),i.wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.change()}}),i.each(function(){var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),a=e(this).closest(".yith-single-colorpicker"),n=i.find(".wp-picker-input-wrap"),l=a.find(".wp-picker-input-wrap");if(n.length&&i.find("a.wp-color-result").attr("title",t),a.length&&a.find("a.wp-color-result").attr("title",t),!n.find(".wp-picker-clear-custom").length){var s=e("<span/>").attr({"class":"wp-picker-default-custom"});n.find(".wp-picker-default").wrap(s)}l.find(".wp-picker-clear-custom").length||(s=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(s))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(a.imgUrl.change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),n=e(this).parent().find(a.imgPreviewHandler).first();n.length<1&&(n=e(this).parent().parent().find(a.imgPreviewHandler).first()),i.test(t)?n.html('<img src="'+t+'" style="max-width:100px; max-height:100px;" />'):n.html("")}).trigger("change"),e(document).on("click",a.uploadButtonHandler,function(t){t.preventDefault();var i,n=e(this).attr("id").replace(/-button$/,"").replace(/(\[|\])/g,"\\$1");if(i)i.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+n).val(t.url),e("#"+n+"-yith-attachment-id")&&e("#"+n+"-yith-attachment-id").val(t.id),a.imgUrl.trigger("change")}),i.open()}}),e(document).on("click",a.resetButtonHandler,function(t){var i=e(this),n=i.attr("id").replace(/(\[|\])/g,"\\$1"),l=i.attr("id").replace(/-button-reset$/,"").replace(/(\[|\])/g,"\\$1"),s=e("#"+n).data("default");e("#"+l).val(s),a.imgUrl.trigger("change")}));n.on("click",function(){}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("click",l.buttonHandler,function(t){var i=e(this),a=i.closest(".image-gallery"),n=a.find(".image_gallery_ids"),l=n.val(),s=a.find("ul.slides-wrapper"),o=wp.media.frames.image_gallery=wp.media({title:i.data("choose"),button:{text:i.data("update")},states:[new wp.media.controller.Library({title:i.data("choose"),filterable:"all",multiple:!0})]});o.on("select",function(){o.state().get("selection").map(function(e){(e=e.toJSON()).id&&(l=l?l+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+i.data("delete")+'">x</a></li></ul></li>'))}),n.val(l)}),o.open()}),l.sliderWrapper.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(i,a){var n="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),t.closest(".image-gallery").find(".image_gallery_ids").val(n)}})}),l.sliderWrapper.on("click","a.delete",function(){var t=e(this).closest(".image-gallery"),i=e(this).closest(".image-gallery ul.slides-wrapper"),a=t.find(".image_gallery_ids"),n="";e(this).closest("li.image").remove(),i.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");n=n+t+","}),a.val(n)})),s.each(function(){e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),a=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),n=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==n)switch(n){case"left":i.show(),a.hide();break;case"right":a.show(),i.hide();break;case"double":i.show(),a.show();break;default:i.hide(),a.hide()}})}),o.each(function(){var t=e(this).data("val"),i=e(this).data("min"),a=e(this).data("max"),n=e(this).data("step"),l=e(this).data("labels");e(this).slider({value:t,min:i,max:a,range:"min",step:n,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+l)}})}),r.each(function(t,i){var a=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",a)}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),d.each(function(){var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),a=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(n){var l=e(n.target).closest("li"),s=l.data("font"),o=l.data("icon"),r=l.data("key"),d=l.data("name");i.attr("data-font",s),i.attr("data-icon",o),i.attr("data-key",r),i.attr("data-name",d),a.val(s+":"+d),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),a=t.closest(".yith-plugin-fw-select-images__wrapper"),n=a.find(".yith-plugin-fw-select-images__item"),l=a.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed"),n.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document.body).trigger("wc-enhanced-select-init"),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var a=jQuery(".ui-sortable-handle"),n=0,l=new Array;for(n=0;n<a.length;n++)l[n]=e(a[n]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("checked")?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e.fn.saveToggleElement=function(t,i){var a=e(this),n="yith_plugin_fw_save_toggle_element",l=a.serializeToggleElement(),s=a.find(".yith-toggle_wrapper"),o=s.attr("id"),r=e.urlParam("tab");l.append("security",s.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),a.closest(".metaboxes-tab.yith-plugin-ui").length?(n="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+n+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+o+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+n+"&tab="+r+"&toggle_id="+o,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,a])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,a=e(t).find(":input").serializeArray();return e.each(a,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),a=t.find("span.title").data("title_format"),n=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==a)var s=a.match(l);if(void 0!==n)var o=n.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)))}),""!==a&&t.find("span.title").html(a),""!==n&&t.find(".subtitle").html(n),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),a=i.closest(".yith-toggle-row"),n=a.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;a.is(".yith-toggle-row-opened")?n.slideUp(400):n.slideDown(400),a.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),a=i.data("box_id"),n=i.data("closed_label"),l=i.data("opened_label"),s=i.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+s),""!==a&&(e("#"+a).html(template({index:"box_id"})).slideToggle(),""!==n&&(i.html()===n?i.html(l).removeClass("closed"):i.html(n).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),a=e(this).closest(".yith-toggle_wrapper").attr("id"),n=i.find(".spinner"),l=e(this).parents(".toggle-element"),s=i.find(":input"),o=l.find(".yith-toggle-row").length,r=e('<input type="hidden">');r.val(o),e(document).trigger("yith-toggle-change-counter",[r,i]),o=r.val();var d=wp.template("yith-toggle-element-item-"+a),c=e(d({index:o}));n.addClass("show"),e.each(s,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_val=e(i).val(),"radio"==e(i).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+o,e(i).is(":checked")&&e(c).find("#"+$field_id).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(c).find("#"+$field_id).html(e("#"+e(i).attr("id")).html()),e(c).find("#"+$field_id).val($field_val))}),e(c).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,c,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(c),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),a=e(this).closest(".yith-toggle-row"),n=a.find(".spinner");a.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,a,l]),"yes"===l.val()&&(n.addClass("show"),i.saveToggleElement(n))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).val(e(this).data("value")),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var t={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var i=t;e(document).on("click",i.selectors.units.single,i.unitChange),e(document).on("click",i.selectors.linked.button,i.linkedChange),e(document).on("change keyup",i.selectors.dimensions.number,i.numberChange)},unitChange:function(i){var a=e(this).closest(t.selectors.units.single),n=a.closest(t.selectors.units.wrapper),l=n.find(t.selectors.units.single),s=n.find(t.selectors.units.value).first(),o=a.data("value");l.removeClass(t.selectors.units.selectedClass),a.addClass(t.selectors.units.selectedClass),s.val(o)},linkedChange:function(){var i=e(this).closest(t.selectors.linked.button),a=i.closest(t.selectors.wrapper),n=i.find(t.selectors.linked.value);"yes"===n.val()?(a.removeClass(t.selectors.linked.wrapperActiveClass),n.val("no")):(a.addClass(t.selectors.linked.wrapperActiveClass),n.val("yes"),a.find(t.selectors.dimensions.number).first().trigger("change"))},numberChange:function(i){var a=e(this).closest(t.selectors.dimensions.number),n=a.closest(t.selectors.wrapper);n.hasClass(t.selectors.linked.wrapperActiveClass)&&n.find(t.selectors.dimensions.number).val(a.val())}};t.init()}(jQuery);
|
plugin-fw/assets/js/yith-gutenberg.js
CHANGED
@@ -1,211 +1,211 @@
|
|
1 |
-
(function ($) {
|
2 |
-
// Get registerBlockType() from wp.blocks in the global scope
|
3 |
-
var __ = wp.i18n.__,
|
4 |
-
el = wp.element.createElement,
|
5 |
-
Fragment = wp.element.Fragment,
|
6 |
-
PanelBody = wp.components.PanelBody,
|
7 |
-
registerBlockType = wp.blocks.registerBlockType,
|
8 |
-
RichText = wp.editor.RichText,
|
9 |
-
BlockControls = wp.editor.BlockControls,
|
10 |
-
InspectorControls = wp.editor.InspectorControls,
|
11 |
-
AlignmentToolbar = wp.editor.AlignmentToolbar,
|
12 |
-
Components = wp.components,
|
13 |
-
RawHTML = wp.element.RawHTML,
|
14 |
-
SelectControl = wp.components.SelectControl,
|
15 |
-
ToggleControl = wp.components.ToggleControl,
|
16 |
-
CheckboxControl = wp.components.CheckboxControl,
|
17 |
-
RangeControl = wp.components.RangeControl,
|
18 |
-
ColorPicker = wp.components.ColorPicker,
|
19 |
-
RadioControl = wp.components.RadioControl,
|
20 |
-
TextControl = wp.components.TextControl,
|
21 |
-
TextareaControl = wp.components.TextareaControl;
|
22 |
-
|
23 |
-
const yith_icon = el('svg', {width: 22, height: 22},
|
24 |
-
el('path', {d: "M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"})
|
25 |
-
);
|
26 |
-
|
27 |
-
function create_shortcode(sc_args, props, callback) {
|
28 |
-
var gt_block = '',
|
29 |
-
gutenberg_preview = '';
|
30 |
-
|
31 |
-
if (typeof props.callback != 'undefined' && typeof $[props.callback] == 'function') {
|
32 |
-
gt_block = $[props.callback](sc_args, props);
|
33 |
-
}
|
34 |
-
|
35 |
-
else {
|
36 |
-
var sc_name = props.shortcode_name,
|
37 |
-
sc = '[' + sc_name,
|
38 |
-
do_shortcode = null;
|
39 |
-
|
40 |
-
|
41 |
-
$.each(sc_args.attributes, function ($v, $k) {
|
42 |
-
if ($v != '
|
43 |
-
sc += ' ' + $v + '=';
|
44 |
-
var arg = props.attributes[$v],
|
45 |
-
remove_quotes = arg.remove_quotes;
|
46 |
-
|
47 |
-
if( remove_quotes == true ){
|
48 |
-
sc += $k;
|
49 |
-
}
|
50 |
-
|
51 |
-
else {
|
52 |
-
sc += '"' + $k + '"';
|
53 |
-
}
|
54 |
-
}
|
55 |
-
});
|
56 |
-
|
57 |
-
sc += ']';
|
58 |
-
|
59 |
-
var block_id = md5(sc);
|
60 |
-
|
61 |
-
gutenberg_preview = '<span class="yith_block_' + block_id + '">' + sc + '</span>';
|
62 |
-
|
63 |
-
if (callback == 'edit' && props.do_shortcode != false) {
|
64 |
-
do_shortcode = (function (block_id) {
|
65 |
-
var ajax_call_date = null;
|
66 |
-
$(document).trigger( 'yith_plugin_fw_gutenberg_before_do_shortcode', [sc, block_id] );
|
67 |
-
$.ajax({
|
68 |
-
async: true,
|
69 |
-
url: yith_gutenberg_ajax.ajaxurl,
|
70 |
-
method: 'post',
|
71 |
-
data: {action: 'yith_plugin_fw_gutenberg_do_shortcode', shortcode: sc},
|
72 |
-
success: function (data) {
|
73 |
-
ajax_call_date = data;
|
74 |
-
if (ajax_call_date != '') {
|
75 |
-
$('.yith_block_' + block_id).html(ajax_call_date);
|
76 |
-
$(document).trigger( 'yith_plugin_fw_gutenberg_success_do_shortcode', [sc, block_id, ajax_call_date] );
|
77 |
-
}
|
78 |
-
}
|
79 |
-
});
|
80 |
-
$(document).trigger( 'yith_plugin_fw_gutenberg_after_do_shortcode', [sc, block_id, ajax_call_date] );
|
81 |
-
return ajax_call_date;
|
82 |
-
})(block_id);
|
83 |
-
}
|
84 |
-
|
85 |
-
gt_block = el(RawHTML, null, gutenberg_preview);
|
86 |
-
}
|
87 |
-
|
88 |
-
return gt_block;
|
89 |
-
}
|
90 |
-
|
91 |
-
function onChangeEvent(new_value, attribute_name, args, block_type) {
|
92 |
-
var attributes = {};
|
93 |
-
|
94 |
-
if (block_type == 'colorpicker' || block_type == 'color') {
|
95 |
-
new_value = new_value.hex;
|
96 |
-
}
|
97 |
-
|
98 |
-
attributes[attribute_name] = new_value;
|
99 |
-
args.setAttributes(attributes);
|
100 |
-
return args;
|
101 |
-
}
|
102 |
-
|
103 |
-
$.each(yith_gutenberg, function ($block, $props) {
|
104 |
-
registerBlockType("yith/" + $block, {
|
105 |
-
title: $props.title,
|
106 |
-
description: $props.description,
|
107 |
-
category: $props.category,
|
108 |
-
attributes: $props.attributes,
|
109 |
-
icon: typeof $props.icon != 'undefined' ? $props.icon : yith_icon,
|
110 |
-
keywords: $props.keywords,
|
111 |
-
edit: function edit(args) {
|
112 |
-
var elements = new Array();
|
113 |
-
|
114 |
-
$.each($props.attributes, function ($attribute_name, $attribute_args) {
|
115 |
-
var ComponentControl = null,
|
116 |
-
block_type = $attribute_args.blocktype;
|
117 |
-
if (typeof block_type != 'undefined') {
|
118 |
-
switch (block_type) {
|
119 |
-
case 'select':
|
120 |
-
ComponentControl = SelectControl;
|
121 |
-
break;
|
122 |
-
|
123 |
-
case 'text':
|
124 |
-
ComponentControl = TextControl;
|
125 |
-
break;
|
126 |
-
|
127 |
-
case 'textarea':
|
128 |
-
ComponentControl = TextareaControl;
|
129 |
-
break;
|
130 |
-
|
131 |
-
case 'toggle':
|
132 |
-
ComponentControl = ToggleControl;
|
133 |
-
break;
|
134 |
-
|
135 |
-
case 'checkbox':
|
136 |
-
ComponentControl = CheckboxControl;
|
137 |
-
break;
|
138 |
-
|
139 |
-
case 'number':
|
140 |
-
case 'range':
|
141 |
-
ComponentControl = RangeControl;
|
142 |
-
break;
|
143 |
-
|
144 |
-
case 'color':
|
145 |
-
case 'colorpicker':
|
146 |
-
ComponentControl = ColorPicker;
|
147 |
-
break;
|
148 |
-
|
149 |
-
case 'radio':
|
150 |
-
ComponentControl = RadioControl;
|
151 |
-
break;
|
152 |
-
}
|
153 |
-
|
154 |
-
if (ComponentControl != null) {
|
155 |
-
var helpMessageChecked = helpMessageUncheked = '';
|
156 |
-
if (typeof $attribute_args.helps != 'undefined' && typeof $attribute_args.helps.checked != 'undefined' && typeof $attribute_args.helps.unchecked != 'undefined') {
|
157 |
-
helpMessageChecked = $attribute_args.helps.checked;
|
158 |
-
helpMessageUncheked = $attribute_args.helps.unchecked;
|
159 |
-
}
|
160 |
-
|
161 |
-
else if (typeof $attribute_args.help != 'undefined') {
|
162 |
-
helpMessageChecked = helpMessageUncheked = $attribute_args.help;
|
163 |
-
}
|
164 |
-
|
165 |
-
elements.push(
|
166 |
-
el(
|
167 |
-
ComponentControl,
|
168 |
-
{
|
169 |
-
value: args.attributes[$attribute_name],
|
170 |
-
options: $attribute_args.options,
|
171 |
-
label: $attribute_args.label,
|
172 |
-
checked: args.attributes[$attribute_name],
|
173 |
-
selected: args.attributes[$attribute_name],
|
174 |
-
help: args.attributes[$attribute_name] ? helpMessageChecked : helpMessageUncheked,
|
175 |
-
disableAlpha: $attribute_args.disableAlpha,
|
176 |
-
min: $attribute_args.min,
|
177 |
-
max: $attribute_args.max,
|
178 |
-
multiple: $attribute_args.multiple,
|
179 |
-
onChange: function (new_value, attribute_name = $attribute_name) {
|
180 |
-
args = onChangeEvent(new_value, attribute_name, args, block_type);
|
181 |
-
},
|
182 |
-
onChangeComplete: function (new_value, attribute_name = $attribute_name) {
|
183 |
-
args = onChangeEvent(new_value, attribute_name, args, block_type);
|
184 |
-
},
|
185 |
-
},
|
186 |
-
)
|
187 |
-
);
|
188 |
-
}
|
189 |
-
}
|
190 |
-
});
|
191 |
-
|
192 |
-
sc = create_shortcode(args, $props, 'edit');
|
193 |
-
|
194 |
-
return [
|
195 |
-
el(
|
196 |
-
Fragment,
|
197 |
-
null,
|
198 |
-
el(
|
199 |
-
InspectorControls,
|
200 |
-
null,
|
201 |
-
elements,
|
202 |
-
),
|
203 |
-
sc,
|
204 |
-
)];
|
205 |
-
},
|
206 |
-
save: function save(args) {
|
207 |
-
return create_shortcode(args, $props, 'save');
|
208 |
-
}
|
209 |
-
});
|
210 |
-
});
|
211 |
-
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
+
// Get registerBlockType() from wp.blocks in the global scope
|
3 |
+
var __ = wp.i18n.__,
|
4 |
+
el = wp.element.createElement,
|
5 |
+
Fragment = wp.element.Fragment,
|
6 |
+
PanelBody = wp.components.PanelBody,
|
7 |
+
registerBlockType = wp.blocks.registerBlockType,
|
8 |
+
RichText = wp.editor.RichText,
|
9 |
+
BlockControls = wp.editor.BlockControls,
|
10 |
+
InspectorControls = wp.editor.InspectorControls,
|
11 |
+
AlignmentToolbar = wp.editor.AlignmentToolbar,
|
12 |
+
Components = wp.components,
|
13 |
+
RawHTML = wp.element.RawHTML,
|
14 |
+
SelectControl = wp.components.SelectControl,
|
15 |
+
ToggleControl = wp.components.ToggleControl,
|
16 |
+
CheckboxControl = wp.components.CheckboxControl,
|
17 |
+
RangeControl = wp.components.RangeControl,
|
18 |
+
ColorPicker = wp.components.ColorPicker,
|
19 |
+
RadioControl = wp.components.RadioControl,
|
20 |
+
TextControl = wp.components.TextControl,
|
21 |
+
TextareaControl = wp.components.TextareaControl;
|
22 |
+
|
23 |
+
const yith_icon = el('svg', {width: 22, height: 22},
|
24 |
+
el('path', {d: "M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"})
|
25 |
+
);
|
26 |
+
|
27 |
+
function create_shortcode(sc_args, props, callback) {
|
28 |
+
var gt_block = '',
|
29 |
+
gutenberg_preview = '';
|
30 |
+
|
31 |
+
if (typeof props.callback != 'undefined' && typeof $[props.callback] == 'function') {
|
32 |
+
gt_block = $[props.callback](sc_args, props);
|
33 |
+
}
|
34 |
+
|
35 |
+
else {
|
36 |
+
var sc_name = props.shortcode_name,
|
37 |
+
sc = '[' + sc_name,
|
38 |
+
do_shortcode = null;
|
39 |
+
|
40 |
+
|
41 |
+
$.each(sc_args.attributes, function ($v, $k) {
|
42 |
+
if ( typeof props.attributes != 'undefined' && typeof props.attributes[$v] != 'undefined' ) {
|
43 |
+
sc += ' ' + $v + '=';
|
44 |
+
var arg = props.attributes[$v],
|
45 |
+
remove_quotes = arg.remove_quotes;
|
46 |
+
|
47 |
+
if( remove_quotes == true ){
|
48 |
+
sc += $k;
|
49 |
+
}
|
50 |
+
|
51 |
+
else {
|
52 |
+
sc += '"' + $k + '"';
|
53 |
+
}
|
54 |
+
}
|
55 |
+
});
|
56 |
+
|
57 |
+
sc += ']';
|
58 |
+
|
59 |
+
var block_id = md5(sc);
|
60 |
+
|
61 |
+
gutenberg_preview = '<span class="yith_block_' + block_id + '">' + sc + '</span>';
|
62 |
+
|
63 |
+
if (callback == 'edit' && props.do_shortcode != false) {
|
64 |
+
do_shortcode = (function (block_id) {
|
65 |
+
var ajax_call_date = null;
|
66 |
+
$(document).trigger( 'yith_plugin_fw_gutenberg_before_do_shortcode', [sc, block_id] );
|
67 |
+
$.ajax({
|
68 |
+
async: true,
|
69 |
+
url: yith_gutenberg_ajax.ajaxurl,
|
70 |
+
method: 'post',
|
71 |
+
data: {action: 'yith_plugin_fw_gutenberg_do_shortcode', shortcode: sc},
|
72 |
+
success: function (data) {
|
73 |
+
ajax_call_date = data;
|
74 |
+
if (ajax_call_date != '') {
|
75 |
+
$('.yith_block_' + block_id).html(ajax_call_date);
|
76 |
+
$(document).trigger( 'yith_plugin_fw_gutenberg_success_do_shortcode', [sc, block_id, ajax_call_date] );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
});
|
80 |
+
$(document).trigger( 'yith_plugin_fw_gutenberg_after_do_shortcode', [sc, block_id, ajax_call_date] );
|
81 |
+
return ajax_call_date;
|
82 |
+
})(block_id);
|
83 |
+
}
|
84 |
+
|
85 |
+
gt_block = el(RawHTML, null, gutenberg_preview);
|
86 |
+
}
|
87 |
+
|
88 |
+
return gt_block;
|
89 |
+
}
|
90 |
+
|
91 |
+
function onChangeEvent(new_value, attribute_name, args, block_type) {
|
92 |
+
var attributes = {};
|
93 |
+
|
94 |
+
if (block_type == 'colorpicker' || block_type == 'color') {
|
95 |
+
new_value = new_value.hex;
|
96 |
+
}
|
97 |
+
|
98 |
+
attributes[attribute_name] = new_value;
|
99 |
+
args.setAttributes(attributes);
|
100 |
+
return args;
|
101 |
+
}
|
102 |
+
|
103 |
+
$.each(yith_gutenberg, function ($block, $props) {
|
104 |
+
registerBlockType("yith/" + $block, {
|
105 |
+
title: $props.title,
|
106 |
+
description: $props.description,
|
107 |
+
category: $props.category,
|
108 |
+
attributes: $props.attributes,
|
109 |
+
icon: typeof $props.icon != 'undefined' ? $props.icon : yith_icon,
|
110 |
+
keywords: $props.keywords,
|
111 |
+
edit: function edit(args) {
|
112 |
+
var elements = new Array();
|
113 |
+
|
114 |
+
$.each($props.attributes, function ($attribute_name, $attribute_args) {
|
115 |
+
var ComponentControl = null,
|
116 |
+
block_type = $attribute_args.blocktype;
|
117 |
+
if (typeof block_type != 'undefined') {
|
118 |
+
switch (block_type) {
|
119 |
+
case 'select':
|
120 |
+
ComponentControl = SelectControl;
|
121 |
+
break;
|
122 |
+
|
123 |
+
case 'text':
|
124 |
+
ComponentControl = TextControl;
|
125 |
+
break;
|
126 |
+
|
127 |
+
case 'textarea':
|
128 |
+
ComponentControl = TextareaControl;
|
129 |
+
break;
|
130 |
+
|
131 |
+
case 'toggle':
|
132 |
+
ComponentControl = ToggleControl;
|
133 |
+
break;
|
134 |
+
|
135 |
+
case 'checkbox':
|
136 |
+
ComponentControl = CheckboxControl;
|
137 |
+
break;
|
138 |
+
|
139 |
+
case 'number':
|
140 |
+
case 'range':
|
141 |
+
ComponentControl = RangeControl;
|
142 |
+
break;
|
143 |
+
|
144 |
+
case 'color':
|
145 |
+
case 'colorpicker':
|
146 |
+
ComponentControl = ColorPicker;
|
147 |
+
break;
|
148 |
+
|
149 |
+
case 'radio':
|
150 |
+
ComponentControl = RadioControl;
|
151 |
+
break;
|
152 |
+
}
|
153 |
+
|
154 |
+
if (ComponentControl != null) {
|
155 |
+
var helpMessageChecked = helpMessageUncheked = '';
|
156 |
+
if (typeof $attribute_args.helps != 'undefined' && typeof $attribute_args.helps.checked != 'undefined' && typeof $attribute_args.helps.unchecked != 'undefined') {
|
157 |
+
helpMessageChecked = $attribute_args.helps.checked;
|
158 |
+
helpMessageUncheked = $attribute_args.helps.unchecked;
|
159 |
+
}
|
160 |
+
|
161 |
+
else if (typeof $attribute_args.help != 'undefined') {
|
162 |
+
helpMessageChecked = helpMessageUncheked = $attribute_args.help;
|
163 |
+
}
|
164 |
+
|
165 |
+
elements.push(
|
166 |
+
el(
|
167 |
+
ComponentControl,
|
168 |
+
{
|
169 |
+
value: args.attributes[$attribute_name],
|
170 |
+
options: $attribute_args.options,
|
171 |
+
label: $attribute_args.label,
|
172 |
+
checked: args.attributes[$attribute_name],
|
173 |
+
selected: args.attributes[$attribute_name],
|
174 |
+
help: args.attributes[$attribute_name] ? helpMessageChecked : helpMessageUncheked,
|
175 |
+
disableAlpha: $attribute_args.disableAlpha,
|
176 |
+
min: $attribute_args.min,
|
177 |
+
max: $attribute_args.max,
|
178 |
+
multiple: $attribute_args.multiple,
|
179 |
+
onChange: function (new_value, attribute_name = $attribute_name) {
|
180 |
+
args = onChangeEvent(new_value, attribute_name, args, block_type);
|
181 |
+
},
|
182 |
+
onChangeComplete: function (new_value, attribute_name = $attribute_name) {
|
183 |
+
args = onChangeEvent(new_value, attribute_name, args, block_type);
|
184 |
+
},
|
185 |
+
},
|
186 |
+
)
|
187 |
+
);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
});
|
191 |
+
|
192 |
+
sc = create_shortcode(args, $props, 'edit');
|
193 |
+
|
194 |
+
return [
|
195 |
+
el(
|
196 |
+
Fragment,
|
197 |
+
null,
|
198 |
+
el(
|
199 |
+
InspectorControls,
|
200 |
+
null,
|
201 |
+
elements,
|
202 |
+
),
|
203 |
+
sc,
|
204 |
+
)];
|
205 |
+
},
|
206 |
+
save: function save(args) {
|
207 |
+
return create_shortcode(args, $props, 'save');
|
208 |
+
}
|
209 |
+
});
|
210 |
+
});
|
211 |
+
})(jQuery);
|
plugin-fw/assets/js/yith-gutenberg.min.js
CHANGED
@@ -1 +1,6 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(h){function q(g,b,e){var f="";f="";if("undefined"!=typeof b.callback&&"function"==typeof h[b.callback])f=h[b.callback](g,b);else{var c="["+b.shortcode_name;h.each(g.attributes,function(a,d){"undefined"!=typeof b.attributes&&"undefined"!=typeof b.attributes[a]&&(c+=" "+a+"=",c=1==b.attributes[a].remove_quotes?c+d:c+('"'+d+'"'))});c+="]";g=md5(c);f='<span class="yith_block_'+g+'">'+c+"</span>";"edit"==e&&0!=b.do_shortcode&&function(a){var d=null;h(document).trigger("yith_plugin_fw_gutenberg_before_do_shortcode",
|
2 |
+
[c,a]);h.ajax({async:!0,url:yith_gutenberg_ajax.ajaxurl,method:"post",data:{action:"yith_plugin_fw_gutenberg_do_shortcode",shortcode:c},success:function(l){d=l;""!=d&&(h(".yith_block_"+a).html(d),h(document).trigger("yith_plugin_fw_gutenberg_success_do_shortcode",[c,a,d]))}});h(document).trigger("yith_plugin_fw_gutenberg_after_do_shortcode",[c,a,d]);return d}(g);f=m(t,null,f)}return f}function r(g,b,e,f){var c={};if("colorpicker"==f||"color"==f)g=g.hex;c[b]=g;e.setAttributes(c);return e}var m=wp.element.createElement,
|
3 |
+
u=wp.element.Fragment,v=wp.blocks.registerBlockType,w=wp.editor.InspectorControls,t=wp.element.RawHTML,x=wp.components.SelectControl,y=wp.components.ToggleControl,z=wp.components.CheckboxControl,A=wp.components.RangeControl,B=wp.components.ColorPicker,C=wp.components.RadioControl,D=wp.components.TextControl,E=wp.components.TextareaControl,F=m("svg",{width:22,height:22},m("path",{d:"M 18.24 7.628 C 17.291 8.284 16.076 8.971 14.587 9.688 C 15.344 7.186 15.765 4.851 15.849 2.684 C 15.912 0.939 15.133 0.045 13.514 0.003 C 11.558 -0.06 10.275 1.033 9.665 3.284 C 10.007 3.137 10.359 3.063 10.723 3.063 C 11.021 3.063 11.267 3.184 11.459 3.426 C 11.651 3.668 11.736 3.947 11.715 4.262 C 11.695 5.082 11.276 5.961 10.46 6.896 C 9.644 7.833 8.918 8.3 8.282 8.3 C 7.837 8.3 7.625 7.922 7.646 7.165 C 7.667 6.765 7.804 5.955 8.056 4.735 C 8.287 3.579 8.403 2.801 8.403 2.401 C 8.403 1.707 8.224 1.144 7.867 0.713 C 7.509 0.282 6.994 0.098 6.321 0.161 C 5.858 0.203 5.175 0.624 4.27 1.422 C 3.596 2.035 2.923 2.644 2.25 3.254 L 2.976 4.106 C 3.564 3.664 3.922 3.443 4.048 3.443 C 4.448 3.443 4.637 3.717 4.617 4.263 C 4.617 4.306 4.427 4.968 4.049 6.251 C 3.671 7.534 3.471 8.491 3.449 9.122 C 3.407 9.985 3.565 10.647 3.924 11.109 C 4.367 11.677 5.106 11.919 6.142 11.835 C 7.366 11.751 8.591 11.298 9.816 10.479 C 10.323 10.142 10.808 9.753 11.273 9.311 C 11.105 10.153 10.905 10.868 10.673 11.457 C 8.402 12.487 6.762 13.37 5.752 14.107 C 4.321 15.137 3.554 16.241 3.449 17.419 C 3.259 19.459 4.29 20.479 6.541 20.479 C 8.055 20.479 9.517 19.554 10.926 17.703 C 12.125 16.126 13.166 14.022 14.049 11.394 C 15.578 10.635 16.87 9.892 17.928 9.164 C 17.894 9.409 18.319 7.308 18.24 7.628 Z M 7.393 16.095 C 7.056 16.095 6.898 15.947 6.919 15.653 C 6.961 15.106 7.908 14.38 9.759 13.476 C 8.791 15.221 8.002 16.095 7.393 16.095 Z"}));
|
4 |
+
h.each(yith_gutenberg,function(g,b){v("yith/"+g,{title:b.title,description:b.description,category:b.category,attributes:b.attributes,icon:"undefined"!=typeof b.icon?b.icon:F,keywords:b.keywords,edit:function(e){var f=[];h.each(b.attributes,function(c,a){var d=null,l=a.blocktype;if("undefined"!=typeof l){switch(l){case "select":d=x;break;case "text":d=D;break;case "textarea":d=E;break;case "toggle":d=y;break;case "checkbox":d=z;break;case "number":case "range":d=A;break;case "color":case "colorpicker":d=
|
5 |
+
B;break;case "radio":d=C}if(null!=d){var n=helpMessageUncheked="";"undefined"!=typeof a.helps&&"undefined"!=typeof a.helps.checked&&"undefined"!=typeof a.helps.unchecked?(n=a.helps.checked,helpMessageUncheked=a.helps.unchecked):"undefined"!=typeof a.help&&(n=helpMessageUncheked=a.help);f.push(m(d,{value:e.attributes[c],options:a.options,label:a.label,checked:e.attributes[c],selected:e.attributes[c],help:e.attributes[c]?n:helpMessageUncheked,disableAlpha:a.disableAlpha,min:a.min,max:a.max,multiple:a.multiple,
|
6 |
+
onChange:function(p,k){k=void 0===k?c:k;e=r(p,k,e,l)},onChangeComplete:function(p,k){k=void 0===k?c:k;e=r(p,k,e,l)}}))}}});sc=q(e,b,"edit");return[m(u,null,m(w,null,f),sc)]},save:function(e){return q(e,b,"save")}})})})(jQuery);
|
plugin-fw/bin/clean-language-files.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* jshint ignore: start */
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
const fs = require( 'fs' );
|
10 |
+
const glob = require( 'glob' );
|
11 |
+
const chalk = require( 'chalk' );
|
12 |
+
|
13 |
+
const DELETED = chalk.reset.inverse.bold.green( ' DELETED ' );
|
14 |
+
const ERROR = chalk.reset.inverse.bold.red( ' ERROR ' );
|
15 |
+
|
16 |
+
console.log( chalk.green( '\nCleaning language files...' ) );
|
17 |
+
glob( "languages/*.po~", function ( er, files ) {
|
18 |
+
|
19 |
+
if ( files.length ) {
|
20 |
+
console.log( `Processing ${files.length} files:` );
|
21 |
+
|
22 |
+
files.forEach( ( file ) => {
|
23 |
+
fs.unlink( file, ( err ) => {
|
24 |
+
if ( err ) {
|
25 |
+
console.log( chalk.bold( ` - ${file} ` ) + ERROR );
|
26 |
+
console.error( err );
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
console.log( chalk.bold( ` - ${file} ` ) + DELETED );
|
30 |
+
} );
|
31 |
+
} );
|
32 |
+
} else {
|
33 |
+
console.log( `No file to clean.\n` );
|
34 |
+
}
|
35 |
+
|
36 |
+
} );
|
plugin-fw/bin/download-translations-config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"projectPath": "https://translate.yithemes.com/gp/projects/yith-framework/",
|
3 |
+
"textDomain": "yith-plugin-fw",
|
4 |
+
"destFolder": "languages/",
|
5 |
+
"languages": [
|
6 |
+
{
|
7 |
+
"id": "es",
|
8 |
+
"name": "Spanish",
|
9 |
+
"slug": "es_ES"
|
10 |
+
},
|
11 |
+
{
|
12 |
+
"id": "it",
|
13 |
+
"name": "Italian",
|
14 |
+
"slug": "it_IT"
|
15 |
+
},
|
16 |
+
{
|
17 |
+
"id": "nl",
|
18 |
+
"name": "Dutch",
|
19 |
+
"slug": "nl_NL"
|
20 |
+
},
|
21 |
+
{
|
22 |
+
"id": "el",
|
23 |
+
"name": "Greek",
|
24 |
+
"slug": "el"
|
25 |
+
}
|
26 |
+
]
|
27 |
+
}
|
plugin-fw/bin/download-translations.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* jshint ignore: start */
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This script download translations from https://translate.yithemes.com/
|
5 |
+
*
|
6 |
+
* @version 1.1.0
|
7 |
+
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
8 |
+
*/
|
9 |
+
|
10 |
+
const fs = require( 'fs' );
|
11 |
+
const path = require( 'path' );
|
12 |
+
const axios = require( 'axios' );
|
13 |
+
const chalk = require( 'chalk' );
|
14 |
+
const options = require( './download-translations-config' );
|
15 |
+
|
16 |
+
const SPACE = '\t';
|
17 |
+
const DONE = chalk.reset.inverse.bold.green( ' DONE ' );
|
18 |
+
const ERROR = chalk.reset.inverse.bold.red( ' ERROR ' );
|
19 |
+
|
20 |
+
async function download( url, dest ) {
|
21 |
+
const destPath = path.resolve( dest );
|
22 |
+
const writer = fs.createWriteStream( destPath );
|
23 |
+
|
24 |
+
const response = await axios( {
|
25 |
+
url,
|
26 |
+
method : 'GET',
|
27 |
+
responseType: 'stream'
|
28 |
+
} );
|
29 |
+
|
30 |
+
response.data.pipe( writer );
|
31 |
+
|
32 |
+
return new Promise( ( resolve, reject ) => {
|
33 |
+
writer.on( 'finish', resolve );
|
34 |
+
writer.on( 'error', reject );
|
35 |
+
} )
|
36 |
+
}
|
37 |
+
|
38 |
+
const downloadLanguage = function ( language ) {
|
39 |
+
const languageName = language.name || language.id;
|
40 |
+
const source = options.projectPath + language.id + "/default/export-translations/";
|
41 |
+
const fileName = options.textDomain + '-' + language.slug + '.po';
|
42 |
+
const dest = options.destFolder + fileName;
|
43 |
+
const message = ' - ' + chalk.bold( languageName ) + SPACE;
|
44 |
+
|
45 |
+
download( source, dest ).then( () => {
|
46 |
+
console.log( message + DONE );
|
47 |
+
} ).catch( ( err ) => {
|
48 |
+
console.log( message + ERROR );
|
49 |
+
throw err;
|
50 |
+
} );
|
51 |
+
};
|
52 |
+
|
53 |
+
console.log( chalk.green( '\nDownloading Transations from translate.yithemes.com...' ) );
|
54 |
+
|
55 |
+
options.languages.forEach( ( language ) => {
|
56 |
+
downloadLanguage( language );
|
57 |
+
} );
|
plugin-fw/init.php
CHANGED
@@ -1,7 +1,7 @@
|
|
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/
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
+
* Version: 3.4.31
|
5 |
* Author: YITH
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
plugin-fw/lib/yit-plugin-panel.php
CHANGED
@@ -67,6 +67,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
67 |
* Constructor
|
68 |
*
|
69 |
* @param array $args
|
|
|
70 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
71 |
* @since 1.0
|
72 |
*/
|
@@ -84,8 +85,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
84 |
);
|
85 |
|
86 |
$args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
|
87 |
-
if ( isset( $args['parent_page'] ) && 'yit_plugin_panel' === $args['parent_page'] )
|
88 |
$args['parent_page'] = 'yith_plugin_panel';
|
|
|
89 |
|
90 |
$this->settings = $args;
|
91 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
@@ -113,10 +115,10 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
113 |
|
114 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
|
121 |
/**
|
122 |
* Is this a custom post type page?
|
@@ -130,7 +132,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
130 |
$excluded_post_types = array( 'product', 'page', 'post' );
|
131 |
|
132 |
return in_array( $pagenow, array( 'post.php', 'post-new.php', 'edit.php' ), true ) &&
|
133 |
-
|
134 |
}
|
135 |
|
136 |
/**
|
@@ -145,7 +147,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
145 |
$excluded_taxonomies = array( 'category', 'post_tag', 'product_cat', 'product_tag' );
|
146 |
|
147 |
return in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) &&
|
148 |
-
|
149 |
}
|
150 |
|
151 |
/**
|
@@ -168,6 +170,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
168 |
$tabs = $this->get_taxonomy_tabs( $taxonomy );
|
169 |
}
|
170 |
|
|
|
|
|
171 |
if ( $tabs ) {
|
172 |
// tabs_in_edit
|
173 |
$current_tab_args = array(
|
@@ -176,14 +180,18 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
176 |
'current_sub_tab' => isset( $tabs['sub_tab'] ) ? $tabs['sub_tab'] : '',
|
177 |
);
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
182 |
|
183 |
if ( ! self::$_panel_tabs_in_wp_pages ) {
|
184 |
self::$_panel_tabs_in_wp_pages = $current_tab_args;
|
185 |
-
|
186 |
-
|
|
|
|
|
187 |
add_filter( 'parent_file', array( $this, 'set_parent_file_to_handle_menu_for_wp_pages' ) );
|
188 |
add_filter( 'submenu_file', array( $this, 'set_submenu_file_to_handle_menu_for_wp_pages' ), 10, 2 );
|
189 |
}
|
@@ -250,14 +258,16 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
250 |
* Add yith-plugin-fw-panel in body classes in Panel pages
|
251 |
*
|
252 |
* @param $admin_body_classes
|
|
|
253 |
* @return string
|
254 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
255 |
* @since 3.0.0
|
256 |
*/
|
257 |
public static function add_body_class( $admin_body_classes ) {
|
258 |
global $pagenow;
|
259 |
-
if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) )
|
260 |
$admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
|
|
|
261 |
|
262 |
return $admin_body_classes;
|
263 |
}
|
@@ -355,6 +365,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
355 |
* a callback function called by Register Settings function
|
356 |
*
|
357 |
* @param $input
|
|
|
358 |
* @return array validate input fields
|
359 |
* @since 1.0
|
360 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -463,6 +474,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
463 |
* Print the tabs navigation
|
464 |
*
|
465 |
* @param array $args
|
|
|
466 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
467 |
* @since 3.4.0
|
468 |
*/
|
@@ -524,6 +536,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
524 |
* @param string $tab
|
525 |
* @param string $sub_tab
|
526 |
* @param string $parent_page
|
|
|
527 |
* @return string
|
528 |
*/
|
529 |
public function get_nav_url( $page, $tab, $sub_tab = '', $parent_page = '' ) {
|
@@ -548,6 +561,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
548 |
* Print the Sub-tabs navigation if the current tab has sub-tabs
|
549 |
*
|
550 |
* @param array $args
|
|
|
551 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
552 |
* @since 3.4.0
|
553 |
*/
|
@@ -597,6 +611,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
597 |
|
598 |
if ( $custom_tab_action ) {
|
599 |
$this->print_custom_tab( $custom_tab_action );
|
|
|
600 |
return;
|
601 |
}
|
602 |
|
@@ -612,17 +627,17 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
612 |
<p> </p>
|
613 |
<?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
|
614 |
<input type="hidden" name="<?php echo $this->get_name_field( 'option_key' ) ?>"
|
615 |
-
|
616 |
<input type="submit" class="button-primary"
|
617 |
-
|
618 |
-
|
619 |
</form>
|
620 |
<form method="post">
|
621 |
<?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
|
622 |
<input type="hidden" name="yit-action" value="reset"/>
|
623 |
<input type="submit" name="yit-reset" class="button-secondary"
|
624 |
-
|
625 |
-
|
626 |
</form>
|
627 |
<p> </p>
|
628 |
<?php endif ?>
|
@@ -637,6 +652,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
637 |
*
|
638 |
* @param array $options
|
639 |
* @param string $option_key
|
|
|
640 |
* @return bool
|
641 |
*/
|
642 |
public function is_custom_tab( $options, $option_key ) {
|
@@ -655,6 +671,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
655 |
$first = ! ! $tab_options && is_array( $tab_options ) ? current( $tab_options ) : array();
|
656 |
$type = isset( $first['type'] ) ? $first['type'] : 'options';
|
657 |
$special_types = array( 'post_type', 'taxonomy', 'custom_tab', 'multi_tab' );
|
|
|
658 |
return in_array( $type, $special_types ) ? $type : 'options';
|
659 |
}
|
660 |
|
@@ -675,6 +692,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
675 |
* Fire the action to print the custom tab
|
676 |
*
|
677 |
* @param string $action Action to fire
|
|
|
678 |
* @return void
|
679 |
* @since 1.0
|
680 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
@@ -730,11 +748,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
730 |
foreach ( $this->settings['admin-tabs'] as $item => $title ) {
|
731 |
|
732 |
$wp_admin_bar->add_menu( array(
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
}
|
739 |
}
|
740 |
}
|
@@ -848,6 +866,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
848 |
* @param $message
|
849 |
* @param string $type can be 'error' or 'updated'
|
850 |
* @param bool $echo
|
|
|
851 |
* @return string
|
852 |
* @since 1.0
|
853 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -876,7 +895,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
876 |
|
877 |
$tabs = array();
|
878 |
|
879 |
-
foreach ( ( array )glob( $option_files_path . '*.php' ) as $filename ) {
|
880 |
preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
|
881 |
|
882 |
if ( ! isset( $filename_parts[1] ) ) {
|
@@ -915,6 +934,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
915 |
* Return the sub-tabs array of a specific tab
|
916 |
*
|
917 |
* @param array|bool $_tab the tab; if not set it'll be the current tab
|
|
|
918 |
* @since 3.4.0
|
919 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
920 |
* @return array sub-tabs array
|
@@ -937,6 +957,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
937 |
if ( $_first && is_array( $_first ) && isset( $_first['type'] ) && 'multi_tab' === $_first['type'] && ! empty( $_first['sub-tabs'] ) ) {
|
938 |
return $_first['sub-tabs'];
|
939 |
}
|
|
|
940 |
return array();
|
941 |
}
|
942 |
|
@@ -1005,6 +1026,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1005 |
}
|
1006 |
}
|
1007 |
}
|
|
|
1008 |
return '';
|
1009 |
}
|
1010 |
|
@@ -1013,6 +1035,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1013 |
* return the title of section
|
1014 |
*
|
1015 |
* @param $section
|
|
|
1016 |
* @return string
|
1017 |
* @since 1.0
|
1018 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -1026,6 +1049,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1026 |
return $option['name'];
|
1027 |
}
|
1028 |
}
|
|
|
1029 |
return '';
|
1030 |
}
|
1031 |
|
@@ -1034,6 +1058,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1034 |
* return the description of section if is set
|
1035 |
*
|
1036 |
* @param $section
|
|
|
1037 |
* @return string
|
1038 |
* @since 1.0
|
1039 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -1047,6 +1072,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1047 |
return '<p>' . $option['desc'] . '</p>';
|
1048 |
}
|
1049 |
}
|
|
|
1050 |
return '';
|
1051 |
}
|
1052 |
|
@@ -1082,6 +1108,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1082 |
* return a string with the name of the input field
|
1083 |
*
|
1084 |
* @param string $name
|
|
|
1085 |
* @return string
|
1086 |
* @since 1.0
|
1087 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -1095,6 +1122,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1095 |
* return a string with the id of the input field
|
1096 |
*
|
1097 |
* @param string $id
|
|
|
1098 |
* @return string
|
1099 |
* @since 1.0
|
1100 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -1110,6 +1138,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1110 |
* return a text area
|
1111 |
*
|
1112 |
* @param array $param
|
|
|
1113 |
* @return void
|
1114 |
* @since 1.0
|
1115 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
@@ -1132,11 +1161,13 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1132 |
$std = isset( $option['std'] ) ? $option['std'] : '';
|
1133 |
$db_value = ( isset( $db_options[ $option['id'] ] ) ) ? $db_options[ $option['id'] ] : $std;
|
1134 |
|
1135 |
-
if ( isset( $option['deps'] ) )
|
1136 |
$deps = $option['deps'];
|
|
|
1137 |
|
1138 |
-
if ( 'on-off' === $option['type'] )
|
1139 |
$option['type'] = 'onoff';
|
|
|
1140 |
|
1141 |
if ( $field_template_path = yith_plugin_fw_get_field_template_path( $option ) ) {
|
1142 |
$field_container_path = apply_filters( 'yith_plugin_fw_panel_field_container_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/panel-field-container.php', $option );
|
@@ -1169,6 +1200,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1169 |
* Show a box panel with specific content in two columns as a new woocommerce type
|
1170 |
*
|
1171 |
* @param array $args
|
|
|
1172 |
* @return void
|
1173 |
* @since 1.0
|
1174 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.com>
|
@@ -1184,6 +1216,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1184 |
* Show a box panel with specific content in two columns as a new woocommerce type
|
1185 |
*
|
1186 |
* @param array $args
|
|
|
1187 |
* @return void
|
1188 |
* @deprecated 3.0.12 Do nothing! Method left to prevent Fatal Error if called directly
|
1189 |
*/
|
@@ -1278,11 +1311,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1278 |
</div>
|
1279 |
<div class="yith-plugin-fw-rate">
|
1280 |
<?php printf( '<strong>%s</strong> %s <a href="%s" target="_blank"><u>%s</u> <span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a> %s',
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
</div>
|
1287 |
<?php else: ?>
|
1288 |
<h1 class="notice-container"></h1>
|
@@ -1368,72 +1401,73 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
1368 |
public function maybe_redirect_to_proper_wp_page() {
|
1369 |
global $pagenow;
|
1370 |
if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && $this->settings['page'] === $_GET['page'] &&
|
1371 |
-
|
1372 |
$url = $this->get_nav_url( $this->settings['page'], $this->get_current_tab(), $this->get_current_sub_tab() );
|
1373 |
if ( strpos( $url, 'edit.php' ) !== false || strpos( $url, 'edit-tags.php' ) !== false ) {
|
1374 |
wp_safe_redirect( add_query_arg( array( 'yith-plugin-fw-panel-skip-redirect' => 1 ), $url ) );
|
1375 |
exit;
|
1376 |
}
|
1377 |
}
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
|
|
1439 |
}
|
67 |
* Constructor
|
68 |
*
|
69 |
* @param array $args
|
70 |
+
*
|
71 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
72 |
* @since 1.0
|
73 |
*/
|
85 |
);
|
86 |
|
87 |
$args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
|
88 |
+
if ( isset( $args['parent_page'] ) && 'yit_plugin_panel' === $args['parent_page'] ) {
|
89 |
$args['parent_page'] = 'yith_plugin_panel';
|
90 |
+
}
|
91 |
|
92 |
$this->settings = $args;
|
93 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
115 |
|
116 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
117 |
|
118 |
+
//yith-plugin-ui
|
119 |
+
add_action( 'yith_plugin_fw_before_yith_panel', array( $this, 'add_plugin_banner' ), 10, 1 );
|
120 |
+
add_action( 'wp_ajax_yith_plugin_fw_save_toggle_element', array( $this, 'save_toggle_element_options' ) );
|
121 |
+
}
|
122 |
|
123 |
/**
|
124 |
* Is this a custom post type page?
|
132 |
$excluded_post_types = array( 'product', 'page', 'post' );
|
133 |
|
134 |
return in_array( $pagenow, array( 'post.php', 'post-new.php', 'edit.php' ), true ) &&
|
135 |
+
! in_array( $post_type, $excluded_post_types, true );
|
136 |
}
|
137 |
|
138 |
/**
|
147 |
$excluded_taxonomies = array( 'category', 'post_tag', 'product_cat', 'product_tag' );
|
148 |
|
149 |
return in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) &&
|
150 |
+
! in_array( $taxonomy, $excluded_taxonomies, true );
|
151 |
}
|
152 |
|
153 |
/**
|
170 |
$tabs = $this->get_taxonomy_tabs( $taxonomy );
|
171 |
}
|
172 |
|
173 |
+
$is_block_editor = function_exists( 'get_current_screen' ) && get_current_screen() && get_current_screen()->is_block_editor();
|
174 |
+
|
175 |
if ( $tabs ) {
|
176 |
// tabs_in_edit
|
177 |
$current_tab_args = array(
|
180 |
'current_sub_tab' => isset( $tabs['sub_tab'] ) ? $tabs['sub_tab'] : '',
|
181 |
);
|
182 |
|
183 |
+
if ( ! $is_block_editor ) {
|
184 |
+
wp_enqueue_style( 'yit-plugin-style' );
|
185 |
+
wp_enqueue_style( 'yith-plugin-fw-fields' );
|
186 |
+
wp_enqueue_script( 'yith-plugin-fw-wp-pages' );
|
187 |
+
}
|
188 |
|
189 |
if ( ! self::$_panel_tabs_in_wp_pages ) {
|
190 |
self::$_panel_tabs_in_wp_pages = $current_tab_args;
|
191 |
+
if ( ! $is_block_editor ) {
|
192 |
+
add_action( 'all_admin_notices', array( $this, 'print_panel_tabs_in_wp_pages' ) );
|
193 |
+
add_action( 'admin_footer', array( $this, 'print_panel_tabs_in_wp_pages_end' ) );
|
194 |
+
}
|
195 |
add_filter( 'parent_file', array( $this, 'set_parent_file_to_handle_menu_for_wp_pages' ) );
|
196 |
add_filter( 'submenu_file', array( $this, 'set_submenu_file_to_handle_menu_for_wp_pages' ), 10, 2 );
|
197 |
}
|
258 |
* Add yith-plugin-fw-panel in body classes in Panel pages
|
259 |
*
|
260 |
* @param $admin_body_classes
|
261 |
+
*
|
262 |
* @return string
|
263 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
264 |
* @since 3.0.0
|
265 |
*/
|
266 |
public static function add_body_class( $admin_body_classes ) {
|
267 |
global $pagenow;
|
268 |
+
if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) ) {
|
269 |
$admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
|
270 |
+
}
|
271 |
|
272 |
return $admin_body_classes;
|
273 |
}
|
365 |
* a callback function called by Register Settings function
|
366 |
*
|
367 |
* @param $input
|
368 |
+
*
|
369 |
* @return array validate input fields
|
370 |
* @since 1.0
|
371 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
474 |
* Print the tabs navigation
|
475 |
*
|
476 |
* @param array $args
|
477 |
+
*
|
478 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
479 |
* @since 3.4.0
|
480 |
*/
|
536 |
* @param string $tab
|
537 |
* @param string $sub_tab
|
538 |
* @param string $parent_page
|
539 |
+
*
|
540 |
* @return string
|
541 |
*/
|
542 |
public function get_nav_url( $page, $tab, $sub_tab = '', $parent_page = '' ) {
|
561 |
* Print the Sub-tabs navigation if the current tab has sub-tabs
|
562 |
*
|
563 |
* @param array $args
|
564 |
+
*
|
565 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
566 |
* @since 3.4.0
|
567 |
*/
|
611 |
|
612 |
if ( $custom_tab_action ) {
|
613 |
$this->print_custom_tab( $custom_tab_action );
|
614 |
+
|
615 |
return;
|
616 |
}
|
617 |
|
627 |
<p> </p>
|
628 |
<?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
|
629 |
<input type="hidden" name="<?php echo $this->get_name_field( 'option_key' ) ?>"
|
630 |
+
value="<?php echo esc_attr( $option_key ) ?>"/>
|
631 |
<input type="submit" class="button-primary"
|
632 |
+
value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>"
|
633 |
+
style="float:left;margin-right:10px;"/>
|
634 |
</form>
|
635 |
<form method="post">
|
636 |
<?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
|
637 |
<input type="hidden" name="yit-action" value="reset"/>
|
638 |
<input type="submit" name="yit-reset" class="button-secondary"
|
639 |
+
value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>"
|
640 |
+
onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');"/>
|
641 |
</form>
|
642 |
<p> </p>
|
643 |
<?php endif ?>
|
652 |
*
|
653 |
* @param array $options
|
654 |
* @param string $option_key
|
655 |
+
*
|
656 |
* @return bool
|
657 |
*/
|
658 |
public function is_custom_tab( $options, $option_key ) {
|
671 |
$first = ! ! $tab_options && is_array( $tab_options ) ? current( $tab_options ) : array();
|
672 |
$type = isset( $first['type'] ) ? $first['type'] : 'options';
|
673 |
$special_types = array( 'post_type', 'taxonomy', 'custom_tab', 'multi_tab' );
|
674 |
+
|
675 |
return in_array( $type, $special_types ) ? $type : 'options';
|
676 |
}
|
677 |
|
692 |
* Fire the action to print the custom tab
|
693 |
*
|
694 |
* @param string $action Action to fire
|
695 |
+
*
|
696 |
* @return void
|
697 |
* @since 1.0
|
698 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
748 |
foreach ( $this->settings['admin-tabs'] as $item => $title ) {
|
749 |
|
750 |
$wp_admin_bar->add_menu( array(
|
751 |
+
'parent' => $this->settings['parent'],
|
752 |
+
'title' => $title,
|
753 |
+
'id' => $this->settings['parent'] . '-' . $item,
|
754 |
+
'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings['parent_page'] . '&tab=' . $item,
|
755 |
+
) );
|
756 |
}
|
757 |
}
|
758 |
}
|
866 |
* @param $message
|
867 |
* @param string $type can be 'error' or 'updated'
|
868 |
* @param bool $echo
|
869 |
+
*
|
870 |
* @return string
|
871 |
* @since 1.0
|
872 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
895 |
|
896 |
$tabs = array();
|
897 |
|
898 |
+
foreach ( ( array ) glob( $option_files_path . '*.php' ) as $filename ) {
|
899 |
preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
|
900 |
|
901 |
if ( ! isset( $filename_parts[1] ) ) {
|
934 |
* Return the sub-tabs array of a specific tab
|
935 |
*
|
936 |
* @param array|bool $_tab the tab; if not set it'll be the current tab
|
937 |
+
*
|
938 |
* @since 3.4.0
|
939 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
940 |
* @return array sub-tabs array
|
957 |
if ( $_first && is_array( $_first ) && isset( $_first['type'] ) && 'multi_tab' === $_first['type'] && ! empty( $_first['sub-tabs'] ) ) {
|
958 |
return $_first['sub-tabs'];
|
959 |
}
|
960 |
+
|
961 |
return array();
|
962 |
}
|
963 |
|
1026 |
}
|
1027 |
}
|
1028 |
}
|
1029 |
+
|
1030 |
return '';
|
1031 |
}
|
1032 |
|
1035 |
* return the title of section
|
1036 |
*
|
1037 |
* @param $section
|
1038 |
+
*
|
1039 |
* @return string
|
1040 |
* @since 1.0
|
1041 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
1049 |
return $option['name'];
|
1050 |
}
|
1051 |
}
|
1052 |
+
|
1053 |
return '';
|
1054 |
}
|
1055 |
|
1058 |
* return the description of section if is set
|
1059 |
*
|
1060 |
* @param $section
|
1061 |
+
*
|
1062 |
* @return string
|
1063 |
* @since 1.0
|
1064 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
1072 |
return '<p>' . $option['desc'] . '</p>';
|
1073 |
}
|
1074 |
}
|
1075 |
+
|
1076 |
return '';
|
1077 |
}
|
1078 |
|
1108 |
* return a string with the name of the input field
|
1109 |
*
|
1110 |
* @param string $name
|
1111 |
+
*
|
1112 |
* @return string
|
1113 |
* @since 1.0
|
1114 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
1122 |
* return a string with the id of the input field
|
1123 |
*
|
1124 |
* @param string $id
|
1125 |
+
*
|
1126 |
* @return string
|
1127 |
* @since 1.0
|
1128 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
1138 |
* return a text area
|
1139 |
*
|
1140 |
* @param array $param
|
1141 |
+
*
|
1142 |
* @return void
|
1143 |
* @since 1.0
|
1144 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
1161 |
$std = isset( $option['std'] ) ? $option['std'] : '';
|
1162 |
$db_value = ( isset( $db_options[ $option['id'] ] ) ) ? $db_options[ $option['id'] ] : $std;
|
1163 |
|
1164 |
+
if ( isset( $option['deps'] ) ) {
|
1165 |
$deps = $option['deps'];
|
1166 |
+
}
|
1167 |
|
1168 |
+
if ( 'on-off' === $option['type'] ) {
|
1169 |
$option['type'] = 'onoff';
|
1170 |
+
}
|
1171 |
|
1172 |
if ( $field_template_path = yith_plugin_fw_get_field_template_path( $option ) ) {
|
1173 |
$field_container_path = apply_filters( 'yith_plugin_fw_panel_field_container_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/panel-field-container.php', $option );
|
1200 |
* Show a box panel with specific content in two columns as a new woocommerce type
|
1201 |
*
|
1202 |
* @param array $args
|
1203 |
+
*
|
1204 |
* @return void
|
1205 |
* @since 1.0
|
1206 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.com>
|
1216 |
* Show a box panel with specific content in two columns as a new woocommerce type
|
1217 |
*
|
1218 |
* @param array $args
|
1219 |
+
*
|
1220 |
* @return void
|
1221 |
* @deprecated 3.0.12 Do nothing! Method left to prevent Fatal Error if called directly
|
1222 |
*/
|
1311 |
</div>
|
1312 |
<div class="yith-plugin-fw-rate">
|
1313 |
<?php printf( '<strong>%s</strong> %s <a href="%s" target="_blank"><u>%s</u> <span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a> %s',
|
1314 |
+
__( 'We need your support', 'yith-plugin-fw' ),
|
1315 |
+
__( 'to keep updating and improving the plugin. Please,', 'yith-plugin-fw' ),
|
1316 |
+
$rate_link,
|
1317 |
+
__( 'help us by leaving a five-star rating', 'yith-plugin-fw' ),
|
1318 |
+
__( ':) Thanks!', 'yith-plugin-fw' ) ) ?>
|
1319 |
</div>
|
1320 |
<?php else: ?>
|
1321 |
<h1 class="notice-container"></h1>
|
1401 |
public function maybe_redirect_to_proper_wp_page() {
|
1402 |
global $pagenow;
|
1403 |
if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && $this->settings['page'] === $_GET['page'] &&
|
1404 |
+
! $this->is_custom_taxonomy_page() && ! $this->is_custom_post_type_page() && ! isset( $_REQUEST['yith-plugin-fw-panel-skip-redirect'] ) ) {
|
1405 |
$url = $this->get_nav_url( $this->settings['page'], $this->get_current_tab(), $this->get_current_sub_tab() );
|
1406 |
if ( strpos( $url, 'edit.php' ) !== false || strpos( $url, 'edit-tags.php' ) !== false ) {
|
1407 |
wp_safe_redirect( add_query_arg( array( 'yith-plugin-fw-panel-skip-redirect' => 1 ), $url ) );
|
1408 |
exit;
|
1409 |
}
|
1410 |
}
|
1411 |
+
}
|
1412 |
+
|
1413 |
+
/**
|
1414 |
+
* Print the Panel tabs and sub-tabs navigation in WP pages
|
1415 |
+
* Important: this opens a wrapper <div> that will be closed through YIT_Plugin_Panel::print_panel_tabs_in_post_edit_page_end()
|
1416 |
+
*
|
1417 |
+
* @since 3.4.0
|
1418 |
+
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
1419 |
+
*/
|
1420 |
+
public function print_panel_tabs_in_wp_pages() {
|
1421 |
+
if ( self::$_panel_tabs_in_wp_pages ) {
|
1422 |
+
wp_enqueue_style( 'yit-plugin-style' );
|
1423 |
+
wp_enqueue_script( 'yit-plugin-panel' );
|
1424 |
+
|
1425 |
+
$wrap_class = isset( $this->settings['class'] ) ? $this->settings['class'] : '';
|
1426 |
+
|
1427 |
+
?>
|
1428 |
+
<div class="yith-plugin-fw-wp-page-wrapper">
|
1429 |
+
<?php
|
1430 |
+
echo "<div class='{$wrap_class}'>";
|
1431 |
+
$this->add_plugin_banner( $this->settings['page'] );
|
1432 |
+
$this->print_tabs_nav( self::$_panel_tabs_in_wp_pages );
|
1433 |
+
echo "</div>";
|
1434 |
+
}
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
|
1438 |
+
/**
|
1439 |
+
* Close the wrapper opened in YIT_Plugin_Panel::print_panel_tabs_in_wp_pages()
|
1440 |
+
*
|
1441 |
+
* @since 3.4.0
|
1442 |
+
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
1443 |
+
*/
|
1444 |
+
public function print_panel_tabs_in_wp_pages_end() {
|
1445 |
+
if ( self::$_panel_tabs_in_wp_pages ) {
|
1446 |
+
echo "</div><!-- /yith-plugin-fw-wp-page-wrapper -->";
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
|
1450 |
+
public function set_parent_file_to_handle_menu_for_wp_pages( $parent_file ) {
|
1451 |
+
if ( self::$_panel_tabs_in_wp_pages ) {
|
1452 |
+
return 'yith_plugin_panel';
|
1453 |
+
}
|
1454 |
+
|
1455 |
+
return $parent_file;
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
public function set_submenu_file_to_handle_menu_for_wp_pages( $submenu_file, $parent_file ) {
|
1459 |
+
if ( self::$_panel_tabs_in_wp_pages ) {
|
1460 |
+
return $this->settings['page'];
|
1461 |
+
}
|
1462 |
+
|
1463 |
+
return $submenu_file;
|
1464 |
+
}
|
1465 |
+
|
1466 |
+
/**
|
1467 |
+
*
|
1468 |
+
*/
|
1469 |
+
public function save_toggle_element_options() {
|
1470 |
+
return true;
|
1471 |
+
}
|
1472 |
+
}
|
1473 |
}
|
plugin-fw/package.json
CHANGED
@@ -6,12 +6,18 @@
|
|
6 |
"scripts": {
|
7 |
"build": "npm run js && npm run i18n",
|
8 |
"js": "grunt js",
|
9 |
-
"i18n": "
|
|
|
|
|
|
|
|
|
|
|
10 |
},
|
11 |
"author": "YITH",
|
12 |
"license": "GPL-3.0+",
|
13 |
"keywords": [],
|
14 |
"devDependencies": {
|
|
|
15 |
"grunt": "^1.0.3",
|
16 |
"grunt-cli": "^1.3.2",
|
17 |
"grunt-contrib-jshint": "^2.0.0",
|
6 |
"scripts": {
|
7 |
"build": "npm run js && npm run i18n",
|
8 |
"js": "grunt js",
|
9 |
+
"i18n": "npm run -s i18n:build && npm run -s i18n:translations",
|
10 |
+
"i18n:build": "grunt makepot",
|
11 |
+
"i18n:translations": "npm run -s i18n:download-translations && npm run -s i18n:update-po && npm run -s i18n:clean",
|
12 |
+
"i18n:download-translations": "node ./bin/download-translations.js",
|
13 |
+
"i18n:update-po": "grunt update_po",
|
14 |
+
"i18n:clean": "node ./bin/clean-language-files.js"
|
15 |
},
|
16 |
"author": "YITH",
|
17 |
"license": "GPL-3.0+",
|
18 |
"keywords": [],
|
19 |
"devDependencies": {
|
20 |
+
"axios": "^0.19.2",
|
21 |
"grunt": "^1.0.3",
|
22 |
"grunt-cli": "^1.3.2",
|
23 |
"grunt-contrib-jshint": "^2.0.0",
|
plugin-fw/templates/fields/dimensions.php
CHANGED
@@ -57,25 +57,7 @@ if ( $allow_linked && 'yes' === $linked ) {
|
|
57 |
<?php echo $custom_attributes ?>
|
58 |
<?php echo isset( $data ) ? yith_plugin_fw_html_data_to_string( $data ) : ''; ?>
|
59 |
>
|
60 |
-
<div class="yith-plugin-fw-
|
61 |
-
<input class='yith-plugin-fw-dimensions__unit__value' type="hidden" name="<?php echo $name ?>[unit]" value="<?php echo isset( $value['unit'] ) ? $value['unit'] : current( array_keys( $units ) ) ?>">
|
62 |
-
<?php foreach ( $units as $key => $label ) : ?>
|
63 |
-
<?php
|
64 |
-
$key = sanitize_title( $key );
|
65 |
-
$classes = array(
|
66 |
-
'yith-plugin-fw-dimensions__unit',
|
67 |
-
"yith-plugin-fw-dimensions__unit--{$key}-unit",
|
68 |
-
);
|
69 |
-
if ( $unit_value === $key ) {
|
70 |
-
$classes[] = 'yith-plugin-fw-dimensions__unit--selected';
|
71 |
-
}
|
72 |
-
$classes = implode( ' ', $classes );
|
73 |
-
?>
|
74 |
-
<span class="<?php echo $classes; ?>" data-value="<?php echo $key; ?>"><?php echo $label; ?></span>
|
75 |
-
<?php endforeach ?>
|
76 |
-
</div>
|
77 |
-
|
78 |
-
<ul class="yith-plugin-fw-dimensions__dimensions">
|
79 |
<?php foreach ( $dimensions as $key => $dimension ) : ?>
|
80 |
<?php
|
81 |
$d_id = "{$id}-dimension-" . sanitize_title( $key );
|
@@ -104,20 +86,37 @@ if ( $allow_linked && 'yes' === $linked ) {
|
|
104 |
}
|
105 |
|
106 |
?>
|
107 |
-
<
|
|
|
108 |
<input id="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__number"
|
109 |
type="number" name="<?php echo $d_name; ?>" value="<?php echo $d_value; ?>"
|
110 |
<?php echo $d_attributes; ?>
|
111 |
>
|
112 |
-
|
113 |
-
</li>
|
114 |
<?php endforeach ?>
|
115 |
|
116 |
<?php if ( $allow_linked ): ?>
|
117 |
-
<
|
118 |
<input class='yith-plugin-fw-dimensions__linked__value' type="hidden" name="<?php echo $name ?>[linked]" value="<?php echo $linked ?>">
|
119 |
<span class="dashicons dashicons-admin-links"></span>
|
120 |
-
</
|
121 |
<?php endif; ?>
|
122 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
</div>
|
57 |
<?php echo $custom_attributes ?>
|
58 |
<?php echo isset( $data ) ? yith_plugin_fw_html_data_to_string( $data ) : ''; ?>
|
59 |
>
|
60 |
+
<div class="yith-plugin-fw-dimensions__dimensions">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<?php foreach ( $dimensions as $key => $dimension ) : ?>
|
62 |
<?php
|
63 |
$d_id = "{$id}-dimension-" . sanitize_title( $key );
|
86 |
}
|
87 |
|
88 |
?>
|
89 |
+
<div class="yith-plugin-fw-dimensions__dimension yith-plugin-fw-dimensions__dimension--<?php echo sanitize_title( $key ); ?>">
|
90 |
+
<label for="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__label"><?php echo $d_label; ?></label>
|
91 |
<input id="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__number"
|
92 |
type="number" name="<?php echo $d_name; ?>" value="<?php echo $d_value; ?>"
|
93 |
<?php echo $d_attributes; ?>
|
94 |
>
|
95 |
+
</div>
|
|
|
96 |
<?php endforeach ?>
|
97 |
|
98 |
<?php if ( $allow_linked ): ?>
|
99 |
+
<div class="yith-plugin-fw-dimensions__linked" title="<?php _ex( 'Link values together', 'Tooltip in the "Dimensions" field', 'yith-plugin-fw' ); ?>">
|
100 |
<input class='yith-plugin-fw-dimensions__linked__value' type="hidden" name="<?php echo $name ?>[linked]" value="<?php echo $linked ?>">
|
101 |
<span class="dashicons dashicons-admin-links"></span>
|
102 |
+
</div>
|
103 |
<?php endif; ?>
|
104 |
+
</div>
|
105 |
+
<div class="yith-plugin-fw-dimensions__units">
|
106 |
+
<input class='yith-plugin-fw-dimensions__unit__value' type="hidden" name="<?php echo $name ?>[unit]" value="<?php echo isset( $value['unit'] ) ? $value['unit'] : current( array_keys( $units ) ) ?>">
|
107 |
+
<?php foreach ( $units as $key => $label ) : ?>
|
108 |
+
<?php
|
109 |
+
$key = sanitize_title( $key );
|
110 |
+
$classes = array(
|
111 |
+
'yith-plugin-fw-dimensions__unit',
|
112 |
+
"yith-plugin-fw-dimensions__unit--{$key}-unit",
|
113 |
+
);
|
114 |
+
if ( $unit_value === $key ) {
|
115 |
+
$classes[] = 'yith-plugin-fw-dimensions__unit--selected';
|
116 |
+
}
|
117 |
+
$classes = implode( ' ', $classes );
|
118 |
+
?>
|
119 |
+
<span class="<?php echo $classes; ?>" data-value="<?php echo $key; ?>"><?php echo $label; ?></span>
|
120 |
+
<?php endforeach ?>
|
121 |
+
</div>
|
122 |
</div>
|
plugin-fw/templates/sysinfo/system-information-panel.php
CHANGED
@@ -104,7 +104,7 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
|
|
104 |
<?php esc_html_e( 'Site URL', 'yith-plugin-fw' ); ?>
|
105 |
</th>
|
106 |
<td class="requirement-value">
|
107 |
-
<?php echo get_site_url(); ?>
|
108 |
</td>
|
109 |
</tr>
|
110 |
<tr>
|
@@ -112,7 +112,7 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
|
|
112 |
<?php esc_html_e( 'Output IP Address', 'yith-plugin-fw' ); ?>
|
113 |
</th>
|
114 |
<td class="requirement-value">
|
115 |
-
<?php echo $output_ip; ?>
|
116 |
</td>
|
117 |
</tr>
|
118 |
<tr>
|
@@ -123,6 +123,14 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
|
|
123 |
<?php echo( defined( 'WP_CACHE' ) && WP_CACHE ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
|
124 |
</td>
|
125 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
</table>
|
127 |
|
128 |
<table class="widefat striped">
|
104 |
<?php esc_html_e( 'Site URL', 'yith-plugin-fw' ); ?>
|
105 |
</th>
|
106 |
<td class="requirement-value">
|
107 |
+
<?php echo esc_attr( get_site_url() ); ?>
|
108 |
</td>
|
109 |
</tr>
|
110 |
<tr>
|
112 |
<?php esc_html_e( 'Output IP Address', 'yith-plugin-fw' ); ?>
|
113 |
</th>
|
114 |
<td class="requirement-value">
|
115 |
+
<?php echo esc_attr( $output_ip ); ?>
|
116 |
</td>
|
117 |
</tr>
|
118 |
<tr>
|
123 |
<?php echo( defined( 'WP_CACHE' ) && WP_CACHE ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
|
124 |
</td>
|
125 |
</tr>
|
126 |
+
<tr>
|
127 |
+
<th>
|
128 |
+
<?php esc_html_e( 'External object cache', 'yith-plugin-fw' ); ?>
|
129 |
+
</th>
|
130 |
+
<td class="requirement-value">
|
131 |
+
<?php echo( wp_using_ext_object_cache() ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
|
132 |
+
</td>
|
133 |
+
</tr>
|
134 |
</table>
|
135 |
|
136 |
<table class="widefat striped">
|