remove ok = confirm() thing

This commit is contained in:
Andrew Dolgov 2018-11-30 13:05:59 +03:00
parent fd752a79af
commit da1a3c2cc5
4 changed files with 14 additions and 51 deletions

View File

@ -1118,9 +1118,7 @@ function backend_sanity_check_callback(transport) {
} }
function genUrlChangeKey(feed, is_cat) { function genUrlChangeKey(feed, is_cat) {
const ok = confirm(__("Generate new syndication address for this feed?")); if (confirm(__("Generate new syndication address for this feed?"))) {
if (ok) {
notify_progress("Trying to change address...", true); notify_progress("Trying to change address...", true);
@ -1392,12 +1390,8 @@ function showFeedsWithErrors() {
removeSelected: function() { removeSelected: function() {
const sel_rows = this.getSelectedFeeds(); const sel_rows = this.getSelectedFeeds();
console.log(sel_rows);
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
const ok = confirm(__("Remove selected feeds?")); if (confirm(__("Remove selected feeds?"))) {
if (ok) {
notify_progress("Removing selected feeds...", true); notify_progress("Removing selected feeds...", true);
const query = { op: "pref-feeds", method: "remove", const query = { op: "pref-feeds", method: "remove",

View File

@ -248,10 +248,7 @@ function removeSelectedLabels() {
const sel_rows = getSelectedLabels(); const sel_rows = getSelectedLabels();
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected labels?"))) {
const ok = confirm(__("Remove selected labels?"));
if (ok) {
notify_progress("Removing selected labels..."); notify_progress("Removing selected labels...");
const query = { op: "pref-labels", method: "remove", const query = { op: "pref-labels", method: "remove",
@ -274,9 +271,7 @@ function removeSelectedUsers() {
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
const ok = confirm(__("Remove selected users? Neither default admin nor your account will be removed.")); if (confirm(__("Remove selected users? Neither default admin nor your account will be removed."))) {
if (ok) {
notify_progress("Removing selected users..."); notify_progress("Removing selected users...");
const query = { op: "pref-users", method: "remove", const query = { op: "pref-users", method: "remove",
@ -299,10 +294,7 @@ function removeSelectedFilters() {
const sel_rows = getSelectedFilters(); const sel_rows = getSelectedFilters();
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected filters?"))) {
const ok = confirm(__("Remove selected filters?"));
if (ok) {
notify_progress("Removing selected filters..."); notify_progress("Removing selected filters...");
const query = { op: "pref-filters", method: "remove", const query = { op: "pref-filters", method: "remove",
@ -324,10 +316,7 @@ function removeSelectedFeeds() {
const sel_rows = getSelectedFeeds(); const sel_rows = getSelectedFeeds();
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Unsubscribe from selected feeds?"))) {
const ok = confirm(__("Unsubscribe from selected feeds?"));
if (ok) {
notify_progress("Unsubscribing from selected feeds...", true); notify_progress("Unsubscribing from selected feeds...", true);
@ -378,9 +367,7 @@ function resetSelectedUserPass() {
return; return;
} }
const ok = confirm(__("Reset password of selected user?")); if (confirm(__("Reset password of selected user?"))) {
if (ok) {
notify_progress("Resetting password for selected user..."); notify_progress("Resetting password for selected user...");
const id = rows[0]; const id = rows[0];
@ -452,9 +439,7 @@ function joinSelectedFilters() {
return; return;
} }
const ok = confirm(__("Combine selected filters?")); if (confirm(__("Combine selected filters?"))) {
if (ok) {
notify_progress("Joining filters..."); notify_progress("Joining filters...");
xhrPost("backend.php", { op: "pref-filters", method: "join", ids: rows.toString() }, () => { xhrPost("backend.php", { op: "pref-filters", method: "join", ids: rows.toString() }, () => {
@ -947,9 +932,7 @@ function editProfiles() {
const sel_rows = this.getSelectedProfiles(); const sel_rows = this.getSelectedProfiles();
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
const ok = confirm(__("Remove selected profiles? Active and default profiles will not be removed.")); if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) {
if (ok) {
notify_progress("Removing selected profiles...", true); notify_progress("Removing selected profiles...", true);
const query = { op: "rpc", method: "remprofiles", const query = { op: "rpc", method: "remprofiles",
@ -969,10 +952,7 @@ function editProfiles() {
const sel_rows = this.getSelectedProfiles(); const sel_rows = this.getSelectedProfiles();
if (sel_rows.length == 1) { if (sel_rows.length == 1) {
if (confirm(__("Activate selected profile?"))) {
const ok = confirm(__("Activate selected profile?"));
if (ok) {
notify_progress("Loading, please wait..."); notify_progress("Loading, please wait...");
xhrPost("backend.php", { op: "rpc", method: "setprofile", id: sel_rows.toString() }, () => { xhrPost("backend.php", { op: "rpc", method: "setprofile", id: sel_rows.toString() }, () => {
@ -1033,9 +1013,7 @@ function activatePrefProfile() {
function clearFeedAccessKeys() { function clearFeedAccessKeys() {
const ok = confirm(__("This will invalidate all previously generated feed URLs. Continue?")); if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
if (ok) {
notify_progress("Clearing URLs..."); notify_progress("Clearing URLs...");
xhrPost("backend.php", { op: "pref-feeds", method: "clearKeys" }, () => { xhrPost("backend.php", { op: "pref-feeds", method: "clearKeys" }, () => {

View File

@ -10,10 +10,7 @@ function shareArticle(id) {
title: __("Share article by URL"), title: __("Share article by URL"),
style: "width: 600px", style: "width: 600px",
newurl: function() { newurl: function() {
if (confirm(__("Generate new share URL for this article?"))) {
var ok = confirm(__("Generate new share URL for this article?"));
if (ok) {
notify_progress("Trying to change URL...", true); notify_progress("Trying to change URL...", true);
@ -51,10 +48,7 @@ function shareArticle(id) {
}, },
unshare: function() { unshare: function() {
if (confirm(__("Remove sharing for this article?"))) {
var ok = confirm(__("Remove sharing for this article?"));
if (ok) {
notify_progress("Trying to unshare...", true); notify_progress("Trying to unshare...", true);

View File

@ -1,8 +1,5 @@
function clearArticleAccessKeys() { function clearArticleAccessKeys() {
if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) {
var ok = confirm(__("This will invalidate all previously shared article URLs. Continue?"));
if (ok) {
notify_progress("Clearing URLs..."); notify_progress("Clearing URLs...");
var query = "?op=pluginhandler&plugin=share&method=clearArticleKeys"; var query = "?op=pluginhandler&plugin=share&method=clearArticleKeys";