silverstripe-cms/client/dist/js/bundle.js

1 line
26 KiB
JavaScript
Raw Normal View History

!function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,a){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=22)}([function(t,e){t.exports=jQuery},function(t,e){t.exports=i18n},function(t,e){t.exports=Injector},function(t,e){t.exports=React},,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={ANCHORSELECTOR_UPDATED:"ANCHORSELECTOR_UPDATED",ANCHORSELECTOR_UPDATING:"ANCHORSELECTOR_UPDATING",ANCHORSELECTOR_UPDATE_FAILED:"ANCHORSELECTOR_UPDATE_FAILED"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={SUCCESS:"SUCCESS",DIRTY:"DIRTY",UPDATING:"UPDATING",FAILED:"FAILED"}},function(t,e){t.exports=Redux},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}var i=n(21),o=a(i),r=n(20),s=a(r);window.document.addEventListener("DOMContentLoaded",function(){(0,s.default)(),(0,o.default)()})},function(t,e,n){"use strict";var a=n(0);(function(t){return t&&t.__esModule?t:{default:t}})(a).default.entwine("ss",function(t){t(".TreeDropdownField").entwine({OldValue:null}),t("#Form_AddForm_ParentID_Holder .treedropdownfield").entwine({onmatch:function(){this._super(),t(".cms-add-form").updateTypeList()}}),t(".cms-add-form .parent-mode :input").entwine({onclick:function(t){var e=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");"top"==this.val()?(e.setOldValue(e.getValue()),e.setValue(0)):(e.setValue(e.getOldValue()||0),e.setOldValue(null)),e.refresh(),e.trigger("change")}}),t(".cms-add-form").entwine({ParentCache:{},onadd:function(){var e=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").bind("change",function(){e.updateTypeList()}),this.find(".SelectionGroup.parent-mode").bind("change",function(){e.updateTypeList()}),"top"==t(".cms-add-form .parent-mode :input").val()&&this.updateTypeList()},loadCachedChildren:function(t){var e=this.getParentCache();return void 0!==e[t]?e[t]:null},saveCachedChildren:function(t,e){var n=this.getParentCache();n[t]=e,this.setParentCache(n)},updateTypeList:function(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID"),a=this.find("input[name=ParentModeField]:checked").val(),i=n.data("metadata"),o="child"===a?n.getValue():null,r=i?i.ClassName:null,s=r&&"child"===a&&o?r:"Root",d=void 0!==e[s]?e[s]:null,l=this,u=d&&void 0!==d.defaultChild?d.defaultChild:null,c=[];if(o){if(this.hasClass("loading"))return;return this.addClass("loading"),null!==(c=this.loadCachedChildren(o))?(this.updateSelectionFilter(c,u),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),data:{ParentID:o},success:function(t){l.saveCachedChildren(o,t),l.updateSelectionFilter(t,u)},complete:function(){l.removeClass("loading")}}),!1)}c=d&&void 0!==d.disallowedChildren?d.disallowedChildren:[],this.updateSelectionFilter(c,u)},updateSelectionFilter:function(e,n){var a=null;if(this.find("#Form_AddForm_PageType div.radio").each(function(){var n=t(this).find("input").val(),i=-1===t.inArray(n,e);t(this).setEnabled(i),i||t(this).setSelected(!1),a=null===a?i:a&&i}),n)var i=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first");else var i=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first");i.setSelected(!0),i.siblings().setSelected(!1),this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?this.find("button[name=action_doAdd]").removeAttr("disabled"):this.find("button[name=action_doAdd]").attr("disabled","disabled"),this.find(".message-restricted")[a?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function(t){this.setSelected(!0)},setSelected:function(t){var e=this.find("input");t&&!e.is(":disabled")?(this.siblings().