Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files_sharing/src/components/SharingEntryInternal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default {
methods: {
async copyLink() {
try {
await this.$copyText(this.internalLink)
await navigator.clipboard.writeText(this.internalLink)
showSuccess(t('files_sharing', 'Link copied'))
// focus and show the tooltip (note: cannot set ref on NcActionLink)
this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus()
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ export default {
},
async copyLink() {
try {
await this.$copyText(this.shareLink)
await navigator.clipboard.writeText(this.shareLink)
showSuccess(t('files_sharing', 'Link copied'))
// focus and show the tooltip
this.$refs.copyButton.$el.focus()
Expand Down
2 changes: 0 additions & 2 deletions apps/files_sharing/src/files_sharing_tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/

import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'

import SharingTab from './views/SharingTab'
Expand All @@ -42,7 +41,6 @@ Object.assign(window.OCA.Sharing, { ShareTabSections: new TabSections() })

Vue.prototype.t = t
Vue.prototype.n = n
Vue.use(VueClipboard)

// Init Sharing tab component
const View = Vue.extend(SharingTab)
Expand Down
48 changes: 29 additions & 19 deletions apps/settings/src/components/AuthTokenSetupDialogue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@
class="monospaced"
readonly="readonly"
@focus="selectInput">

<a ref="clipboardButton"
<NcButton type="tertiary"
:title="copyTooltipOptions"
:aria-label="copyTooltipOptions"
v-clipboard:copy="appPassword"
v-clipboard:success="onCopyPassword"
v-clipboard:error="onCopyPasswordFailed"
class="icon icon-clippy"
@mouseover="hoveringCopyButton = true"
@mouseleave="hoveringCopyButton = false" />
@click="copyPassword">
<template #icon>
<Check v-if="copied" :size="20" />
<ContentCopy v-else :size="20" />
</template>
</NcButton>
<NcButton @click="reset">
{{ t('settings', 'Done') }}
</NcButton>
Expand All @@ -85,14 +84,20 @@
import QR from '@chenfengyuan/vue-qrcode'
import { confirmPassword } from '@nextcloud/password-confirmation'
import '@nextcloud/password-confirmation/dist/style.css'
import { showError } from '@nextcloud/dialogs'
import { getRootUrl } from '@nextcloud/router'
import NcButton from '@nextcloud/vue/dist/Components/NcButton'

import Check from 'vue-material-design-icons/Check.vue'
import ContentCopy from 'vue-material-design-icons/ContentCopy.vue'

export default {
name: 'AuthTokenSetupDialogue',
components: {
QR,
Check,
ContentCopy,
NcButton,
QR,
},
props: {
add: {
Expand All @@ -107,15 +112,14 @@ export default {
deviceName: '',
appPassword: '',
loginName: '',
passwordCopied: false,
copied: false,
showQR: false,
qrUrl: '',
hoveringCopyButton: false,
}
},
computed: {
copyTooltipOptions() {
if (this.passwordCopied) {
if (this.copied) {
return t('settings', 'Copied!')
}
return t('settings', 'Copy')
Expand Down Expand Up @@ -150,13 +154,19 @@ export default {
this.reset()
})
},
onCopyPassword() {
this.passwordCopied = true
this.$refs.clipboardButton.blur()
setTimeout(() => { this.passwordCopied = false }, 3000)
},
onCopyPasswordFailed() {
OC.Notification.showTemporary(t('settings', 'Could not copy app password. Please copy it manually.'))
async copyPassword() {
try {
await navigator.clipboard.writeText(this.appPassword)
this.copied = true
} catch (e) {
this.copied = false
console.error(e)
showError(t('settings', 'Could not copy app password. Please copy it manually.'))
} finally {
setTimeout(() => {
this.copied = false
}, 4000)
}
},
reset() {
this.adding = false
Expand Down
2 changes: 0 additions & 2 deletions apps/settings/src/main-personal-security.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@

import { loadState } from '@nextcloud/initial-state'
import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
import VTooltip from 'v-tooltip'

import AuthTokenSection from './components/AuthTokenSection'

// eslint-disable-next-line camelcase
__webpack_nonce__ = btoa(OC.requestToken)

Vue.use(VueClipboard)
Vue.use(VTooltip, { defaultHtml: false })
Vue.prototype.t = t

Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-security.js.map

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"v-tooltip": "^2.1.3",
"vue": "^2.7.14",
"vue-click-outside": "^1.1.0",
"vue-clipboard2": "^0.3.3",
"vue-cropperjs": "^4.2.0",
"vue-infinite-loading": "^2.4.5",
"vue-localstorage": "^0.6.2",
Expand Down