mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 14:35:58 +00:00
prefs: some async work
This commit is contained in:
19
functions.js
19
functions.js
@@ -2086,4 +2086,23 @@ function updateFeedBrowser() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function browseFeeds(limit) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
var query = "backend.php?op=pref-feeds&subop=browse";
|
||||||
|
|
||||||
|
notify_progress("Loading, please wait...", true);
|
||||||
|
|
||||||
|
new Ajax.Request(query, {
|
||||||
|
onComplete: function(transport) {
|
||||||
|
infobox_callback2(transport);
|
||||||
|
} });
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("browseFeeds", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
203
prefs.js
203
prefs.js
@@ -245,16 +245,12 @@ function init_cat_inline_editor() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function infobox_feed_cat_callback() {
|
function infobox_feed_cat_callback2(transport) {
|
||||||
if (xmlhttp.readyState == 4) {
|
try {
|
||||||
try {
|
infobox_callback2(transport);
|
||||||
|
init_cat_inline_editor();
|
||||||
infobox_callback();
|
} catch (e) {
|
||||||
init_cat_inline_editor();
|
exception_error("infobox_feed_cat_callback2", e);
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
exception_error("infobox_feed_cat_callback", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,10 +375,13 @@ function addFeedCat() {
|
|||||||
} else {
|
} else {
|
||||||
notify_progress("Adding feed category...");
|
notify_progress("Adding feed category...");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=add&cat=" +
|
var query = "backend.php?op=pref-feeds&subop=editCats&action=add&cat=" +
|
||||||
param_escape(cat.value), true);
|
param_escape(cat.value);
|
||||||
xmlhttp.onreadystatechange=infobox_feed_cat_callback;
|
|
||||||
xmlhttp.send(null);
|
new Ajax.Request(query, {
|
||||||
|
onComplete: function(transport) {
|
||||||
|
infobox_feed_cat_callback2(transport);
|
||||||
|
} });
|
||||||
|
|
||||||
link.value = "";
|
link.value = "";
|
||||||
|
|
||||||
@@ -716,10 +715,14 @@ function removeSelectedFeedCats() {
|
|||||||
if (ok) {
|
if (ok) {
|
||||||
notify_progress("Removing selected categories...");
|
notify_progress("Removing selected categories...");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=remove&ids="+
|
var query = "backend.php?op=pref-feeds&subop=editCats&action=remove&ids="+
|
||||||
param_escape(sel_rows.toString()), true);
|
param_escape(sel_rows.toString());
|
||||||
xmlhttp.onreadystatechange=infobox_feed_cat_callback;
|
|
||||||
xmlhttp.send(null);
|
new Ajax.Request(query, {
|
||||||
|
onComplete: function(transport) {
|
||||||
|
infobox_feed_cat_callback2(transport);
|
||||||
|
} });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -918,62 +921,35 @@ function resetSelectedUserPass() {
|
|||||||
|
|
||||||
function selectedUserDetails() {
|
function selectedUserDetails() {
|
||||||
|
|
||||||
if (!xmlhttp_ready(xmlhttp)) {
|
try {
|
||||||
printLockingError();
|
|
||||||
return
|
var rows = getSelectedUsers();
|
||||||
|
|
||||||
|
if (rows.length == 0) {
|
||||||
|
alert(__("No users are selected."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rows.length > 1) {
|
||||||
|
alert(__("Please select only one user."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
notify_progress("Loading, please wait...");
|
||||||
|
|
||||||
|
var id = rows[0];
|
||||||
|
|
||||||
|
var query = "backend.php?op=pref-users&subop=user-details&id=" + id;
|
||||||
|
|
||||||
|
new Ajax.Request(query, {
|
||||||
|
onComplete: function(transport) {
|
||||||
|
infobox_callback2(transport);
|
||||||
|
} });
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("selectedUserDetails", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
var rows = getSelectedUsers();
|
|
||||||
|
|
||||||
if (rows.length == 0) {
|
|
||||||
alert(__("No users are selected."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rows.length > 1) {
|
|
||||||
alert(__("Please select only one user."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
notify_progress("Loading, please wait...");
|
|
||||||
|
|
||||||
var id = rows[0];
|
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-users&subop=user-details&id=" + id, true);
|
|
||||||
xmlhttp.onreadystatechange=infobox_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectedFeedDetails() {
|
|
||||||
|
|
||||||
if (!xmlhttp_ready(xmlhttp)) {
|
|
||||||
printLockingError();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var rows = getSelectedFeeds();
|
|
||||||
|
|
||||||
if (rows.length == 0) {
|
|
||||||
alert(__("No feeds are selected."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rows.length > 1) {
|
|
||||||
alert(__("Please select only one feed."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// var id = rows[0];
|
|
||||||
|
|
||||||
notify("");
|
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=feed-details&id=" +
|
|
||||||
param_escape(rows.toString()), true);
|
|
||||||
xmlhttp.onreadystatechange=infobox_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function editSelectedFilter() {
|
function editSelectedFilter() {
|
||||||
var rows = getSelectedFilters();
|
var rows = getSelectedFilters();
|
||||||
@@ -1016,30 +992,31 @@ function editSelectedFeed() {
|
|||||||
|
|
||||||
function editSelectedFeeds() {
|
function editSelectedFeeds() {
|
||||||
|
|
||||||
if (!xmlhttp_ready(xmlhttp)) {
|
try {
|
||||||
printLockingError();
|
var rows = getSelectedFeeds();
|
||||||
return
|
|
||||||
|
if (rows.length == 0) {
|
||||||
|
alert(__("No feeds are selected."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
notify("");
|
||||||
|
|
||||||
|
disableHotkeys();
|
||||||
|
|
||||||
|
notify_progress("Loading, please wait...");
|
||||||
|
|
||||||
|
var query = "backend.php?op=pref-feeds&subop=editfeeds&ids=" +
|
||||||
|
param_escape(rows.toString());
|
||||||
|
|
||||||
|
new Ajax.Request(query, {
|
||||||
|
onComplete: function(transport) {
|
||||||
|
infobox_callback2(transport);
|
||||||
|
} });
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("editSelectedFeeds", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
var rows = getSelectedFeeds();
|
|
||||||
|
|
||||||
if (rows.length == 0) {
|
|
||||||
alert(__("No feeds are selected."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
notify("");
|
|
||||||
|
|
||||||
disableHotkeys();
|
|
||||||
|
|
||||||
notify_progress("Loading, please wait...");
|
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeeds&ids=" +
|
|
||||||
param_escape(rows.toString()), true);
|
|
||||||
|
|
||||||
xmlhttp.onreadystatechange=infobox_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function piggie(enable) {
|
function piggie(enable) {
|
||||||
@@ -1369,14 +1346,6 @@ function validatePrefsReset() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function browseFeeds(limit) {
|
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=browse", true);
|
|
||||||
xmlhttp.onreadystatechange=infobox_callback;
|
|
||||||
xmlhttp.send(null);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function feedBrowserSubscribe() {
|
function feedBrowserSubscribe() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -1669,22 +1638,24 @@ function pref_hotkey_handler(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function editFeedCats() {
|
function editFeedCats() {
|
||||||
if (!xmlhttp_ready(xmlhttp)) {
|
|
||||||
printLockingError();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementById("subscribe_to_feed_btn").disabled = true;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
document.getElementById("top25_feeds_btn").disabled = true;
|
document.getElementById("subscribe_to_feed_btn").disabled = true;
|
||||||
} catch (e) {
|
|
||||||
// this button is not always available, no-op if not found
|
try {
|
||||||
}
|
document.getElementById("top25_feeds_btn").disabled = true;
|
||||||
|
} catch (e) {
|
||||||
|
// this button is not always available, no-op if not found
|
||||||
|
}
|
||||||
|
|
||||||
|
var query = "backend.php?op=pref-feeds&subop=editCats";
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true);
|
new Ajax.Request(query, {
|
||||||
xmlhttp.onreadystatechange=infobox_feed_cat_callback;
|
onComplete: function(transport) {
|
||||||
xmlhttp.send(null);
|
infobox_feed_cat_callback2(transport);
|
||||||
|
} });
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("editFeedCats", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showFeedsWithErrors() {
|
function showFeedsWithErrors() {
|
||||||
|
|||||||
19
tt-rss.js
19
tt-rss.js
@@ -1423,25 +1423,6 @@ function visitOfficialSite() {
|
|||||||
window.open("http://tt-rss.org/");
|
window.open("http://tt-rss.org/");
|
||||||
}
|
}
|
||||||
|
|
||||||
function browseFeeds(limit) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
var query = "backend.php?op=pref-feeds&subop=browse";
|
|
||||||
|
|
||||||
notify_progress("Loading, please wait...", true);
|
|
||||||
|
|
||||||
new Ajax.Request(query, {
|
|
||||||
onComplete: function(transport) {
|
|
||||||
infobox_callback2(transport);
|
|
||||||
} });
|
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
|
||||||
exception_error("browseFeeds", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function feedBrowserSubscribe() {
|
function feedBrowserSubscribe() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user