Change: some node integration on rend-proc #86

This commit is contained in:
Cutls 2019-06-15 02:30:29 +09:00
parent 070c40a958
commit eba54d0906
4 changed files with 20 additions and 21 deletions

View File

@ -104,13 +104,13 @@
class="material-icons left">close</i>Close</button> class="material-icons left">close</i>Close</button>
<script type="text/javascript" src="./js/ui/theme.js"></script> <script type="text/javascript" src="./js/ui/theme.js"></script>
<script> <script>
postMessage(["sendSinmpleIpc", "aboutData"], "*")
function renderAbout(args) {
$("#now").text(localStorage.getItem("ver")); $("#now").text(localStorage.getItem("ver"));
var electron = require("electron"); $("#node").text(args.version);
var remote = electron.remote; $("#chrome").text(args.versions.chrome);
const shell = electron.shell; $("#electron").text(args.versions.electron);
$("#node").text(remote.process.version); }
$("#chrome").text(remote.process.versions.chrome);
$("#electron").text(remote.process.versions.electron);
if (location.search) { if (location.search) {
var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/); var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/);
var ver = m[1]; var ver = m[1];
@ -118,7 +118,7 @@
} }
$(document).on('click', 'a', e => { $(document).on('click', 'a', e => {
var url = $(e.target).attr('href'); var url = $(e.target).attr('href');
shell.openExternal(url); postMessage(["openUrl", url], "*")
return false; return false;
}); });
</script> </script>

View File

@ -1,6 +1,3 @@
//jQuery読む
window.jQuery = window.$ = require('../../js/common/jquery.js');
var Hammer = require('../../js/common/hammer.min.js');
$.strip_tags = function (str, allowed) { $.strip_tags = function (str, allowed) {
if (!str) { if (!str) {
return ""; return "";

View File

@ -243,12 +243,13 @@ ipc.on('prog', function (event, arg) {
ipc.on('mess', function (event, arg) { ipc.on('mess', function (event, arg) {
updateMess(arg) updateMess(arg)
}) })
/* //about.html
ipc.on('aboutData', function (event, arg) {
renderAbout(arg)
})
var webviewDom = document.getElementById('webview'); var webviewDom = document.getElementById('webview');
const { if(webviewDom){
shell
} = require('electron');
webviewDom.addEventListener('new-window', function (e) { webviewDom.addEventListener('new-window', function (e) {
shell.openExternal(e.url); shell.openExternal(e.url);
}); });
*/ }

View File

@ -144,9 +144,10 @@ function system(mainWindow, dir, lang) {
about(); about();
}); });
ipc.on('aboutData', (e, args) => {
e.sender.webContents.send('aboutDataRender', process);
});
function about() { function about() {
var ver = app.getVersion() var ver = app.getVersion()
var window = new BrowserWindow({ var window = new BrowserWindow({
webPreferences: { webPreferences: {