Skip to content
Snippets Groups Projects
Commit ab66a878 authored by Adam Procter's avatar Adam Procter
Browse files

added copy/download button

This is a work around and I dont think is obvious at all but it allows for testing and playing
parent 403aae43
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ export default {
props: {
uploadready: Boolean,
// copyready: Boolean,
copyready: Boolean,
},
data: function () {
return {
......@@ -61,11 +61,18 @@ export default {
watch: {
uploadready: function (newVal) {
// watch it
console.log(newVal)
//console.log(newVal)
if (newVal == true) {
document.getElementById('file').click()
}
},
copyready: function (newVal2) {
// watch it
//console.log(newVal2)
if (newVal2 == true) {
document.getElementById('copyme').click()
}
},
},
methods: {
async getIpfsNodeInfo() {
......@@ -110,14 +117,14 @@ export default {
},
copyClipBoard(e) {
this.copytext = 'https://ipfs.io/ipfs/' + e
this.copyready = true
setTimeout(this.copyClick, 1000)
this.copytext = '![](https://ipfs.io/ipfs/' + e + ')'
//this.copyready = true
// setTimeout(this.copyClick, 1000)
},
copyClick() {
document.getElementById('copyme').click()
},
// copyClick() {
// document.getElementById('copyme').click()
// },
copyDone() {
var copyHash = document.getElementById('ipfshash')
......@@ -126,6 +133,7 @@ export default {
copyHash.setSelectionRange(0, 99999) /*For mobile devices*/
document.execCommand('copy')
this.$emit('uploadAdded')
this.$emit('copyDone')
},
},
}
......
......@@ -15,7 +15,7 @@
</template>
<script>
var serverUrl = 'http://127.0.0.1:5984'
var serverUrl = 'http://nodenogg.in'
import { mapState, mapGetters } from 'vuex'
import * as allModes from '@/experimental/modes'
......@@ -48,6 +48,12 @@ export default {
// this.selectedFile = event.target.files[0]
// }
}
if (mode == 'copy') {
this.$emit('copyDone')
// onFileSelected(event) {
// this.selectedFile = event.target.files[0]
// }
}
},
isActive(mode) {
......
<template>
<g>
<circle cx="6.5" cy="30.5" r="5.5" fill="black" />
<circle cx="40.5" cy="30.5" r="5.5" fill="black" />
<circle cx="17.5" cy="27.5" r="8.5" fill="black" />
<circle cx="28.5" cy="25.5" r="10.5" fill="black" />
<rect x="6" y="31" width="35" height="5" fill="black" />
<circle
cx="9.5"
cy="25.5"
r="4.5"
fill="white"
stroke="black"
stroke-width="2"
/>
<circle
cx="43.5"
cy="25.5"
r="4.5"
fill="white"
stroke="black"
stroke-width="2"
/>
<circle
cx="20.5"
cy="22.5"
r="7.5"
fill="white"
stroke="black"
stroke-width="2"
/>
<circle
cx="31.5"
cy="20.5"
r="9.5"
fill="white"
stroke="black"
stroke-width="2"
/>
<rect x="9" y="23" width="35" height="6" fill="white" />
<rect x="9" y="23" width="12" height="5" fill="white" />
<rect x="18" y="21" width="9" height="6" fill="white" />
<rect
x="44.0038"
y="27.99"
width="21"
height="5"
transform="rotate(179.956 44.0038 27.99)"
fill="white"
/>
<rect
x="40.0031"
y="24.9931"
width="10"
height="4"
transform="rotate(179.956 40.0031 24.9931)"
fill="white"
/>
<path
d="M30.4747 27.5307C30.7678 27.8234 31.2427 27.823 31.5353 27.5299L36.3046 22.7533C36.5973 22.4602 36.5969 21.9853 36.3038 21.6926C36.0107 21.4 35.5358 21.4003 35.2432 21.6934L31.0038 25.9393L26.7579 21.7C26.4648 21.4073 25.9899 21.4076 25.6972 21.7008C25.4046 21.9939 25.4049 22.4688 25.698 22.7614L30.4747 27.5307ZM30.2454 15.0006L30.2546 27.0006L31.7546 26.9994L31.7454 14.9994L30.2454 15.0006Z"
fill="black"
/>
</g>
</template>
......@@ -10,6 +10,7 @@ import plus from './plus'
import select from './select'
import upload from './upload'
import exit from './exit'
import copy from './copy'
export {
addNode,
......@@ -24,4 +25,5 @@ export {
select,
upload,
exit,
copy,
}
......@@ -64,6 +64,17 @@ export const upload = {
shortcut: false,
}
export const copy = {
name: 'copy',
view: {
pan: false,
zoom: false,
},
icon: 'copy',
cursor: 'copy',
shortcut: false,
}
export const exit = {
name: 'exit',
view: {
......
......@@ -79,11 +79,14 @@
@offlineTriggered="offlineTriggered()"
@onlineTriggered="onlineTriggered()"
@uploadAdded="uploadAdded()"
@copyDone="copyDone()"
/>
<ViewToolbar />
<UploadLayer
v-bind:uploadready="uploadready"
v-bind:copyready="copyready"
@uploadAdded="uploadAdded()"
@copyDone="copyDone()"
/>
</div>
</div>
......@@ -117,6 +120,7 @@ export default {
listview: false,
offline: false,
uploadready: false,
copyready: false,
}
},
computed: {
......@@ -165,11 +169,13 @@ export default {
},
uploadAdded() {
//
console.log('step one')
this.uploadready = !this.uploadready
},
copyDone() {
this.copyready = !this.copyready
},
clientAdded() {
this.clientset = !this.clientset
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment