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

8 lines
158 KiB
JavaScript
Raw Normal View History

!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_reactRedux=require("react-redux"),_reactRouter=require("react-router"),_createBrowserHistory=require("history/lib/createBrowserHistory"),_createBrowserHistory2=_interopRequireDefault(_createBrowserHistory),_Config=require("lib/Config"),_Config2=_interopRequireDefault(_Config),_Router=require("lib/Router"),_Router2=_interopRequireDefault(_Router),_ReactRouteRegister=require("lib/ReactRouteRegister"),_ReactRouteRegister2=_interopRequireDefault(_ReactRouteRegister),_App=require("containers/App/App"),_App2=_interopRequireDefault(_App),_reactRouterRedux=require("react-router-redux"),BootRoutes=function(){function BootRoutes(store){_classCallCheck(this,BootRoutes),this.store=store;var base=_Config2["default"].get("absoluteBaseUrl");_Router2["default"].setAbsoluteBase(base)}return BootRoutes.prototype.start=function(location){this.matchesLegacyRoute(location)?this.initLegacyRouter():this.initReactRouter()},BootRoutes.prototype.matchesLegacyRoute=function(location){var sections=_Config2["default"].get("sections"),currentPath=_Router2["default"].resolveURLToBase(location).replace(/\/$/,"");return!!Object.keys(sections).find(function(key){var section=sections[key],route=_Router2["default"].resolveURLToBase(section.url).replace(/\/$/,"");return section.reactRouter?!1:currentPath.match(route)})},BootRoutes.prototype.initReactRouter=function(){_ReactRouteRegister2["default"].updateRootRoute({component:_App2["default"]});var history=(0,_reactRouterRedux.syncHistoryWithStore)((0,_reactRouter.useRouterHistory)(_createBrowserHistory2["default"])({basename:_Config2["default"].get("baseUrl")}),this.store);_reactDom2["default"].render(_react2["default"].createElement(_reactRedux.Provider,{store:this.store},_react2["default"].createElement(_reactRouter.Router,{history:history,routes:_ReactRouteRegister2["default"].getRootRoute()})),document.getElementsByClassName("cms-content")[0])},BootRoutes.prototype.initLegacyRouter=function(){var sections=_Config2["default"].get("sections"),store=this.store;(0,_Router2["default"])("*",function(ctx,next){ctx.store=store,next()}),Object.keys(sections).forEach(function(key){var route=_Router2["default"].resolveURLToBase(sections[key].url);route=route.replace(/\/$/,""),route+="(/*?)?",(0,_Router2["default"])(route,function(ctx,next){return"complete"!==document.readyState||ctx.init?void next():void(0,_jQuery2["default"])(".cms-container").entwine("ss").handleStateChange(null,ctx.state)})}),_Router2["default"].start()},BootRoutes}();exports["default"]=BootRoutes},{"containers/App/App":9,"history/lib/createBrowserHistory":48,jQuery:"jQuery","lib/Config":15,"lib/ReactRouteRegister":"lib/ReactRouteRegister","lib/Router":17,react:"react","react-dom":"react-dom","react-redux":"react-redux","react-router":"react-router","react-router-redux":"react-router-redux"}],2:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequi
className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],null,_react2["default"].createElement(_Breadcrumb2["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),_react2["default"].createElement("div",{className:"panel-scrollable panel-scrollable--single-toolbar"},_react2["default"].createElement("div",{className:"toolbar--content"},_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement(_FormAction2["default"],formActionProps))),_react2["default"].createElement("div",{className:"campaign-admin container-fluid"},_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps)))))},CampaignAdmin.prototype.renderItemListView=function(){var props={sectionConfig:this.props.sectionConfig,campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,handleBackButtonClick:this.handleBackButtonClick.bind(this)};return _react2["default"].createElement(_CampaignAdminList2["default"],props)},CampaignAdmin.prototype.renderDetailEditView=function(){var baseSchemaUrl=this.props.sectionConfig.form.DetailEditForm.schemaUrl,formBuilderProps={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:baseSchemaUrl+"/"+this.props.params.id};return _react2["default"].createElement("div",{className:"cms-content__inner"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},_react2["default"].createElement(_Breadcrumb2["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),_react2["default"].createElement("div",{className:"panel-scrollable panel-scrollable--single-toolbar container-fluid m-t-1"},_react2["default"].createElement("div",{className:"form--inline"},_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps))))},CampaignAdmin.prototype.renderCreateView=function(){var baseSchemaUrl=this.props.sectionConfig.form.DetailEditForm.schemaUrl,formBuilderProps={createFn:this.campaignAddCreateFn.bind(this),schemaUrl:baseSchemaUrl+"/"+this.props.params.id};return _react2["default"].createElement("div",{className:"cms-content__inner"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},_react2["default"].createElement(_Breadcrumb2["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),_react2["default"].createElement("div",{className:"panel-scrollable panel-scrollable--single-toolbar container-fluid m-t-1"},_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps)))},CampaignAdmin.prototype.campaignEditCreateFn=function(Component,props){var _this2=this,url=this.props.sectionConfig.url;if("action_cancel"===props.name){var extendedProps=_extends({},props,{handleClick:function(event){event.preventDefault(),_this2.props.router.push(url)}});return _react2["default"].createElement(Component,_extends({key:props.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.campaignAddCreateFn=function(Component,props){var _this3=this,url=this.props.sectionConfig.url;if("action_cancel"===props.name){var extendedProps=_extends({},props,{handleClick:function(event){event.preventDefault(),_this3.props.router.push(url)}});return _react2["default"].createElement(Component,_extends({key:props.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.campaignListCreateFn=function(Component,props){var _this4=this,sectionUrl=this.props.sectionConfig.url,typeUrlParam="set";if("GridField"===props.component){var extendedProps=_extends({},props,{data:_extends({},props.data,{handleDrillDown:function(event,record){_this4.props.router.push(sectionUrl+"/"+typeUrlParam+"/"+record.ID+"/show")},handleEditRecord:function(event,id){_this4.props.router.push(sectionUrl+"/"+typeUrlParam+"/"+id+"/edit")}})});return _react2["default"].createElement(Component,_extends({ke
dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_REQUEST,payload:{campaignId:campaignId}}),publishApi({id:campaignId}).then(function(data){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_SUCCESS,payload:{campaignId:campaignId}}),dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS,payload:{recordType:recordType,data:data}})})["catch"](function(error){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_FAILURE,payload:{error:error}})})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.selectChangeSetItem=selectChangeSetItem,exports.showCampaignView=showCampaignView,exports.publishCampaign=publishCampaign;var _CampaignActionTypes=require("./CampaignActionTypes"),_CampaignActionTypes2=_interopRequireDefault(_CampaignActionTypes),_RecordsActionTypes=require("state/records/RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes)},{"./CampaignActionTypes":20,"state/records/RecordsActionTypes":28}],22:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function reducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1];switch(action.type){case _CampaignActionTypes2["default"].SET_CAMPAIGN_SELECTED_CHANGESETITEM:return(0,_deepFreezeStrict2["default"])(_extends({},state,{changeSetItemId:action.payload.changeSetItemId}));case _CampaignActionTypes2["default"].SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,_deepFreezeStrict2["default"])(_extends({},state,{campaignId:action.payload.campaignId,view:action.payload.view,changeSetItemId:null}));case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_REQUEST:return(0,_deepFreezeStrict2["default"])(_extends({},state,{isPublishing:!0}));case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_SUCCESS:case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_FAILURE:return(0,_deepFreezeStrict2["default"])(_extends({},state,{isPublishing:!1}));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreezeStrict=require("deep-freeze-strict"),_deepFreezeStrict2=_interopRequireDefault(_deepFreezeStrict),_CampaignActionTypes=require("./CampaignActionTypes"),_CampaignActionTypes2=_interopRequireDefault(_CampaignActionTypes),initialState=(0,_deepFreezeStrict2["default"])({campaignId:null,changeSetItemId:null,isPublishing:!1,view:null});exports["default"]=reducer},{"./CampaignActionTypes":20,"deep-freeze-strict":"deep-freeze-strict"}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={SET_CONFIG:"SET_CONFIG"}},{}],24:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function setConfig(config){return{type:_ConfigActionTypes2["default"].SET_CONFIG,payload:{config:config}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setConfig=setConfig;var _ConfigActionTypes=require("./ConfigActionTypes"),_ConfigActionTypes2=_interopRequireDefault(_ConfigActionTypes)},{"./ConfigActionTypes":23}],25:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function configReducer(){var state=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],action=arguments[1];switch(action.type){case _ConfigActionTypes2["default"].SET_CONFIG:return(0,_deepFreezeStrict2["default"])(_extends({},state,action.payload.config));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreezeStrict=r
promise._state=lib$es6$promise$$internal$$FULFILLED,0!==promise._subscribers.length&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,promise))}function lib$es6$promise$$internal$$reject(promise,reason){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._state=lib$es6$promise$$internal$$REJECTED,promise._result=reason,lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection,promise))}function lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection){var subscribers=parent._subscribers,length=subscribers.length;parent._onerror=null,subscribers[length]=child,subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment,subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection,0===length&&parent._state&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,parent)}function lib$es6$promise$$internal$$publish(promise){var subscribers=promise._subscribers,settled=promise._state;if(0!==subscribers.length){for(var child,callback,detail=promise._result,i=0;i<subscribers.length;i+=3)child=subscribers[i],callback=subscribers[i+settled],child?lib$es6$promise$$internal$$invokeCallback(settled,child,callback,detail):callback(detail);promise._subscribers.length=0}}function lib$es6$promise$$internal$$ErrorObject(){this.error=null}function lib$es6$promise$$internal$$tryCatch(callback,detail){try{return callback(detail)}catch(e){return lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e,lib$es6$promise$$internal$$TRY_CATCH_ERROR}}function lib$es6$promise$$internal$$invokeCallback(settled,promise,callback,detail){var value,error,succeeded,failed,hasCallback=lib$es6$promise$utils$$isFunction(callback);if(hasCallback){if(value=lib$es6$promise$$internal$$tryCatch(callback,detail),value===lib$es6$promise$$internal$$TRY_CATCH_ERROR?(failed=!0,error=value.error,value=null):succeeded=!0,promise===value)return void lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$cannotReturnOwn())}else value=detail,succeeded=!0;promise._state!==lib$es6$promise$$internal$$PENDING||(hasCallback&&succeeded?lib$es6$promise$$internal$$resolve(promise,value):failed?lib$es6$promise$$internal$$reject(promise,error):settled===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,value):settled===lib$es6$promise$$internal$$REJECTED&&lib$es6$promise$$internal$$reject(promise,value))}function lib$es6$promise$$internal$$initializePromise(promise,resolver){try{resolver(function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}catch(e){lib$es6$promise$$internal$$reject(promise,e)}}function lib$es6$promise$promise$all$$all(entries){return new lib$es6$promise$enumerator$$default(this,entries).promise}function lib$es6$promise$promise$race$$race(entries){function onFulfillment(value){lib$es6$promise$$internal$$resolve(promise,value)}function onRejection(reason){lib$es6$promise$$internal$$reject(promise,reason)}var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);if(!lib$es6$promise$utils$$isArray(entries))return lib$es6$promise$$internal$$reject(promise,new TypeError("You must pass an array to race.")),promise;for(var length=entries.length,i=0;promise._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]),void 0,onFulfillment,onRejection);return promise}function lib$es6$promise$promise$reject$$reject(reason){var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$reject(promise,reason),promise}function lib$es6$promise$promise$$needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function lib$es6$promise$promise$$needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function lib$es6$promise$promise$$Promise(resolver){this._id=lib$es6$promise$promise$$counter++,this
var result=argv[0],size=argv.length;(clone||"object"!==typeOf(result))&&(result={});for(var index=0;size>index;++index){var item=argv[index],type=typeOf(item);if("object"===type)for(var key in item){var sitem=clone?Public.clone(item[key]):item[key];recursive?result[key]=merge_recursive(result[key],sitem):result[key]=sitem}}return result}function typeOf(input){return{}.toString.call(input).slice(8,-1).toLowerCase()}var Public=function(clone){return merge(clone===!0,!1,arguments)},publicName="merge";Public.recursive=function(clone){return merge(clone===!0,!0,arguments)},Public.clone=function(input){var index,size,output=input,type=typeOf(input);if("array"===type)for(output=[],size=input.length,index=0;size>index;++index)output[index]=Public.clone(input[index]);else if("object"===type){output={};for(index in input)output[index]=Public.clone(input[index])}return output},isNode?module.exports=Public:window[publicName]=Public}("object"==typeof module&&module&&"object"==typeof module.exports&&module.exports)},{}],58:[function(require,module,exports){"use strict";var Stringify=require("./stringify"),Parse=require("./parse");module.exports={stringify:Stringify,parse:Parse}},{"./parse":59,"./stringify":60}],59:[function(require,module,exports){"use strict";var Utils=require("./utils"),internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};internals.parseValues=function(str,options){for(var obj={},parts=str.split(options.delimiter,options.parameterLimit===1/0?void 0:options.parameterLimit),i=0;i<parts.length;++i){var part=parts[i],pos=-1===part.indexOf("]=")?part.indexOf("="):part.indexOf("]=")+1;if(-1===pos)obj[Utils.decode(part)]="",options.strictNullHandling&&(obj[Utils.decode(part)]=null);else{var key=Utils.decode(part.slice(0,pos)),val=Utils.decode(part.slice(pos+1));Object.prototype.hasOwnProperty.call(obj,key)?obj[key]=[].concat(obj[key]).concat(val):obj[key]=val}}return obj},internals.parseObject=function(chain,val,options){if(!chain.length)return val;var obj,root=chain.shift();if("[]"===root)obj=[],obj=obj.concat(internals.parseObject(chain,val,options));else{obj=options.plainObjects?Object.create(null):{};var cleanRoot="["===root[0]&&"]"===root[root.length-1]?root.slice(1,root.length-1):root,index=parseInt(cleanRoot,10);!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit?(obj=[],obj[index]=internals.parseObject(chain,val,options)):obj[cleanRoot]=internals.parseObject(chain,val,options)}return obj},internals.parseKeys=function(givenKey,val,options){if(givenKey){var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,"[$1]"):givenKey,parent=/^([^\[\]]*)/,child=/(\[[^\[\]]*\])/g,segment=parent.exec(key),keys=[];if(segment[1]){if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])&&!options.allowPrototypes)return;keys.push(segment[1])}for(var i=0;null!==(segment=child.exec(key))&&i<options.depth;)i+=1,(options.plainObjects||!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g,""))||options.allowPrototypes)&&keys.push(segment[1]);return segment&&keys.push("["+key.slice(segment.index)+"]"),internals.parseObject(keys,val,options)}},module.exports=function(str,opts){var options=opts||{};if(options.delimiter="string"==typeof options.delimiter||Utils.isRegExp(options.delimiter)?options.delimiter:internals.delimiter,options.depth="number"==typeof options.depth?options.depth:internals.depth,options.arrayLimit="number"==typeof options.arrayLimit?options.arrayLimit:internals.arrayLimit,options.parseArrays=options.parseArrays!==!1,options.allowDots="boolean"==typeof options.allowDots?options.allowDots:internals.allowDots,options.plainObjects="boolean"==typeof options.plainObjects?options.plainObjects:internals.plainObjects,options.allowPrototypes="boolean"==typeof options.allowPrototypes?options.allowPrototypes:internals.allowPrototypes,options.parameterLimit="number"==typeof options.parameterLimit?options.parameterLimit:internals.parameterLimit,options.strictNullHa
blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self},methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this)},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(-1===redirectStatuses.indexOf(status))throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})},self.Headers=Headers,self.Request=Request,self.Response=Response,self.fetch=function(input,init){return new Promise(function(resolve,reject){function responseURL(){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}var request;request=Request.prototype.isPrototypeOf(input)&&!init?input:new Request(input,init);var xhr=new XMLHttpRequest;xhr.onload=function(){var status=1223===xhr.status?204:xhr.status;if(100>status||status>599)return void reject(new TypeError("Network request failed"));var options={status:status,statusText:xhr.statusText,headers:headers(xhr),url:responseURL()},body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))},xhr.onerror=function(){reject(new TypeError("Network request failed"))},xhr.open(request.method,request.url,!0),"include"===request.credentials&&(xhr.withCredentials=!0),"responseType"in xhr&&support.blob&&(xhr.responseType="blob"),request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)}),xhr.send("undefined"==typeof request._bodyInit?null:request._bodyInit)})},self.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}]},{},[2]);
2016-04-07 13:43:43 +02:00
//# sourceMappingURL=bundle-framework.js.map