Remove: node on ui/img/layout.js #86

This commit is contained in:
Cutls 2019-06-15 01:32:59 +09:00
parent 725f0f789a
commit 7b46145114
4 changed files with 44 additions and 39 deletions

View File

@ -19,6 +19,12 @@ onmessage = function (e) {
ipc.send('native-notf', e.data[1]);
} else if (e.data[0] == "dialogClient") {
ipc.send("dialogClient", e.data[1])
} else if (e.data[0] == "generalDL") {
ipc.send('general-dl', e.data[1]);
} else if (e.data[0] == "openFinder") {
ipc.send('open-finder', e.data[1]);
} else if (e.data[0] == "columnDel") {
ipc.send('column-del', e.data[1]);
}
}
//version.js
@ -134,6 +140,29 @@ ipc.on('dialogClientRender', function (event, arg) {
}
parseColumn();
});
//ui,img.js
ipc.on('general-dl-prog', function (event, arg) {
console.log("Progress: " + arg);
})
ipc.on('general-dl-message', function (event, arg) {
var argC = arg.replace(/\\/g, "\\\\") + "\\\\.";
M.toast({ html: lang.lang_img_DLDone + arg + '<button class="btn-flat toast-action" onclick="openFinder(\'' + argC + '\')">Show</button>', displayLength: 5000 })
})
//layout.js
ipc.on('column-del-reply', function (event, args) {
if (args[0] === 1) {
localStorage.removeItem("card_" + args[1]);
obj.splice(args[1], 1);
for (var i = 0; i < obj.length; i++) {
localStorage.setItem("card_" + i, "true");
localStorage.removeItem("catch_" + i);
}
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn();
sortload()
}
})
/*
var webviewDom = document.getElementById('webview');
const {

View File

@ -271,22 +271,14 @@ function detFromImg() {
//画像保存
function dlImg() {
var url = $("#imgmodal").attr("src");
var electron = require("electron");
var ipc = electron.ipcRenderer;
if (localStorage.getItem("savefolder")) {
var save = localStorage.getItem("savefolder");
} else {
var save = "";
}
ipc.send('general-dl', [url, save, false]);
ipc.on('general-dl-prog', function (event, arg) {
console.log("Progress: " + arg);
})
ipc.on('general-dl-message', function (event, arg) {
var argC = arg.replace(/\\/g, "\\\\") + "\\\\.";
M.toast({ html: lang.lang_img_DLDone + arg + '<button class="btn-flat toast-action" onclick="openFinder(\'' + argC + '\')">Show</button>', displayLength: 5000 })
})
postMessage(["generalDL", [url, save, false]], "*")
}
function openFinder(dir) {
ipc.send('open-finder', dir);
postMessage(["openFinder", dir], "*")
}

View File

@ -170,10 +170,10 @@ function parseColumn(dontclose) {
'<input type="checkbox" class="filled-in" id="exc-follow-' + key + '" ' + excludeCk(key, "follow") + ' /><label for="exc-follow-' + key + '" class="exc-chb" ><i class="fas fa-users exc-icons"></i></label> ' +
'<input type="checkbox" class="filled-in" id="exc-poll-' + key + '" ' + excludeCk(key, "poll") + ' /><label for="exc-poll-' + key + '" class="exc-chb" ><i class="fas fa-tasks exc-icons"></i></label> ' +
'<button class="btn waves-effect" style="width:60px; padding:0;" onclick="exclude(' + key + ')">Filter</button>';
if(checkNotfFilter(key)){
exclude=exclude+'<button class="btn red waves-effect" style="width:60px; padding:0;" onclick="resetNotfFilter(' + key + ')">Clear all</button>'
}
exclude=exclude+"<br>";
if (checkNotfFilter(key)) {
exclude = exclude + '<button class="btn red waves-effect" style="width:60px; padding:0;" onclick="resetNotfFilter(' + key + ')">Clear all</button>'
}
exclude = exclude + "<br>";
} else if (acct.type == "home") {
var exclude = '<a onclick="ebtToggle(' + key +
')" class="setting nex"><i class="fas fa-retweet waves-effect nex" title="' + lang.lang_layout_excludingbt + '" style="font-size:24px"></i><span id="sta-bt-' +
@ -308,7 +308,7 @@ function secvis(set) {
//カラム追加
function addColumn() {
var acct = $("#add-acct-sel").val();
if(acct != "webview" && acct != "noauth"){
if (acct != "webview" && acct != "noauth") {
localStorage.setItem("last-use", acct);
}
var type = $("#type-sel").val();
@ -367,23 +367,7 @@ function removeColumn(tlid) {
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
//聞く
var electron = require("electron");
var ipc = electron.ipcRenderer;
ipc.send('column-del', "");
ipc.on('column-del-reply', function (event, arg) {
if (arg === 1) {
localStorage.removeItem("card_" + tlid);
obj.splice(tlid, 1);
for (var i = 0; i < obj.length; i++) {
localStorage.setItem("card_" + i, "true");
localStorage.removeItem("catch_" + i);
}
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn();
sortload()
}
})
postMessage(["columnDel", tlid], "*")
}
//設定トグル

View File

@ -73,7 +73,7 @@ function system(mainWindow, dir, lang) {
e.sender.webContents.send('dialogClientRender', arg);
});
})
//ハードウェアアクセラレーションの無効化
ipc.on('ha', function (e, arg) {
@ -100,7 +100,7 @@ function system(mainWindow, dir, lang) {
var ver = app.getVersion()
var window = new BrowserWindow({
webPreferences: {
nodeIntegration:true
nodeIntegration: true
},
width: 300,
height: 480,
@ -111,12 +111,12 @@ function system(mainWindow, dir, lang) {
window.loadURL(dir + '/about.html?ver=' + ver);
return "true"
}
ipc.on('column-del', (e, args) => {
ipc.on('column-del', (e, tlid) => {
console.log(lang);
var options = language.delsel(lang)
dialog.showMessageBox(options, function (index) {
e.sender.webContents.send('column-del-reply', index);
e.sender.webContents.send('column-del-reply', [index, tlid]);
})
});
ipc.on('nano', function (e, x, y) {
@ -131,7 +131,7 @@ function system(mainWindow, dir, lang) {
}
var nanowindow = new BrowserWindow({
webPreferences: {
nodeIntegration:true
nodeIntegration: true
},
width: 350,
height: 200,
@ -165,7 +165,7 @@ function system(mainWindow, dir, lang) {
}
});
ipc.on('export', (e, args) => {
fs.writeFileSync(args[0], args[1]);
});