mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 07:05:56 +00:00
confirm dangerous actions in prefs, main quick-delete action change
This commit is contained in:
@@ -353,7 +353,7 @@
|
|||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
while ($line = db_fetch_assoc($result)) {
|
||||||
|
|
||||||
$feed = $line["title"];
|
$feed = db_unescape_string($line["title"]);
|
||||||
$feed_id = $line["id"];
|
$feed_id = $line["id"];
|
||||||
|
|
||||||
$subop = $_GET["subop"];
|
$subop = $_GET["subop"];
|
||||||
@@ -2986,7 +2986,8 @@
|
|||||||
name=\"subop\" value=\"Save configuration\">";
|
name=\"subop\" value=\"Save configuration\">";
|
||||||
|
|
||||||
print " <input class=\"button\" type=\"submit\"
|
print " <input class=\"button\" type=\"submit\"
|
||||||
name=\"subop\" value=\"Reset to defaults\"></p>";
|
name=\"subop\" onclick=\"return validatePrefsReset()\"
|
||||||
|
value=\"Reset to defaults\"></p>";
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
|
|||||||
96
prefs.js
96
prefs.js
@@ -486,13 +486,16 @@ function removeSelectedLabels() {
|
|||||||
|
|
||||||
if (sel_rows.length > 0) {
|
if (sel_rows.length > 0) {
|
||||||
|
|
||||||
notify("Removing selected labels...");
|
var ok = confirm("Remove selected labels?");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+
|
|
||||||
param_escape(sel_rows.toString()), true);
|
|
||||||
xmlhttp.onreadystatechange=labellist_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
|
if (ok) {
|
||||||
|
notify("Removing selected labels...");
|
||||||
|
|
||||||
|
xmlhttp.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+
|
||||||
|
param_escape(sel_rows.toString()), true);
|
||||||
|
xmlhttp.onreadystatechange=labellist_callback;
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
notify("Please select some labels first.");
|
notify("Please select some labels first.");
|
||||||
}
|
}
|
||||||
@@ -509,12 +512,16 @@ function removeSelectedUsers() {
|
|||||||
|
|
||||||
if (sel_rows.length > 0) {
|
if (sel_rows.length > 0) {
|
||||||
|
|
||||||
notify("Removing selected users...");
|
var ok = confirm("Remove selected users?");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-users&subop=remove&ids="+
|
if (ok) {
|
||||||
param_escape(sel_rows.toString()), true);
|
notify("Removing selected users...");
|
||||||
xmlhttp.onreadystatechange=userlist_callback;
|
|
||||||
xmlhttp.send(null);
|
xmlhttp.open("GET", "backend.php?op=pref-users&subop=remove&ids="+
|
||||||
|
param_escape(sel_rows.toString()), true);
|
||||||
|
xmlhttp.onreadystatechange=userlist_callback;
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
notify("Please select some labels first.");
|
notify("Please select some labels first.");
|
||||||
@@ -532,13 +539,16 @@ function removeSelectedFilters() {
|
|||||||
|
|
||||||
if (sel_rows.length > 0) {
|
if (sel_rows.length > 0) {
|
||||||
|
|
||||||
notify("Removing selected filters...");
|
var ok = confirm("Remove selected filters?");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
|
|
||||||
param_escape(sel_rows.toString()), true);
|
|
||||||
xmlhttp.onreadystatechange=filterlist_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
|
if (ok) {
|
||||||
|
notify("Removing selected filters...");
|
||||||
|
|
||||||
|
xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
|
||||||
|
param_escape(sel_rows.toString()), true);
|
||||||
|
xmlhttp.onreadystatechange=filterlist_callback;
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
notify("Please select some filters first.");
|
notify("Please select some filters first.");
|
||||||
}
|
}
|
||||||
@@ -556,12 +566,17 @@ function removeSelectedFeeds() {
|
|||||||
|
|
||||||
if (sel_rows.length > 0) {
|
if (sel_rows.length > 0) {
|
||||||
|
|
||||||
notify("Removing selected feeds...");
|
var ok = confirm("Remove selected feeds?");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
|
if (ok) {
|
||||||
param_escape(sel_rows.toString()), true);
|
|
||||||
xmlhttp.onreadystatechange=feedlist_callback;
|
notify("Removing selected feeds...");
|
||||||
xmlhttp.send(null);
|
|
||||||
|
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
|
||||||
|
param_escape(sel_rows.toString()), true);
|
||||||
|
xmlhttp.onreadystatechange=feedlist_callback;
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -582,12 +597,16 @@ function removeSelectedFeedCats() {
|
|||||||
|
|
||||||
if (sel_rows.length > 0) {
|
if (sel_rows.length > 0) {
|
||||||
|
|
||||||
notify("Removing selected categories...");
|
var ok = confirm("Remove selected categories?");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
|
if (ok) {
|
||||||
param_escape(sel_rows.toString()), true);
|
notify("Removing selected categories...");
|
||||||
xmlhttp.onreadystatechange=feedlist_callback;
|
|
||||||
xmlhttp.send(null);
|
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
|
||||||
|
param_escape(sel_rows.toString()), true);
|
||||||
|
xmlhttp.onreadystatechange=feedlist_callback;
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -946,15 +965,18 @@ function resetSelectedUserPass() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
notify("Resetting password for selected user...");
|
var ok = confirm("Reset password of selected user?");
|
||||||
|
|
||||||
var id = rows[0];
|
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
|
|
||||||
param_escape(id), true);
|
|
||||||
xmlhttp.onreadystatechange=userlist_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
|
if (ok) {
|
||||||
|
notify("Resetting password for selected user...");
|
||||||
|
|
||||||
|
var id = rows[0];
|
||||||
|
|
||||||
|
xmlhttp.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
|
||||||
|
param_escape(id), true);
|
||||||
|
xmlhttp.onreadystatechange=userlist_callback;
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectedUserDetails() {
|
function selectedUserDetails() {
|
||||||
@@ -1248,3 +1270,7 @@ function categorizeSelectedFeeds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validatePrefsReset() {
|
||||||
|
return confirm("Reset to defaults?");
|
||||||
|
}
|
||||||
|
|||||||
11
tt-rss.js
11
tt-rss.js
@@ -438,8 +438,11 @@ function quickMenuGo() {
|
|||||||
notify("Please select some feed first.");
|
notify("Please select some feed first.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (confirm("Remove current feed?")) {
|
||||||
|
qfdDelete(actid);
|
||||||
|
}
|
||||||
|
|
||||||
displayDlg("quickDelFeed", actid);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,10 +549,10 @@ function qfdDelete(feed_id) {
|
|||||||
|
|
||||||
notify("Removing feed...");
|
notify("Removing feed...");
|
||||||
|
|
||||||
var feeds_doc = window.frames["feeds-frame"].document;
|
// var feeds_doc = window.frames["feeds-frame"].document;
|
||||||
feeds_doc.location.href = "backend.php?op=error&msg=Loading,%20please wait...";
|
// feeds_doc.location.href = "backend.php?op=error&msg=Loading,%20please wait...";
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids=" + feed_id);
|
xmlhttp.open("GET", "backend.php?op=pref-feeds&quiet=1&subop=remove&ids=" + feed_id);
|
||||||
xmlhttp.onreadystatechange=dlg_frefresh_callback;
|
xmlhttp.onreadystatechange=dlg_frefresh_callback;
|
||||||
xmlhttp.send(null);
|
xmlhttp.send(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user