keycode = e.which;
}
- var m_ctx = getMainContext();
- var f_ctx = getFeedsContext();
- var h_ctx = getHeadlinesContext();
-
if (keycode == 82) { // r
- return m_ctx.scheduleFeedUpdate(true);
+ return scheduleFeedUpdate(true);
}
if (keycode == 83) { // r
- return m_ctx.displayDlg("search", getActiveFeedId());
+ return displayDlg("search", getActiveFeedId());
}
if (keycode == 85) { // u
if (getActiveFeedId()) {
- return f_ctx.viewfeed(getActiveFeedId(), "ForceUpdate");
+ return viewfeed(getActiveFeedId(), "ForceUpdate");
}
}
if (keycode == 65) { // a
- return m_ctx.toggleDispRead();
+ return toggleDispRead();
}
- var f_doc = document;
- var feedlist = f_doc.getElementById('feedList');
+ var feedlist = document.getElementById('feedList');
if (keycode == 74) { // j
var feed = getActiveFeedId();
}
if (keycode == 78 || keycode == 40) { // n, down
- if (typeof h_ctx.moveToPost != 'undefined') {
- return h_ctx.moveToPost('next');
+ if (typeof moveToPost != 'undefined') {
+ return moveToPost('next');
}
}
if (keycode == 80 || keycode == 38) { // p, up
- if (typeof h_ctx.moveToPost != 'undefined') {
- return h_ctx.moveToPost('prev');
+ if (typeof moveToPost != 'undefined') {
+ return moveToPost('prev');
}
}
function getActiveFeedId() {
// return getCookie("ttrss_vf_actfeed");
try {
- debug("gAFID: " + getMainContext().active_feed_id);
- return getMainContext().active_feed_id;
+ debug("gAFID: " + active_feed_id);
+ return active_feed_id;
} catch (e) {
exception_error("getActiveFeedId", e);
}
}
function activeFeedIsCat() {
- return getMainContext().active_feed_is_cat;
+ return active_feed_is_cat;
}
function setActiveFeedId(id) {
// return setCookie("ttrss_vf_actfeed", id);
try {
debug("sAFID(" + id + ")");
- getMainContext().active_feed_id = id;
+ active_feed_id = id;
} catch (e) {
exception_error("setActiveFeedId", e);
}
function parse_counters(reply, scheduled_call) {
try {
- var f_document = document;
- var title_obj = this.window;
var feeds_found = 0;
reply = reply.firstChild;
}
- debug("F_DOC: " + f_document + ", T_OBJ: " + title_obj);
-
for (var l = 0; l < reply.childNodes.length; l++) {
if (!reply.childNodes[l] ||
typeof(reply.childNodes[l].getAttribute) == "undefined") {
var updated = reply.childNodes[l].getAttribute("updated");
if (id == "global-unread") {
- title_obj.global_unread = ctr;
- title_obj.updateTitle();
+ global_unread = ctr;
+ updateTitle();
continue;
}
}
if (t == "category") {
- var catctr = f_document.getElementById("FCATCTR-" + id);
+ var catctr = document.getElementById("FCATCTR-" + id);
if (catctr) {
catctr.innerHTML = "(" + ctr + " unread)";
}
continue;
}
- var feedctr = f_document.getElementById("FEEDCTR-" + id);
- var feedu = f_document.getElementById("FEEDU-" + id);
- var feedr = f_document.getElementById("FEEDR-" + id);
- var feed_img = f_document.getElementById("FIMG-" + id);
- var feedlink = f_document.getElementById("FEEDL-" + id);
- var feedupd = f_document.getElementById("FLUPD-" + id);
+ var feedctr = document.getElementById("FEEDCTR-" + id);
+ var feedu = document.getElementById("FEEDU-" + id);
+ var feedr = document.getElementById("FEEDR-" + id);
+ var feed_img = document.getElementById("FIMG-" + id);
+ var feedlink = document.getElementById("FEEDL-" + id);
+ var feedupd = document.getElementById("FLUPD-" + id);
if (updated && feedlink) {
if (error) {
}
}
- hideOrShowFeeds(getFeedsContext().document,
- getInitParam("hide_read_feeds") == 1);
+ hideOrShowFeeds(document, getInitParam("hide_read_feeds") == 1);
- var feeds_stored = getMainContext().number_of_feeds;
+ var feeds_stored = number_of_feeds;
debug("Feed counters, C: " + feeds_found + ", S:" + feeds_stored);
if (feeds_stored != feeds_found) {
- getMainContext().number_of_feeds = feeds_found;
+ number_of_feeds = feeds_found;
if (feeds_stored != 0) {
debug("Subscribed feed number changed, refreshing feedlist");
var runtime = counters.nextSibling;
if (runtime) {
- getMainContext().parse_runtime_info(runtime);
+ parse_runtime_info(runtime);
}
if (getInitParam("feeds_sort_by_unread") == 1) {
function resort_feedlist() {
debug("resort_feedlist");
- var fd = getFeedsContext().document;
+ var fd = document;
if (fd.getElementById("feedCatHolder")) {
debug("hideOrShowFeeds: " + doc + ", " + hide);
- var fd = getFeedsContext().document;
+ var fd = document;
var list = fd.getElementById("feedList");
closeInfoBox();
- var feeds_doc = getFeedsContext().document;
+ var feeds_doc = document;
// feeds_doc.location.href = "backend.php?op=error&msg=Loading,%20please wait...";
return this.window;
}
-
function getHeadlinesContext() {
return this.window;
}
var debug_last_class = "even";
function debug(msg) {
- var ctx = getMainContext();
- if (ctx.debug_last_class == "even") {
- ctx.debug_last_class = "odd";
+ if (debug_last_class == "even") {
+ debug_last_class = "odd";
} else {
- ctx.debug_last_class = "even";
+ debug_last_class = "even";
}
- var c = ctx.document.getElementById('debug_output');
+ var c = document.getElementById('debug_output');
if (c && c.style.display == "block") {
while (c.lastChild != 'undefined' && c.childNodes.length > 100) {
c.removeChild(c.lastChild);
var d = new Date();
var ts = leading_zero(d.getHours()) + ":" + leading_zero(d.getMinutes()) +
":" + leading_zero(d.getSeconds());
- c.innerHTML = "<li class=\"" + ctx.debug_last_class + "\"><span class=\"debugTS\">[" + ts + "]</span> " +
+ c.innerHTML = "<li class=\"" + debug_last_class + "\"><span class=\"debugTS\">[" + ts + "]</span> " +
msg + "</li>" + c.innerHTML;
}
}
try {
debug("loading article: " + id + "/" + feed_id);
- var f_document = getFeedsContext().document;
- var m_document = document;
-
enableHotkeys();
var crow = document.getElementById("RROW-" + id);
active_post_id = id;
setActiveFeedId(feed_id);
- var content = m_document.getElementById("content-frame");
+ var content = document.getElementById("content-frame");
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
markHeadline(active_post_id);
function toggleMark(id) {
- var f_document = document;
-
if (!xmlhttp_ready(xmlhttp_rpc)) {
printLockingError();
return;
var query = "backend.php?op=rpc&id=" + id + "&subop=mark";
var mark_img = document.getElementById("FMARKPIC-" + id);
- var vfeedu = f_document.getElementById("FEEDU--1");
+ var vfeedu = document.getElementById("FEEDU--1");
var crow = document.getElementById("RROW-" + id);
if (mark_img.alt != "Reset mark") {
}
- var vfeedctr = f_document.getElementById("FEEDCTR--1");
- var vfeedr = f_document.getElementById("FEEDR--1");
+ var vfeedctr = document.getElementById("FEEDCTR--1");
+ var vfeedr = document.getElementById("FEEDR--1");
if (vfeedu && vfeedctr) {
if ((+vfeedu.innerHTML) > 0) {
debug("LFS: " + query);
xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=getMainContext().dlg_frefresh_callback;
+ xmlhttp_rpc.onreadystatechange=dlg_frefresh_callback;
xmlhttp_rpc.send(null);
}
}
-/*
-function headlines_init() {
- if (arguments.callee.done) return;
- arguments.callee.done = true;
-
- if (parent.frames["feeds-frame"]) {
- document.onkeydown = hotkey_handler;
- }
-
- var hl = document.getElementById("headlinesList");
-
- if (!hl) {
- hl = document.getElementById("headlinesContainer");
- }
-
- var hw = hl.scrollHeight;
- var pw = parent.document.getElementById("headlines").scrollHeight;
-
- if (hw >= pw) {
- var bt = document.getElementById("headlineActionsBottom");
- bt.className = "headlinesSubToolbar";
- }
-
-}
-*/