From: Andrew Dolgov
"; + + if ($feed_id) { + print "
"; } + print ""; + + print ""; + return; } } @@ -1358,21 +1362,6 @@ print ""; -/* print "
"; @@ -1538,4 +1527,5 @@ return $feedctr; } + ?> diff --git a/prefs.js b/prefs.js index 1a48571c..bf257444 100644 --- a/prefs.js +++ b/prefs.js @@ -39,12 +39,6 @@ function feedlist_callback2(transport) { } } -/* stub for subscription dialog */ - -function dlg_frefresh_callback(transport) { - return feedlist_callback2(transport); -} - function filterlist_callback2(transport) { var container = $('prefContent'); container.innerHTML=transport.responseText; @@ -127,34 +121,6 @@ function notify_callback2(transport) { notify_info(transport.responseText); } -function prefs_reset_callback2(transport) { - try { - notify_info(transport.responseText); - selectTab(); - } catch (e) { - exception_error("prefs_reset_callback2", e); - } -} - - -function changepass_callback2(transport) { - try { - - if (transport.responseText.indexOf("ERROR: ") == 0) { - notify_error(transport.responseText.replace("ERROR: ", "")); - } else { - notify_info(transport.responseText); - var warn = $("default_pass_warning"); - if (warn) warn.style.display = "none"; - } - - document.forms['change_pass_form'].reset(); - - } catch (e) { - exception_error("changepass_callback2", e); - } -} - function init_cat_inline_editor() { try { @@ -1221,34 +1187,6 @@ function init() { } } -function categorizeSelectedFeeds() { - - var sel_rows = getSelectedFeeds(); - - var cat_sel = $("sfeed_set_fcat"); - var cat_id = cat_sel[cat_sel.selectedIndex].value; - - if (sel_rows.length > 0) { - - notify_progress("Changing category of selected feeds..."); - - var query = "?op=pref-feeds&subop=categorize&ids="+ - param_escape(sel_rows.toString()) + "&cat_id=" + param_escape(cat_id); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - feedlist_callback2(transport); - } }); - - } else { - - alert(__("No feeds are selected.")); - - } - -} - function validatePrefsReset() { try { var ok = confirm(__("Reset to defaults?")); @@ -1262,7 +1200,8 @@ function validatePrefsReset() { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - prefs_reset_callback2(transport); + notify_info(transport.responseText); + selectTab(); } }); } @@ -1644,12 +1583,20 @@ function changeUserPassword() { var query = Form.serialize("change_pass_form"); - notify_progress("Trying to change password..."); + notify_progress("Changing password..."); new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - changepass_callback2(transport); + if (transport.responseText.indexOf("ERROR: ") == 0) { + notify_error(transport.responseText.replace("ERROR: ", "")); + } else { + notify_info(transport.responseText); + var warn = $("default_pass_warning"); + if (warn) warn.style.display = "none"; + } + + document.forms['change_pass_form'].reset(); } }); @@ -2154,3 +2101,6 @@ function mouse_up_handler(e) { } } +function inPreferences() { + return true; +} diff --git a/tt-rss.css b/tt-rss.css index fc42bb0a..f8204924 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1893,10 +1893,6 @@ div.dlgButtons { clear : both; } -div#label_test_result { - clear : both; -} - pre, code { font-size : 12px; font-family : monospace; diff --git a/tt-rss.js b/tt-rss.js index fefbf963..eef469c4 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -98,27 +98,6 @@ function dlg_frefresh_callback(transport, deleted_feed) { closeInfoBox(); } -function refetch_callback2(transport) { - try { - - var date = new Date(); - - parse_counters_reply(transport, true); - - debug("refetch_callback2: done"); - -/* if (!daemon_enabled && !daemon_refresh_only) { - notify_info("All feeds updated."); - updateTitle(""); - } else { - //notify(""); - } */ - } catch (e) { - exception_error("refetch_callback", e); - updateTitle(""); - } -} - function backend_sanity_check_callback(transport) { try { @@ -232,7 +211,7 @@ function scheduleFeedUpdate(force) { new Ajax.Request("backend.php", { parameters: query_str, onComplete: function(transport) { - refetch_callback2(transport); + parse_counters_reply(transport, true); } }); } @@ -1524,4 +1503,6 @@ function feedBrowserSubscribe() { } } - +function inPreferences() { + return false; +} diff --git a/viewfeed.js b/viewfeed.js index d2425d99..028ad68f 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -15,39 +15,6 @@ var post_under_pointer = false; var last_requested_article = false; -function toggle_published_callback(transport) { - try { - if (transport.responseXML) { - - all_counters_callback2(transport); - - var note = transport.responseXML.getElementsByTagName("note")[0]; - - if (note) { - var note_id = note.getAttribute("id"); - var note_size = note.getAttribute("size"); - var note_content = note.firstChild.nodeValue; - - var container = $('POSTNOTE-' + note_id); - - cache_invalidate(note_id); - - if (container) { - if (note_size == "0") { - Element.hide(container); - } else { - container.innerHTML = note_content; - Element.show(container); - } - } - } - } - - } catch (e) { - exception_error("toggle_published_callback", e, transport); - } -} - function catchup_callback2(transport, callback) { try { debug("catchup_callback2 " + transport + ", " + callback); @@ -720,12 +687,33 @@ function togglePub(id, client_only, no_effects, note) { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - toggle_published_callback(transport); + all_counters_callback2(transport); + + var note = transport.responseXML.getElementsByTagName("note")[0]; + + if (note) { + var note_id = note.getAttribute("id"); + var note_size = note.getAttribute("size"); + var note_content = note.firstChild.nodeValue; + + var container = $('POSTNOTE-' + note_id); + + cache_invalidate(note_id); + + if (container) { + if (note_size == "0") { + Element.hide(container); + } else { + container.innerHTML = note_content; + Element.show(container); + } + } + } + } }); } } catch (e) { - exception_error("togglePub", e); } } @@ -1476,39 +1464,6 @@ function editArticleTags(id, feed_id, cdm_enabled) { }); } - -function tag_saved_callback(transport) { - try { - debug("in tag_saved_callback"); - - closeInfoBox(); - notify(""); - - if (tagsAreDisplayed()) { - _reload_feedlist_after_view = true; - } - - - if (transport.responseXML) { - var tags_str = transport.responseXML.getElementsByTagName("tags-str")[0]; - - if (tags_str) { - var id = tags_str.getAttribute("id"); - - if (id) { - var tags = $("ATSTR-" + id); - if (tags) { - tags.innerHTML = tags_str.firstChild.nodeValue; - } - } - } - } - - } catch (e) { - exception_error("tag_saved_callback", e); - } -} - function editTagsSave() { notify_progress("Saving article tags..."); @@ -1524,9 +1479,35 @@ function editTagsSave() { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - tag_saved_callback(transport); + try { + debug("tags saved..."); + + closeInfoBox(); + notify(""); + + if (tagsAreDisplayed()) { + _reload_feedlist_after_view = true; + } + + if (transport.responseXML) { + var tags_str = transport.responseXML.getElementsByTagName("tags-str")[0]; + + if (tags_str) { + var id = tags_str.getAttribute("id"); + + if (id) { + var tags = $("ATSTR-" + id); + if (tags) { + tags.innerHTML = tags_str.firstChild.nodeValue; + } + } + } + } + + } catch (e) { + exception_error("editTagsSave", e); + } } }); - } function editTagsInsert() { @@ -1934,24 +1915,6 @@ function cdmClicked(id) { } } -function preload_article_callback(transport) { - try { - if (transport.responseXML) { - var articles = transport.responseXML.getElementsByTagName("article"); - - for (var i = 0; i < articles.length; i++) { - var id = articles[i].getAttribute("id"); - if (!cache_check(id)) { - cache_inject(id, articles[i].firstChild.nodeValue); - debug("preloaded article: " + id); - } - } - } - } catch (e) { - exception_error("preload_article_callback", e); - } -} - function preloadArticleUnderPointer(id) { try { if (getInitParam("bw_limit") == "1") return; @@ -1981,7 +1944,15 @@ function preloadArticleUnderPointer(id) { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - preload_article_callback(transport); + var articles = transport.responseXML.getElementsByTagName("article"); + + for (var i = 0; i < articles.length; i++) { + var id = articles[i].getAttribute("id"); + if (!cache_check(id)) { + cache_inject(id, articles[i].firstChild.nodeValue); + debug("preloaded article: " + id); + } + } } }); } } catch (e) {