File "yith-enhanced-select.min.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/yith-woocommerce-compare/plugin-fw/assets/js/yith-enhanced-select.min.js
File size: 4.82 KB
MIME-type: text/plain
Charset: utf-8
jQuery(function(e){"use strict";var t=function(){return{inputTooShort:function(e){var t=e.minimum-e.input.length;return 1===t?yith_framework_enhanced_select_params.i18n.input_too_short_1:yith_framework_enhanced_select_params.i18n.input_too_short_n.replace("%s",t)},errorLoading:function(){return yith_framework_enhanced_select_params.i18n.searching},loadingMore:function(){return yith_framework_enhanced_select_params.i18n.load_more},noResults:function(){return yith_framework_enhanced_select_params.i18n.no_matches},searching:function(){return yith_framework_enhanced_select_params.i18n.searching}}},n=function(t){return t=e.extend({},t),e.each(["placeholder","allow_clear","minimum_input_length","sortable"],function(e,n){delete t[n]}),t};e(document.body).on("yith-framework-enhanced-select-init",function(){e(".yith-enhanced-select").filter(":not(.enhanced)").each(function(){var n={minimumResultsForSearch:10,allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:!!e(this).data("minimum_input_length")&&e(this).data("minimum_input_length"),closeOnSelect:"no"!==e(this).data("close_on_select"),language:t(),escapeMarkup:function(e){return e}};e(this).select2(n).addClass("enhanced")}),e(".yith-post-search").filter(":not(.enhanced)").each(function(){var a={action:"yith_plugin_fw_json_search_posts",security:yith_framework_enhanced_select_params.search_posts_nonce,post_type:"post"},i=e.extend(a,e(this).data()),c={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",closeOnSelect:"no"!==e(this).data("close_on_select"),language:t(),escapeMarkup:function(e){return e},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(t){return n(e.extend({term:t.term},i))},processResults:function(t){var n=[];return t&&e.each(t,function(e,t){n.push({id:e,text:t})}),{results:n}},cache:!0}};if(e(this).select2(c).addClass("enhanced"),e(this).data("sortable")){var r=e(this),s=e(this).next(".select2-container").find("ul.select2-selection__rendered");s.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(s.find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,n=r.find('option[value="'+t+'"]')[0];r.prepend(n)})}})}}),e(".yith-customer-search").filter(":not(.enhanced)").each(function(){var a={action:"woocommerce_json_search_customers",security:yith_framework_enhanced_select_params.search_customers_nonce},i=e.extend(a,e(this).data()),c={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",closeOnSelect:"no"!==e(this).data("close_on_select"),language:t(),escapeMarkup:function(e){return e},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(t){return n(e.extend({term:t.term},i))},processResults:function(t){var n=[];return t&&e.each(t,function(e,t){n.push({id:e,text:t})}),{results:n}},cache:!0}};if(e(this).select2(c).addClass("enhanced"),e(this).data("sortable")){var r=e(this),s=e(this).next(".select2-container").find("ul.select2-selection__rendered");s.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(s.find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,n=r.find('option[value="'+t+'"]')[0];r.prepend(n)})}})}}),e(".yith-term-search").filter(":not(.enhanced)").each(function(){var a={action:"yith_plugin_fw_json_search_terms",security:yith_framework_enhanced_select_params.search_terms_nonce,taxonomy:"category"},i=e.extend(a,e(this).data()),c={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",closeOnSelect:"no"!==e(this).data("close_on_select"),language:t(),escapeMarkup:function(e){return e},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(t){return n(e.extend({term:t.term},i))},processResults:function(t){var n=[];return t&&e.each(t,function(e,t){n.push({id:e,text:t})}),{results:n}},cache:!0}};if(e(this).select2(c).addClass("enhanced"),e(this).data("sortable")){var r=e(this),s=e(this).next(".select2-container").find("ul.select2-selection__rendered");s.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(s.find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,n=r.find('option[value="'+t+'"]')[0];r.prepend(n)})}})}})}).trigger("yith-framework-enhanced-select-init")});