From 93eb86d1440215617ef544bce974ee6bc64bf225 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Fri, 25 May 2018 19:01:29 +0100 Subject: [PATCH] Put global input for debug purposes --- js/webamp.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/webamp.js b/js/webamp.js index e15ae127..7bd20896 100644 --- a/js/webamp.js +++ b/js/webamp.js @@ -10,7 +10,8 @@ import { getTrackCount } from "./selectors"; import { setSkinFromUrl, loadMediaFiles, - setWindowSize + setWindowSize, + loadFilesFromReferences } from "./actionCreators"; import { LOAD_STYLE } from "./constants"; import { uniqueId, objectMap, objectForEach } from "./utils"; @@ -77,6 +78,18 @@ class Winamp { type: navigator.onLine ? NETWORK_CONNECTED : NETWORK_DISCONNECTED }); + if (true) { + const fileInput = document.createElement("input"); + fileInput.id = "webamp-file-input"; + fileInput.style.display = "none"; + fileInput.type = "file"; + fileInput.value = null; + fileInput.addEventListener("change", e => { + this.store.dispatch(loadFilesFromReferences(e.target.files)); + }); + document.body.appendChild(fileInput); + } + this.genWindows = []; if (__extraWindows) { this.genWindows = __extraWindows.map(genWindow => ({