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

6 lines
101 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 _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 _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function appBoot(){_ReducerRegister2["default"].add("config",_ConfigReducer2["default"]),_ReducerRegister2["default"].add("form",_FormReducer2["default"]),_ReducerRegister2["default"].add("schemas",_SchemaReducer2["default"]),_ReducerRegister2["default"].add("records",_RecordsReducer2["default"]),_ReducerRegister2["default"].add("campaign",_CampaignReducer2["default"]);var initialState={},rootReducer=(0,_redux.combineReducers)(_ReducerRegister2["default"].getAll()),middleware=[_reduxThunk2["default"]];"dev"===window.ss.config.environment&&middleware.push((0,_reduxLogger2["default"])());var createStoreWithMiddleware=_redux.applyMiddleware.apply(void 0,middleware)(_redux.createStore);window.store=createStoreWithMiddleware(rootReducer,initialState),window.store.dispatch(configActions.setConfig(window.ss.config))}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_redux=require("redux"),_reduxThunk=require("redux-thunk"),_reduxThunk2=_interopRequireDefault(_reduxThunk),_reduxLogger=require("redux-logger"),_reduxLogger2=_interopRequireDefault(_reduxLogger),_ReducerRegister=require("lib/ReducerRegister"),_ReducerRegister2=_interopRequireDefault(_ReducerRegister),_ConfigActions=require("state/config/ConfigActions"),configActions=_interopRequireWildcard(_ConfigActions),_ConfigReducer=require("state/config/ConfigReducer"),_ConfigReducer2=_interopRequireDefault(_ConfigReducer),_FormReducer=require("state/form/FormReducer"),_FormReducer2=_interopRequireDefault(_FormReducer),_SchemaReducer=require("state/schema/SchemaReducer"),_SchemaReducer2=_interopRequireDefault(_SchemaReducer),_RecordsReducer=require("state/records/RecordsReducer"),_RecordsReducer2=_interopRequireDefault(_RecordsReducer),_CampaignReducer=require("state/campaign/CampaignReducer"),_CampaignReducer2=_interopRequireDefault(_CampaignReducer),_index=require("containers/CampaignAdmin/index");_interopRequireDefault(_index);(0,_jQuery2["default"])("body").entwine({onadd:function(){return appBoot()}})},{"containers/CampaignAdmin/index":10,jQuery:"jQuery","lib/ReducerRegister":"lib/ReducerRegister",redux:"redux","redux-logger":33,"redux-thunk":"redux-thunk","state/campaign/CampaignReducer":14,"state/config/ConfigActions":16,"state/config/ConfigReducer":17,"state/form/FormReducer":19,"state/records/RecordsReducer":22,"state/schema/SchemaReducer":24}],2:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superCl
}function mapStateToProps(state,ownProps){var record=null;return state.records&&state.records.ChangeSet&&ownProps.campaignId&&(record=state.records.ChangeSet[parseInt(ownProps.campaignId,10)]),{record:record||{},campaign:state.campaign}}function mapDispatchToProps(dispatch){return{recordActions:(0,_redux.bindActionCreators)(recordActions,dispatch),campaignActions:(0,_redux.bindActionCreators)(campaignActions,dispatch)}}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},_react=require("react"),_react2=_interopRequireDefault(_react),_redux=require("redux"),_reactRedux=require("react-redux"),_RecordsActions=require("state/records/RecordsActions"),recordActions=_interopRequireWildcard(_RecordsActions),_CampaignActions=require("state/campaign/CampaignActions"),campaignActions=_interopRequireWildcard(_CampaignActions),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_Accordion=require("components/Accordion/Accordion"),_Accordion2=_interopRequireDefault(_Accordion),_AccordionBlock=require("components/Accordion/AccordionBlock"),_AccordionBlock2=_interopRequireDefault(_AccordionBlock),_ListGroupItem=require("components/ListGroup/ListGroupItem"),_ListGroupItem2=_interopRequireDefault(_ListGroupItem),_Toolbar=require("components/Toolbar/Toolbar"),_Toolbar2=_interopRequireDefault(_Toolbar),_FormAction=require("components/FormAction/FormAction"),_FormAction2=_interopRequireDefault(_FormAction),_CampaignAdminItem=require("./CampaignAdminItem"),_CampaignAdminItem2=_interopRequireDefault(_CampaignAdminItem),_Breadcrumb=require("components/Breadcrumb/Breadcrumb"),_Breadcrumb2=_interopRequireDefault(_Breadcrumb),_Preview=require("components/Preview/Preview"),_Preview2=_interopRequireDefault(_Preview),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),CampaignAdminList=function(_SilverStripeComponen){function CampaignAdminList(props){_classCallCheck(this,CampaignAdminList);var _this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return _this.handlePublish=_this.handlePublish.bind(_this),_this.handleItemSelected=_this.handleItemSelected.bind(_this),_this}return _inherits(CampaignAdminList,_SilverStripeComponen),CampaignAdminList.prototype.componentDidMount=function(){var fetchURL=this.props.itemListViewEndpoint.replace(/:id/,this.props.campaignId);_SilverStripeComponen.prototype.componentDidMount.call(this),this.props.recordActions.fetchRecord("ChangeSet","get",fetchURL)},CampaignAdminList.prototype.render=function(){var _this2=this,itemID=this.props.campaign.changeSetItemId,itemLinks=null,campaignId=this.props.campaignId,campaign=this.props.record,itemGroups=this.groupItemsForSet(),accordionBlocks=[];Object.keys(itemGroups).forEach(function(className){var group=itemGroups[className],groupCount=group.items.length,listGroupItems=[],title=groupCount+" "+(1===groupCount?group.singular:group.plural),groupid="Set_"+campaignId+"_Group_"+className;group.items.forEach(function(item){itemID||(itemID=item.ID);var selected=itemID===item.ID;selected&&item._links.preview&&(itemLinks=item._links);var itemClassNames=[];"none"!==item.ChangeType&&"published"!==campaign.State||itemClassNames.push("list-group-item--inactive"),selected&&itemClassNames.push("active"),listGroupItems.push(_react2["default"].createElement(_ListGroupItem2["default"],{key:item.ID,className:itemClassNames.join(" "),handleClick:_this2.handleItemSelected,handleClickArg:item.ID},_react2["default"].createElement(_CampaignAdminItem2["default"],{item:item,campaign:_this2.props.record})))}),accordionBlocks.push(_react2["default"].createElement(_AccordionBlock2["default"],{key:groupid,groupid:groupid,title:title},listGroupItems))});var classNames=itemLinks?"cms-content__split cms-content__split--left-sm":"cms-content__split cms-content__split--none";return _re
lib$es6$promise$asap$$asap=asapFn}function lib$es6$promise$asap$$useNextTick(){return function(){process.nextTick(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useVertxTimer(){return function(){lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useMutationObserver(){var iterations=0,observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush),node=document.createTextNode("");return observer.observe(node,{characterData:!0}),function(){node.data=iterations=++iterations%2}}function lib$es6$promise$asap$$useMessageChannel(){var channel=new MessageChannel;return channel.port1.onmessage=lib$es6$promise$asap$$flush,function(){channel.port2.postMessage(0)}}function lib$es6$promise$asap$$useSetTimeout(){return function(){setTimeout(lib$es6$promise$asap$$flush,1)}}function lib$es6$promise$asap$$flush(){for(var i=0;lib$es6$promise$asap$$len>i;i+=2){var callback=lib$es6$promise$asap$$queue[i],arg=lib$es6$promise$asap$$queue[i+1];callback(arg),lib$es6$promise$asap$$queue[i]=void 0,lib$es6$promise$asap$$queue[i+1]=void 0}lib$es6$promise$asap$$len=0}function lib$es6$promise$asap$$attemptVertx(){try{var r=require,vertx=r("vertx");return lib$es6$promise$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext,lib$es6$promise$asap$$useVertxTimer()}catch(e){return lib$es6$promise$asap$$useSetTimeout()}}function lib$es6$promise$then$$then(onFulfillment,onRejection){var parent=this,state=parent._state;if(state===lib$es6$promise$$internal$$FULFILLED&&!onFulfillment||state===lib$es6$promise$$internal$$REJECTED&&!onRejection)return this;var child=new this.constructor(lib$es6$promise$$internal$$noop),result=parent._result;if(state){var callback=arguments[state-1];lib$es6$promise$asap$$asap(function(){lib$es6$promise$$internal$$invokeCallback(state,child,callback,result)})}else lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection);return child}function lib$es6$promise$promise$resolve$$resolve(object){var Constructor=this;if(object&&"object"==typeof object&&object.constructor===Constructor)return object;var promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$resolve(promise,object),promise}function lib$es6$promise$$internal$$noop(){}function lib$es6$promise$$internal$$selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function lib$es6$promise$$internal$$cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function lib$es6$promise$$internal$$getThen(promise){try{return promise.then}catch(error){return lib$es6$promise$$internal$$GET_THEN_ERROR.error=error,lib$es6$promise$$internal$$GET_THEN_ERROR}}function lib$es6$promise$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$es6$promise$$internal$$handleForeignThenable(promise,thenable,then){lib$es6$promise$asap$$asap(function(promise){var sealed=!1,error=lib$es6$promise$$internal$$tryThen(then,thenable,function(value){sealed||(sealed=!0,thenable!==value?lib$es6$promise$$internal$$resolve(promise,value):lib$es6$promise$$internal$$fulfill(promise,value))},function(reason){sealed||(sealed=!0,lib$es6$promise$$internal$$reject(promise,reason))},"Settle: "+(promise._label||" unknown promise"));!sealed&&error&&(sealed=!0,lib$es6$promise$$internal$$reject(promise,error))},promise)}function lib$es6$promise$$internal$$handleOwnThenable(promise,thenable){thenable._state===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,thenable._result):thenable._state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,thenable._result):lib$es6$promise$$internal$$subscribe(thenable,void 0,function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}function lib$es6$promise$$internal$$handleMaybeThenable(promise,maybeThenable,then){maybeThenable.constructor===promise.constructor&&t
},{}],34:[function(require,module,exports){!function(self){"use strict";function normalizeName(name){if("string"!=typeof name&&(name=String(name)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name))throw new TypeError("Invalid character in header field name");return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value=String(value)),value}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach(function(value,name){this.append(name,value)},this):headers&&Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}function consumed(body){return body.bodyUsed?Promise.reject(new TypeError("Already read")):void(body.bodyUsed=!0)}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader;return reader.readAsArrayBuffer(blob),fileReaderReady(reader)}function readBlobAsText(blob){var reader=new FileReader;return reader.readAsText(blob),fileReaderReady(reader)}function Body(){return this.bodyUsed=!1,this._initBody=function(body){if(this._bodyInit=body,"string"==typeof body)this._bodyText=body;else if(support.blob&&Blob.prototype.isPrototypeOf(body))this._bodyBlob=body;else if(support.formData&&FormData.prototype.isPrototypeOf(body))this._bodyFormData=body;else if(body){if(!support.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(body))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof body?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},support.blob?(this.blob=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(readBlobAsArrayBuffer)},this.text=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var rejected=consumed(this);return rejected?rejected:Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}function normalizeMethod(method){var upcased=method.toUpperCase();return methods.indexOf(upcased)>-1?upcased:method}function Request(input,options){options=options||{};var body=options.body;if(Request.prototype.isPrototypeOf(input)){if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,body||(body=input._bodyInit,input.bodyUsed=!0)}else this.url=input;if(this.credentials=options.credentials||this.credentials||"omit",!options.headers&&this.headers||(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(body)}function decode(body){var form=new FormData;return body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}}),form}function headers(xhr){var head=new Headers,pairs=xhr.getAllResponseHeaders().trim().split("\n");return pairs.forEach(function(header){var split=header.trim().split(":"),key=split.shift().trim(),value=split.join(":").trim();head.append(key,value)}),hea
2016-04-07 13:43:43 +02:00
//# sourceMappingURL=bundle-framework.js.map