(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("jQuery")); else if(typeof define === 'function' && define.amd) define(["jQuery"], factory); else if(typeof exports === 'object') exports["toolkit"] = factory(require("jQuery")); else root["Architects"] = root["Architects"] || {}, root["Architects"]["toolkit"] = factory(root["jQuery"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { var $, Application, HomePage, Location, Locations, PackageDetailsPage, React, Sidebar, definitions, getComponent, getPage, global, registry, _; __webpack_require__(9); __webpack_require__(12); $ = __webpack_require__(1); _ = __webpack_require__(11); global = typeof window !== "undefined" ? window : global; React = __webpack_require__(7); global.Router = __webpack_require__(6); Locations = Router.Locations; Location = Router.Location; global.util = __webpack_require__(2); global.stylish = __webpack_require__(5).stylish; global.factory = React.createFactory; global.Link = Router.Link; definitions = __webpack_require__(3).globalized(); registry = __webpack_require__(4).globalized().loaded(); getComponent = registry.getComponent, getPage = registry.getPage; HomePage = getPage("HomePage"); PackageDetailsPage = getPage("PackageDetailsPage"); Sidebar = getComponent("Sidebar"); Application = React.createClass({ displayName: "Application", getInitialState: function() { return { loaded: false, fullWidth: false }; }, getContainerClasses: function() { return cx({ "full": true, "height": true, "container": !this.requiresFullWidth() }); }, requiresFullWidth: function() { return this.state.fullWidth === true; }, componentDidMount: function() { this.setState({ loaded: true }); this.sidebar = React.render(React.createElement(Sidebar, null), el("sidebar")); return this.setWidth(); }, onNavigation: function() { this.setWidth(); return $('#sidebar').sidebar('hide'); }, setWidth: function() { var route; route = this.getCurrentRoute(); if (route && (route.props.fullWidth != null)) { return this.setState({ fullWidth: route.props.fullWidth }); } }, getSidebar: function() { return this.sidebar; }, getCurrentRoute: function() { var _ref; return _((_ref = this.refs.router) != null ? _ref.refs : void 0).values()[0]; }, isLoaded: function() { return this.state.loaded === true; }, render: function() { if (this.isLoaded()) { return this.showApp(); } else { return this.showLoadingIndicator(); } }, showLoadingIndicator: function() { return React.createElement("div", { "className": "ui alert" }, "Loading"); }, showApp: function() { return React.createElement(Locations, { "ref": "router", "className": this.getContainerClasses(), "onNavigation": this.onNavigation, "onBeforeNavigation": this.onBeforeNavigation, "hash": true }, React.createElement(Location, { "ref": "package_details", "path": "/packages/:slug", "handler": PackageDetailsPage }), React.createElement(Location, { "ref": "home_page", "path": "/", "handler": HomePage })); } }); $(function() { return global.App = React.render(React.createElement(Application, null), document.getElementById('app')); }); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { module.exports = jQuery; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { var util, _; _ = __webpack_require__(11); module.exports = util = {}; util.chunk = function(data, size) { return _.chain(data).groupBy(function(element, index) { return Math.floor(index / size); }).toArray().value(); }; util.read = function(value) { if (_.isFunction(value)) { return value(); } else { return value; } }; util.wordsForNumber = function(number) { if (number === 0) { number = 0; } if (number > 1) { number = number - 1; } return ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen"][number]; }; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, _) {var ComponentDefinition, delegate, fn, originals, registry, sugar, _i, _len, _ref; module.exports = sugar = {}; registry = __webpack_require__(4); ComponentDefinition = (function() { function ComponentDefinition(name, options) { var _ref; if (options == null) { options = {}; } this.name = name; this.completed = false; this.type = options.type || "component"; if (((_ref = options.mixins) != null ? _ref.length : void 0) > 0) { this.mixins = options.mixins; } global.previousComponent = this; } ComponentDefinition.prototype.state = function(initialState) { this.initialState = initialState; return this; }; ComponentDefinition.prototype.properties = function(defaultProperties) { this.defaultProperties = defaultProperties; return this; }; ComponentDefinition.prototype.view = function(v) { this._view = v; return this; }; ComponentDefinition.prototype.helpers = function(helpers) { if (helpers == null) { helpers = {}; } this.helpers || (this.helpers = {}); this.helpers = _.extend(this.helpers, helpers); return this; }; ComponentDefinition.prototype.classMethods = function(classMethods) { if (classMethods == null) { classMethods = {}; } this.classMethods || (this.classMethods = {}); this.classMethods = _.extend(this.classMethods, classMethods); return this; }; ComponentDefinition.prototype.events = function(helpers) { if (helpers == null) { helpers = {}; } this.helpers || (this.helpers = {}); this.helpers = _.extend(this.helpers, helpers); return this; }; ComponentDefinition.prototype.finished = function(cb) { return this.register(cb); }; ComponentDefinition.prototype.register = function(cb) { var definition, k, me, _ref; this.completed = true; definition = _.extend(this.helpers || {}, { displayName: this.name, render: this._view || (function() {}) }); if (this.classMethods) { definition.statics = _.extend(definition.statics || {}, this.classMethods); } if (((_ref = this.mixins) != null ? _ref.length : void 0) > 0) { definition.mixins = this.mixins; } me = this; if (_.isFunction(this.defaultProperties)) { definition.getDefaultProps = this.defaultProperties; } else if (_.isObject(this.defaultProperties)) { definition.getDefaultProps = function() { return me.defaultProperties; }; } if (_.isFunction(this.initialState)) { definition.getInitialState = this.initialState; } else if (_.isObject(this.initialState)) { definition.getInitialState = function() { return me.initialState; }; } if (_.isArray(this.mixins) && this.mixins.length > 0) { definition.mixins = this.mixins; } k = React.createClass(definition); if (typeof cb === "function") { cb(k); } if (this.type === "component") { if (typeof global.setComponent === "function") { global.setComponent(this.name, k); } } if (this.type === "page") { if (typeof global.setPage === "function") { global.setPage(this.name, k); } } global.previousComponent = void 0; return k; }; return ComponentDefinition; })(); global.previousComponent = void 0; originals = {}; delegate = function(fnName) { return sugar[fnName] = function() { var _ref, _ref1; return (_ref = global.previousComponent) != null ? (_ref1 = _ref[fnName]) != null ? _ref1.apply(global.previousComponent, arguments) : void 0 : void 0; }; }; _ref = ['properties', 'helpers', 'events', 'view', 'state', 'classMethods', 'finished']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { fn = _ref[_i]; originals[fn] = global[fn]; delegate(fn); } global.register = function(name, options) { if (options == null) { options = {}; } return global.previousComponent = new ComponentDefinition(name, options); }; global.page = function(name, options) { if (options == null) { options = {}; } return global.previousComponent = new ComponentDefinition(name, options); }; global.component = function(name, options) { if (options == null) { options = {}; } options.type = "component"; return global.previousComponent = new ComponentDefinition(name, options); }; global.el = function(id) { return document.getElementById(id); }; global.cx = React.addons.classSet; sugar.globalized = function() { var prop, val; for (prop in originals) { val = originals[prop]; global[prop] = sugar[prop]; } return sugar; }; sugar.finish = function() { var prop, val, _results; _results = []; for (prop in originals) { val = originals[prop]; _results.push(global[prop] = val); } return _results; }; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(11))) /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(_) {var global, iface, registry; module.exports = iface = {}; global = typeof window !== "undefined" ? window : global; registry = { pages: {}, apis: {}, components: {} }; iface.loaded = function() { _.extend(registry.apis, __webpack_require__(5)); _.extend(registry.pages, __webpack_require__(15)); _.extend(registry.components, __webpack_require__(16)); return iface; }; iface.setPage = function(name, componentClass) { return registry.pages[name] = componentClass; }; iface.setComponent = function(name, componentClass) { return registry.component[name] = componentClass; }; iface.setApi = function(name, component) { return registry.apis[name] = component; }; iface.getPage = function(identifier) { return registry.pages[identifier]; }; iface.getComponent = function(identifier) { return registry.components[identifier]; }; iface.getApi = function(identifier) { return registry.apis[identifier]; }; iface.globalized = function() { var prop, val; for (prop in iface) { val = iface[prop]; global[prop] = iface[val]; } return iface; }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { var Api, apis; Api = (function() { function Api(options) { if (options == null) { options = {}; } this.base = options.base; this.host = options.host; this.cache = {}; } Api.prototype.get = function(endpoint) { return $.get("http://localhost:8080/stylish/" + endpoint); }; Api.prototype.browsePackages = function(cb, bypass) { var packages; if (bypass == null) { bypass = false; } packages = this.cache.packages; if (!bypass && packages) { cb(packages); return; } return this.get("models/browse/packages").then((function(_this) { return function(r) { _this.cache.packages = r; return cb(r); }; })(this)); }; Api.prototype.showPackage = function(slug, cb, bypass) { var existing, _base; if (bypass == null) { bypass = false; } (_base = this.cache).packageDetails || (_base.packageDetails = {}); existing = this.cache.packageDetails[slug]; if (existing && !bypass) { cb(existing); } else { return this.get("models/show/packages/" + slug).then((function(_this) { return function(r) { _this.cache.packageDetails[slug] = r; return cb(r); }; })(this)); } }; return Api; })(); module.exports = apis = {}; apis.stylish = new Api(); /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var Router = __webpack_require__(17); var Route = __webpack_require__(18); var Link = __webpack_require__(19); var RouterMixin = __webpack_require__(20); var AsyncRouteRenderingMixin = __webpack_require__(21); var RouteRenderingMixin = __webpack_require__(22); var NavigatableMixin = __webpack_require__(23); var environment = __webpack_require__(25); var CaptureClicks = __webpack_require__(24); module.exports = { Locations: Router.Locations, Pages: Router.Pages, Location: Route.Route, Page: Route.Route, NotFound: Route.NotFound, Link: Link, environment: environment, RouterMixin: RouterMixin, RouteRenderingMixin: RouteRenderingMixin, AsyncRouteRenderingMixin: AsyncRouteRenderingMixin, NavigatableMixin: NavigatableMixin, CaptureClicks: CaptureClicks }; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["React"] = __webpack_require__(8); /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(26); /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a