2023-01-18 01:11:33 +01:00
|
|
|
!function(){"use strict";var e={157:function(e,t,i){var s;((s=i(311))&&s.__esModule?s:{default:s}).default.entwine("ss",(e=>{window.bulkTools={gridfieldRefresh(e,t){t.isError||(t.isDestructive?this.removeGridFieldRows(e,t.records.success):this.updateGridFieldRows(e,t.records.success),this.failedGridFieldRows(e,t.records.failed))},getGridFieldRow(e,t){return e.find(`.ss-gridfield-item[data-id="${t.id}"][data-class="${t.class}"]`)},cleanGridFieldRow(e){return e.removeClass("bt-deleted bt-failed bt-updated").removeAttr("bt-error")},removeGridFieldRows(e,t){t.forEach((function(t){this.getGridFieldRow(e,t).addClass("bt-deleted").fadeOut(2e3)}),this),e.entwine(".").entwine("ss").delay(2e3).reload()},failedGridFieldRows(e,t){t.forEach((function(t){this.getGridFieldRow(e,t).addClass("bt-failed").attr("bt-error",t.message)}),this)},updateGridFieldRows(t,i){t.find(".ss-gridfield-item.ss-gridfield-no-items").remove(),i.forEach((function(i){const s=this.getGridFieldRow(t,i),d=e(i.row).addClass("bt-updated");1===s.length?s.replaceWith(d):t.find(".ss-gridfield-items").prepend(d)}),this)}}}))},572:function(e,t,i){var s=n(i(311)),d=n(i(754));function n(e){return e&&e.__esModule?e:{default:e}}s.default.entwine("colymba",(e=>{e(".bulkManagerOptions").entwine({onmatch(){const t=this.parents("thead"),i=t.find("tr"),s=t.find([".filter-header",".sortable-header"].join(",")),d=i.index(this);let n=i.length-1;s.each(((e,t)=>{const s=i.index(t);s<n&&(n=s)})),d>n&&i.eq(n).insertAfter(e(this))}}),e("td.col-bulkSelect").entwine({onmouseover(){e(this).parents(".ss-gridfield-item").find(".edit-link").removeClass("edit-link").addClass("tempDisabledEditLink")},onmouseout(){e(this).parents(".ss-gridfield-item").find(".tempDisabledEditLink").addClass("edit-link").removeClass("tempDisabledEditLink")},onclick(t){const i=e(t.target).find("input");e(i).prop("checked")?e(i).prop("checked",!1):e(i).prop("checked",!0)}}),e("td.col-bulkSelect input").entwine({onmatch(){},onunmatch(){},onclick(){e(this).parents(".grid-field__table").find("input.bulkSelectAll").prop("checked","")}}),e("input.bulkSelectAll").entwine({onclick(){const t=e(this).prop("checked");e(this).parents(".grid-field__table").find("td.col-bulkSelect input").prop("checked",t).trigger("change")},getSelectRecordsID(){return e(this).parents(".grid-field__table").find("td.col-bulkSelect input:checked").map((function(){return parseInt(e(this).data("record"),10)})).get()}}),e("select.bulkActionName").entwine({onchange(){const t=e(this).val(),i=e(this).parents(".bulkManagerOptions").find(".doBulkActionButton"),s=i.data("config");if(e.each(s,((e,s)=>{e!==t&&i.removeClass(s.buttonClasses)})),t){if(i.removeClass("disabled"),i.addClass(s[t].buttonClasses).addClass("btn-outline-secondary"),s[t].icon){const e=i.find("img");e.length?e.attr("src",s[t].icon):i.prepend(`<img src="${s[t].icon}" alt="" />`)}else i.find("img").remove();s[t].destructive?i.addClass("btn-outline-danger"):i.removeClass("btn-outline-danger")}else i.addClass("disabled")}}),e(".doBulkActionButton").entwine({getActionURL(e,t){const i=(new Date).getTime();let s=t.split("?"),d="";return e&&(d=`/${e}`),s=s[1]?`${s[0]+d}?${s[1]}&cacheBuster=${i}`:`${s[0]+d}?cacheBuster=${i}`,s},onclick(){const t=e(this).parents(".bulkManagerOptions").find("select.bulkActionName").val(),i=e(this).parents(".bulkManagerOptions").find("input.bulkSelectAll:first").getSelectRecordsID();this.doBulkAction(t,i)},doBulkAction(t,i){const{bulkTools:s}=window,n=e(this).parents(".bulkManagerOptions"),a=n.find("a.doBulkActionButton"),r=n.find(".message"),l=a.data("config");let o=this.getActionURL(t,e(this).data("url"));const c={records:i};if(i.length<=0)return alert(d.default._t("GRIDFIELD_BULK_MANAGER.BULKACTION_EMPTY_SELECT")),!1;if(l[t].destructive&&!confirm(d.default._t("GRIDFIELD_BULK_MANAGER.CONFIRM_DESTRUCTIVE_ACTION")))return!1;if(a.addClass("loading"),r.removeClass("static show error warning"),l[t].xhr)e.ajax({url:o,data:c,type:"POST",context:e(this)}).always((function(t){let i=t;a.removeClass("loading"),t.responseText&&(i=JSON.parse(t.responseText)),r.html(i.message
|