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

4 lines
59 KiB
JavaScript
Raw Normal View History

Correct naming for JS and CSS files in client/ Removed some dist/js/*.js files since they're no longer built as individual files. This was a side effect of them living in the toplevel folder of admin/client/src/, which used to have all the legacy/*.js files in there (they do need to be built). Following AirBnB convention: https://github.com/airbnb/javascript#naming--filename-matches-export While it technically allows index.js files, we found them to be bad for dev and debugging in practice: Depending on the used IDE, editor tabs all look the same. Other views like Chrome Dev Tools with sourcemaps rely on path context, and are harder to auto-complete. There's no direct rules for CSS files, but same principles apply here. Also renamed the sections/ folder to containers/, which more clearly communicates the distinction between components/ (shouldn't contain state-dependant, smart components). Renamed state/ files to follow AirBnB naming conventions https://github.com/airbnb/javascript#naming--filename-matches-export https://github.com/airbnb/javascript#naming--camelCase-default-export https://github.com/airbnb/javascript#naming--PascalCase-singleton Leaving the folder name in state/<state-key> lowercase since that's also the key to reducers in the actual state object. References: http://engineering.kapost.com/2016/01/organizing-large-react-applications/ https://github.com/erikras/react-redux-universal-hot-example/tree/master/src https://github.com/RickWong/react-isomorphic-starterkit/tree/master/src https://github.com/react-toolbox/react-toolbox/issues/98 https://github.com/react-bootstrap/react-bootstrap/tree/master/src
2016-04-21 11:59:44 +02:00
!function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return o(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[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 i(){h["default"].add("config",v["default"]),h["default"].add("schemas",E["default"]),h["default"].add("records",w["default"]),h["default"].add("campaign",O["default"]);var e={},t=(0,c.combineReducers)(h["default"].getAll()),r=[l["default"]];"dev"===window.ss.config.environment&&r.push((0,p["default"])());var n=c.applyMiddleware.apply(void 0,r)(c.createStore);window.store=n(t,e),window.store.dispatch(y.setConfig(window.ss.config))}var a=e("jQuery"),s=o(a),c=e("redux"),u=e("redux-thunk"),l=o(u),f=e("redux-logger"),p=o(f),d=e("lib/ReducerRegister"),h=o(d),m=e("state/config/ConfigActions"),y=n(m),b=e("state/config/ConfigReducer"),v=o(b),g=e("state/schema/SchemaReducer"),E=o(g),_=e("state/records/RecordsReducer"),w=o(_),C=e("state/campaign/CampaignReducer"),O=o(C),S=e("containers/CampaignAdmin/index");o(S);(0,s["default"])("body").entwine({onadd:function(){return i()}})},{"containers/CampaignAdmin/index":10,jQuery:"jQuery","lib/ReducerRegister":"lib/ReducerRegister",redux:"redux","redux-logger":31,"redux-thunk":"redux-thunk","state/campaign/CampaignReducer":14,"state/config/ConfigActions":16,"state/config/ConfigReducer":17,"state/records/RecordsReducer":20,"state/schema/SchemaReducer":22}],2:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("lib/SilverStripeComponent"),f=n(l),p=function(e){function t(){return i(this,t),a(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){return u["default"].createElement("div",{role:"tablist","aria-multiselectable":"true"},this.props.children)},t}(f["default"]);r["default"]=p},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],3:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("
default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=e("deep-freeze"),s=n(a),c=e("./ConfigActionTypes"),u=n(c);r["default"]=o},{"./ConfigActionTypes":15,"deep-freeze":"deep-freeze"}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},{}],19:[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 i(e,t,r){var n={recordType:e},i={Accept:"text/json"},a=t.toLowerCase();return function(t){t({type:u["default"].FETCH_RECORDS_REQUEST,payload:n});var s="get"===a?[o(r,n),i]:[o(r,n),{},i];return f["default"][a].apply(f["default"],s).then(function(e){return e.json()}).then(function(r){t({type:u["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:r}})})["catch"](function(r){t({type:u["default"].FETCH_RECORDS_FAILURE,payload:{error:r,recordType:e}})})}}function a(e,t,r){var n={recordType:e},i={Accept:"text/json"},a=t.toLowerCase();return function(t){t({type:u["default"].FETCH_RECORD_REQUEST,payload:n});var s="get"===a?[o(r,n),i]:[o(r,n),{},i];return f["default"][a].apply(f["default"],s).then(function(e){return e.json()}).then(function(r){t({type:u["default"].FETCH_RECORD_SUCCESS,payload:{recordType:e,data:r}})})["catch"](function(r){t({type:u["default"].FETCH_RECORD_FAILURE,payload:{error:r,recordType:e}})})}}function s(e,t,r,n){var i={recordType:e,id:t};return function(a){return a({type:u["default"].DELETE_RECORD_REQUEST,payload:i}),f["default"][r.toLowerCase()](o(n,i)).then(function(){a({type:u["default"].DELETE_RECORD_SUCCESS,payload:{recordType:e,id:t}})})["catch"](function(r){a({type:u["default"].DELETE_RECORD_FAILURE,payload:{error:r,recordType:e,id:t}})})}}Object.defineProperty(r,"__esModule",{value:!0}),r.fetchRecords=i,r.fetchRecord=a,r.deleteRecord=s;var c=e("./RecordsActionTypes"),u=n(c),l=e("lib/Backend.js"),f=n(l)},{"./RecordsActionTypes":18,"lib/Backend.js":11}],20:[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 i(){var e=arguments.length<=0||void 0===arguments[0]?f:arguments[0],t=arguments[1],r=void 0,n=void 0,i=void 0;switch(t.type){case l["default"].CREATE_RECORD:return(0,c["default"])(a({},e,{}));case l["default"].UPDATE_RECORD:return(0,c["default"])(a({},e,{}));case l["default"].DELETE_RECORD:return(0,c["default"])(a({},e,{}));case l["default"].FETCH_RECORDS_REQUEST:return e;case l["default"].FETCH_RECORDS_FAILURE:return e;case l["default"].FETCH_RECORDS_SUCCESS:return n=t.payload.recordType,r=t.payload.data._embedded[n+"s"]||{},r=r.reduce(function(e,t){return a({},e,o({},t.id,t))},{}),(0,c["default"])(a({},e,o({},n,r)));case l["default"].FETCH_RECORD_REQUEST:return e;case l["default"].FETCH_RECORD_FAILURE:return e;case l["default"].FETCH_RECORD_SUCCESS:return n=t.payload.recordType,i=t.payload.data,(0,c["default"])(a({},e,o({},n,a({},e[n],o({},i.ID,i)))));case l["default"].DELETE_RECORD_REQUEST:return e;case l["default"].DELETE_RECORD_FAILURE:return e;case l["default"].DELETE_RECORD_SUCCESS:return n=t.payload.recordType,r=e[n],r=Object.keys(r).reduce(function(e,n){return parseInt(n,10)!==parseInt(t.payload.id,10)?a({},e,o({},n,r[n])):e},{}),(0,c["default"])(a({},e,o({},n,r)));default:return e}}Object.defi
2016-04-07 13:43:43 +02:00
//# sourceMappingURL=bundle-framework.js.map