3 input#upload(type="file" @change="upload")
5 @click="uploadTrigger()"
6 aria-label="store.state.tr['Upload a game']"
8 img.inline(src="/images/icons/upload.svg")
13 name: "my-upload-game",
15 uploadTrigger: function() {
16 document.getElementById("upload").click();
19 const file = (e.target.files || e.dataTransfer.files)[0];
20 var reader = new FileReader();
21 reader.onloadend = ev => {
22 this.parseAndEmit(ev.currentTarget.result);
24 reader.readAsText(file);
26 parseAndEmit: function(pgn) {
27 // TODO: header gives game Info, third secton the moves
29 // mark sur ID pour dire import : I_
30 this.$emit("game-uploaded", game);
36 <style lang="sass" scoped>
46 @media screen and (max-width: 767px)