GridFieldBulkEditingTools/client/dist/js/main.js

1 line
6.8 KiB
JavaScript
Raw Normal View History

!function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}({"./client/src/js/bulkTools.js":function(e,t,n){(function(e){window.bulkTools={gridfieldRefresh:function(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:function(e,t){return e.find('.ss-gridfield-item[data-id="'+t.id+'"][data-class="'+t.class+'"]')},cleanGridFieldRow:function(e){return e.removeClass("bt-deleted bt-failed bt-updated").removeAttr("bt-error")},removeGridFieldRows:function(e,t){t.forEach(function(t){this.getGridFieldRow(e,t).addClass("bt-deleted").fadeOut(2e3)},this),e.entwine(".").entwine("ss").delay(2e3).reload()},failedGridFieldRows:function(e,t){t.forEach(function(t){this.getGridFieldRow(e,t).addClass("bt-failed").attr("bt-error",t.message)},this)},updateGridFieldRows:function(t,n){t.find(".ss-gridfield-item.ss-gridfield-no-items").remove(),n.forEach(function(n){var i=this.getGridFieldRow(t,n),s=e(n.row).addClass("bt-updated");1===i.length?i.replaceWith(s):t.find(".ss-gridfield-items").prepend(s)},this)}}}).call(t,n("jquery"))},"./client/src/js/manager.js":function(e,t,n){(function(e){!function(e){e.entwine("ss",function(e){e.entwine("colymba",function(e){e(".bulkManagerOptions").entwine({onmatch:function(){var t=this.parents("thead"),n=t.find("tr"),i=[".filter-header",".sortable-header"],s=t.find(i.join(",")),o=n.index(this),a=n.length-1;s.each(function(e,t){var i=n.index(t);i<a&&(a=i)}),o>a&&n.eq(a).insertAfter(e(this))},onunmatch:function(){}}),e("td.col-bulkSelect").entwine({onmatch:function(){},onunmatch:function(){},onmouseover:function(){e(this).parents(".ss-gridfield-item").find(".edit-link").removeClass("edit-link").addClass("tempDisabledEditLink")},onmouseout:function(){e(this).parents(".ss-gridfield-item").find(".tempDisabledEditLink").addClass("edit-link").removeClass("tempDisabledEditLink")},onclick:function(t){var n=e(t.target).find("input");e(n).prop("checked")?e(n).prop("checked",!1):e(n).prop("checked",!0)}}),e("td.col-bulkSelect input").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(t){e(this).parents(".grid-field__table").find("input.bulkSelectAll").prop("checked","")}}),e("input.bulkSelectAll").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(){var t=e(this).prop("checked");e(this).parents(".grid-field__table").find("td.col-bulkSelect input").prop("checked",t).trigger("change")},getSelectRecordsID:function(){return e(this).parents(".grid-field__table").find("td.col-bulkSelect input:checked").map(function(){return parseInt(e(this).data("record"))}).get()}}),e("select.bulkActionName").entwine({onmatch:function(){},onunmatch:function(){},onchange:function(t){var n=e(this).val(),i=e(this).parents(".bulkManagerOptions"),s=i.find(".doBulkActionButton"),o=s.data("config");if(e.each(o,function(e,t){e!=n&&s.removeClass(t.buttonClasses)}),!n)return void s.addClass("disabled");if(s.removeClass("disabled"),s.addClass(o[n].buttonClasses).addClass("btn-outline-secondary"),o[n].icon){var a=s.find("img");a.length?a.attr("src",o[n].icon):s.prepend('<img src="'+o[n].icon+'" alt="" />')}else s.find("img").remove();o[n].destructive?s.addClass("btn-outline-danger"):s.removeClass("btn-outline-danger")}}),e(".doBulkActionButton").entwine({onmatch:function(){},onunmatch:function(){},getActionURL:function(e,t){var n=(new Date).getTime();return t=t.split("?"),e=e?"/"+e:"",t=t[1]?t[0]+e+"?"+t[1]+"&cacheBuster="+n:t[0]+e+"?cacheBuster="+n},onclick:function(t){var n=e(this).parents(".bulkManagerOptions"),i=n.find("select.bulkActionName").val(),s=e(this).parents(".bulkManagerOption