From da1a3c2cc5621bccdb844cfbd03e377ada079fa9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 30 Nov 2018 13:05:59 +0300 Subject: [PATCH] remove ok = confirm() thing --- js/functions.js | 10 ++------- js/prefs.js | 40 ++++++++---------------------------- plugins/share/share.js | 10 ++------- plugins/share/share_prefs.js | 5 +---- 4 files changed, 14 insertions(+), 51 deletions(-) diff --git a/js/functions.js b/js/functions.js index c7530c8a..29dbe70c 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1118,9 +1118,7 @@ function backend_sanity_check_callback(transport) { } function genUrlChangeKey(feed, is_cat) { - const ok = confirm(__("Generate new syndication address for this feed?")); - - if (ok) { + if (confirm(__("Generate new syndication address for this feed?"))) { notify_progress("Trying to change address...", true); @@ -1392,12 +1390,8 @@ function showFeedsWithErrors() { removeSelected: function() { const sel_rows = this.getSelectedFeeds(); - console.log(sel_rows); - if (sel_rows.length > 0) { - const ok = confirm(__("Remove selected feeds?")); - - if (ok) { + if (confirm(__("Remove selected feeds?"))) { notify_progress("Removing selected feeds...", true); const query = { op: "pref-feeds", method: "remove", diff --git a/js/prefs.js b/js/prefs.js index 29c1f026..965e12fa 100755 --- a/js/prefs.js +++ b/js/prefs.js @@ -248,10 +248,7 @@ function removeSelectedLabels() { const sel_rows = getSelectedLabels(); if (sel_rows.length > 0) { - - const ok = confirm(__("Remove selected labels?")); - - if (ok) { + if (confirm(__("Remove selected labels?"))) { notify_progress("Removing selected labels..."); const query = { op: "pref-labels", method: "remove", @@ -274,9 +271,7 @@ function removeSelectedUsers() { if (sel_rows.length > 0) { - const ok = confirm(__("Remove selected users? Neither default admin nor your account will be removed.")); - - if (ok) { + if (confirm(__("Remove selected users? Neither default admin nor your account will be removed."))) { notify_progress("Removing selected users..."); const query = { op: "pref-users", method: "remove", @@ -299,10 +294,7 @@ function removeSelectedFilters() { const sel_rows = getSelectedFilters(); if (sel_rows.length > 0) { - - const ok = confirm(__("Remove selected filters?")); - - if (ok) { + if (confirm(__("Remove selected filters?"))) { notify_progress("Removing selected filters..."); const query = { op: "pref-filters", method: "remove", @@ -324,10 +316,7 @@ function removeSelectedFeeds() { const sel_rows = getSelectedFeeds(); if (sel_rows.length > 0) { - - const ok = confirm(__("Unsubscribe from selected feeds?")); - - if (ok) { + if (confirm(__("Unsubscribe from selected feeds?"))) { notify_progress("Unsubscribing from selected feeds...", true); @@ -378,9 +367,7 @@ function resetSelectedUserPass() { return; } - const ok = confirm(__("Reset password of selected user?")); - - if (ok) { + if (confirm(__("Reset password of selected user?"))) { notify_progress("Resetting password for selected user..."); const id = rows[0]; @@ -452,9 +439,7 @@ function joinSelectedFilters() { return; } - const ok = confirm(__("Combine selected filters?")); - - if (ok) { + if (confirm(__("Combine selected filters?"))) { notify_progress("Joining filters..."); xhrPost("backend.php", { op: "pref-filters", method: "join", ids: rows.toString() }, () => { @@ -947,9 +932,7 @@ function editProfiles() { const sel_rows = this.getSelectedProfiles(); if (sel_rows.length > 0) { - const ok = confirm(__("Remove selected profiles? Active and default profiles will not be removed.")); - - if (ok) { + if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) { notify_progress("Removing selected profiles...", true); const query = { op: "rpc", method: "remprofiles", @@ -969,10 +952,7 @@ function editProfiles() { const sel_rows = this.getSelectedProfiles(); if (sel_rows.length == 1) { - - const ok = confirm(__("Activate selected profile?")); - - if (ok) { + if (confirm(__("Activate selected profile?"))) { notify_progress("Loading, please wait..."); xhrPost("backend.php", { op: "rpc", method: "setprofile", id: sel_rows.toString() }, () => { @@ -1033,9 +1013,7 @@ function activatePrefProfile() { function clearFeedAccessKeys() { - const ok = confirm(__("This will invalidate all previously generated feed URLs. Continue?")); - - if (ok) { + if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) { notify_progress("Clearing URLs..."); xhrPost("backend.php", { op: "pref-feeds", method: "clearKeys" }, () => { diff --git a/plugins/share/share.js b/plugins/share/share.js index 09c973ed..0fb2f124 100644 --- a/plugins/share/share.js +++ b/plugins/share/share.js @@ -10,10 +10,7 @@ function shareArticle(id) { title: __("Share article by URL"), style: "width: 600px", newurl: function() { - - var ok = confirm(__("Generate new share URL for this article?")); - - if (ok) { + if (confirm(__("Generate new share URL for this article?"))) { notify_progress("Trying to change URL...", true); @@ -51,10 +48,7 @@ function shareArticle(id) { }, unshare: function() { - - var ok = confirm(__("Remove sharing for this article?")); - - if (ok) { + if (confirm(__("Remove sharing for this article?"))) { notify_progress("Trying to unshare...", true); diff --git a/plugins/share/share_prefs.js b/plugins/share/share_prefs.js index 9efe291f..e4c22262 100644 --- a/plugins/share/share_prefs.js +++ b/plugins/share/share_prefs.js @@ -1,8 +1,5 @@ function clearArticleAccessKeys() { - - var ok = confirm(__("This will invalidate all previously shared article URLs. Continue?")); - - if (ok) { + if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) { notify_progress("Clearing URLs..."); var query = "?op=pluginhandler&plugin=share&method=clearArticleKeys"; -- 2.39.2