Remove: colummn-deleting dialog

This commit is contained in:
Cutls 2019-06-26 00:52:15 +09:00
parent fc4d3b24f6
commit 3e0dbd8433
7 changed files with 30 additions and 60 deletions

View File

@ -21,9 +21,9 @@ var lang = {
//common/version.js
"lang_version_usever": "No update is found({{ver}})",
"lang_version_skipver": "Update was ignored.",
"lang_version_platform": "Was this software installed at Microsoft Store? Most users select 'No' since they installed from the website. When select 'yes', any update was ignored.",
"lang_version_platform_linux": "Was this software installed at Snapcraft(snapd)? Most users select 'No' since they installed from the website. When select 'yes', any update was ignored.",
"lang_version_platform_mac": "Was this software installed at Homebrew Cask? Most users select 'No' since they installed from the website. When select 'yes', any update was ignored.",
"lang_version_platform": "Do you want auto-updates?(users installed on Microsoft Store select 'No')",
"lang_version_platform_linux": "Do you want auto-updates?(users installed on Snapcraft select 'No')",
"lang_version_platform_mac": "Do you want auto-updates?(Homebrew Cask users select 'No')",
//login
//login/login.js
"lang_login_noauth": "Show TL of unlogined accounts",
@ -111,6 +111,8 @@ var lang = {
//tl/tl.js
"lang_tl_media": "Media",
"lang_tl_reconnect": "Reconnect to streaming API",
//ui/img.js
"lang_img_DLDone": "Downloaded:",
//ui/layout.js
"lang_layout_gotop": "Go top of this column. When icon is red, this column cannot connect straming API. Please reload.",
"lang_layout_thisacct": "{{notf}} of this account",
@ -129,6 +131,8 @@ var lang = {
"lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)",
"lang_layout_leftFold": "Stack to the left",
"lang_layout_leftUnfold": "Dock on the right",
"lang_layout_deleteColumn":"Delete this column",
"lang_layout_deleteColumnDesc":"Delete this column",
//ui/sort.js
"lang_sort_gothis": "Go to this column",
"lang_sort_remthis": "Delete this column",

View File

@ -131,6 +131,8 @@ var lang = {
"lang_layout_excludingbt": "BT表示(OFF/BT除外/BTのみ)",
"lang_layout_leftFold": "左へ重ねる",
"lang_layout_leftUnfold": "右へ出す",
"lang_layout_deleteColumn":"カラム削除",
"lang_layout_deleteColumnDesc":"カラムを削除しますか?",
//ui/sort.js
"lang_sort_gothis": "このカラムへ",
"lang_sort_remthis": "このカラムを削除",

View File

@ -136,8 +136,6 @@ onmessage = function (e) {
M.toast({ html: lang.lang_img_DLDone + e.data[1][0] + '<button class="btn-flat toast-action" onclick="openFinder(\'' + e.data[1][1] + '\')">Show</button>', displayLength: 5000 })
} else if (e.data[0] == "parseColumn") {
parseColumn()
} else if (e.data[0] == "sortload") {
sortload()
} else if (e.data[0] == "exportSettingsCore") {
exportSettingsCore()
} else if (e.data[0] == "fontList") {

View File

@ -111,23 +111,6 @@ ipc.on('general-dl-message', function (event, arg) {
console.log("saved")
postMessage(["toastSaved", [arg, argC]], "*")
})
//layout.js
ipc.on('column-del-reply', function (event, args) {
if (args[0] === 1) {
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
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);
postMessage(["parseColumn", ""], "*")
postMessage(["sortload", ""], "*")
}
})
//setting.js
ipc.on('langres', function (event, arg) {
location.href = "../" + lang + "/setting.html"

View File

@ -364,8 +364,26 @@ function addselCk() {
function removeColumn(tlid) {
$("#sort-box").addClass("hide");
$("#sort-box").removeClass("show");
//聞く
postMessage(["columnDel", tlid], "*")
Swal.fire({
title: lang.lang_layout_deleteColumn,
text: lang.lang_layout_deleteColumnDesc,
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: lang.lang_yesno,
cancelButtonText: lang.lang_no
}).then((result) => {
if (result.value) {
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
obj.splice(tlid, 1);
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn()
sortLoad()
}
});
}
//設定トグル

View File

@ -146,33 +146,5 @@ function templete(lang, mainWindow, packaged, dir) {
];
return menu;
}
function delsel(lang) {
const dict = {
"delete": {
"ja": "カラム削除",
"en": "Delete this column"
},
"mess": {
"ja": "カラムを削除しますか?(すべてのカラムのリンク解析がOFFになります。)",
"en": "Delete this column(URL analyzes of all windows will be disabled.)"
},
"yes": {
"ja": "はい",
"en": "Yes"
},
"no": {
"ja": "いいえ",
"en": "No"
}
}
const options = {
type: 'info',
title: dict.delete[lang],
message: dict.mess[lang],
buttons: [dict.no[lang], dict.yes[lang]]
}
return options;
}
exports.template = templete;
exports.delsel = delsel;

View File

@ -136,13 +136,6 @@ function system(mainWindow, dir, lang, dirname) {
window.loadURL(dir + '/about.html?ver=' + ver);
return "true"
}
ipc.on('column-del', (e, tlid) => {
console.log(tlid);
var options = language.delsel(lang)
dialog.showMessageBox(options, function (index) {
e.sender.webContents.send('column-del-reply', [index, tlid]);
})
});
ipc.on('nano', function (e, x, y) {
var nano_info_path = join(app.getPath("userData"),