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

6 lines
101 KiB
JavaScript
Raw Normal View History

2016-04-27 04:26:39 +02:00
!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":34,"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
{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),_AccordionGroup=require("components/Accordion/AccordionGroup"),_AccordionGroup2=_interopRequireDefault(_AccordionGroup),_AccordionItem=require("components/Accordion/AccordionItem"),_AccordionItem2=_interopRequireDefault(_AccordionItem),_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,previewUrl=null,campaignId=this.props.campaignId,campaign=this.props.record,itemGroups=this.groupItemsForSet(),accordionGroups=[];Object.keys(itemGroups).forEach(function(className){var group=itemGroups[className],groupCount=group.items.length,accordionItems=[],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&&(item._links.preview.Stage?previewUrl=item._links.preview.Stage.href:item._links.preview.Live&&(previewUrl=item._links.preview.Live.href));var itemClassNames=[];"none"!==item.ChangeType&&"published"!==campaign.State||itemClassNames.push("list-group-item--published"),selected&&itemClassNames.push("active"),accordionItems.push(_react2["default"].createElement(_AccordionItem2["default"],{key:item.ID,className:itemClassNames.join(" "),handleClick:_this2.handleItemSelected,handleClickArg:item.ID},_react2["default"].createElement(_CampaignAdminItem2["default"],{item:item,campaign:_this2.props.record})))}),accordionGroups.push(_react2["default"].createElement(_AccordionGroup2["default"],{key:groupid,groupid:groupid,title:title},accordionItems))});var classNames=previewUrl?"cms-content__split cms-content__split--left-sm":"cms-content__split cms-content__split--none";return _react2["default"].createElement("div",{className:classNames},_react2["default
}}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&&then===lib$es6$promise$then$$default&&constructor.resolve===lib$es6$promise$promise$resolve$$default?lib$es6$promise$$internal$$handleOwnThenab
if(!source)return target;if("object"!=typeof source){if(Array.isArray(target))target.push(source);else{if("object"!=typeof target)return[target,source];target[source]=!0}return target}if("object"!=typeof target)return[target].concat(source);var mergeTarget=target;return Array.isArray(target)&&!Array.isArray(source)&&(mergeTarget=exports.arrayToObject(target,options)),Object.keys(source).reduce(function(acc,key){var value=source[key];return Object.prototype.hasOwnProperty.call(acc,key)?acc[key]=exports.merge(acc[key],value,options):acc[key]=value,acc},mergeTarget)},exports.decode=function(str){try{return decodeURIComponent(str.replace(/\+/g," "))}catch(e){return str}},exports.encode=function(str){if(0===str.length)return str;for(var string="string"==typeof str?str:String(str),out="",i=0;i<string.length;++i){var c=string.charCodeAt(i);45===c||46===c||95===c||126===c||c>=48&&57>=c||c>=65&&90>=c||c>=97&&122>=c?out+=string.charAt(i):128>c?out+=hexTable[c]:2048>c?out+=hexTable[192|c>>6]+hexTable[128|63&c]:55296>c||c>=57344?out+=hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|63&c]:(i+=1,c=65536+((1023&c)<<10|1023&string.charCodeAt(i)),out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|63&c])}return out},exports.compact=function(obj,references){if("object"!=typeof obj||null===obj)return obj;var refs=references||[],lookup=refs.indexOf(obj);if(-1!==lookup)return refs[lookup];if(refs.push(obj),Array.isArray(obj)){for(var compacted=[],i=0;i<obj.length;++i)"undefined"!=typeof obj[i]&&compacted.push(obj[i]);return compacted}for(var keys=Object.keys(obj),j=0;j<keys.length;++j){var key=keys[j];obj[key]=exports.compact(obj[key],refs)}return obj},exports.isRegExp=function(obj){return"[object RegExp]"===Object.prototype.toString.call(obj)},exports.isBuffer=function(obj){return null===obj||"undefined"==typeof obj?!1:!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))}},{}],34:[function(require,module,exports){"use strict";function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _typeof(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function getLogLevel(level,action,payload,type){switch("undefined"==typeof level?"undefined":_typeof(level)){case"object":return"function"==typeof level[type]?level[type].apply(level,_toConsumableArray(payload)):level[type];case"function":return level(action);default:return level}}function createLogger(){function printBuffer(){logBuffer.forEach(function(logEntry,key){var started=logEntry.started,startedTime=logEntry.startedTime,action=logEntry.action,prevState=logEntry.prevState,error=logEntry.error,took=logEntry.took,nextState=logEntry.nextState,nextEntry=logBuffer[key+1];nextEntry&&(nextState=nextEntry.prevState,took=nextEntry.started-started);var formattedAction=actionTransformer(action),isCollapsed="function"==typeof collapsed?collapsed(function(){return nextState},action):collapsed,formattedTime=formatTime(startedTime),titleCSS=colors.title?"color: "+colors.title(formattedAction)+";":null,title="action "+(timestamp?formattedTime:"")+" "+formattedAction.type+" "+(duration?"(in "+took.toFixed(2)+" ms)":"");try{isCollapsed?colors.title?logger.groupCollapsed("%c "+title,titleCSS):logger.groupCollapsed(title):colors.title?logger.group("%c "+title,titleCSS):logger.group(title)}catch(e){logger.log(title)}var prevStateLevel=getLogLevel(level,formattedAction,[prevState],"prevState"),actionLevel=getLogLevel(level,formattedAction,[formattedAction],"action"),errorLevel=getLogLevel(level,formattedAction,[error,prevState],"error"),nextStateLevel=getLogLevel(level,formattedAction,[nextState],"nextState");prevStateLevel&&(colors.prevState?logger[prevStateLevel]("%c prev state","color: "+colors.prevState(prevState)+"; font-weight: bold",prevState):logger[prevStateLevel]("prev state",prevState)),actionLevel&&(colors.action?logger[actionLevel]("%c action","color: "+colors.action(formattedAction)+"; font-weight:
2016-04-07 13:43:43 +02:00
//# sourceMappingURL=bundle-framework.js.map