diff --git a/0.bootstrap.js b/0.bootstrap.js index e7e4b17..da2dc5a 100644 --- a/0.bootstrap.js +++ b/0.bootstrap.js @@ -43,7 +43,7 @@ eval("\"use strict\";\n// Instantiate WebAssembly module\nvar wasmExports = __we /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gpx_web_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gpx-web-utils */ \"../pkg/gpx_web_utils.js\");\n\n\nconst inputElement = document.getElementById(\"input\");\n\ninputElement.addEventListener(\"change\", readFiles, false);\n\nfunction readFiles() {\n if (inputElement.files.length < 2) { alert(\"open two or more files\"); return; }\n\n const files = Array.from(inputElement.files);\n const promises = files.map(f => f.text());\n\n Promise.all(promises).then(gpxes => {\n const merged = gpx_web_utils__WEBPACK_IMPORTED_MODULE_0__[\"merge\"](gpxes);\n writeOutput(merged);\n inputElement.value = \"\";\n });\n}\n\nfunction writeOutput(file) {\n const blob = new Blob([file], {type: \"text/gpx\"});\n const a = document.createElement(\"a\");\n a.href = URL.createObjectURL(blob);\n a.download = \"merged.gpx\";\n a.click();\n URL.revokeObjectURL(a.href);\n}\n\n\n//# sourceURL=webpack:///./index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gpx_web_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gpx-web-utils */ \"../pkg/gpx_web_utils.js\");\n\n\nconst inputElement = document.getElementById(\"gpxInput\");\n\ninputElement.addEventListener(\"change\", readFiles, false);\n\nfunction readFiles() {\n if (inputElement.files.length < 2) { alert(\"open two or more files\"); return; }\n\n const files = Array.from(inputElement.files);\n const promises = files.map(f => f.text());\n\n Promise.all(promises).then(gpxes => {\n const merged = gpx_web_utils__WEBPACK_IMPORTED_MODULE_0__[\"merge\"](gpxes);\n writeOutput(merged);\n inputElement.value = \"\";\n });\n}\n\nfunction writeOutput(file) {\n const blob = new Blob([file], {type: \"text/gpx\"});\n const a = document.createElement(\"a\");\n a.href = URL.createObjectURL(blob);\n a.download = \"merged.gpx\";\n a.click();\n URL.revokeObjectURL(a.href);\n}\n\n\n//# sourceURL=webpack:///./index.js?"); /***/ }), diff --git a/index.html b/index.html index 1951cd3..7a414bf 100644 --- a/index.html +++ b/index.html @@ -2,11 +2,39 @@
-