silverstripe-framework/admin/client/dist/js/bundle-framework.js

11 lines
102 KiB
JavaScript
Raw Normal View History

2016-09-14 14:07:13 +02:00
!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(){h["default"].add("config",g["default"]),h["default"].add("form",w["default"]),h["default"].add("schemas",T["default"]),h["default"].add("records",P["default"]),h["default"].add("campaign",j["default"]),h["default"].add("breadcrumbs",A["default"]),h["default"].add("routing",te.routerReducer),m["default"].register("TextField",I["default"]),m["default"].register("HiddenField",N["default"]),m["default"].register("GridField",U["default"]),m["default"].register("SingleSelectField",M["default"]),m["default"].register("PopoverField",G["default"]),m["default"].register("HeaderField",Q["default"]),m["default"].register("LiteralField",K["default"]),m["default"].register("HtmlReadonlyField",W["default"]),m["default"].register("CompositeField",J["default"]),m["default"].register("Tabs",z["default"]),m["default"].register("TabItem",ee["default"]),m["default"].register("FormAction",B["default"]);var e={},t=(0,s.combineReducers)(h["default"].getAll()),r=[c["default"]],n=p["default"].get("environment"),o=p["default"].get("debugging"),a=s.applyMiddleware.apply(void 0,r),i=window.devToolsExtension;"dev"===n&&o&&"function"==typeof i&&(a=(0,s.compose)(s.applyMiddleware.apply(void 0,r),i()));var l=a(s.createStore),f=l(t,e);f.dispatch(v.setConfig(p["default"].getAll())),window.ss=window.ss||{},window.ss.store=f;var d=new u["default"](f);d.start(window.location.pathname)}var i=r(2),u=o(i),s=r(30),l=r(31),c=o(l),f=r(24),p=o(f),d=r(32),h=o(d),y=r(33),m=o(y),b=r(34),v=n(b),_=r(36),g=o(_),E=r(38),w=o(E),O=r(40),T=o(O),C=r(42),P=o(C),S=r(44),j=o(S),R=r(46),A=o(R),k=r(48),I=o(k),x=r(50),M=o(x),D=r(52),N=o(D),L=r(53),U=o(L),F=r(54),B=o(F),H=r(55),G=o(H),q=r(57),Q=o(q),V=r(58),K=o(V),Y=r(59),W=o(Y),$=r(60),J=o($),X=r(61),z=o(X),Z=r(62),ee=o(Z),te=r(29),re=r(63),ne=o(re);window.onload=a},function(e,t){e.exports=jQuery},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),u=n(i),s=r(3),l=n(s),c=r(4),f=n(c),p=r(5),d=r(6),h=r(7),y=n(h),m=r(24),b=n(m),v=r(25),_=n(v),g=r(26),E=n(g),w=r(27),O=n(w),T=r(29),C=function(){function e(t){o(this,e),this.store=t;var r=b["default"].get("absoluteBaseUrl");_["default"].setAbsoluteBase(r)}return a(e,[{key:"start",value:function t(e){this.matchesLegacyRoute(e)?this.initLegacyRouter():this.initReactRouter()}},{key:"matchesLegacyRoute",value:function r(e){var t=b["default"].get("sections"),r=_["default"].resolveURLToBase(e).replace(/\/$/,"");return!!Object.keys(t).find(function(e){var n=t[e],o=_["default"].resolveURLToBase(n.url).replace(/\/$/,"");return!n.reactRouter&&r.match(o)})}},{key:"initReactRouter",value:function n(){E["default"].updateRootRoute({component:O["default"]});var e=(0,T.syncHistoryWithStore)((0,d.useRouterHistory)(y["default"])({basename:b["default"].get("baseUrl")}),this.store);f["default"].render(l["default"].createElement(p.Provider,{store:this.store},l["default"].createElement(d.Router,{history:e,routes:E["default"].getRootRoute()})),document.getElementsByClassName("cms-content")[0])}},{key:"initLegacyRouter",value:function i(){var e=b["default"].get("sections"),t=this.store;(0,_["default"])("*",function(e,r){e.store=t,r()});var r=null;Object.keys(e).forEach(function(t){var n=_["default"].resolveURLToBase(e[t].url);n=n.replace(/\/$/,""),
}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(3),l=n(s),c=r(28),f=n(c),p=r(49),d=n(p),h=r(51),y=n(h),m=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.handleChange=r.handleChange.bind(r),r}return i(t,e),u(t,[{key:"render",value:function r(){var e=null;return e=this.props.readOnly?this.getReadonlyField():this.getSelectField()}},{key:"getReadonlyField",value:function n(){var e=this,t=this.props.source&&this.props.source.find(function(t){return t.value===e.props.value});return t="string"==typeof t?t:this.props.value,l["default"].createElement("div",null,l["default"].createElement("i",null,t))}},{key:"getSelectField",value:function s(){var e=this,t=this.props.source||[];return this.props.data.hasEmptyDefault&&!t.find(function(e){return!e.value})&&t.unshift({value:"",title:this.props.data.emptyString,disabled:!1}),l["default"].createElement("select",this.getInputProps(),t.map(function(t,r){var n=e.props.name+"-"+(t.value||"empty"+r);return l["default"].createElement("option",{key:n,value:t.value,disabled:t.disabled},t.title)}))}},{key:"getInputProps",value:function c(){return{className:["form-control",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.handleChange,value:this.props.value}}},{key:"handleChange",value:function f(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{id:this.props.id,value:e.target.value})}}]),t}(f["default"]);m.propTypes={id:l["default"].PropTypes.string,name:l["default"].PropTypes.string.isRequired,onChange:l["default"].PropTypes.func,value:l["default"].PropTypes.oneOfType([l["default"].PropTypes.string,l["default"].PropTypes.number]),readOnly:l["default"].PropTypes.bool,source:l["default"].PropTypes.arrayOf(l["default"].PropTypes.shape({value:l["default"].PropTypes.oneOfType([l["default"].PropTypes.string,l["default"].PropTypes.number]),title:l["default"].PropTypes.any,disabled:l["default"].PropTypes.bool})),data:l["default"].PropTypes.oneOfType([l["default"].PropTypes.array,l["default"].PropTypes.shape({hasEmptyDefault:l["default"].PropTypes.bool,emptyString:l["default"].PropTypes.string})])},m.defaultProps={source:[],data:{emptyString:y["default"]._t("Boolean.ANY","Any")}},t["default"]=(0,d["default"])(m)},function(e,t){e.exports=i18n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(3),l=n(s),c=r(28),f=n(c),p=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||O
itemLinks:r,itemId:t}))}},{key:"handleItemSelected",value:function s(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"renderButtonToolbar",value:function l(){var e=this.getItems();if(!e||!e.length)return h["default"].createElement("div",{className:"btn-toolbar"});var t={};return"open"===this.props.record.State?t=c(t,{title:G["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(t=c(t,{title:G["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"default",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{className:"btn-toolbar"},h["default"].createElement(M["default"],t))}},{key:"getItems",value:function d(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{key:"groupItemsForSet",value:function y(){var e={},t=this.getItems();return t?(t.forEach(function(t){var r=t.BaseClass;e[r]||(e[r]={singular:t.Singular,plural:t.Plural,items:[]}),e[r].items.push(t)}),e):e}},{key:"handlePublish",value:function m(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId)}}]),t}(T["default"]);q.propTypes={campaign:h["default"].PropTypes.shape({isPublishing:h["default"].PropTypes.bool.isRequired,changeSetItemId:h["default"].PropTypes.number}),breadcrumbsActions:h["default"].PropTypes.object.isRequired,campaignActions:h["default"].PropTypes.object.isRequired,publishApi:h["default"].PropTypes.func.isRequired,record:h["default"].PropTypes.object.isRequired,recordActions:h["default"].PropTypes.object.isRequired,sectionConfig:h["default"].PropTypes.object.isRequired,handleBackButtonClick:h["default"].PropTypes.func},t["default"]=(0,m.connect)(s,l)(q)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=["id"];return r.reduce(function(e,r){return e.replace(":"+r,t[r])},e)}function a(e,t,r){var n={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORDS_REQUEST,payload:n});var u="get"===i?[o(r,n),a]:[o(r,n),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(r){t({type:l["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:r}})})["catch"](function(r){t({type:l["default"].FETCH_RECORDS_FAILURE,payload:{error:r,recordType:e}})})}}function i(e,t,r){var n={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORD_REQUEST,payload:n});var u="get"===i?[o(r,n),a]:[o(r,n),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(r){t({type:l["default"].FETCH_RECORD_SUCCESS,payload:{recordType:e,data:r}})})["catch"](function(r){t({type:l["default"].FETCH_RECORD_FAILURE,payload:{error:r,recordType:e}})})}}function u(e,t,r,n){var a=arguments.length<=4||void 0===arguments[4]?{}:arguments[4],i={recordType:e,id:t},u=r.toLowerCase(),s="get"===u?[o(n,i),a]:[o(n,i),{},a];return function(r){return r({type:l["default"].DELETE_RECORD_REQUEST,payload:i}),f["default"][u].apply(f["default"],s).then(function(){r({type:l["default"].DELETE_RECORD_SUCCESS,payload:{recordType:e,id:t}})})["catch"](function(n){r({type:l["default"].DELETE_RECORD_FAILURE,payload:{error:n,recordType:e,id:t}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchRecords=a,t.fetchRecord=i,t.deleteRecord=u;var s=r(43),l=n(s),c=r(72),f=n(c)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){var t=null,r=null;if(!(e.status>=200&&e.status<300))throw r=new Error(e.statusText),r.response=e,r;return t=e}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version 3.3.1
*/
!function(t,r){e.exports=r()}(this,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function a(e){return"function"==typeof e}function i(e){J=e}function u(e){X=e}function s(){return function(){return t.nextTick(d)}}function l(){return function(){$(d)}}function c(){var e=0,t=new ee(d),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=d,function(){return e.port2.postMessage(0)}}function p(){var e=setTimeout;return function(){return e(d,1)}}function d(){for(var e=0;e<W;e+=2){var t=ne[e],r=ne[e+1];t(r),ne[e]=void 0,ne[e+1]=void 0}W=0}function h(){try{var e=n,t=r(77);return $=t.runOnLoop||t.runOnContext,l()}catch(o){return p()}}function y(e,t){var r=arguments,n=this,o=new this.constructor(b);void 0===o[ae]&&N(o);var a=n._state;return a?!function(){var e=r[a-1];X(function(){return x(a,o,e,n._result)})}():R(n,o,e,t),o}function m(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(b);return C(r,e),r}function b(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(t){return le.error=t,le}}function E(e,t,r,n){try{e.call(t,r,n)}catch(o){return o}}function w(e,t,r){X(function(e){var n=!1,o=E(r,t,function(r){n||(n=!0,t!==r?C(e,r):S(e,r))},function(t){n||(n=!0,j(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,j(e,o))},e)}function O(e,t){t._state===ue?S(e,t._result):t._state===se?j(e,t._result):R(t,void 0,function(t){return C(e,t)},function(t){return j(e,t)})}function T(e,t,r){t.constructor===e.constructor&&r===y&&t.constructor.resolve===m?O(e,t):r===le?j(e,le.error):void 0===r?S(e,t):a(r)?w(e,t,r):S(e,t)}function C(t,r){t===r?j(t,v()):e(r)?T(t,r,g(r)):S(t,r)}function P(e){e._onerror&&e._onerror(e._result),A(e)}function S(e,t){e._state===ie&&(e._result=t,e._state=ue,0!==e._subscribers.length&&X(A,e))}function j(e,t){e._state===ie&&(e._state=se,e._result=t,X(P,e))}function R(e,t,r,n){var o=e._subscribers,a=o.length;e._onerror=null,o[a]=t,o[a+ue]=r,o[a+se]=n,0===a&&e._state&&X(A,e)}function A(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,a=e._result,i=0;i<t.length;i+=3)n=t[i],o=t[i+r],n?x(r,n,o,a):o(a);e._subscribers.length=0}}function k(){this.error=null}function I(e,t){try{return e(t)}catch(r){return ce.error=r,ce}}function x(e,t,r,n){var o=a(r),i=void 0,u=void 0,s=void 0,l=void 0;if(o){if(i=I(r,n),i===ce?(l=!0,u=i.error,i=null):s=!0,t===i)return void j(t,_())}else i=n,s=!0;t._state!==ie||(o&&s?C(t,i):l?j(t,u):e===ue?S(t,i):e===se&&j(t,i))}function M(e,t){try{t(function n(t){C(e,t)},function o(t){j(e,t)})}catch(r){j(e,r)}}function D(){return fe++}function N(e){e[ae]=fe++,e._state=void 0,e._result=void 0,e._subscribers=[]}function L(e,t){this._instanceConstructor=e,this.promise=new e(b),this.promise[ae]||N(this.promise),Y(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&S(this.promise,this._result))):j(this.promise,U())}function U(){return new Error("Array Methods must be provided an Array")}function F(e){return new L(this,e).promise}function B(e){var t=this;return new t(Y(e)?function(r,n){for(var o=e.length,a=0;a<o;a++)t.resolve(e[a]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function H(e){var t=this,r=new t(b);return j(r,e),r}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function Q(e){this[ae]=D(),this._result=this._state=void 0,this._subscribers=[],b!==e&&("function"!=typeof e&&G(),this instanceof Q?M(this,e):q())}function V(){var
//# sourceMappingURL=bundle-framework.js.map