PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.9.10
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.9.10
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / assets / js / admin / merchant-preview.min.js

merchant-preview.min.js in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.9.10, at assets/js/admin/merchant-preview.min.js

1 lines 8.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _createForOfIteratorHelper(e,t){var r,n,a,o,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return a=!(n=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){a=!0,r=e},f:function(){try{n||null==i.return||i.return()}finally{if(a)throw r}}};if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}!function(H,L){H(L).ready(function(){function r(){if(C(I.css))for(var e in I.css)!function(t){var e,r;I.css.hasOwnProperty(t)&&(e=L.querySelectorAll(I.css[t].selector),r=H('[name="merchant['+I.css[t].setting+']"]').val()+I.css[t].unit,"radio"===H('[name="merchant['+I.css[t].setting+']"]').attr("type")&&(r=H('[name="merchant['+I.css[t].setting+']"]:checked').val()+I.css[t].unit),e.forEach(function(e){e.style.setProperty(I.css[t].variable,r)}))}(e);if(C(I.text))for(var t in I.text){var r;I.text.hasOwnProperty(t)&&(r=H('[name="merchant['+I.text[t].setting+']"]').val(),I.text[t].hasOwnProperty("replacements")&&(r=j(r,I.text[t])),H(I.text[t].selector).html(r))}if(C(I.attributes))for(var n in I.attributes){var a;I.attributes.hasOwnProperty(n)&&(a=(a="radio"===(a=H('[name="merchant['+I.attributes[n].setting+']"]')).attr("type")?H('[name="merchant['+I.attributes[n].setting+']"]:checked'):a).val(),I.attributes[n].hasOwnProperty("replacements")&&(a=j(a,I.attributes[n])),H(I.attributes[n].selector).attr(I.attributes[n].attribute,a))}if(C(I.classes))for(var o in I.classes)if(I.classes.hasOwnProperty(o)){if(I.classes[o].hasOwnProperty("remove")){var i,s=_createForOfIteratorHelper(I.classes[o].remove);try{for(s.s();!(i=s.n()).done;){var c=i.value;H(I.classes[o].selector).removeClass(c)}}catch(e){s.e(e)}finally{s.f()}}var l=H('[name="merchant['+I.classes[o].setting+']"]'),f=l.attr("type");"radio"===f&&(l=H('[name="merchant['+I.classes[o].setting+']"]:checked')),"checkbox"===f?l.is(":checked")?H(I.classes[o].selector).addClass(I.classes[o].add):H(I.classes[o].selector).removeClass(I.classes[o].add):(f=l.val(),I.classes[o].hasOwnProperty("add")?H(I.classes[o].selector).toggleClass(I.classes[o].add):H(I.classes[o].selector).addClass(f))}if(C(I.icons))for(var u in I.icons){var p,h;I.icons.hasOwnProperty(u)&&(h=(p=H('[name="merchant['+I.icons[u].setting+']"]:checked')).parent().find("figure img").attr("src"),u=H(I.icons[u].selector),"none"===p.val()?u.hide():(u.show(),u.attr("src",h)))}if(C(I.svg_icons))for(var m in I.svg_icons){var d,y;I.svg_icons.hasOwnProperty(m)&&(d=H('[name="merchant['+I.svg_icons[m].setting+']"]:checked'),y=I.svg_icons[m].icons_lib[d.val()],m=H(I.svg_icons[m].selector),"none"===d.val()?m.hide():(m.show(),m.html(y)))}if(C(I.repeater_content))for(var v in I.repeater_content)if(I.repeater_content.hasOwnProperty(v)){var g=H('[name="merchant['+I.repeater_content[v].setting+']"]'),b=g.val()?JSON.parse(g.val()):[],_=H(I.repeater_content[v].selector);if(b.length){var x,w=_createForOfIteratorHelper(b.entries());try{for(w.s();!(x=w.n()).done;){var O=_slicedToArray(x.value,2),A=O[0],T=O[1];_.length&&_.eq(A).html(T)}}catch(e){w.e(e)}finally{w.f()}if(_.length>b.length)for(var k=b.length;k<_.length;k++)_.eq(k).parent().remove();if(_.length<b.length)for(var P=_.length;P<b.length;P++)_.eq(0).parent().clone().appendTo(_.eq(0).parent().parent())}}if(C(I.flexible_content))for(var S in I.flexible_content)!function(i){var s=H(I.flexible_content[i].selector),e=s.children(),c=e.eq(0),t=H(".merchant-flexible-content-control[data-id="+I.flexible_content[i].setting+"]").find(".merchant-flexible-content").children();e.each(function(){H(this).hasClass("flexible-content-template")||H(this).remove()}),t.each(function(){var e,t=c.clone(),r=H(this).data("type");for(e in I.flexible_content[i].variables[r]){var n=I.flexible_content[i].variables[r][e],n=H(this).find(".merchant-module-page-setting-field[data-id="+n+"]"),a=n.data("type"),o=n.find("input").val();"text"===a&&t.html(t.html().replace(e,o)),"upload"===a&&void 0!==(o=n.find(".merchant-upload-image img").prop("outerHTML"))&&t.html(t.html().replace(e,o)),"choices"===a&&(o=n.find("input:checked"),n.find(".merchant-svg").length)&&void 0!==(a=o.parent().find("svg").prop("outerHTML"))&&t.html(t.html().replace(e,a)),t.html(t.html().replace(e,"")).removeClass("flexible-content-template").appendTo(s)}})}(S)}function e(e){var t=e.attr("type");"text"!==t&&"TEXTAREA"!==e.prop("tagName")||e.on("keyup input",r),"number"===t&&(e.on("keyup input",r),e.parent().find("input[type=range]").length)&&e.parent().find("input[type=range]").on("input change",r),"radio"===t&&e.on("input",r),"checkbox"!==t&&!e.is("select")||e.on("change",r),e.hasClass("merchant-sortable-repeater-input")&&e.on("change",r),e.hasClass("merchant-upload-input")&&e.on("change",r)}var I=merchantPreviewManipulators,C=function(e){return void 0!==e&&0<Object.keys(e).length};if(void 0!==I){if(C(I.css))for(var t in I.css)e(H('[name="merchant['+I.css[t].setting+']"]'));if(C(I.text))for(var n in I.text)e(H('[name="merchant['+I.text[n].setting+']"]'));if(C(I.attributes))for(var a in I.attributes)e(H('[name="merchant['+I.attributes[a].setting+']"]'));if(C(I.classes))for(var o in I.classes)e(H('[name="merchant['+I.classes[o].setting+']"]'));if(C(I.icons))for(var i in I.icons)e(H('[name="merchant['+I.icons[i].setting+']"]'));if(C(I.svg_icons))for(var s in I.svg_icons)e(H('[name="merchant['+I.svg_icons[s].setting+']"]'));if(C(I.repeater_content))for(var c in I.repeater_content)e(H('[name="merchant['+I.repeater_content[c].setting+']"]'));if(C(I.flexible_content))for(var l in I.flexible_content){l=H(".merchant-flexible-content-control[data-id="+I.flexible_content[l].setting+"]");e(l.find("input")),l.find(".customize-control-flexible-content-delete").on("click",r),l.on("merchant.sorted",r)}if(C(I.update))for(var f in I.update)e(H('[name="merchant['+I.update[f].setting+']"]'));for(var u=0,p=[".pcr-color-palette",".pcr-swatches button",".pcr-color-chooser",".pcr-color-opacity"];u<p.length;u++){var h=p[u];H(L).on("click",h,r)}}function m(e,t,r){var n=H('input[name="merchant['+r.setting+']"]').val();return r.hasOwnProperty("format")&&(n=r.format.replace("{string}",n)),e.replace(t,n)}var j=function(e,t){var r,n=t.replacements[0],a=t.replacements[1],o=_createForOfIteratorHelper(n.entries());try{for(o.s();!(r=o.n()).done;){var i=_slicedToArray(r.value,2),s=i[0],c=i[1],l=a[s];if("string"==typeof l&&(e=e.replace(c,l)),"object"===_typeof(l))if(l.hasOwnProperty("conditions")){var f,u=H('[name="merchant['+l.setting+']"]');for(f in l.conditions)l.conditions.hasOwnProperty(f)&&u.val()===f&&("string"==typeof l.conditions[f]&&(e=e.replace(c,l.conditions[f])),"object"===_typeof(l.conditions[f]))&&(e=m(e,c,l.conditions[f]))}else e=m(e,c,l)}}catch(e){o.e(e)}finally{o.f()}return e}})}(jQuery,(window,document));