GridFieldBulkEditingTools/client/dist/js/bulkTools.js

1 line
8.9 KiB
JavaScript
Raw Normal View History

2018-02-01 08:39:12 +01:00
!function(t){function i(e){if(n[e])return n[e].exports;var a=n[e]={i:e,l:!1,exports:{}};return t[e].call(a.exports,a,a.exports,i),a.l=!0,a.exports}var n={};i.m=t,i.c=n,i.d=function(t,n,e){i.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:e})},i.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(n,"a",n),n},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="",i(i.s=0)}([function(t,i,n){n(1),n(2),t.exports=n(3)},function(t,i){!function(t){t.entwine("ss",function(t){t.entwine("colymba",function(t){t(".bulkManagerOptions").entwine({onmatch:function(){var i=this.parents("thead"),n=i.find("tr"),e=[".filter-header",".sortable-header"],a=i.find(e.join(",")),s=n.index(this),o=n.length-1;a.each(function(t,i){var e=n.index(i);e<o&&(o=e)}),s>o&&n.eq(o).insertAfter(t(this))},onunmatch:function(){}}),t("td.col-bulkSelect").entwine({onmatch:function(){},onunmatch:function(){},onmouseover:function(){t(this).parents(".ss-gridfield-item").find(".edit-link").removeClass("edit-link").addClass("tempDisabledEditLink")},onmouseout:function(){t(this).parents(".ss-gridfield-item").find(".tempDisabledEditLink").addClass("edit-link").removeClass("tempDisabledEditLink")},onclick:function(i){var n=t(i.target).find("input");t(n).prop("checked")?t(n).prop("checked",!1):t(n).prop("checked",!0)}}),t("td.col-bulkSelect input").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(i){t(this).parents(".grid-field__table").find("input.bulkSelectAll").prop("checked","")}}),t("input.bulkSelectAll").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(){var i=t(this).prop("checked");t(this).parents(".grid-field__table").find("td.col-bulkSelect input").prop("checked",i).trigger("change")},getSelectRecordsID:function(){return t(this).parents(".grid-field__table").find("td.col-bulkSelect input:checked").map(function(){return parseInt(t(this).data("record"))}).get()}}),t("select.bulkActionName").entwine({onmatch:function(){},onunmatch:function(){},onchange:function(i){var n=t(this).val(),e=t(this).parents(".bulkManagerOptions"),a=e.find(".doBulkActionButton"),s=a.data("config"),o=e.find(".doBulkActionButton .ui-icon");t.each(s,function(t,i){t!=n&&o.removeClass("btn-icon-"+i.icon)}),o.addClass("btn-icon-"+s[n].icon),s[n].isDestructive?a.addClass("ss-ui-action-destructive"):a.removeClass("ss-ui-action-destructive")}}),t(".doBulkActionButton").entwine({onmatch:function(){},onunmatch:function(){},getActionURL:function(t,i){var n=(new Date).getTime();return i=i.split("?"),t=t?"/"+t:"",i=i[1]?i[0]+t+"?"+i[1]+"&cacheBuster="+n:i[0]+t+"?cacheBuster="+n},onclick:function(i){var n=t(this).parents(".bulkManagerOptions"),e=n.find("select.bulkActionName").val(),a=t(this).parents(".bulkManagerOptions").find("input.bulkSelectAll:first").getSelectRecordsID();this.doBulkAction(e,a)},doBulkAction:function(i,n,e,a){var s=t(this).parents(".bulkManagerOptions"),o=s.find("a.doBulkActionButton"),d=o.data("config"),l=this.getActionURL(i,t(this).data("url")),r={records:n};if(n.length<=0)return void alert(ss.i18n._t("GRIDFIELD_BULK_MANAGER.BULKACTION_EMPTY_SELECT"));if(d[i].isDestructive&&!confirm(ss.i18n._t("GRIDFIELD_BULK_MANAGER.CONFIRM_DESTRUCTIVE_ACTION")))return e&&a&&e.call(a,!1),!1;if(o.addClass("loading"),d[i].isAjax)t.ajax({url:l,data:r,type:"POST",context:t(this)}).done(function(i,n,s){o.removeClass("loading"),e&&a?e.call(a,i):t(this).parents(".ss-gridfield").entwine(".").entwine("ss").reload()});else{l=l+"&"+("records[]="+n.join("&records[]=")),window.location.href=l}}})})})}(jQuery)},function(t,i){!function(t){t.entwine("colymba",function(t){t("#bulkEditToggle").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(i){var n=this.parents("form").find(".ss-toggle .ui-accordion-header"),e=this.data("state");e=e&&"close"!==e?"close":"open",n.each(function(){var i=t(this);"open"!==e||i.hasClass("ui-state-active")||i.click(),"close"===e&&i.hasClass("ui-state-active")&&i.click()}),this.data("state",e)}}),t(".bulkEditingFieldHolder").entwine({onmat