about #141 clipboard

This commit is contained in:
cutls 2019-10-14 00:52:33 +09:00
parent 5f9ddd969e
commit 9a315c241c
3 changed files with 9 additions and 5 deletions

View File

@ -81,11 +81,8 @@ $(document).on('click', 'a', e => {
//コピー
function execCopy(string) {
var temp = $("#copy");
temp.val(string);
temp.select();
var result = document.execCommand('copy');
return result;
postMessage(["copy", string], "*")
return true;
}
function progshow(e) {
if (e.lengthComputable) {

View File

@ -59,6 +59,8 @@ onmessage = function (e) {
ipc.send('nano', null);
} else if (e.data[0] == "asReadComp") {
ipc.send('sendMarkersComplete', null);
} else if (e.data[0] == "copy") {
ipc.send('copy', e.data[1]);
}
}
//version.js

View File

@ -6,6 +6,7 @@ function system(mainWindow, dir, lang, dirname) {
const fs = require("fs");
var JSON5 = require('json5');
var ipc = electron.ipcMain;
const clipboard = electron.clipboard;
var tmp_img = join(app.getPath("userData"), "tmp.png");
var ha_path = join(app.getPath("userData"), "hardwareAcceleration");
var lang_path = join(app.getPath("userData"), "language");
@ -209,5 +210,9 @@ function system(mainWindow, dir, lang, dirname) {
e.sender.webContents.send('font-list', fonts_sorted);
});
});
//コピー
ipc.on('copy', (e, arg) => {
clipboard.writeText(arg)
});
}
exports.system = system;