1 line
6.6 KiB
JavaScript
Raw Normal View History

2018-02-27 15:08:39 +02:00
!function(t){function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var e={};n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)}([function(t,n,e){e(1),e(2),t.exports=e(3)},function(t,n){!function(t){t.entwine("ss",function(t){t.entwine("colymba",function(t){t(".bulkManagerOptions").entwine({onmatch:function(){var n=this.parents("thead"),e=n.find("tr"),i=[".filter-header",".sortable-header"],s=n.find(i.join(",")),a=e.index(this),o=e.length-1;s.each(function(t,n){var i=e.index(n);i<o&&(o=i)}),a>o&&e.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(n){var e=t(n.target).find("input");t(e).prop("checked")?t(e).prop("checked",!1):t(e).prop("checked",!0)}}),t("td.col-bulkSelect input").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(n){t(this).parents(".grid-field__table").find("input.bulkSelectAll").prop("checked","")}}),t("input.bulkSelectAll").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(){var n=t(this).prop("checked");t(this).parents(".grid-field__table").find("td.col-bulkSelect input").prop("checked",n).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(n){var e=t(this).val(),i=t(this).parents(".bulkManagerOptions"),s=i.find(".doBulkActionButton"),a=s.data("config");if(t.each(a,function(t,n){t!=e&&s.removeClass(n.buttonClasses)}),!e)return void s.addClass("disabled");if(s.removeClass("disabled"),s.addClass(a[e].buttonClasses).addClass("btn-outline-secondary"),a[e].icon){var o=s.find("img");o.length?o.attr("src",a[e].icon):s.prepend('<img src="'+a[e].icon+'" alt="" />')}else s.find("img").remove();a[e].destructive?s.addClass("btn-outline-danger"):s.removeClass("btn-outline-danger")}}),t(".doBulkActionButton").entwine({onmatch:function(){},onunmatch:function(){},getActionURL:function(t,n){var e=(new Date).getTime();return n=n.split("?"),t=t?"/"+t:"",n=n[1]?n[0]+t+"?"+n[1]+"&cacheBuster="+e:n[0]+t+"?cacheBuster="+e},onclick:function(n){var e=t(this).parents(".bulkManagerOptions"),i=e.find("select.bulkActionName").val(),s=t(this).parents(".bulkManagerOptions").find("input.bulkSelectAll:first").getSelectRecordsID();this.doBulkAction(i,s)},doBulkAction:function(n,e,i,s){var a=t(this).parents(".bulkManagerOptions"),o=a.find("a.doBulkActionButton"),l=o.data("config"),d=this.getActionURL(n,t(this).data("url")),c={records:e};if(e.length<=0)return void alert(ss.i18n._t("GRIDFIELD_BULK_MANAGER.BULKACTION_EMPTY_SELECT"));if(l[n].destructive&&!confirm(ss.i18n._t("GRIDFIELD_BULK_MANAGER.CONFIRM_DESTRUCTIVE_ACTION")))return i&&s&&i.call(s,!1),!1;if(o.addClass("loading"),l[n].xhr)t.ajax({url:d,data:c,type:"POST",context:t(this)}).done(function(n,e,a){o.removeClass("loading"),i&&s?i.call(s,n):t(this).parents(".ss-gridfield").entwine(".").entwine("ss").reload()});else{d=d+"&"+("records[]="+e.join("&records[]=")),window.location.href=d}}})})})}(jQuery)},function(t,n){!function(t){t.entwine("colymba",function(t){t("#bulkEditToggle").entwine({onmatch:function(){},onunmatch:function(){},onclick:function(n){var e=this.parents("form").find(".ss-toggle .ui-accordion-header"),i=this.data("state");i=i&&"close"!==i?"close":"open",e.each(function(){var n=t(this