mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
Merge branch 'on-screen-clipboard' of github.com:m1k1o/neko into dev
This commit is contained in:
commit
c4f950bde1
@ -34,7 +34,7 @@
|
|||||||
<li v-if="hosting"><i @click.stop.prevent="onClipboard" class="fas fa-clipboard"></i></li>
|
<li v-if="hosting"><i @click.stop.prevent="onClipboard" class="fas fa-clipboard"></i></li>
|
||||||
</ul>
|
</ul>
|
||||||
<neko-resolution ref="resolution" v-if="admin" />
|
<neko-resolution ref="resolution" v-if="admin" />
|
||||||
<neko-clipboard ref="clipboard" v-if="hosting && !navigator.clipboard" />
|
<neko-clipboard ref="clipboard" v-if="hosting && !clipboard_available" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -237,6 +237,10 @@
|
|||||||
return this.$accessor.settings.scroll_invert
|
return this.$accessor.settings.scroll_invert
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get clipboard_available() {
|
||||||
|
return 'clipboard' in navigator
|
||||||
|
}
|
||||||
|
|
||||||
get clipboard() {
|
get clipboard() {
|
||||||
return this.$accessor.remote.clipboard
|
return this.$accessor.remote.clipboard
|
||||||
}
|
}
|
||||||
@ -310,7 +314,7 @@
|
|||||||
|
|
||||||
@Watch('clipboard')
|
@Watch('clipboard')
|
||||||
onClipboardChanged(clipboard: string) {
|
onClipboardChanged(clipboard: string) {
|
||||||
if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') {
|
if (this.clipboard_available && typeof navigator.clipboard.writeText === 'function') {
|
||||||
navigator.clipboard.writeText(clipboard).catch(console.error)
|
navigator.clipboard.writeText(clipboard).catch(console.error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -426,7 +430,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hosting && navigator.clipboard && typeof navigator.clipboard.readText === 'function') {
|
if (this.hosting && this.clipboard_available && typeof navigator.clipboard.readText === 'function') {
|
||||||
navigator.clipboard
|
navigator.clipboard
|
||||||
.readText()
|
.readText()
|
||||||
.then(text => {
|
.then(text => {
|
||||||
|
Loading…
Reference in New Issue
Block a user