copy image to clipboard #715
This commit is contained in:
@@ -79,6 +79,8 @@ onmessage = function(e) {
|
||||
ipc.send('sendMarkersComplete', null)
|
||||
} else if (e.data[0] == 'copy') {
|
||||
ipc.send('copy', e.data[1])
|
||||
} else if (e.data[0] == 'copyBinary') {
|
||||
ipc.send('copyBinary', e.data[1])
|
||||
} else if (e.data[0] == 'log') {
|
||||
ipc.send('log', e.data[1])
|
||||
} else if (e.data[0] == 'twitterLogin') {
|
||||
|
@@ -78,7 +78,7 @@ function imgCont(type) {
|
||||
function imageXhr(id, key, murl) {
|
||||
let time = 0
|
||||
var startTime = new Date()
|
||||
const timer = setInterval(function() {
|
||||
const timer = setInterval(function () {
|
||||
time = time + 1
|
||||
$('#imgsec').text(time)
|
||||
}, 10)
|
||||
@@ -343,3 +343,13 @@ function copyImgUrl() {
|
||||
execCopy(murl)
|
||||
M.toast({ html: lang.lang_img_copyDone, displayLength: 1500 })
|
||||
}
|
||||
async function copyImgBinary() {
|
||||
var murl = $('#imagemodal').attr('data-original')
|
||||
const blob = await (await fetch(murl)).blob()
|
||||
const reader = new FileReader()
|
||||
reader.onloadend = function () {
|
||||
postMessage(['copyBinary', reader.result], '*')
|
||||
M.toast({ html: lang.lang_imgBin_copyDone, displayLength: 1500 })
|
||||
}
|
||||
reader.readAsDataURL(blob)
|
||||
}
|
Reference in New Issue
Block a user