if (!c) {
c = document.getElementById("headlinesInnerContainer");
}
+
+ var ids = getSelectedArticleIds2();
c.innerHTML = c.innerHTML + headlines.firstChild.nodeValue;
+
+ debug("restore selected ids: " + ids);
+
+ for (var i = 0; i < ids.length; i++) {
+ markHeadline(ids[i]);
+ }
+
} else {
debug("no new headlines received");
}
}
_feed_cur_page = feed_cur_page;
-
+ _infscroll_request_sent = 0;
+
notify("");
} catch (e) {
exception_error("headlines_callback2", e);
cleanSelected("headlinesList");
var crow = document.getElementById("RROW-" + id);
+
+ if (!crow) return;
+
var article_is_unread = crow.className.match("Unread");
crow.className = crow.className.replace("Unread", "");
var date = new Date();
-/* if (!xmlhttp_ready(xmlhttp) && last_article_view < date.getTime() / 1000 - 15) {
- debug("<b>xmlhttp seems to be stuck at view, aborting</b>");
- xmlhttp.abort();
- if (is_safari()) {
- debug("trying alternative reset method for Safari");
- xmlhttp = Ajax.getTransport();
- }
- }
-
- if (xmlhttp_ready(xmlhttp)) { */
-
var neighbor_ids = getRelativePostIds(active_post_id);
/* only request uncached articles */
function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
try {
-/* if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- return;
- } */
-
var rows;
if (cdm_mode) {
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
param_escape(rows.toString()) + "&cmode=" + cmode;
-// _catchup_callback_func = callback_func;
-
- debug(callback_func);
-
notify_progress("Loading, please wait...");
-/* xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=catchup_callback;
- xmlhttp_rpc.send(null); */
-
new Ajax.Request(query, {
onComplete: function(transport) {
catchup_callback2(transport, callback_func);
var fn = getFeedName(getActiveFeedId(), active_feed_is_cat);
- var str = __("Mark all selected articles in %s as read?");
+ var str = __("Mark %d selected articles in %s as read?");
+ str = str.replace("%d", rows.length);
str = str.replace("%s", fn);
if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
"&title=" + param_escape(title);
debug("LFS: " + query);
-
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=dlg_frefresh_callback;
- xmlhttp_rpc.send(null);
- }
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ dlg_frefresh_callback(transport);
+ } });
+ }
}
function editArticleTags(id, feed_id, cdm_enabled) {
}
-function tag_saved_callback() {
- if (xmlhttp_rpc.readyState == 4) {
- try {
- debug("in tag_saved_callback");
+function tag_saved_callback(transport) {
+ try {
+ debug("in tag_saved_callback");
- closeInfoBox();
- notify("");
+ closeInfoBox();
+ notify("");
- if (tagsAreDisplayed()) {
- _reload_feedlist_after_view = true;
- }
+ if (tagsAreDisplayed()) {
+ _reload_feedlist_after_view = true;
+ }
- if (!_tag_active_cdm) {
- if (active_post_id == _tag_active_post_id) {
- debug("reloading current article");
- view(_tag_active_post_id, _tag_active_feed_id);
- }
- } else {
- debug("reloading current feed");
- viewCurrentFeed();
+ if (!_tag_active_cdm) {
+ if (active_post_id == _tag_active_post_id) {
+ debug("reloading current article");
+ view(_tag_active_post_id, _tag_active_feed_id);
}
-
- } catch (e) {
- exception_error("catchup_callback", e);
+ } else {
+ debug("reloading current feed");
+ viewCurrentFeed();
}
+
+ } catch (e) {
+ exception_error("catchup_callback", e);
}
}
function editTagsSave() {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- }
-
notify_progress("Saving article tags...");
var form = document.forms["tag_edit_form"];
debug(query);
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=tag_saved_callback;
- xmlhttp_rpc.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ tag_saved_callback(transport);
+ } });
}
var e = document.getElementById("headlinesInnerContainer");
- if (e.scrollTop + e.offsetHeight > e.scrollHeight - 300) {
- if (!_infscroll_disable) {
- debug("more cowbell!");
- viewNextFeedPage();
+ // don't do infinite scrolling when Limit == All
+
+ var toolbar_form = document.forms["main_toolbar_form"];
+
+ var limit = toolbar_form.limit[toolbar_form.limit.selectedIndex];
+ if (limit.value != 0) {
+ if (e.scrollTop + e.offsetHeight > e.scrollHeight - 50) {
+ if (!_infscroll_disable) {
+ debug("more cowbell!");
+ viewNextFeedPage();
+ }
}
}
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
param_escape(ids_to_mark.toString()) + "&cmode=0";
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=catchup_callback;
- xmlhttp_rpc.send(null);
-
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ catchup_callback2(transport);
+ } });
+
}
}
exception_error("catchupRelativeToArticle", e);
}
}
+
+function cdmExpandArticle(a_id) {
+ try {
+ var id = 'CICD-' + a_id;
+
+ Effect.Appear(id, {duration : 0.5,
+ beforeStart: function(effect) {
+ var h_id = 'CICH-' + a_id;
+ var h_elem = document.getElementById(h_id);
+ if (h_elem) { h_elem.style.display = "none"; }
+
+ toggleUnread(a_id, 0);
+ }});
+
+
+ } catch (e) {
+ exception_error("appearBlockElementF", e);
+ }
+
+}
+
+