deploy: a577f55387
				
					
				
			This commit is contained in:
		
							parent
							
								
									4f85667529
								
							
						
					
					
						commit
						be357517f6
					
				
					 2 changed files with 11 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -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(\"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?");
 | 
			
		||||
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\");\nconst loadingElement = document.createElement(\"span\");\n\nloadingElement.innerHTML = \"<strong>processing...</strong>\";\ninputElement.value = \"\";\ninputElement.addEventListener(\"change\", readFiles, false);\n\nfunction readFiles() {\n  if (inputElement.files.length < 2) { alert(\"open two or more files\"); return; }\n\n  inputElement.replaceWith(loadingElement);\n  const files = Array.from(inputElement.files);\n  const promises = files.map(f => f.text());\n\n  Promise.all(promises).then(gpxes => {\n    try {\n      const merged = gpx_web_utils__WEBPACK_IMPORTED_MODULE_0__[\"merge\"](gpxes);\n      writeOutput(merged);\n    } catch {\n      alert(\"there was a problem, please check the console.\");\n    } finally {\n      inputElement.value = \"\";\n      loadingElement.replaceWith(inputElement);\n    }\n  });\n}\n\nfunction writeOutput(file) {\n    const blob = new Blob([file], {type: \"text/gpx\"});\n    const anchorElement = document.createElement(\"a\");\n    anchorElement.href = URL.createObjectURL(blob);\n    anchorElement.download = \"merged.gpx\";\n    anchorElement.click();\n    URL.revokeObjectURL(anchorElement.href);\n}\n\n\n//# sourceURL=webpack:///./index.js?");
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										16
									
								
								index.html
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								index.html
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -22,19 +22,23 @@
 | 
			
		|||
    <h1>
 | 
			
		||||
      <a href="https://gpx.thermokar.st">gpx.thermokar.st</a>
 | 
			
		||||
    </h1>
 | 
			
		||||
    <span>
 | 
			
		||||
    <p>
 | 
			
		||||
      This client-side tool is for merging
 | 
			
		||||
      <a href="https://www.topografix.com/gpx.asp">GPX files</a>.
 | 
			
		||||
      Please note, this has only been tested on GPX files produced by
 | 
			
		||||
      <a href="https://www.garmin.com">Garmin</a> and
 | 
			
		||||
      <a href="https://www.strava.com">Strava</a> - your mileage may vary.
 | 
			
		||||
      Source:
 | 
			
		||||
    </p>
 | 
			
		||||
    <form>
 | 
			
		||||
      <input id="gpxInput" type="file" multiple accept="text/gpx,.gpx">
 | 
			
		||||
    </form>
 | 
			
		||||
    <hr>
 | 
			
		||||
    <p>
 | 
			
		||||
      <small>
 | 
			
		||||
         <a href="https://github.com/thermokarst/gpx-web-utils">
 | 
			
		||||
          https://github.com/thermokarst/gpx-web-utils</a>
 | 
			
		||||
    </span>
 | 
			
		||||
    <form>
 | 
			
		||||
      <input id="gpxInput" type="file" multiple>
 | 
			
		||||
    </form>
 | 
			
		||||
      </small>
 | 
			
		||||
    </p>
 | 
			
		||||
    <script src="./bootstrap.js"></script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue