%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tradesc/www/relax/wp-content/plugins/wpforms-lite/assets/js/admin/share/
Upload File :
Create Path :
Current File : /home/tradesc/www/relax/wp-content/plugins/wpforms-lite/assets/js/admin/share/list-table-ext.min.js

const WPFormsAdminListTableExt=window.WPFormsAdminListTableExt||function(e,l,i){const t=["#wpforms-overview","#wpforms-entries-list"],o={cogIcon:"#wpforms-list-table-ext-edit-columns-cog",submitButton:"#wpforms-list-table-ext-edit-columns-select-submit"},c={},d={init(){d.initElements(),c.$doc.on("wpformsReady",d.initMultiSelect),i(d.ready)},ready(){d.prepareTableFootColumns(),d.initTableScrollColumns(),d.initTableSortableColumns(),d.events(),d.windowResize()},events(){c.$doc.on("click",o.cogIcon,d.onClickCog).on("wpforms_multiselect_checkbox_list_toggle",d.onMenuToggle).on("click",o.submitButton,d.onSaveChanges),c.$tableScroll?.on("scroll",d.tableScroll),i(l).on("resize",_.debounce(d.windowResize,100)),c.$searchInput?.on("input",_.debounce(d.maybeShowNoResults,310))},initElements(){c.$doc=i(e),c.$header=i("#wpforms-header"),c.$page=i(t.join(",")),c.$table=c.$page.find(".wp-list-table"),c.$tableContainer=c.$table.parent(),c.$menu=i("#wpforms-list-table-ext-edit-columns-select-container"),c.$cog=d.initCogIcon(),c.$wpcontent=i("#wpcontent"),c.$tableContainer.hasClass("wpforms-table-container")||(c.$table.wrap('<div class="wpforms-table-container"></div>'),c.$tableContainer=c.$table.parent()),c.$page.addClass("wpforms-list-table-ext-page")},prepareTableFootColumns(){c.$table.find("thead tr .manage-column").each(function(){var e=i(this).attr("id");c.$table.find("tfoot tr .column-"+e).attr("id",e+"-foot")}),c.$table.find(".manage-column.column-cog").addClass("wpforms-table-cell-sticky")},initTableSortableColumns(){let s,a;c.$table.find("thead tr, tfoot tr").each(function(){i(this).sortable({items:"> th:not(:first-child):not(.wpforms-table-cell-sticky)",connectWith:"",delay:100,opacity:.75,cursor:"move",cancel:".wpforms-table-column-not-draggable",placeholder:"wpforms-table-column-drag-placeholder",appendTo:c.$page,zindex:1e4,tolerance:"intersect",distance:1,helper(e,t){var t=i(t),o=t.clone(),t=t.outerWidth();return o.css("width",t+"px")},start(e,t){t.helper.addClass("wpforms-table-column-drag-helper"),t.item.addClass("wpforms-table-column-dragged-out").css("display",""),c.$wpcontent.addClass("wpforms-no-scroll"),a=t.item.attr("id").replace("-foot","")},stop(e,t){t.item.removeClass("wpforms-table-column-drag-helper").removeClass("wpforms-table-column-dragged-out"),c.$table.find("thead tr > *, tfoot tr > *").removeClass("wpforms-table-column-drag-placeholder-prev"),c.$wpcontent.removeClass("wpforms-no-scroll");var o=t.item.prev().attr("id").replace("-foot",""),l=c.$table.find("tbody tr:not(.wpforms-hidden)"),n="cb"!==o?".column-"+o:".check-column";s=l.find("td.column-"+a).detach();for(let e=0;e<s.length;e++)l.eq(e).find(n).after(s.eq(e));o=0<t.item.closest("thead").length?"tfoot":"thead",t=c.$table.find(o+" tr .column-"+a).detach();c.$table.find(o+" tr "+n).after(t),d.updateMenuColumnsOrder()},change(e,t){c.$table.find("thead tr > *, tfoot tr > *").removeClass("wpforms-table-column-drag-placeholder-prev"),t.placeholder.prev().addClass("wpforms-table-column-drag-placeholder-prev")},update(){d.saveColumnsOrder()}})})},initTableScrollColumns(){c.$page.is("#wpforms-entries-list")&&(c.$tableScroll=c.$tableContainer,c.$tableScroll.addClass("wpforms-table-scroll"),c.$tableScroll.toggleClass("wpforms-scrollbar",d.isCustomScrollbarNeeded()),c.$table.find(".check-column, .column-indicators").addClass("wpforms-table-cell-sticky").addClass("left"),c.$table.find(".column-actions").addClass("wpforms-table-cell-sticky").addClass("right"))},tableScroll(){var e,t,o;c.$tableScroll?.length&&(e=c.$tableScroll.outerWidth(),t=Math.abs(c.$tableScroll.get(0).scrollLeft),o=c.$tableScroll.get(0).scrollWidth,c.$tableScroll.find(".wpforms-table-cell-sticky.left").toggleClass("shadow",1<t),c.$tableScroll.find(".wpforms-table-cell-sticky.right").toggleClass("shadow",t<=o-e))},windowResize(){c.$table.find("thead th, tfoot th").toggleClass("wpforms-table-column-not-draggable",l.innerWidth<=782),d.closeMenu(),d.windowResizeToggleColumns(),d.tableScroll()},windowResizeToggleColumns(){var e,t;c.$page.is("#wpforms-overview")&&(e=c.$table.find("thead tr th:visible"),t=c.$table.find(".column-tags"),960<l.innerWidth&&l.innerWidth<=1280?t.toggleClass("wpforms-hidden",4<e.length):t.removeClass("wpforms-hidden"),c.$menu.find("label").removeClass("wpforms-hidden"),c.$table.find("thead tr th:not(:visible)").each(function(){var e=i(this);c.$menu.find(`input[value="${e.attr("id")}"]`).closest("label").addClass("wpforms-hidden")}))},maybeShowNoResults(){["fields","meta"].forEach(e=>{var t=c.$menu.find(".wpforms-multiselect-checkbox-optgroup-"+e).nextUntil(".wpforms-multiselect-checkbox-optgroup").filter("label"),o=t.filter(function(){return i(this).is(":hidden")});c.$menu.find(".wpforms-multiselect-checkbox-no-results-"+e).toggleClass("wpforms-hidden",t.length!==o.length)})},closeMenu(){c.$cog.hasClass("active")&&(c.$cog.removeClass("active"),c.$menu.find(".wpforms-multiselect-checkbox-list").removeClass("open"),c.$searchInput.val(""),c.$searchInput[0]?.dispatchEvent(new Event("input")))},getColumnsOrder(){var e=c.$table.find("thead tr");const t=[];return e.find("th").each(function(){t.push(i(this).attr("id"))}),t},getMenuColumnsOrder(){let t=d.getColumnsOrder();const o=[];var l=[];c.$menu.find("input:checked").each(function(){o.push(i(this).val())}),t=t.map(function(e){return d.convertColumnId(e)});for(let e=0;e<t.length;e++){var n=t[e];o.includes(n)&&(l.push(n),o.splice(o.indexOf(n),1))}return l.concat(o)},saveColumnsOrder(){var e={nonce:wpforms_admin.nonce,action:c.$menu.find('[name="action"]').val(),form_id:c.$menu.find('[name="form_id"]').val(),columns:d.getColumnsOrder()};i.post(wpforms_admin.ajax_url,e).done(function(e){e.success||d.displayErrorModal(e.data||wpforms_admin.unknown_error)}).fail(function(){d.displayErrorModal(wpforms_admin.server_error)})},displayErrorModal(e){i.alert({title:wpforms_admin.uh_oh,content:e,icon:"fa fa-exclamation-circle",type:"red",buttons:{cancel:{text:wpforms_admin.close,btnClass:"btn-confirm",keys:["enter"]}}})},updateMenuColumnsOrder(){let o=d.getColumnsOrder();var e=c.$menu.find(".wpforms-multiselect-checkbox-optgroup"),l=c.$menu.find(".wpforms-multiselect-checkbox-items"),t=l.find("label");const n=[0];n[0]=t,e.length&&e.each(function(e){n[e]=i(this).nextUntil(".wpforms-multiselect-checkbox-optgroup")}),o=o.map(function(e){return d.convertColumnId(e)});for(let t=0;t<n.length;t++){n[t]=n[t].filter(function(){return 0<i(this).find("input:checked").length}),n[t].detach();var s=e.eq(t);for(let e=o.length-1;0<=e;e--){const r=o[e];var a=n[t].filter(function(){return 0<i(this).find(`[value="${r}"]`).length});a.length&&(s.length?s.after(a):l.prepend(a))}}},convertColumnId(e){let t=e.replace("wpforms_field_","");return t="notes_count"===(t="entry_id"===(t=t.replace("-foot",""))?"-1":t)?"-2":t},initMultiSelect(){c.$cog.length&&(c.$menu.find(".wpforms-list-table-ext-edit-columns-select").each(function(){var e=10<i(this).find("option").length,e=c.$page.is("#wpforms-entries-list")&&e,t=(new l.WPFormsMultiSelectCheckbox(this,{showMask:!0,showSearch:e,customOpener:c.$cog.get(0)}).init(),i(this).next(".wpforms-multiselect-checkbox-wrapper")),o=t.find(".wpforms-multiselect-checkbox-list");d.appendNoResultsText(o),e||t.find(".wpforms-multiselect-checkbox-items").addClass("wpforms-multiselect-checkbox-items-no-search"),o.append('<button type="button" class="button button-secondary" id="wpforms-list-table-ext-edit-columns-select-submit" data-value="save-table-columns">'+wpforms_admin.save_changes+"</button>"),d.updateMenuColumnsOrder()}),c.$searchInput=i("#wpforms-list-table-ext-edit-columns-select-container .wpforms-multiselect-checkbox-search"),c.$menu.removeClass("wpforms-hidden"))},appendNoResultsText(e){e.find(".wpforms-multiselect-checkbox-optgroup").each(function(e){var t=0===e?"fields":"meta",e=0===e?wpforms_admin.column_selector_no_fields:wpforms_admin.column_selector_no_meta;i(this).addClass("wpforms-multiselect-checkbox-optgroup-"+t).after(`<span class="wpforms-multiselect-checkbox-no-results wpforms-multiselect-checkbox-no-results-${t} wpforms-hidden">${e}</span>`)})},initCogIcon(){var e,t;return c.$cog||((e=c.$table.find("thead th:not(.hidden):last")).length?(t=o.cogIcon.replace("#",""),t=i(`<a href="#" title="${wpforms_admin.column_selector_title}" id="${t}"><i class="fa fa-cog" aria-hidden="true"></i></a>`),e.append(t),t):i())},onClickCog(e){e.preventDefault()},onSaveChanges(e){e.preventDefault();e={nonce:wpforms_admin.nonce,action:c.$menu.find('input[name="action"]').val(),form_id:c.$menu.find('input[name="form_id"]').val(),columns:d.getMenuColumnsOrder()};d.closeMenu(),i.post(wpforms_admin.ajax_url,e).done(function(e){e.success?l.location.reload():d.displayErrorModal(e.data||wpforms_admin.unknown_error)}).fail(function(){d.displayErrorModal(wpforms_admin.server_error)})},onMenuToggle(e){i(o.cogIcon).toggleClass("active",e.detail.isOpen),c.$menu.find(".wpforms-multiselect-checkbox-no-results").addClass("wpforms-hidden"),d.positionMultiselectColumnsMenu()},positionMultiselectColumnsMenu(){c.$cog.length&&c.$menu.css({top:c.$cog.offset().top-i("#wpbody-content").offset().top+c.$cog.outerHeight()+6})},isCustomScrollbarNeeded(){var e=navigator.userAgent;return(e.includes("Windows")||e.includes("Linux"))&&(e.includes("Chrome")||e.includes("Firefox"))}};return d}(document,window,jQuery);WPFormsAdminListTableExt.init();

Zerion Mini Shell 1.0