var hotkeys_enabled = true;
var debug_mode_enabled = false;
var xmlhttp_rpc = Ajax.getTransport();
-var hotkey_zone = 0;
+var notify_silent = false;
/* 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");
try {
// called from prefs, reload tab
- if (active_tab) {
+ if (typeof active_tab != 'undefined' && active_tab) {
selectTab(active_tab, false);
}
} catch (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");
-
- // we can be called from some other tab in Prefs
- if (active_tab) active_tab = "filterConfig";
+ 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;
- return true;
+ if (reg_exp == "") {
+ alert(__("Can't add filter: nothing to match on."));
+ return false;
+ }
+
+ var query = Form.serialize("filter_add_form");
+
+ // 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) {
}
} 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) {
- debug("getRelativePostIds: " + id);
+ if (!limit) limit = 3;
+
+ 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);
+ debug(query + " " + wname);
+
+ 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;
-
- if (zone == 1) {
- feeds.style.borderColor = _border_color_highlight;
-
- new Effect.Highlight(feeds, {duration: 0.5, startcolor:
- _border_color_flash,
- queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } );
- }
-
- if (zone == 2) {
- headlines.style.borderColor = _border_color_highlight;
-
- new Effect.Highlight(headlines, {duration: 0.5, startcolor:
- _border_color_flash,
- queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } );
- }
-
- if (zone == 3 && content) {
- content.style.borderColor = _border_color_highlight;
-
- new Effect.Highlight(content, {duration: 0.5, startcolor:
- _border_color_flash,
- queue: { position:'end', scope: 'EFCHL-Q', limit: 1 } } );
- }
-
+ var e = document.getElementById(id);
+ if (e) e.focus();
} catch (e) {
- exception_error("highlightHotkeyZone", e);
+ exception_error("focus_element", e);
}
+ return false;
}
-
-function setHotkeyZone(zone) {
+function loading_set_progress(v) {
try {
- hotkey_zone = zone;
-
- highlightHotkeyZone(zone);
-
+ var o = document.getElementById("l_progress_i");
+ o.style.width = (v*2) + "px";
} catch (e) {
- exception_error("setHotkeyZone", e);
+ exception_error("loading_set_progress", e);
}
}
-