var hotkeys_enabled = true;
-var debug_mode_enabled = false;
var xmlhttp_rpc = Ajax.getTransport();
-var hotkey_zone = 0;
+var notify_silent = false;
+var last_progress_point = 0;
/* add method to remove element from array */
debug("open_article_callback, received link: " + link);
- if (link) {
- debug("link url: " + link.firstChild.nodeValue);
+ if (link && id) {
- var w = window.open(link.firstChild.nodeValue, "_blank");
+ var wname = "ttrss_article_" + id.firstChild.nodeValue;
+
+ debug("link url: " + link.firstChild.nodeValue + ", wname " + wname);
+
+ var w = window.open(link.firstChild.nodeValue, wname);
if (!w) { notify_error("Failed to load article in new window"); }
}
}
+function notify_silent_next() {
+ notify_silent = true;
+}
+
function notify_real(msg, no_hide, n_type) {
+ if (notify_silent) {
+ notify_silent = false;
+ return;
+ }
+
var n = document.getElementById("notify");
var nb = document.getElementById("notify_body");
var rows = new Array();
+ if (!content) return rows;
+
for (i = 0; i < content.rows.length; i++) {
var row_id = content.rows[i].id.replace("RROW-", "");
if (row_id.length > 0 && content.rows[i].className.match("Unread")) {
var rows = new Array();
+ if (!content) return rows;
+
for (i = 0; i < content.rows.length; i++) {
var row_id = content.rows[i].id.replace("RROW-", "");
if (row_id.length > 0) {
try {
// called from prefs, reload tab
- if (active_tab) {
+ if (typeof active_tab != 'undefined' && active_tab) {
selectTab(active_tab, false);
}
} catch (e) { }
{ tokens: ',', paramName: "search" });
}
+ disableHotkeys();
+
notify("");
} catch (e) {
exception_error("infobox_callback2", e);
function createFilter() {
- var form = document.forms['filter_add_form'];
- var reg_exp = form.reg_exp.value;
-
- if (reg_exp == "") {
- alert(__("Can't add filter: nothing to match on."));
- return false;
- }
-
- var query = Form.serialize("filter_add_form");
+ try {
- new Ajax.Request("backend.php?" + query, {
- onComplete: function (transport) {
- infobox_submit_callback2(transport);
- } });
+ var form = document.forms['filter_add_form'];
+ var reg_exp = form.reg_exp.value;
+
+ if (reg_exp == "") {
+ alert(__("Can't add filter: nothing to match on."));
+ return false;
+ }
+
+ var query = Form.serialize("filter_add_form");
- return true;
+ // we can be called from some other tab in Prefs
+ if (typeof active_tab != 'undefined' && active_tab) {
+ active_tab = "filterConfig";
+ }
+
+ new Ajax.Request("backend.php?" + query, {
+ onComplete: function (transport) {
+ infobox_submit_callback2(transport);
+ } });
+
+ return true;
+
+ } catch (e) {
+ exception_error("createFilter", e);
+ }
}
function toggleSubmitNotEmpty(e, submit_id) {
}
var c = document.getElementById('debug_output');
- if (c && c.style.display == "block") {
+ if (c && Element.visible(c)) {
while (c.lastChild != 'undefined' && c.childNodes.length > 100) {
c.removeChild(c.lastChild);
}
}
} catch (e) {
- exception_error(e, "filterDlgCheckAction");
+ exception_error("filterDlgCheckAction", e);
}
}
}
// this only searches loaded headlines list, not in CDM
-function getRelativePostIds(id) {
+function getRelativePostIds(id, limit) {
+
+ if (!limit) limit = 3;
- debug("getRelativePostIds: " + id);
+ debug("getRelativePostIds: " + id + " limit=" + limit);
var ids = new Array();
var container = document.getElementById("headlinesList");
var r_id = rows[i].id.replace("RROW-", "");
if (r_id == id) {
- if (i > 0) ids.push(rows[i-1].id.replace("RROW-", ""));
+/* if (i > 0) ids.push(rows[i-1].id.replace("RROW-", ""));
if (i > 1) ids.push(rows[i-2].id.replace("RROW-", ""));
if (i > 2) ids.push(rows[i-3].id.replace("RROW-", ""));
if (i < rows.length-1) ids.push(rows[i+1].id.replace("RROW-", ""));
if (i < rows.length-2) ids.push(rows[i+2].id.replace("RROW-", ""));
- if (i < rows.length-3) ids.push(rows[i+3].id.replace("RROW-", ""));
+ if (i < rows.length-3) ids.push(rows[i+3].id.replace("RROW-", "")); */
+
+ for (var k = 1; k <= limit; k++) {
+ var nid = false;
+
+ if (i > k-1) var nid = rows[i-k].id.replace("RROW-", "");
+ if (nid) ids.push(nid);
+
+ if (i < rows.length-k) nid = rows[i+k].id.replace("RROW-", "");
+ if (nid) ids.push(nid);
+ }
return ids;
}
debug("openArticleInNewWindow: " + id);
var query = "backend.php?op=rpc&subop=getArticleLink&id=" + id;
+ var wname = "ttrss_article_" + id;
+
+ debug(query + " " + wname);
- debug(query);
+ var w = window.open("", wname);
+
+ if (!w) notify_error("Failed to open window for the article");
new Ajax.Request(query, {
onComplete: function(transport) {
return false;
}
-var _border_color_normal = "#88b0f0";
-var _border_color_highlight = "#72eda8";
-var _border_color_flash = "#f0fff0";
-
-function highlightHotkeyZone(zone) {
+function focus_element(id) {
try {
- var feeds = document.getElementById("feeds-holder");
- var headlines = document.getElementById("headlines-frame");
- var content = document.getElementById("content-frame");
-
- feeds.style.borderColor = _border_color_normal;
- headlines.style.borderColor = _border_color_normal;
- content.style.borderColor = _border_color_normal;
+ var e = document.getElementById(id);
+ if (e) e.focus();
+ } catch (e) {
+ exception_error("focus_element", e);
+ }
+ return false;
+}
- if (zone == 1) {
- feeds.style.borderColor = _border_color_highlight;
+function loading_set_progress(p) {
+ try {
+ if (p < last_progress_point || !Element.visible("overlay")) return;
- new Effect.Highlight(feeds, {duration: 0.5, startcolor:
- _border_color_flash,
- queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } );
- }
+ debug("<b>loading_set_progress : " + p + " (" + last_progress_point + ")</b>");
- if (zone == 2) {
- headlines.style.borderColor = _border_color_highlight;
+ var o = document.getElementById("l_progress_i");
- new Effect.Highlight(headlines, {duration: 0.5, startcolor:
- _border_color_flash,
- queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } );
- }
+// o.style.width = (p * 2) + "px";
- if (zone == 3 && content) {
- content.style.borderColor = _border_color_highlight;
+ new Effect.Scale(o, p, {
+ scaleY : false,
+ scaleFrom : last_progress_point,
+ scaleMode: { originalWidth : 200 },
+ queue: { position: 'end', scope: 'LSP-Q', limit: 3 } });
- new Effect.Highlight(content, {duration: 0.5, startcolor:
- _border_color_flash,
- queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } );
- }
+ last_progress_point = p;
} catch (e) {
- exception_error("highlightHotkeyZone", e);
+ exception_error("loading_set_progress", e);
}
}
-
-function setHotkeyZone(zone) {
- try {
- hotkey_zone = zone;
-
- highlightHotkeyZone(zone);
-
-
- } catch (e) {
- exception_error("setHotkeyZone", e);
+function remove_splash() {
+ if (Element.visible("overlay")) {
+ debug("about to remove splash, OMG!");
+ Element.hide("overlay");
+ debug("removed splash!");
}
}
-