Feature: add file-name for customurl

add $fileName arg for customUrl

ISSUES CLOSED: #173
This commit is contained in:
Molunerfinn
2019-04-18 17:25:10 +08:00
parent 3c6b329927
commit c59e2bcc97
5 changed files with 29 additions and 18 deletions

View File

@@ -213,13 +213,12 @@ export default {
this.changeZIndexForGallery(false)
},
copy (item) {
const url = item.url || item.imgUrl
const style = this.$db.read().get('settings.pasteStyle').value() || 'markdown'
const copyLink = pasteStyle(style, url)
const copyLink = pasteStyle(style, item)
const obj = {
title: '复制链接成功',
body: copyLink,
icon: url
icon: item.url || item.imgUrl
}
const myNotification = new window.Notification(obj.title, obj)
this.$electron.clipboard.writeText(copyLink)
@@ -325,8 +324,7 @@ export default {
Object.keys(this.choosedList).forEach(key => {
if (this.choosedList[key]) {
const item = this.$db.read().get('uploaded').getById(key).value()
const url = item.url || item.imgUrl
copyString += pasteStyle(style, url) + '\n'
copyString += pasteStyle(style, item) + '\n'
this.choosedList[key] = false
}
})

View File

@@ -84,7 +84,7 @@
this.notification.icon = item.imgUrl
const myNotification = new window.Notification(this.notification.title, this.notification)
const pasteStyle = this.$db.read().get('settings.pasteStyle').value() || 'markdown'
this.$electron.clipboard.writeText(pasteTemplate(pasteStyle, item.imgUrl))
this.$electron.clipboard.writeText(pasteTemplate(pasteStyle, item))
myNotification.onclick = () => {
return true
}