Remove: node on post.js #86

This commit is contained in:
Cutls 2019-06-15 01:15:45 +09:00
parent e2cde71831
commit 3c276b329b
3 changed files with 34 additions and 27 deletions

View File

@ -13,6 +13,8 @@ onmessage = function (e) {
ipc.send("dialogStore", e.data[1])
} else if (e.data[0] == "bmpImage") {
ipc.send('bmp-image', e.data[1]);
} else if (e.data[0] == "dialogCW") {
ipc.send("dialogCW", e.data[1])
}
}
//version.js
@ -50,26 +52,38 @@ function nano() {
}
//first.js
ipc.on('custom-css-response', function (event, arg) {
if (arg == "") { return false; }
var styleNode = document.createElement("style");
styleNode.setAttribute("type", "text/css")
if (arg == "") { return false; }
var styleNode = document.createElement("style");
styleNode.setAttribute("type", "text/css")
var content = document.createTextNode(arg)
styleNode.append(content)
document.getElementsByTagName("head")[0].append(styleNode)
var content = document.createTextNode(arg)
styleNode.append(content)
document.getElementsByTagName("head")[0].append(styleNode)
})
ipc.on('theme-css-response', function (event, arg) {
if (arg == "") { return false; }
var styleNode = document.createElement("style");
styleNode.setAttribute("type", "text/css")
if (arg == "") { return false; }
var styleNode = document.createElement("style");
styleNode.setAttribute("type", "text/css")
var content = document.createTextNode(arg)
styleNode.append(content)
document.getElementsByTagName("head")[0].append(styleNode)
var content = document.createTextNode(arg)
styleNode.append(content)
document.getElementsByTagName("head")[0].append(styleNode)
})
//img.js
ipc.on('bmp-img-comp', function (event, b64) {
media(b64[0], "image/png", b64[1]);
media(b64[0], "image/png", b64[1]);
});
//post.js
ipc.on('dialogCWRender', function (event, arg) {
if (arg === 1) {
$("#cw-text").show();
$("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail");
$("#cw-text").val(plus);
post("pass");
} else if (arg === 2) {
post("pass");
}
});
/*
var webviewDom = document.getElementById('webview');

View File

@ -47,9 +47,6 @@ function post(mode, postvis) {
}
if (domain != "kirishima.cloud") {
if (mode != "pass" && !$("#cw").hasClass("cw-avail") && (str.length > cw_sent || (str.split("\n").length - 1) > cw_ltres)) {
var electron = require("electron");
var remote = electron.remote;
var dialog = remote.dialog;
var plus = str.replace(/\n/g, "").slice(0, 10) + "...";
const options = {
type: 'info',
@ -57,17 +54,7 @@ function post(mode, postvis) {
message: lang.lang_post_cwtxt + plus,
buttons: [lang.lang_post_btn1, lang.lang_post_btn2, lang.lang_post_btn3]
}
dialog.showMessageBox(options, function (arg) {
if (arg === 1) {
$("#cw-text").show();
$("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail");
$("#cw-text").val(plus);
post("pass");
} else if (arg === 2) {
post("pass");
}
})
postMessage(["dialogCW", options], "*")
return false;
}
}

View File

@ -61,6 +61,12 @@ function system(mainWindow, dir, lang) {
}
});
})
//CWのダイアログ
ipc.on('dialogCW', function (e, args) {
dialog.showMessageBox(args, function (arg) {
e.sender.webContents.send('dialogCWRender', arg);
});
})
//ハードウェアアクセラレーションの無効化
ipc.on('ha', function (e, arg) {