tapspace
Version:
A zoomable user interface lib for web apps
188 lines (163 loc) • 25.5 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["affinedom"] = factory();
else
root["affinedom"] = factory();
})(window, function() {
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] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = 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;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./index.js":
/*!******************!*\
!*** ./index.js ***!
\******************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// API Tapspace v2\n\nconst Element = __webpack_require__(/*! ./lib/Element */ \"./lib/Element/index.js\")\nconst Viewport = __webpack_require__(/*! ./lib/Viewport */ \"./lib/Viewport/index.js\")\nconst Plane = __webpack_require__(/*! ./lib/Plane */ \"./lib/Plane/index.js\")\n\nconst main = (el) => {\n return new Element(el)\n}\n\nmain.element = (el) => {\n return new Element(el)\n}\n\nmain.viewport = (el) => {\n console.log('view created')\n return new Viewport(el)\n}\n\nmain.plane = (el) => {\n return new Plane(el)\n}\n// or .space or .plane or .layer\n\n// main.geom = require('./lib/geom')\nmain.preload = __webpack_require__(/*! loadimages */ \"./node_modules/loadimages/index.js\")\nmain.version = __webpack_require__(/*! ./lib/version */ \"./lib/version.js\")\n\nmodule.exports = main\n\n\n//# sourceURL=webpack://affinedom/./index.js?");
/***/ }),
/***/ "./lib/Element/index.js":
/*!******************************!*\
!*** ./lib/Element/index.js ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const setElementTransform = __webpack_require__(/*! ./setElementTransform */ \"./lib/Element/setElementTransform.js\")\n// const proj = require('../geom/proj')\n\nconst SpaceElement = function (el) {\n if (typeof el === 'string') {\n // Treat as selector string. The querySelector returns the first match.\n // If not found, results null\n el = document.querySelector(el)\n }\n if (!el) {\n throw new Error('Element does not exist')\n }\n\n // TODO The parent DOM element must be a space element.\n // TODO Allow bastard space elements.\n // TODO allow viewless dom spaces. Much easier for the programmers\n // Use parentNode instead of parentElement. See:\n // https://stackoverflow.com/a/8685780/638546\n\n // TODO capture transformation from css at init\n\n // The element must be absolutely positioned to free\n // from the browser layout.\n // TODO detect instead of reset?\n // el.style.position = 'absolute'\n // el.style.top = '0'\n // el.style.left = '0'\n // el.style.bottom = 'auto' // avoid problems if bottom and right already set.\n // el.style.right = 'auto'\n // el.style.transform = 'matrix(1, 0, 0, 1, 0, 0)' // TODO consider if view pare\n\n // Allow us to find the space element of the parent DOM element.\n // This frees us from duplicating the DOM structure.\n\n // TODO Should we use an id?\n // Store all objects in a global map from affineid --> SpaceElement\n // el.dataset.affineid = Math.random().toFixed(16).substring(2)// TODO unique\n\n // We can attach directly to the DOM element\n // NOTE Beware of memory leaks. https://stackoverflow.com/a/1402782/638546\n el.affinedom = this\n\n this.el = el\n\n // Why we need to duplicate the coordinates here and in style?\n // Assumption: Too much overhead from parsing the css values\n // possibly thousands of times per second.\n //\n // What if the coordinates change thousands of times per second?\n // Style.transform will be generated thousands of times per second.\n // Perspective panning would ask 60 * n string generations, which\n // is probably as heavy operation as parsing the transform string\n // 60 * n times, where n is the number of space elements.\n\n // Translation from parent origin in the parent's space\n // this.x = 0\n // this.y = 0\n // this.z = 0 // represented as depth towards view origin\n // NOTE gestures are unable to modify z\n\n // Scaling and rotation about the set origin.\n // This defines the vector space of the element's affine plane.\n // this.s = 0 // scale, multiplier\n // this.r = 0 // radians\n // TODO or directly multiplicable:\n // this.a\n // this.b\n // this.c\n // this.d\n\n this.tr = {\n a: 1,\n b: 0,\n x: 0,\n y: 0\n }\n\n // Relative to the left top corner of the html element,\n // the pixel position for the origin of the space element.\n // Use px,py instead of x,y to emphasize pixel coordinates.\n // this.origin = {\n // px: 0,\n // py: 0\n // }\n // TODO Is origin needed? Or does it complicate things by\n // separating element coordinate space (local DOM coordinate space)\n // and the origin for the linear transformation?\n\n // TODO bind to element resize\n}\n\n// SpaceElement.createView = (el) => {\n// // TODO Is separate viewport creation needed?\n// // TODO name viewport or createViewport?\n// }\n\nconst proto = SpaceElement.prototype\n\nproto.ancestors = function () {\n // Ancestor space elements, ordered from the immediate parent to\n // the farthest ancestor, the immediate parent first.\n const arr = []\n let el = this.el.parentElement\n while (el.affinedom) {\n arr.push(el)\n el = el.parentElement\n }\n return arr\n}\n\nproto.at = function (x, y) {\n // TODO at(spacePoint) to represent spacePoint on el\n return {\n basis: this.el,\n x: x,\n y: y\n }\n}\n\nproto.atNorm = function (rx, ry) {\n // Get point by relative coordinates.\n //\n // Parameters:\n // rx\n // number. 0 at left edge, 1 at right edge.\n // ry\n // number. 0 at top edge, 1 at bottom edge.\n //\n // Return\n // point2 on the element\n //\n const w = this.el.offsetWidth\n const h = this.el.offsetHeight\n return {\n basis: this.el, // defines coordinate system\n x: rx * w,\n y: ry * h\n }\n}\n\nproto.atTopLeft = function () {\n return this.atNorm(0, 0)\n}\nproto.atTopMid = function () {\n return this.atNorm(0.5, 0)\n}\nproto.atTopRight = function () {\n return this.atNorm(1, 0)\n}\nproto.atMidLeft = function () {\n return this.atNorm(0, 0.5)\n}\nproto.atMidMid =\nproto.atMid = function () {\n return this.atNorm(0.5, 0.5)\n}\nproto.atMidRight = function () {\n return this.atNorm(1, 0.5)\n}\nproto.atBottomLeft = function () {\n return this.atNorm(0, 1)\n}\nproto.atBottomMid = function () {\n return this.atNorm(0.5, 1)\n}\nproto.atBottomRight = function () {\n return this.atNorm(1, 1)\n}\n\nproto.translate = function (translation, opts) {\n // TODO update only after possible delay?\n this.tr.x += translation.dx\n this.tr.y += translation.dy\n\n if (opts) {\n setAnimatedElementTransform(this.el, this.tr, opts)\n } else {\n setElementTransform(this.el, this.tr)\n }\n\n return this\n}\n\n// proto.delta =\n// proto.vector =\n// proto.vectorTo =\n// proto.project =\n// proto.projection =\n// proto.projectionTo = function (target) {\n// // Parameters\n// // target\n// // SpaceElement or SpaceView\n// //\n//\n// // TODO allow Element as target? Detect if affine element\n//\n// // TODO find common root and combine transformations\n// // TODO maybe apply a lowest common ancestor algorithm? See:\n// // TODO https://www.baeldung.com/cs/tree-lowest-common-ancestor\n//\n// // Extra naive method: travel always to view\n// // Naive method: assign depth for each, then travel towards root until same\n//\n// // See also: element.compareDocumentPosition()\n//\n// // TODO benchmark in-memory coordinates versus css parsed ones.\n// // Allow all DOM nodes where position absolute, 0, 0 and\n// // transform set\n//\n// // Find our projection to view // TODO why global projection?\n// const sourceProj = this.ancestors().reduce((acc, sel) => {\n// return proj.combine(acc, sel.proj)\n// }, this.proj)\n//\n// // Find target's projection to view // TODO why global?\n// const targetProj = this.ancestors().reduce((acc, sel) => {\n// return proj.combine(acc, sel.proj)\n// }, target.proj)\n//\n// return proj.between(sourceProj, targetProj)\n// }\n\n// proto.move = function (tran4) {\n// // TODO detect if vector2, tran2, tran4\n// // TODO On which plane is the transformation?\n//\n// // TODO recompute the projection to parent\n// this.proj = proj.transform(this.proj, tran4)\n//\n// // TODO if the view is the parent then account its transformation.\n// // We want to set style.transform on the view coordinates\n// const view = this.el.parentElement.affineview\n// if (view) {\n// const projToView = proj.between(this.proj, view.proj)\n// setElementTransform(this.el, projToView)\n// } else {\n// setElementTransform(this.el, this.proj)\n// }\n// }\n\n// proto.off = function (evName, evHandler) {\n// // TODO\n// }\n//\n// proto.on = function (evName, evHandler) {\n// // TODO\n// }\n\nproto.size = function () {\n // clientWidth and clientHeight include margin but not border.\n // offsetWidth and offsetHeight include margin and border.\n // Reference:\n // https://www.javascripttutorial.net/javascript-dom/javascript-width-height/\n return {\n basis: this.el,\n w: this.el.offsetWidth,\n h: this.el.offsetHeight\n }\n}\n\n// proto.touchable = function () {\n// // TODO return a Touch object\n// }\n// or draggable\n\n// proto.wheelable = function () {\n// // TODO return a Wheel object\n// }\n// or scrollable\n\nmodule.exports = SpaceElement\n\n\n//# sourceURL=webpack://affinedom/./lib/Element/index.js?");
/***/ }),
/***/ "./lib/Element/setElementTransform.js":
/*!********************************************!*\
!*** ./lib/Element/setElementTransform.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("const PREC = 8\n\nmodule.exports = function (el, tr) {\n // Update transformation of a HTMLElement.\n // They are HTMLElements parented on view's container, not nodes on space.\n //\n\n // If toString were used scientific notation might reach CSS\n // which leads to problems with Safari and Opera.\n // Therefore we must prevent the notation here with toFixed.\n // Of course this will cause a small deviation in the presentation.\n // However, the deviation is only in the presentation (not in the model)\n // and thus not a problem.\n const a = tr.a.toFixed(PREC)\n const b = tr.b.toFixed(PREC)\n const mb = (-tr.b).toFixed(PREC)\n const x = tr.x.toFixed(PREC)\n const y = tr.y.toFixed(PREC)\n\n // matrix(s, r, -r, s, tx, ty)\n el.style.transform = 'matrix(' +\n a + ',' + b + ',' + mb + ',' + a + ',' + x + ',' + y +\n ')'\n}\n\n\n//# sourceURL=webpack://affinedom/./lib/Element/setElementTransform.js?");
/***/ }),
/***/ "./lib/Plane/index.js":
/*!****************************!*\
!*** ./lib/Plane/index.js ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("// Plane is a kind of a layer with z-dimension.\n// There can be multiple spaces.\n// A Plane is always a direct child of Viewport. TODO awkward restriction?\n\nconst Plane = function (el) {\n // Parameters:\n // z\n // optional number. Perspective distance from the viewer.\n // Affects the scaling of the space.\n // Default z=1 (no perspective scaling)\n //\n this.el = el\n}\n\nconst proto = Plane.prototype\n\nproto.at = function (x, y) {\n return {\n basis: this.el,\n x: x,\n y: y\n }\n}\n\nmodule.exports = Plane\n\n\n//# sourceURL=webpack://affinedom/./lib/Plane/index.js?");
/***/ }),
/***/ "./lib/Viewport/index.js":
/*!*******************************!*\
!*** ./lib/Viewport/index.js ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// SpaceView wraps the element that is to be used as a viewport\n// to the affine dom.\n//\n// SpaceView has interface similar to SpaceElement but\n// the implementation is quite different.\n//\nconst proj = __webpack_require__(/*! ../geom/proj */ \"./lib/geom/proj.js\")\n\nconst Viewport = function (el) {\n if (typeof el === 'string') {\n // Treat as selector string. The querySelector returns the first match.\n // If not found, results null\n el = document.querySelector(el)\n }\n if (!el) {\n throw new Error('Element does not exist')\n }\n\n // A project from the view element onto the space.\n // TODO is Space only a mathematical concept or a concrete Element?\n this.proj = proj.IDENTITY\n\n // We attach the space object directly to the view's dom element.\n // The property will also identify the element as a view.\n el.affineview = this\n\n this.el = el\n}\n\nconst proto = Viewport.prototype\n\nproto.at = function (x, y) {\n // Parameters\n // x\n return {\n basis: this.el, // plane\n x: x,\n y: y\n }\n}\n\nproto.atNorm = function (rx, ry) {\n // Get point by relative coordinates.\n //\n // Parameters:\n // rx\n // number. 0 at left edge, 1 at right edge.\n // ry\n // number. 0 at top edge, 1 at bottom edge.\n //\n // Return\n // point2 on the view\n //\n const w = this.el.offsetWidth\n const h = this.el.offsetHeight\n return {\n basis: this.el, // plane\n x: rx * w,\n y: ry * h\n }\n}\n\nproto.atMid = function () {\n return this.atNorm(0.5, 0.5)\n}\n\nmodule.exports = Viewport\n\n\n//# sourceURL=webpack://affinedom/./lib/Viewport/index.js?");
/***/ }),
/***/ "./lib/geom/proj.js":
/*!**************************!*\
!*** ./lib/geom/proj.js ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("// Projetions are maps from plane A to plane B.\n// A projection can be used as a function that converts\n// coordinates of geometric structures from plane to plane.\n// The structure stays completely intact: isomorphism.\n// Only the representation changes.\n// The structures are in affine space: there is no origin or 'global' plane.\n//\n// The projection defines the location of plane A on plane B.\n// The projection defines the orientation of plane A on plane B.\n// A projection maps plane A (0,0) to the position of the plane A on plane B.\n\n// If plane A is a child element and plane B the parent, then\n// the projection from A to B is equivalent to the location of A on B.\n// This is named as spaceElement.proj.\n\nexports.I =\nexports.IDENTITY = {\n a: 1,\n b: 0,\n x: 0,\n y: 0\n}\n\nexports.copy = (proj) => {\n return Object.assign({}, proj)\n}\n\nexports.create = (a, b, x, y) => {\n return {\n a: 1,\n b: 0,\n x: 0,\n y: 0\n }\n}\n\n// exports.add =\n// exports.apply =\n// exports.multiply =\nexports.combine =\nexports.compose = (p, q) => {\n // Combine two projections\n //\n // Parameters:\n // p\n // projection to be applied last\n // q\n // projection to be applied first\n //\n // Return\n // proj\n //\n return {\n a: p.a * q.a - p.b * q.b,\n b: p.b * q.a + p.a * q.b,\n x: p.a * q.x - p.b * q.y + p.x,\n y: p.b * q.x + p.a * q.y + p.y\n }\n}\n\nexports.invert =\nexports.inverse = (p) => {\n // Invert the projection. A projection from plane P to plane Q\n // becomes a projection from plane Q to plane P.\n\n // See note 2015-10-27 at 2015-10-26-16-30 for analysis\n // Test if singular transformation. These might occur when all the range\n // points are the same, forcing the scale to drop to zero.\n const det = p.a * p.a + p.b * p.b\n if (Math.abs(det) < exports.EPSILON) {\n throw new Error('Singular transformations cannot be inversed.')\n }\n\n return {\n a: p.a / det,\n b: -p.b / det,\n x: (-p.a * p.x - p.b * p.y) / det,\n y: (p.b * p.x - p.a * p.y) / det\n }\n}\n\nexports.transform = (pr, tr) => {\n // Compute new projection between plane A and plane B after\n // the plane A has been moved by tran4 on plane B.\n //\n // Parameters:\n // pr\n // proj from plane A to plane B\n // tr\n // tran4 to move plane A on plane B\n //\n // Return\n // proj\n //\n\n // Matrix multiplication matrix(tran4) * matrix(proj)\n return {\n a: tr.da * pr.a - tr.db * pr.b,\n b: tr.db * pr.a + tr.da * pr.b,\n x: tr.da * pr.x - tr.db * pr.y + tr.dx,\n y: tr.db * pr.x + tr.da * pr.y + tr.dy\n }\n}\n\n// exports.difference =\n// exports.fromto =\n// exports.projectionBetween =\n// exports.relative =\nexports.delta =\nexports.between = (sourceProj, targetProj) => {\n // Finds a projection from a source plane A to a target plane B\n // from their projections to a intermediate root plane R.\n // The result is a combination of the inverse of the target projection\n // and the source projection.\n //\n // Parameters:\n // sourceProj\n // a projection from the source plane A to a root plane R\n // targetProj\n // a projection from the target plane B to a root plane R\n //\n // Return\n // proj\n //\n // TODO open the functions if projection between is used a lot.\n // TODO is the function needed? spaceEl.projectionTo(anotherSpaceEl) exists.\n const invProj = exports.invert(targetProj)\n return exports.combine(invProj, sourceProj)\n}\n\nexports.point2 = (pr, p2) => {\n // Project a point2\n //\n // Parameters:\n // pr\n // projection between planes\n //\n // Return\n // point2\n //\n return {\n x: pr.a * p2.x - pr.b * p2.y + pr.x,\n y: pr.b * p2.x + pr.a * p2.y + pr.y\n }\n}\n\n// exports.projectTranslation =\n// exports.projectVector =\nexports.vector2 = (pr, v2) => {\n // Project vector2 from plane to another.\n // Translations do not affect vectors,\n // only scaling and rotation do.\n //\n // Parameters:\n // pr\n // projection between planes\n // v2\n // vector2, a translation on a plane,\n // represented on the source plane.\n //\n // Return:\n // vector2, represented on the target plane,\n //\n return {\n dx: pr.a * v2.dx - pr.b * v2.dy,\n dy: pr.b * v2.dx + pr.a * v2.dy\n }\n}\n\n// exports.lin2 =\n// exports.linear =\nexports.tran2 = (pr, tr2) => {\n // Project a linear transformation from plane to another.\n // Use to represent the linear transformation on another plane.\n //\n // Parameters:\n // pr\n // projection between planes\n // tr2\n // tran2, linear transformation, represented on the source plane.\n //\n // Return:\n // tran2, represented on the target plane\n //\n return {\n da: pr.a * tr2.da - pr.b * tr2.db,\n db: pr.b * tr2.da + pr.a * tr2.db\n }\n}\n\n// exports.projectProj =\n// exports.projectTransform =\n// exports.tran =\nexports.tran4 = (pr, tr) => {\n // Transforms are quite similar to projections but they\n // happen on the plane, and thus are automorphisms.\n //\n // Parameters:\n // pr\n // proj, projection to be applied\n // tr\n // tran4, an affine similarity transformation\n //\n // Return\n // tran4\n //\n\n // Matrix multiplication matrix(pr) * matrix(tr)\n return {\n a: pr.a * tr.da - pr.b * tr.db,\n b: pr.b * tr.da + pr.a * tr.db,\n x: pr.a * tr.dx - pr.b * tr.dy + pr.x,\n y: pr.b * tr.dx + pr.a * tr.dy + pr.y\n }\n}\n\n\n//# sourceURL=webpack://affinedom/./lib/geom/proj.js?");
/***/ }),
/***/ "./lib/version.js":
/*!************************!*\
!*** ./lib/version.js ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("// generated by genversion\nmodule.exports = '2.0.0-alpha.0'\n\n\n//# sourceURL=webpack://affinedom/./lib/version.js?");
/***/ }),
/***/ "./node_modules/loadimages/index.js":
/*!******************************************!*\
!*** ./node_modules/loadimages/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = function loadimages(imgSrcs, then) {\n // Parameters\n // imgSrcs\n // array of image source paths OR single source path string.\n // then(err, imgElements)\n // Will be called after all the images are loaded. If string was given,\n // imgElements is an Image instead of array of Images.\n\n var numberOfImages, stringGiven, thereWasSuccess, thereWasError, imgs;\n var onloadsCalled, onload, onerror;\n\n if (typeof then !== 'function') {\n throw new Error('callback should be a function: ' + then);\n }\n\n if (typeof imgSrcs === 'string') {\n numberOfImages = 1;\n stringGiven = true;\n imgSrcs = [imgSrcs]; // Normalize\n } else {\n // Array of images\n numberOfImages = imgSrcs.length;\n stringGiven = false;\n }\n thereWasSuccess = false;\n thereWasError = false;\n\n imgs = [];\n\n onloadsCalled = 0;\n onload = function () {\n // Note:\n // this = Image\n if (!thereWasError) {\n onloadsCalled += 1;\n var isFinalImage = (onloadsCalled === numberOfImages);\n if (isFinalImage) {\n thereWasSuccess = true;\n if (stringGiven) {\n then(null, imgs[0]);\n } else {\n then(null, imgs);\n }\n }\n }\n };\n\n onerror = function (errMsg) {\n // Note:\n // this = Image\n\n // No errors after success.\n if (!thereWasSuccess) {\n thereWasError = true;\n then(errMsg, null);\n }\n\n // Prevent firing the default event handler\n // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onerror#Parameters\n return true;\n };\n\n for (i = 0; i < imgSrcs.length; i += 1) {\n imgs.push(new Image());\n imgs[i].onload = onload;\n imgs[i].onabort = onerror;\n imgs[i].onerror = onerror;\n imgs[i].src = imgSrcs[i];\n }\n};\n\n\n//# sourceURL=webpack://affinedom/./node_modules/loadimages/index.js?");
/***/ })
/******/ });
});