about #141 clipboard
This commit is contained in:
parent
5f9ddd969e
commit
9a315c241c
|
@ -81,11 +81,8 @@ $(document).on('click', 'a', e => {
|
||||||
|
|
||||||
//コピー
|
//コピー
|
||||||
function execCopy(string) {
|
function execCopy(string) {
|
||||||
var temp = $("#copy");
|
postMessage(["copy", string], "*")
|
||||||
temp.val(string);
|
return true;
|
||||||
temp.select();
|
|
||||||
var result = document.execCommand('copy');
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
function progshow(e) {
|
function progshow(e) {
|
||||||
if (e.lengthComputable) {
|
if (e.lengthComputable) {
|
||||||
|
|
|
@ -59,6 +59,8 @@ onmessage = function (e) {
|
||||||
ipc.send('nano', null);
|
ipc.send('nano', null);
|
||||||
} else if (e.data[0] == "asReadComp") {
|
} else if (e.data[0] == "asReadComp") {
|
||||||
ipc.send('sendMarkersComplete', null);
|
ipc.send('sendMarkersComplete', null);
|
||||||
|
} else if (e.data[0] == "copy") {
|
||||||
|
ipc.send('copy', e.data[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//version.js
|
//version.js
|
||||||
|
|
|
@ -6,6 +6,7 @@ function system(mainWindow, dir, lang, dirname) {
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
var JSON5 = require('json5');
|
var JSON5 = require('json5');
|
||||||
var ipc = electron.ipcMain;
|
var ipc = electron.ipcMain;
|
||||||
|
const clipboard = electron.clipboard;
|
||||||
var tmp_img = join(app.getPath("userData"), "tmp.png");
|
var tmp_img = join(app.getPath("userData"), "tmp.png");
|
||||||
var ha_path = join(app.getPath("userData"), "hardwareAcceleration");
|
var ha_path = join(app.getPath("userData"), "hardwareAcceleration");
|
||||||
var lang_path = join(app.getPath("userData"), "language");
|
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);
|
e.sender.webContents.send('font-list', fonts_sorted);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//コピー
|
||||||
|
ipc.on('copy', (e, arg) => {
|
||||||
|
clipboard.writeText(arg)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
exports.system = system;
|
exports.system = system;
|
Loading…
Reference in New Issue
Block a user