diff options
Diffstat (limited to 'plugins/jetpack/_inc/build/widgets/search/js/search-widget-admin.min.js')
-rw-r--r-- | plugins/jetpack/_inc/build/widgets/search/js/search-widget-admin.min.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/jetpack/_inc/build/widgets/search/js/search-widget-admin.min.js b/plugins/jetpack/_inc/build/widgets/search/js/search-widget-admin.min.js index 7ea8d66d..9828e41a 100644 --- a/plugins/jetpack/_inc/build/widgets/search/js/search-widget-admin.min.js +++ b/plugins/jetpack/_inc/build/widgets/search/js/search-widget-admin.min.js @@ -1,3 +1 @@ -/* Do not modify this file directly. It is compiled from other files. */ -/* globals jetpack_search_filter_admin, jQuery, analytics */ -!function(e,t){var a=void 0!==t&&t.defaultFilterCount?t.defaultFilterCount:5;function s(a){var s=null,c=null,i=a.find(".filter-select").val();"taxonomy"===i?s=a.find(".taxonomy-select option:selected").text().trim():"date_histogram"===i&&t&&t.i18n?(c=-1!==a.find(".date-field-select").val().indexOf("modified"),s="month"===a.find(".date-interval-select").val()?c?t.i18n.monthUpdated:t.i18n.month:c?t.i18n.yearUpdated:t.i18n.year):s=a.find(".filter-select option:selected").text().trim(),e(a).find(".jetpack-search-filters-widget__title input").prop("placeholder",s)}e(document).ready(function(){i(),window.JetpackSearch=window.JetpackSearch||{},window.JetpackSearch.addFilter=c,"undefined"!=typeof analytics&&t.tracksUserData&&analytics.initialize(t.tracksUserData.userid,t.tracksUserData.username)});var c=function(e,t){var a=_.template(e.closest(".jetpack-search-filters-widget").find(".jetpack-search-filters-widget__filter-template").html());s(e.append(a(t)))},i=function(i){i=void 0===i?e(".jetpack-search-filters-widget"):i;var n=function(t){return e(t).closest(".jetpack-search-filters-widget__filter")};i.on("change",".filter-select",function(){var a=e(this),c=a.val(),i={is_customizer:t.tracksEventData.is_customizer};i.type=c,a.closest(".jetpack-search-filters-widget__filter").attr("class","jetpack-search-filters-widget__filter").addClass("is-"+c),s(n(this)),r("changed_filter_type",i)}),i.on("change",".jetpack-search-filters-widget__search-box-enabled",function(){var a=e(this),s=a.is(":checked"),c=a.closest(".jetpack-search-filters-widget"),i=c.find(".jetpack-search-filters-widget__sort-controls-enabled");c.toggleClass("hide-post-types"),s?(i.removeAttr("disabled"),r("enabled_search_box",t.tracksEventData)):(i.prop("checked",!1),i.prop("disabled",!0),r("disabled_search_box",t.tracksEventData))}),i.on("change",".jetpack-search-filters-widget__sort-controls-enabled",function(){e(this).is(":checked")?r("enabled_sort_controls",t.tracksEventData):r("disabled_sort_controls",t.tracksEventData)}),i.on("click",'.jetpack-search-filters-widget__post-types-select input[type="checkbox"]',function(a){0===e(this).closest(".jetpack-search-filters-widget").find('.jetpack-search-filters-widget__post-types-select input[type="checkbox"]:checked').length&&(a.preventDefault(),a.stopPropagation(),r("attempted_no_post_types",t.tracksEventData))}),i.on("change",'.jetpack-search-filters-widget__post-types-select input[type="checkbox"]',function(){var a=e(this),s={is_customizer:t.tracksEventData.is_customizer,post_type:a.val()};wp&&wp.customize&&wp.customize.state("saved").set(!1),a.is(":checked")?r("added_post_type",s):r("removed_post_type",s)}),i.on("change",".jetpack-search-filters-widget__sort-order",function(){var a={is_customizer:t.tracksEventData.is_customizer};a.order=e(this).val(),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_sort_order",a)}),i.on("change",".jetpack-search-filters-widget__taxonomy-select select",function(){var a={is_customizer:t.tracksEventData.is_customizer};a.taxonomy=e(this).val(),s(n(this)),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_taxonomy",a)}),i.on("change","select.date-field-select",function(){var a={is_customizer:t.tracksEventData.is_customizer};a.field=e(this).val(),s(n(this)),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_date_field",a)}),i.on("change","select.date-interval-select",function(){var a={is_customizer:t.tracksEventData.is_customizer};a.interval=e(this).val(),s(n(this)),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_date_interval",a)}),i.on("change","input.filter-count",function(){var a={is_customizer:t.tracksEventData.is_customizer};a.count=e(this).val(),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_filter_count",a)}),i.on("click",".jetpack-search-filters-widget__add-filter",function(s){s.preventDefault();var i=e(this).closest(".jetpack-search-filters-widget").find(".jetpack-search-filters-widget__filters");c(i,{type:"taxonomy",taxonomy:"",post_type:"",field:"",interval:"",count:a,name_placeholder:"",name:""}),wp&&wp.customize&&wp.customize.state("saved").set(!1),i.find(".jetpack-search-filters-widget__filter").find("input, textarea, select").change(),r("added_filter",t.tracksEventData)}),i.on("click",".jetpack-search-filters-widget__controls .delete",function(a){a.preventDefault();var s=e(this).closest(".jetpack-search-filters-widget__filter"),c={is_customizer:t.tracksEventData.is_customizer};switch(c.type=s.find(".filter-select").val(),c.type){case"taxonomy":c.taxonomy=s.find(".jetpack-search-filters-widget__taxonomy-select select").val();break;case"date_histogram":c.dateField=s.find(".jetpack-search-filters-widget__date-histogram-select:first select").val(),c.dateInterval=s.find(".jetpack-search-filters-widget__date-histogram-select:nth-child( 2 ) select").val()}c.filterCount=s.find(".filter-count").val(),r("deleted_filter",c),s.find("input, textarea, select").change(),s.remove(),wp&&wp.customize&&wp.customize.state("saved").set(!1)}),e(".jetpack-search-filters-widget__filters").sortable({placeholder:"jetpack-search-filters-widget__filter-placeholder",axis:"y",revert:!0,cancel:"input,textarea,button,select,option,.jetpack-search-filters-widget__controls a",change:function(){wp&&wp.customize&&wp.customize.state("saved").set(!1)},update:function(t,a){e(a.item).find("input, textarea, select").change()}}).disableSelection()};function r(e,t){void 0!==t&&"object"==typeof t||(t={}),e&&e.length&&"undefined"!=typeof analytics&&analytics.tracks&&analytics.mc&&(e=0!==(e=e.replace(/-/g,"_")).indexOf("jetpack_widget_search_")?"jetpack_widget_search_"+e:e,analytics.tracks.recordEvent(e,t),e=(e=e.replace("jetpack_widget_search_","")).replace(/_/g,"-"),analytics.mc.bumpStat("jetpack-search-widget",e))}e(document).on("widget-updated widget-added",function(t,a){var s=(a=e(a)).attr("id");s&&-1!==s.indexOf("jetpack-search-filters")&&(a.off("change",".filter-select"),a.off("click",".jetpack-search-filters-widget__controls .delete"),a.off("change",".jetpack-search-filters-widget__use-filters"),a.off("change",".jetpack-search-filters-widget__search-box-enabled"),a.off("change",".jetpack-search-filters-widget__sort-controls-enabled"),a.off("change",".jetpack-search-filters-widget__sort-controls-enabled"),a.off("change",".jetpack-search-filters-widget__post-type-selector"),a.off("change",".jetpack-search-filters-widget__sort-order"),a.off("change",".jetpack-search-filters-widget__taxonomy-select"),a.off("change",".jetpack-search-filters-widget__date-histogram-select:first select"),a.off("change",".jetpack-search-filters-widget__date-histogram-select:eq(1) select"),a.off("click",'.jetpack-search-filters-widget__post-types-select input[type="checkbox"]'),a.off("click",".jetpack-search-filters-widget__add-filter"),i(a))})}(jQuery,jetpack_search_filter_admin);
\ No newline at end of file +!function(e,t){var a=void 0!==t&&t.defaultFilterCount?t.defaultFilterCount:5;function s(a){var s=null,c=null,i=a.find(".filter-select").val();"taxonomy"===i?s=a.find(".taxonomy-select option:selected").text().trim():"date_histogram"===i&&t&&t.i18n?(c=-1!==a.find(".date-field-select").val().indexOf("modified"),s="month"===a.find(".date-interval-select").val()?c?t.i18n.monthUpdated:t.i18n.month:c?t.i18n.yearUpdated:t.i18n.year):s=a.find(".filter-select option:selected").text().trim(),e(a).find(".jetpack-search-filters-widget__title input").prop("placeholder",s)}e(document).ready((function(){i(),window.JetpackSearch=window.JetpackSearch||{},window.JetpackSearch.addFilter=c,"undefined"!=typeof analytics&&t.tracksUserData&&analytics.initialize(t.tracksUserData.userid,t.tracksUserData.username)}));var c=function(e,t){var a=_.template(e.closest(".jetpack-search-filters-widget").find(".jetpack-search-filters-widget__filter-template").html());s(e.append(a(t)))},i=function(i){i=void 0===i?e(".jetpack-search-filters-widget"):i;var n=function(t){return e(t).closest(".jetpack-search-filters-widget__filter")};i.on("change",".filter-select",(function(){var a=e(this),c=a.val(),i={is_customizer:t.tracksEventData.is_customizer};i.type=c,a.closest(".jetpack-search-filters-widget__filter").attr("class","jetpack-search-filters-widget__filter").addClass("is-"+c),s(n(this)),r("changed_filter_type",i)})),i.on("change",".jetpack-search-filters-widget__search-box-enabled",(function(){var a=e(this),s=a.is(":checked"),c=a.closest(".jetpack-search-filters-widget"),i=c.find(".jetpack-search-filters-widget__sort-controls-enabled");c.toggleClass("hide-post-types"),s?(i.removeAttr("disabled"),r("enabled_search_box",t.tracksEventData)):(i.prop("checked",!1),i.prop("disabled",!0),r("disabled_search_box",t.tracksEventData))})),i.on("change",".jetpack-search-filters-widget__sort-controls-enabled",(function(){e(this).is(":checked")?r("enabled_sort_controls",t.tracksEventData):r("disabled_sort_controls",t.tracksEventData)})),i.on("click",'.jetpack-search-filters-widget__post-types-select input[type="checkbox"]',(function(a){0===e(this).closest(".jetpack-search-filters-widget").find('.jetpack-search-filters-widget__post-types-select input[type="checkbox"]:checked').length&&(a.preventDefault(),a.stopPropagation(),r("attempted_no_post_types",t.tracksEventData))})),i.on("change",'.jetpack-search-filters-widget__post-types-select input[type="checkbox"]',(function(){var a=e(this),s={is_customizer:t.tracksEventData.is_customizer,post_type:a.val()};wp&&wp.customize&&wp.customize.state("saved").set(!1),a.is(":checked")?r("added_post_type",s):r("removed_post_type",s)})),i.on("change",".jetpack-search-filters-widget__sort-order",(function(){var a={is_customizer:t.tracksEventData.is_customizer};a.order=e(this).val(),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_sort_order",a)})),i.on("change",".jetpack-search-filters-widget__taxonomy-select select",(function(){var a={is_customizer:t.tracksEventData.is_customizer};a.taxonomy=e(this).val(),s(n(this)),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_taxonomy",a)})),i.on("change","select.date-field-select",(function(){var a={is_customizer:t.tracksEventData.is_customizer};a.field=e(this).val(),s(n(this)),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_date_field",a)})),i.on("change","select.date-interval-select",(function(){var a={is_customizer:t.tracksEventData.is_customizer};a.interval=e(this).val(),s(n(this)),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_date_interval",a)})),i.on("change","input.filter-count",(function(){var a={is_customizer:t.tracksEventData.is_customizer};a.count=e(this).val(),wp&&wp.customize&&wp.customize.state("saved").set(!1),r("changed_filter_count",a)})),i.on("click",".jetpack-search-filters-widget__add-filter",(function(s){s.preventDefault();var i=e(this).closest(".jetpack-search-filters-widget").find(".jetpack-search-filters-widget__filters");c(i,{type:"taxonomy",taxonomy:"",post_type:"",field:"",interval:"",count:a,name_placeholder:"",name:""}),wp&&wp.customize&&wp.customize.state("saved").set(!1),i.find(".jetpack-search-filters-widget__filter").find("input, textarea, select").change(),r("added_filter",t.tracksEventData)})),i.on("click",".jetpack-search-filters-widget__controls .delete",(function(a){a.preventDefault();var s=e(this).closest(".jetpack-search-filters-widget__filter"),c={is_customizer:t.tracksEventData.is_customizer};switch(c.type=s.find(".filter-select").val(),c.type){case"taxonomy":c.taxonomy=s.find(".jetpack-search-filters-widget__taxonomy-select select").val();break;case"date_histogram":c.dateField=s.find(".jetpack-search-filters-widget__date-histogram-select:first select").val(),c.dateInterval=s.find(".jetpack-search-filters-widget__date-histogram-select:nth-child( 2 ) select").val()}c.filterCount=s.find(".filter-count").val(),r("deleted_filter",c),s.find("input, textarea, select").change(),s.remove(),wp&&wp.customize&&wp.customize.state("saved").set(!1)})),e(".jetpack-search-filters-widget__filters").sortable({placeholder:"jetpack-search-filters-widget__filter-placeholder",axis:"y",revert:!0,cancel:"input,textarea,button,select,option,.jetpack-search-filters-widget__controls a",change:function(){wp&&wp.customize&&wp.customize.state("saved").set(!1)},update:function(t,a){e(a.item).find("input, textarea, select").change()}}).disableSelection()};function r(e,t){void 0!==t&&"object"==typeof t||(t={}),e&&e.length&&"undefined"!=typeof analytics&&analytics.tracks&&analytics.mc&&(e=0!==(e=e.replace(/-/g,"_")).indexOf("jetpack_widget_search_")?"jetpack_widget_search_"+e:e,analytics.tracks.recordEvent(e,t),e=(e=e.replace("jetpack_widget_search_","")).replace(/_/g,"-"),analytics.mc.bumpStat("jetpack-search-widget",e))}e(document).on("widget-updated widget-added",(function(t,a){var s=e(a).find(".id_base").val();s&&"jetpack-search-filters"===s&&(a.off("change",".filter-select"),a.off("click",".jetpack-search-filters-widget__controls .delete"),a.off("change",".jetpack-search-filters-widget__use-filters"),a.off("change",".jetpack-search-filters-widget__search-box-enabled"),a.off("change",".jetpack-search-filters-widget__sort-controls-enabled"),a.off("change",".jetpack-search-filters-widget__sort-controls-enabled"),a.off("change",".jetpack-search-filters-widget__post-type-selector"),a.off("change",".jetpack-search-filters-widget__sort-order"),a.off("change",".jetpack-search-filters-widget__taxonomy-select"),a.off("change",".jetpack-search-filters-widget__date-histogram-select:first select"),a.off("change",".jetpack-search-filters-widget__date-histogram-select:eq(1) select"),a.off("click",'.jetpack-search-filters-widget__post-types-select input[type="checkbox"]'),a.off("click",".jetpack-search-filters-widget__add-filter"),i(a))}))}(jQuery,jetpack_search_filter_admin);
\ No newline at end of file |