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

11 lines
103 KiB
JavaScript
Raw Normal View History

!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);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",k["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",$["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()),n=[c["default"]],r=p["default"].get("environment"),o=p["default"].get("debugging"),a=s.applyMiddleware.apply(void 0,n),i=window.devToolsExtension;"dev"===r&&o&&"function"==typeof i&&(a=(0,s.compose)(s.applyMiddleware.apply(void 0,n),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=n(2),u=o(i),s=n(30),l=n(31),c=o(l),f=n(24),p=o(f),d=n(32),h=o(d),y=n(33),m=o(y),b=n(34),v=r(b),_=n(36),g=o(_),E=n(38),w=o(E),O=n(40),T=o(O),C=n(42),P=o(C),S=n(44),j=o(S),R=n(46),k=o(R),A=n(48),I=o(A),x=n(50),M=o(x),D=n(52),N=o(D),L=n(53),U=o(L),F=n(54),B=o(F),H=n(55),G=o(H),q=n(57),Q=o(q),V=n(58),K=o(V),Y=n(59),W=o(Y),J=n(60),$=o(J),X=n(61),z=o(X),Z=n(62),ee=o(Z),te=n(29),ne=n(63),re=o(ne);window.onload=a},function(e,t){e.exports=jQuery},function(e,t,n){"use strict";function r(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 n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),u=r(i),s=n(3),l=r(s),c=n(4),f=r(c),p=n(5),d=n(6),h=n(7),y=r(h),m=n(24),b=r(m),v=n(25),_=r(v),g=n(26),E=r(g),w=n(27),O=r(w),T=n(29),C=function(){function e(t){o(this,e),this.store=t;var n=b["default"].get("absoluteBaseUrl");_["default"].setAbsoluteBase(n)}return a(e,[{key:"start",value:function t(e){this.matchesLegacyRoute(e)?this.initLegacyRouter():this.initReactRouter()}},{key:"matchesLegacyRoute",value:function n(e){var t=b["default"].get("sections"),n=_["default"].resolveURLToBase(e).replace(/\/$/,"");return!!Object.keys(t).find(function(e){var r=t[e],o=_["default"].resolveURLToBase(r.url).replace(/\/$/,"");return!r.reactRouter&&n.match(o)})}},{key:"initReactRouter",value:function r(){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,n){e.store=t,n()});var n=null;Object.keys(e).forEach(function(t){var r=_["default"].resolveURLToBase(e[t].url);r=r.replace(/\/$/,""),
extraClass:p["default"].PropTypes.string,holder_id:p["default"].PropTypes.string,id:p["default"].PropTypes.string,description:p["default"].PropTypes.oneOfType([p["default"].PropTypes.string,p["default"].PropTypes.object])},t}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(3),p=r(f),d=n(28),h=r(d);t["default"]=u},function(e,t,n){"use strict";function r(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 n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=n(49),d=r(p),h=n(51),y=r(h),m=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=n.handleChange.bind(n),n}return i(t,e),u(t,[{key:"render",value:function n(){var e=null;return e=this.props.readOnly?this.getReadonlyField():this.getSelectField()}},{key:"getReadonlyField",value:function r(){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,n){var r=e.props.name+"-"+(t.value||"empty"+n);return l["default"].createElement("option",{key:r,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["def
className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting"," ",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options")," popup on"," ","the ",h["default"].createElement("a",{href:u},"edit page screen"),"."),l=["container-fluid","campaign-items","panel-scrollable","panel-scrollable--double-toolbar"];return h["default"].createElement("div",{className:"cms-content__split cms-content__split--left-sm"},h["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},h["default"].createElement(I["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{className:l.join(" ")},s),h["default"].createElement("div",{className:"toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,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 n=t.BaseClass;e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].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,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=["id"];return n.reduce(function(e,n){return e.replace(":"+n,t[n])},e)}function a(e,t,n){var r={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORDS_REQUEST,payload:r});var u="get"===i?[o(n,r),a]:[o(n,r),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(n){t({type:l["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:n}})})["catch"](function(n){t({type:l["default"].FETCH_RECORDS_FAILURE,payload:{error:n,recordType:e}})})}}function i(e,t,n){var r={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORD_REQUEST,payload:r});var u="get"===i?[o(n,r),a]:[o(n,r),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(n){t({type:l["default"].FETCH_RECORD_SUCCESS,payload:{recordType:e,data:n}})})["catch"](function(n){t({type:l["default"].FETCH_RECORD_FAILURE,payload:{error:n,recordType:e}})})}}function u(e,t,n,r){var a=arguments.length<=4||void
2016-09-14 14:07:13 +02:00
* @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,n){e.exports=n()}(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){$=e}function u(e){X=e}function s(){return function(){return t.nextTick(d)}}function l(){return function(){J(d)}}function c(){var e=0,t=new ee(d),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.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=re[e],n=re[e+1];t(n),re[e]=void 0,re[e+1]=void 0}W=0}function h(){try{var e=r,t=n(77);return J=t.runOnLoop||t.runOnContext,l()}catch(o){return p()}}function y(e,t){var n=arguments,r=this,o=new this.constructor(b);void 0===o[ae]&&N(o);var a=r._state;return a?!function(){var e=n[a-1];X(function(){return x(a,o,e,r._result)})}():R(r,o,e,t),o}function m(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(b);return C(n,e),n}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,n,r){try{e.call(t,n,r)}catch(o){return o}}function w(e,t,n){X(function(e){var r=!1,o=E(n,t,function(n){r||(r=!0,t!==n?C(e,n):S(e,n))},function(t){r||(r=!0,j(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!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,n){t.constructor===e.constructor&&n===y&&t.constructor.resolve===m?O(e,t):n===le?j(e,le.error):void 0===n?S(e,t):a(n)?w(e,t,n):S(e,t)}function C(t,n){t===n?j(t,v()):e(n)?T(t,n,g(n)):S(t,n)}function P(e){e._onerror&&e._onerror(e._result),k(e)}function S(e,t){e._state===ie&&(e._result=t,e._state=ue,0!==e._subscribers.length&&X(k,e))}function j(e,t){e._state===ie&&(e._state=se,e._result=t,X(P,e))}function R(e,t,n,r){var o=e._subscribers,a=o.length;e._onerror=null,o[a]=t,o[a+ue]=n,o[a+se]=r,0===a&&e._state&&X(k,e)}function k(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,a=e._result,i=0;i<t.length;i+=3)r=t[i],o=t[i+n],r?x(n,r,o,a):o(a);e._subscribers.length=0}}function A(){this.error=null}function I(e,t){try{return e(t)}catch(n){return ce.error=n,ce}}function x(e,t,n,r){var o=a(n),i=void 0,u=void 0,s=void 0,l=void 0;if(o){if(i=I(n,r),i===ce?(l=!0,u=i.error,i=null):s=!0,t===i)return void j(t,_())}else i=r,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 r(t){C(e,t)},function o(t){j(e,t)})}catch(n){j(e,n)}}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(n,r){for(var o=e.length,a=0;a<o;a++)t.resolve(e[a]).then(n,r)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function H(e){var t=this,n=new t(b);return j(n,e),n}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
2016-09-14 14:07:13 +02:00
//# sourceMappingURL=bundle-framework.js.map