You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
7 months ago
|
!function(d){"use strict";var l,f={settings:{iconActivate:'<i class="fa fa-toggle-on fa-flip-horizontal" aria-hidden="true"></i>',iconDeactivate:'<i class="fa fa-toggle-on" aria-hidden="true"></i>',iconInstall:'<i class="fa fa-cloud-download" aria-hidden="true"></i>',iconSpinner:'<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>',mediaFrame:!1},init:function(){l=this.settings,d(f.ready),f.initEntriesSingle(),f.initEntriesList(),f.initWelcome(),d(document).on("wpformsReady",f.initAddons),f.initSettings(),f.initTools(),f.initUpgrades()},ready:function(){d(".notice").show(),d("#screen-meta-links, #screen-meta").prependTo("#wpforms-header-temp").show(),f.initChoicesJS(),f.initCheckboxMultiselectColumns(),d(".wpforms-color-picker").each(function(){var e=d(this);e.minicolors({defaultValue:e.data("fallback-color")||""})}),d(".wpforms-file-upload").each(function(){var e=d(this).find("input[type=file]"),n=d(this).find("label"),o=n.html();e.on("change",function(e){var t="";this.files&&1<this.files.length?t=(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):e.target.value&&(t=e.target.value.split("\\").pop()),t?n.find(".fld").html(t):n.html(o)}),e.on("focus",function(){e.addClass("has-focus")}).on("blur",function(){e.removeClass("has-focus")})}),jconfirm.defaults={closeIcon:!1,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",animateFromElement:!1,content:wpforms_admin.something_went_wrong},d(document).on("click",".wpforms-upgrade-modal",function(){d.alert({title:wpforms_admin.thanks_for_interest,content:wpforms_admin.upgrade_modal,icon:"fa fa-info-circle",type:"blue",boxWidth:"550px",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})}),f.initLity(),f.initFlyoutMenu(),d(document).trigger("wpformsReady"),d("#screen-options-wrap .hide-column-tog").on("change",f.handleOnChangeScreenOptions)},handleOnChangeScreenOptions:function(){var e=d(".wpforms-table-list"),t=e.find("thead .manage-column"),n=t.filter(".hidden"),t=Boolean(5<t.length-n.length);e.toggleClass("has-many-columns",t),e.toggleClass("has-few-columns",!t)},initChoicesJS:function(){d(".choicesjs-select").each(function(){var e=d(this),t=window.wpforms_admin_choicesjs_config?{...window.wpforms_admin_choicesjs_config}:{};e.attr("multiple")&&(t.removeItemButton=void 0===t.removeItemButton||t.removeItemButton),"off"===e.data("sorting")&&(t.shouldSort=!1),e.data("search")&&(t.searchEnabled=!0),e.data("choices-position")&&(t.position=e.data("choices-position")),t.itemSelectText="",t.callbackOnInit=function(){var e=d(this.passedElement.element).data("size-class");e&&d(this.containerOuter.element).addClass(e),wpf.initMultipleSelectWithSearch(this)},e.data("choicesjs",new Choices(e[0],t))}),d(document).on("click",".choices",function(e){var t=d(this),n=t.find("select").data("choicesjs");n&&t.hasClass("is-open")&&(e.target.classList.contains("choices__inner")||e.target.classList.contains("choices__arrow"))&&n.hideDropdown()})},initCheckboxMultiselectColumns:function(){d(document).on("change",".checkbox-multiselect-columns input",function(){var e=d(this),t=e.parent(),n=e.closest(".checkbox-multiselect-columns"),t=t.text(),o="check-item-"+e.val(),i=n.find("#"+o);e.prop("checked")?(e.parent().addClass("checked"),i.length||n.find(".second-column ul").append('<li id="'+o+'">'+t+"</li>")):(e.parent().removeClass("checked"),n.find("#"+o).remove())}),d(document).on("click",".checkbox-multiselect-columns .all",function(e){e.preventDefault(),d(this).closest(".checkbox-multiselect-columns").find("input[type=checkbox]").prop("checked",!0).trigger("change"),d(this).remove()})},initFormOverview:function(){console.warn('WARNING! Function "WPFormsAdmin.initFormOverview()" has been deprecated, please use the new "WPFormsForms.Overview.init()" function instead!'),window.WPFormsForms.Overview.init()},initEntriesList:function(){d(document).on("click","#wpforms-entries-table-edit-columns",function(e){e.preventDefault(),f.entriesListFieldColumn()}),d(document).on("click","#wpforms-entrie
|