function render_feedlist(data) {
try {
- var f = document.getElementById("feeds-frame");
+ var f = $("feeds-frame");
f.innerHTML = data;
// cache_invalidate("FEEDLIST");
// cache_inject("FEEDLIST", data, getInitParam("num_feeds"));
var query = "backend.php?op=viewfeed&feed=" + feed + "&" +
toolbar_query + "&subop=" + param_escape(subop);
- if (document.getElementById("search_form")) {
+ if ($("search_form")) {
var search_query = Form.serialize("search_form");
query = query + "&" + search_query;
closeInfoBox(true);
if (!activeFeedIsCat()) {
- var feedlist = document.getElementById('feedList');
+ var feedlist = $('feedList');
var next_unread_feed = getRelativeFeedId(feedlist,
feed, "next", true);
debug(query);
- var container = document.getElementById("headlinesInnerContainer");
+ var container = $("headlinesInnerContainer");
/* if (container && page_offset == 0 && !isCdmMode()) {
new Effect.Fade(container, {duration: 1, to: 0.01,
}
if (cache_check) {
- var f = document.getElementById("headlines-frame");
+ var f = $("headlines-frame");
clean_feed_selections();
setActiveFeedId(feed, is_cat);
if (!is_cat) {
- var feedr = document.getElementById("FEEDR-" + feed);
+ var feedr = $("FEEDR-" + feed);
if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected";
}
} else {
- var feedr = document.getElementById("FCAT-" + feed_id);
+ var feedr = $("FCAT-" + feed_id);
if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected";
}
var elem = effect.element;
var cat = elem.id.replace("FCATLIST-", "");
- var cap = document.getElementById("FCAP-" + cat);
+ var cap = $("FCAP-" + cat);
if (Element.visible(elem)) {
cap.innerHTML = cap.innerHTML.replace("…", "");
function toggleCollapseCat(cat) {
try {
- var cat_elem = document.getElementById("FCAT-" + cat);
- var cat_list = document.getElementById("FCATLIST-" + cat).parentNode;
- var caption = document.getElementById("FCAP-" + cat);
+ var cat_elem = $("FCAT-" + cat);
+ var cat_list = $("FCATLIST-" + cat).parentNode;
+ var caption = $("FCAP-" + cat);
/* if (cat_list.className.match("invisible")) {
cat_list.className = "";
function feedlist_dragsorted(ctr) {
try {
- var elem = document.getElementById("feedList");
+ var elem = $("feedList");
var cats = elem.getElementsByTagName("LI");
var ordered_cats = new Array();
function hide_footer_af(effect) {
try {
- var c = document.getElementById("content-frame");
+ var c = $("content-frame");
if (c) {
c.style.bottom = "0px";
- var ioa = document.getElementById("inline_orig_article");
+ var ioa = $("inline_orig_article");
if (ioa) {
ioa.height = c.offsetHeight;
}
} else {
- var h = document.getElementById("headlines-frame");
+ var h = $("headlines-frame");
if (h) {
h.style.bottom = "0px";
if (theme != "" && theme != "compact") return;
- var fl = document.getElementById("feeds-holder");
- var fh = document.getElementById("headlines-frame");
- var fc = document.getElementById("content-frame");
- var ft = document.getElementById("toolbar");
- var ff = document.getElementById("footer");
- var fhdr = document.getElementById("header");
+ var fl = $("feeds-holder");
+ var fh = $("headlines-frame");
+ var fc = $("content-frame");
+ var ft = $("toolbar");
+ var ff = $("footer");
+ var fhdr = $("header");
- var fbtn = document.getElementById("toggle_feeds_btn");
+ var fbtn = $("toggle_feeds_btn");
if (fbtn) Element.show(fbtn);
if (theme != "" && theme != "compact" && theme != "graycube" &&
theme != "compat") return;
- var fbtn = document.getElementById("collapse_feeds_btn");
+ var fbtn = $("collapse_feeds_btn");
if (fbtn) Element.show(fbtn);
if (!selection_disabled) {
document.onselectstart = null;
- var e = document.getElementById("headlineActionsBody");
+ var e = $("headlineActionsBody");
if (e) Element.hide(e);
}
try {
- var ebc = document.getElementById("xebContent");
+ var ebc = $("xebContent");
if (ebc) {
if (id) {
id = id.firstChild.nodeValue;
- if (!document.getElementById("headlinesList")) {
+ if (!$("headlinesList")) {
window.setTimeout("toggleUnread(" + id + ", 0)", 100);
}
}
var notify_hide_timerid = false;
function hide_notify() {
- var n = document.getElementById("notify");
+ var n = $("notify");
if (n) {
n.style.display = "none";
}
return;
}
- var n = document.getElementById("notify");
- var nb = document.getElementById("notify_body");
+ var n = $("notify");
+ var nb = $("notify_body");
if (!n || !nb) return;
}
function cleanSelected(element) {
- var content = document.getElementById(element);
+ var content = $(element);
for (i = 0; i < content.rows.length; i++) {
content.rows[i].className = content.rows[i].className.replace("Selected", "");
}
function getVisibleUnreadHeadlines() {
- var content = document.getElementById("headlinesList");
+ var content = $("headlinesList");
var rows = new Array();
function getVisibleHeadlineIds() {
- var content = document.getElementById("headlinesList");
+ var content = $("headlinesList");
var rows = new Array();
}
function markHeadline(id) {
- var row = document.getElementById("RROW-" + id);
+ var row = $("RROW-" + id);
if (row) {
var is_active = false;
row.className = row.className = "Active";
}
- var check = document.getElementById("RCHK-" + id);
+ var check = $("RCHK-" + id);
if (check) {
check.checked = true;
}
function getFeedIds() {
- var content = document.getElementById("feedsList");
+ var content = $("feedsList");
var rows = new Array();
if (!doc) doc = document;
- var container = doc.getElementById(id);
+ var container = $(id);
if (!container) {
//alert("disableContainerChildren: element " + id + " not found");
}
if (t == "category") {
- var catctr = document.getElementById("FCATCTR-" + id);
+ var catctr = $("FCATCTR-" + id);
if (catctr) {
catctr.innerHTML = "(" + ctr + ")";
if (ctr > 0) {
continue;
}
- 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);
+ var feedctr = $("FEEDCTR-" + id);
+ var feedu = $("FEEDU-" + id);
+ var feedr = $("FEEDR-" + id);
+ var feed_img = $("FIMG-" + id);
+ var feedlink = $("FEEDL-" + id);
+ var feedupd = $("FLUPD-" + id);
if (updated && feedlink) {
if (error) {
setTimeout('updateFeedList(false, false)', 50);
}
} else {
-/* var fl = document.getElementById("feeds-frame").innerHTML;
+/* var fl = $("feeds-frame").innerHTML;
if (fl) {
cache_invalidate("FEEDLIST");
cache_inject("FEEDLIST", fl, getInitParam("num_feeds"));
function get_feed_unread(id) {
try {
- return parseInt(document.getElementById("FEEDU-" + id).innerHTML);
+ return parseInt($("FEEDU-" + id).innerHTML);
} catch (e) {
return -1;
}
function get_cat_unread(id) {
try {
- var ctr = document.getElementById("FCATCTR-" + id).innerHTML;
+ var ctr = $("FCATCTR-" + id).innerHTML;
ctr = ctr.replace("(", "");
ctr = ctr.replace(")", "");
return parseInt(ctr);
}
try {
- return parseInt(document.getElementById("FEEDU-" + id).innerHTML);
+ return parseInt($("FEEDU-" + id).innerHTML);
} catch (e) {
return -1;
}
function resort_feedlist() {
debug("resort_feedlist");
- if (document.getElementById("FCATLIST--1")) {
+ if ($("FCATLIST--1")) {
var lists = document.getElementsByTagName("UL");
}
} else {
- resort_category(document.getElementById("feedList"));
+ resort_category($("feedList"));
}
}
debug("hideOrShowFeeds: " + hide);
- if (document.getElementById("FCATLIST--1")) {
+ if ($("FCATLIST--1")) {
var lists = document.getElementsByTagName("UL");
var cat_node = null;
if (id) {
- node = document.getElementById("FCATLIST-" + id);
- cat_node = document.getElementById("FCAT-" + id);
+ node = $("FCATLIST-" + id);
+ cat_node = $("FCAT-" + id);
} else {
- node = document.getElementById("feedList"); // no categories
+ node = $("feedList"); // no categories
}
// debug("hideOrShowFeedsCategory: " + node + " (" + hide + ")");
try {
- var row = document.getElementById(elem_id);
+ var row = $(elem_id);
if (row) {
selectTableRow(row, do_select);
}
- var check = document.getElementById(check_id);
+ var check = $(check_id);
if (check) {
check.checked = do_select;
function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
classcheck, reset_others) {
- var content = document.getElementById(content_id);
+ var content = $(content_id);
if (!content) {
alert("[selectTableRows] Element " + content_id + " not found.");
selectTableRow(content.rows[i], do_select);
var row_id = content.rows[i].id.replace(prefix, "");
- var check = document.getElementById(check_prefix + row_id);
+ var check = $(check_prefix + row_id);
if (check) {
check.checked = do_select;
selectTableRow(content.rows[i], false);
var row_id = content.rows[i].id.replace(prefix, "");
- var check = document.getElementById(check_prefix + row_id);
+ var check = $(check_prefix + row_id);
if (check) {
check.checked = false;
selectTableRow(content.rows[i], false);
var row_id = content.rows[i].id.replace(prefix, "");
- var check = document.getElementById(check_prefix + row_id);
+ var check = $(check_prefix + row_id);
if (check) {
check.checked = false;
function getSelectedTableRowIds(content_id, prefix) {
- var content = document.getElementById(content_id);
+ var content = $(content_id);
if (!content) {
alert("[getSelectedTableRowIds] Element " + content_id + " not found.");
}
function toggleSelectRowById(sender, id) {
- var row = document.getElementById(id);
+ var row = $(id);
if (sender.checked) {
if (!row.className.match("Selected")) {
function getNextUnreadCat(id) {
try {
- var rows = document.getElementById("feedList").getElementsByTagName("LI");
+ var rows = $("feedList").getElementsByTagName("LI");
var feeds = new Array();
var unread_only = true;
// alert(id + " IC: " + is_cat + " D: " + direction + " U: " + unread_only);
- var rows = document.getElementById("feedList").getElementsByTagName("LI");
+ var rows = $("feedList").getElementsByTagName("LI");
var feeds = new Array();
for (var i = 0; i < rows.length; i++) {
}
function showBlockElement(id, h_id) {
- var elem = document.getElementById(id);
+ var elem = $(id);
if (elem) {
elem.style.display = "block";
if (h_id) {
- elem = document.getElementById(h_id);
+ elem = $(h_id);
if (elem) {
elem.style.display = "none";
}
if (Element.visible("infoBoxShadow")) {
Element.hide("dialog_overlay");
- var shadow = document.getElementById('infoBoxShadow');
- var box = document.getElementById('infoBoxShadow');
+ var shadow = $('infoBoxShadow');
+ var box = $('infoBoxShadow');
Element.hide(shadow);
Element.show("dialog_overlay");
}
- var box = document.getElementById('infoBox');
- var shadow = document.getElementById('infoBoxShadow');
+ var box = $('infoBox');
+ var shadow = $('infoBoxShadow');
if (box) {
box.innerHTML=transport.responseText;
/* FIXME this needs to be moved out somewhere */
- if (document.getElementById("tags_choices")) {
+ if ($("tags_choices")) {
new Ajax.Autocompleter('tags_str', 'tags_choices',
"backend.php?op=rpc&subop=completeTags",
{ tokens: ',', paramName: "search" });
function toggleSubmitNotEmpty(e, submit_id) {
try {
- document.getElementById(submit_id).disabled = (e.value == "")
+ $(submit_id).disabled = (e.value == "")
} catch (e) {
exception_error("toggleSubmitNotEmpty", e);
}
debug_last_class = "even";
}
- var c = document.getElementById('debug_output');
+ var c = $('debug_output');
if (c && Element.visible(c)) {
while (c.lastChild != 'undefined' && c.childNodes.length > 100) {
c.removeChild(c.lastChild);
if (msg == "") msg = "Unknown error";
- var ebc = document.getElementById("xebContent");
+ var ebc = $("xebContent");
if (ebc) {
var e;
if (is_cat) {
- e = document.getElementById("FCATN-" + id);
+ e = $("FCATN-" + id);
} else {
- e = document.getElementById("FEEDN-" + id);
+ e = $("FEEDN-" + id);
}
if (e) {
return e.innerHTML.stripTags();
return;
}
- var action_param = document.getElementById("filter_dlg_param_box");
+ var action_param = $("filter_dlg_param_box");
if (!action_param) {
debug("filterDlgCheckAction: can't find action param box!");
debug("getRelativePostIds: " + id + " limit=" + limit);
var ids = new Array();
- var container = document.getElementById("headlinesList");
+ var container = $("headlinesList");
if (container) {
var rows = container.rows;
function labeltest_callback(transport) {
try {
- var container = document.getElementById('label_test_result');
+ var container = $('label_test_result');
container.innerHTML = transport.responseText;
if (!Element.visible(container)) {
function labelTest() {
try {
- var container = document.getElementById('label_test_result');
+ var container = $('label_test_result');
var form = document.forms['label_edit_form'];
}
function isCdmMode() {
- return !document.getElementById("headlinesList");
+ return !$("headlinesList");
}
function getSelectedArticleIds2() {
var ids = new Array();
for (var i = 0; i < rows.length; i++) {
- var chk = document.getElementById("RCHK-" + rows[i]);
+ var chk = $("RCHK-" + rows[i]);
if (chk && chk.checked) {
ids.push(rows[i]);
}
function focus_element(id) {
try {
- var e = document.getElementById(id);
+ var e = $(id);
if (e) e.focus();
} catch (e) {
exception_error("focus_element", e);
debug("<b>loading_set_progress : " + p + " (" + last_progress_point + ")</b>");
- var o = document.getElementById("l_progress_i");
+ var o = $("l_progress_i");
// o.style.width = (p * 2) + "px";
function getSelectedFeedsFromBrowser() {
- var list = document.getElementById("browseFeedList");
- if (!list) list = document.getElementById("browseBigFeedList");
+ var list = $("browseFeedList");
+ if (!list) list = $("browseBigFeedList");
var selected = new Array();
if (child.id && child.id.match("FBROW-")) {
var id = child.id.replace("FBROW-", "");
- var cb = document.getElementById("FBCHK-" + id);
+ var cb = $("FBCHK-" + id);
if (cb.checked) {
selected.push(id);
var query = "backend.php?op=rpc&subop=feedBrowser";
- var search = document.getElementById("feed_browser_search");
- var limit = document.getElementById("feed_browser_limit");
+ var search = $("feed_browser_search");
+ var limit = $("feed_browser_limit");
if (limit) {
query = query + "&limit=" + limit[limit.selectedIndex].value;
onComplete: function(transport) {
notify('');
- var c = document.getElementById("browseFeedList");
+ var c = $("browseFeedList");
var r = transport.responseXML.getElementsByTagName("content")[0];
var nr = transport.responseXML.getElementsByTagName("num-results")[0];
- var sb = document.getElementById("feed_browser_subscribe");
+ var sb = $("feed_browser_subscribe");
if (c && r) {
c.innerHTML = r.firstChild.nodeValue;
setActiveFeedId(feed_id, is_cat);
if (!is_cat) {
- var feedr = document.getElementById("FEEDR-" + feed_id);
+ var feedr = $("FEEDR-" + feed_id);
if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected";
}
} else {
- var feedr = document.getElementById("FCAT-" + feed_id);
+ var feedr = $("FCAT-" + feed_id);
if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected";
}
disableContainerChildren("headlinesToolbar", false);
Form.enable("main_toolbar_form");
- var f = document.getElementById("headlines-frame");
+ var f = $("headlines-frame");
try {
if (reply.offset == 0) {
debug("resetting headlines scrollTop");
var sel_none_link;
var sel_inv_link;
- if (document.getElementById("content-frame")) {
+ if ($("content-frame")) {
sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)";
sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)";
sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)";
tmp += "</div>";
tmp += "<div id=\"headlinesInnerContainer\" onscroll=\"headlines_scroll_handler()\">";
- if (document.getElementById("content-frame")) {
+ if ($("content-frame")) {
tmp += "<table class=\"headlinesList\" id=\"headlinesList\" cellspacing=\"0\">";
}
var content_preview = truncate_string(strip_tags(rs.fieldByName("content")),
100);
- if (document.getElementById("content-frame")) {
+ if ($("content-frame")) {
tmp += "<tr class='"+row_class+"' id='RROW-"+id+"' "+mouseover_attrs+">";
}
if (offset == 0) {
- var container = document.getElementById("headlines-frame");
+ var container = $("headlines-frame");
container.innerHTML = tmp;
} else {
var ids = getSelectedArticleIds2();
- var container = document.getElementById("headlinesList");
+ var container = $("headlinesList");
container.innerHTML = container.innerHTML + tmp;
for (var i = 0; i < ids.length; i++) {
Element.hide("topLinksOnline");
Element.show("topLinksOffline");
- var tb_form = document.getElementById("main_toolbar_form");
+ var tb_form = $("main_toolbar_form");
Element.hide(tb_form.update);
- var chooser = document.getElementById("quickMenuChooser");
+ var chooser = $("quickMenuChooser");
chooser.disabled = true;
var rs = db.execute("SELECT key, value FROM init_params");
function set_feedlist_counter(id, ctr, is_cat) {
try {
- var feedctr = document.getElementById("FEEDCTR-" + id);
- var feedu = document.getElementById("FEEDU-" + id);
- var feedr = document.getElementById("FEEDR-" + id);
+ var feedctr = $("FEEDCTR-" + id);
+ var feedu = $("FEEDU-" + id);
+ var feedr = $("FEEDR-" + id);
if (is_cat) {
- var catctr = document.getElementById("FCATCTR-" + id);
+ var catctr = $("FCATCTR-" + id);
if (catctr) {
catctr.innerHTML = "(" + ctr + ")";
if (ctr > 0) {
function replace_pubkey_callback(transport) {
try {
- var link = document.getElementById("pubGenAddress");
+ var link = $("pubGenAddress");
if (transport.responseXML) {
try {
- var container = document.getElementById('prefContent');
+ var container = $('prefContent');
container.innerHTML=transport.responseText;
selectTab("feedConfig", true);
}
function filterlist_callback2(transport) {
- var container = document.getElementById('prefContent');
+ var container = $('prefContent');
container.innerHTML=transport.responseText;
if (typeof correctPNG != 'undefined') {
correctPNG();
function init_label_inline_editor() {
try {
- if (document.getElementById("prefLabelList")) {
- var elems = document.getElementById("prefLabelList").getElementsByTagName("SPAN");
+ if ($("prefLabelList")) {
+ var elems = $("prefLabelList").getElementsByTagName("SPAN");
for (var i = 0; i < elems.length; i++) {
if (elems[i].id && elems[i].id.match("LILT-")) {
try {
- var container = document.getElementById('prefContent');
+ var container = $('prefContent');
closeInfoBox();
container.innerHTML=transport.responseText;
function userlist_callback2(transport) {
try {
- var container = document.getElementById('prefContent');
+ var container = $('prefContent');
if (transport.readyState == 4) {
container.innerHTML=transport.responseText;
notify("");
function prefslist_callback2(transport) {
try {
- var container = document.getElementById('prefContent');
+ var container = $('prefContent');
container.innerHTML=transport.responseText;
notify("");
remove_splash();
notify_error(transport.responseText.replace("ERROR: ", ""));
} else {
notify_info(transport.responseText);
- var warn = document.getElementById("default_pass_warning");
+ var warn = $("default_pass_warning");
if (warn) warn.style.display = "none";
}
function init_cat_inline_editor() {
try {
- if (document.getElementById("prefFeedCatList")) {
- var elems = document.getElementById("prefFeedCatList").getElementsByTagName("SPAN");
+ if ($("prefFeedCatList")) {
+ var elems = $("prefFeedCatList").getElementsByTagName("SPAN");
for (var i = 0; i < elems.length; i++) {
if (elems[i].id && elems[i].id.match("FCATT-")) {
try {
- var feed_search = document.getElementById("feed_search");
+ var feed_search = $("feed_search");
var search = "";
if (feed_search) { search = feed_search.value; }
- var slat = document.getElementById("show_last_article_times");
+ var slat = $("show_last_article_times");
var slat_checked = false;
if (slat) {
try {
- var user_search = document.getElementById("user_search");
+ var user_search = $("user_search");
var search = "";
if (user_search) { search = user_search.value; }
try {
- var link = document.getElementById("fadd_link");
+ var link = $("fadd_link");
if (link.value.length == 0) {
alert(__("Error: No feed URL given."));
function addFeedCat() {
- var cat = document.getElementById("fadd_cat");
+ var cat = $("fadd_cat");
if (cat.value.length == 0) {
alert(__("Can't add category: no name specified."));
function feedEditCancel() {
try {
- document.getElementById("subscribe_to_feed_btn").disabled = false;
- document.getElementById("top25_feeds_btn").disabled = false;
+ $("subscribe_to_feed_btn").disabled = false;
+ $("top25_feeds_btn").disabled = false;
} catch (e) {
// this button is not always available, no-op if not found
}
function filterEditCancel() {
try {
- document.getElementById("create_filter_btn").disabled = false;
+ $("create_filter_btn").disabled = false;
selectPrefRows('filter', false); // cleanup feed selection
} catch (e) { }
closeInfoBox();
- document.getElementById("create_filter_btn").disabled = false;
+ $("create_filter_btn").disabled = false;
new Ajax.Request(query, {
onComplete: function(transport) {
function piggie(enable) {
if (enable) {
debug("I LOVEDED IT!");
- var piggie = document.getElementById("piggie");
+ var piggie = $("piggie");
Element.show(piggie);
Position.Center(piggie);
function validateOpmlImport() {
- var opml_file = document.getElementById("opml_file");
+ var opml_file = $("opml_file");
if (opml_file.value.length == 0) {
alert(__("No OPML file to upload."));
function updateFilterList(sort_key) {
try {
- var filter_search = document.getElementById("filter_search");
+ var filter_search = $("filter_search");
var search = "";
if (filter_search) { search = filter_search.value; }
try {
- var label_search = document.getElementById("label_search");
+ var label_search = $("label_search");
var search = "";
if (label_search) { search = label_search.value; }
try {
try {
- var c = document.getElementById('prefContent');
+ var c = $('prefContent');
c.scrollTop = 0;
} catch (e) { };
/* clean selection from all tabs */
- var tabs_holder = document.getElementById("prefTabs");
+ var tabs_holder = $("prefTabs");
var tab = tabs_holder.firstChild;
while (tab) {
/* mark new tab as selected */
- tab = document.getElementById(id + "Tab");
+ tab = $(id + "Tab");
if (tab) {
if (!tab.className.match("Selected")) {
try {
active_tab = getInitParam("prefs_active_tab");
- if (!document.getElementById(active_tab+"Tab")) active_tab = "genConfig";
+ if (!$(active_tab+"Tab")) active_tab = "genConfig";
if (!active_tab || active_tab == '0') active_tab = "genConfig";
document.onkeydown = pref_hotkey_handler;
var sel_rows = getSelectedFeeds();
- var cat_sel = document.getElementById("sfeed_set_fcat");
+ var cat_sel = $("sfeed_set_fcat");
var cat_id = cat_sel[cat_sel.selectedIndex].value;
if (sel_rows.length > 0) {
"feed_search", "filter_search", "user_search", "feed_browser_search");
for (var i = 0; i < search_boxes.length; i++) {
- var elem = document.getElementById(search_boxes[i]);
+ var elem = $(search_boxes[i]);
if (elem) {
focus_element(search_boxes[i]);
return false;
hotkey_prefix = false;
- if (keycode == 49 && document.getElementById("genConfigTab")) { // 1
+ if (keycode == 49 && $("genConfigTab")) { // 1
selectTab("genConfig");
return false;
}
- if (keycode == 50 && document.getElementById("feedConfigTab")) { // 2
+ if (keycode == 50 && $("feedConfigTab")) { // 2
selectTab("feedConfig");
return false;
}
- if (keycode == 51 && document.getElementById("filterConfigTab")) { // 4
+ if (keycode == 51 && $("filterConfigTab")) { // 4
selectTab("filterConfig");
return false;
}
- if (keycode == 52 && document.getElementById("labelConfigTab")) { // 5
+ if (keycode == 52 && $("labelConfigTab")) { // 5
selectTab("labelConfig");
return false;
}
- if (keycode == 53 && document.getElementById("userConfigTab")) { // 6
+ if (keycode == 53 && $("userConfigTab")) { // 6
selectTab("userConfig");
return false;
}
}
- if (document.getElementById("piggie")) {
+ if ($("piggie")) {
if (seq.match("807371717369")) {
seq = "";
function editFeedCats() {
try {
- document.getElementById("subscribe_to_feed_btn").disabled = true;
+ $("subscribe_to_feed_btn").disabled = true;
try {
- document.getElementById("top25_feeds_btn").disabled = true;
+ $("top25_feeds_btn").disabled = true;
} catch (e) {
// this button is not always available, no-op if not found
}
function feedActionChange() {
try {
- var chooser = document.getElementById("feedActionChooser");
+ var chooser = $("feedActionChooser");
var opid = chooser[chooser.selectedIndex].value;
chooser.selectedIndex = 0;
function batchFeedsToggleField(cb, elem, label) {
try {
var f = document.forms["batch_edit_feed_form"];
- var l = document.getElementById(label);
+ var l = $(label);
if (cb.checked) {
f[elem].disabled = false;
selectPrefRows('label', false);
- var e = document.getElementById("LICID-" + id);
+ var e = $("LICID-" + id);
if (e) {
if (kind == "fg") {
function colorPicker(id, fg, bg) {
try {
- var picker = document.getElementById("colorPicker-" + id);
+ var picker = $("colorPicker-" + id);
if (picker) Element.show(picker);
function colorPickerHideAll() {
try {
- if (document.getElementById("prefLabelList")) {
+ if ($("prefLabelList")) {
- var elems = document.getElementById("prefLabelList").getElementsByTagName("DIV");
+ var elems = $("prefLabelList").getElementsByTagName("DIV");
for (var i = 0; i < elems.length; i++) {
if (elems[i].id && elems[i].id.match("colorPicker-")) {
"&ids=" + param_escape(id) + "&fg=" + param_escape(fg) +
"&bg=" + param_escape(bg);
- var e = document.getElementById("LICID-" + id);
+ var e = $("LICID-" + id);
if (e) {
e.style.color = fg;
debug("toggleTags: " + show_all + "; " + display_tags);
- var p = document.getElementById("dispSwitchPrompt");
+ var p = $("dispSwitchPrompt");
if (!show_all && !display_tags) {
displayDlg("printTagCloud");
function dlg_frefresh_callback(transport, deleted_feed) {
if (getActiveFeedId() == deleted_feed) {
- var h = document.getElementById("headlines-frame");
+ var h = $("headlines-frame");
if (h) {
h.innerHTML = "<div class='whiteBox'>" + __('No feed selected.') + "</div>";
}
if (fetch) query_str = query_str + "&fetch=yes";
-// var feeds_frame = document.getElementById("feeds-frame");
+// var feeds_frame = $("feeds-frame");
// feeds_frame.src = query_str;
debug("updateFeedList Q=" + query_str);
}
function resetSearch() {
- var searchbox = document.getElementById("searchbox")
+ var searchbox = $("searchbox")
if (searchbox.value != "" && getActiveFeedId()) {
searchbox.value = "";
debug("resize_headlines: " + delta_x + ":" + delta_y);
- var h_frame = document.getElementById("headlines-frame");
- var c_frame = document.getElementById("content-frame");
- var f_frame = document.getElementById("footer");
- var feeds_frame = document.getElementById("feeds-holder");
- var resize_grab = document.getElementById("resize-grabber");
- var resize_handle = document.getElementById("resize-handle");
+ var h_frame = $("headlines-frame");
+ var c_frame = $("content-frame");
+ var f_frame = $("footer");
+ var feeds_frame = $("feeds-holder");
+ var resize_grab = $("resize-grabber");
+ var resize_handle = $("resize-handle");
if (!c_frame || !h_frame) return;
if (fl) {
render_feedlist(fl);
- if (document.getElementById("feedList")) {
+ if ($("feedList")) {
request_counters();
} else {
setTimeout('updateFeedList(false, false)', 50);
}
function quickMenuChange() {
- var chooser = document.getElementById("quickMenuChooser");
+ var chooser = $("quickMenuChooser");
var opid = chooser[chooser.selectedIndex].value;
chooser.selectedIndex = 0;
}
if (k == "new_version_available") {
- var icon = document.getElementById("newVersionIcon");
+ var icon = $("newVersionIcon");
if (icon) {
if (v == "1") {
icon.style.display = "inline";
notify('');
}
-/* var w = document.getElementById("noDaemonWarning");
+/* var w = $("noDaemonWarning");
if (w) {
if (k == "daemon_is_running" && v != 1) {
if (theme != "" && theme != "compact" && theme != "graycube" &&
theme != "compat") return;
- var fl = document.getElementById("feeds-holder");
- var fh = document.getElementById("headlines-frame");
- var fc = document.getElementById("content-frame");
- var ft = document.getElementById("toolbar");
- var ff = document.getElementById("footer");
- var fhdr = document.getElementById("header");
- var fbtn = document.getElementById("collapse_feeds_btn");
+ var fl = $("feeds-holder");
+ var fh = $("headlines-frame");
+ var fc = $("content-frame");
+ var ft = $("toolbar");
+ var ff = $("footer");
+ var fhdr = $("header");
+ var fbtn = $("collapse_feeds_btn");
if (!Element.visible(fl)) {
Element.show(fl);
var keycode;
var shift_key = false;
- var feedlist = document.getElementById('feedList');
+ var feedlist = $('feedList');
try {
shift_key = e.shiftKey;
if (keycode == 9) { // tab
var id = getArticleUnderPointer();
if (id) {
- var cb = document.getElementById("RCHK-" + id);
+ var cb = $("RCHK-" + id);
if (cb) {
cb.checked = !cb.checked;
function clean_feed_selections() {
try {
- var feeds = document.getElementById("feedList").getElementsByTagName("LI");
+ var feeds = $("feedList").getElementsByTagName("LI");
for (var i = 0; i < feeds.length; i++) {
if (feeds[i].id && feeds[i].id.match("FEEDR-")) {
}
if (!is_cat) {
- var feedr = document.getElementById("FEEDR-" + feed_id);
+ var feedr = $("FEEDR-" + feed_id);
if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected";
}
} else {
- var feedr = document.getElementById("FCAT-" + feed_id);
+ var feedr = $("FCAT-" + feed_id);
if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected";
}
}
- var f = document.getElementById("headlines-frame");
+ var f = $("headlines-frame");
try {
if (feed_cur_page == 0) {
debug("resetting headlines scrollTop");
if (headlines_count > 0) {
debug("adding some more headlines...");
- var c = document.getElementById("headlinesList");
+ var c = $("headlinesList");
if (!c) {
- c = document.getElementById("headlinesInnerContainer");
+ c = $("headlinesInnerContainer");
}
var ids = getSelectedArticleIds2();
if (_cdm_wd_timeout) window.clearTimeout(_cdm_wd_timeout);
- if (!document.getElementById("headlinesList") &&
+ if (!$("headlinesList") &&
getActiveFeedId() != -3 &&
getInitParam("cdm_auto_catchup") == 1) {
debug("starting CDM watchdog");
function render_article(article) {
try {
- var f = document.getElementById("content-frame");
+ var f = $("content-frame");
try {
f.scrollTop = 0;
} catch (e) { };
- var fi = document.getElementById("content-insert");
+ var fi = $("content-insert");
try {
fi.scrollTop = 0;
cleanSelected("headlinesList");
- var crow = document.getElementById("RROW-" + id);
+ var crow = $("RROW-" + id);
if (!crow) return;
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
- var upd_img_pic = document.getElementById("FUPDPIC-" + id);
+ var upd_img_pic = $("FUPDPIC-" + id);
var cache_prefix = "";
cache_invalidate(cache_prefix + getActiveFeedId());
cache_inject(cache_prefix + getActiveFeedId(),
- document.getElementById("headlines-frame").innerHTML,
+ $("headlines-frame").innerHTML,
get_feed_unread(getActiveFeedId()));
} else if (article_is_unread && view_mode == "all_articles") {
cache_invalidate(cache_prefix + getActiveFeedId());
cache_inject(cache_prefix + getActiveFeedId(),
- document.getElementById("headlines-frame").innerHTML,
+ $("headlines-frame").innerHTML,
get_feed_unread(getActiveFeedId())-1);
} else if (article_is_unread) {
} else {
debug("article_callback: returned no XML object");
- //var f = document.getElementById("content-frame");
+ //var f = $("content-frame");
//f.innerHTML = "<div class='whiteBox'>" + __('Could not display article (missing XML object)') + "</div>";
}
query = query + "&cids=" + cids_to_request.toString();
- var crow = document.getElementById("RROW-" + id);
+ var crow = $("RROW-" + id);
var article_is_unread = crow.className.match("Unread");
if (!async_counters_work) {
query = query + "&omode=flc";
}
- var mark_img = document.getElementById("FMPIC-" + id);
+ var mark_img = $("FMPIC-" + id);
if (!mark_img) return;
- var vfeedu = document.getElementById("FEEDU--1");
- var crow = document.getElementById("RROW-" + id);
+ var vfeedu = $("FEEDU--1");
+ var crow = $("RROW-" + id);
if (mark_img.src.match("mark_unset")) {
mark_img.src = mark_img.src.replace("mark_unset", "mark_set");
mark_img.alt = __("Please wait...");
query = query + "&mark=0";
- if (document.getElementById("headlinesList") && !no_effects) {
+ if ($("headlinesList") && !no_effects) {
Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off});
} else {
mark_img.src = mark_img.src.replace("mark_set", "mark_unset");
query = query + "&omode=flc";
}
- var mark_img = document.getElementById("FPPIC-" + id);
+ var mark_img = $("FPPIC-" + id);
if (!mark_img) return;
- var vfeedu = document.getElementById("FEEDU--2");
- var crow = document.getElementById("RROW-" + id);
+ var vfeedu = $("FEEDU--2");
+ var crow = $("RROW-" + id);
if (mark_img.src.match("pub_unset")) {
mark_img.src = mark_img.src.replace("pub_unset", "pub_set");
mark_img.alt = __("Please wait...");
query = query + "&pub=0";
- if (document.getElementById("headlinesList") && !no_effects) {
+ if ($("headlinesList") && !no_effects) {
Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off});
} else {
mark_img.src = mark_img.src.replace("pub_set", "pub_unset");
try {
- var hlist = document.getElementById("headlinesList");
- var container = document.getElementById("headlinesInnerContainer");
- var row = document.getElementById("RROW-" + id);
+ var hlist = $("headlinesList");
+ var container = $("headlinesInnerContainer");
+ var row = $("RROW-" + id);
var viewport = container.offsetHeight;
var prev_id = false;
var next_id = false;
- if (!document.getElementById('RROW-' + active_post_id)) {
+ if (!$('RROW-' + active_post_id)) {
active_post_id = false;
}
function toggleSelected(id) {
try {
- var cb = document.getElementById("RCHK-" + id);
+ var cb = $("RCHK-" + id);
- var row = document.getElementById("RROW-" + id);
+ var row = $("RROW-" + id);
if (row) {
var nc = row.className;
function toggleUnread(id, cmode, effect) {
try {
- var row = document.getElementById("RROW-" + id);
+ var row = $("RROW-" + id);
if (row) {
var nc = row.className;
var is_selected = row.className.match("Selected");
// since we are removing selection from the object, uncheck
// corresponding checkbox
- var cb = document.getElementById("RCHK-" + id);
+ var cb = $("RCHK-" + id);
if (cb) {
cb.checked = false;
}
}
for (i = 0; i < rows.length; i++) {
- var row = document.getElementById("RROW-" + rows[i]);
+ var row = $("RROW-" + rows[i]);
if (row) {
var nc = row.className;
nc = nc.replace("Unread", "");
function cdmGetSelectedArticles() {
var sel_articles = new Array();
- var container = document.getElementById("headlinesInnerContainer");
+ var container = $("headlinesInnerContainer");
for (i = 0; i < container.childNodes.length; i++) {
var child = container.childNodes[i];
function cdmGetVisibleArticles() {
var sel_articles = new Array();
- var container = document.getElementById("headlinesInnerContainer");
+ var container = $("headlinesInnerContainer");
if (!container) return sel_articles;
function cdmGetUnreadArticles() {
var sel_articles = new Array();
- var container = document.getElementById("headlinesInnerContainer");
+ var container = $("headlinesInnerContainer");
for (i = 0; i < container.childNodes.length; i++) {
var child = container.childNodes[i];
// mode = all,none,unread
function cdmSelectArticles(mode) {
- var container = document.getElementById("headlinesInnerContainer");
+ var container = $("headlinesInnerContainer");
for (i = 0; i < container.childNodes.length; i++) {
var child = container.childNodes[i];
if (child.id && child.id.match("RROW-")) {
var aid = child.id.replace("RROW-", "");
- var cb = document.getElementById("RCHK-" + aid);
+ var cb = $("RCHK-" + aid);
if (mode == "all") {
if (!child.className.match("Selected")) {
return;
}
- if (document.getElementById("headlinesList")) {
+ if ($("headlinesList")) {
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true);
selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
var rows;
- if (document.getElementById("headlinesList")) {
+ if ($("headlinesList")) {
rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
} else {
rows = cdmGetSelectedArticles();
return;
}
- if (document.getElementById("headlinesList")) {
+ if ($("headlinesList")) {
selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
// selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
} else {
var id = tags_str.getAttribute("id");
if (id) {
- var tags = document.getElementById("ATSTR-" + id);
+ var tags = $("ATSTR-" + id);
if (tags) {
tags.innerHTML = tags_str.firstChild.nodeValue;
}
function cdmScrollViewport(where) {
debug("cdmScrollViewport: " + where);
- var ctr = document.getElementById("headlinesInnerContainer");
+ var ctr = $("headlinesInnerContainer");
if (!ctr) return;
function cdmArticleIsBelowViewport(id) {
try {
- var ctr = document.getElementById("headlinesInnerContainer");
- var e = document.getElementById("RROW-" + id);
+ var ctr = $("headlinesInnerContainer");
+ var e = $("RROW-" + id);
if (!e || !ctr) return;
function cdmArticleIsAboveViewport(id) {
try {
- var ctr = document.getElementById("headlinesInnerContainer");
- var e = document.getElementById("RROW-" + id);
+ var ctr = $("headlinesInnerContainer");
+ var e = $("RROW-" + id);
if (!e || !ctr) return;
function cdmScrollToArticleId(id) {
try {
- var ctr = document.getElementById("headlinesInnerContainer");
- var e = document.getElementById("RROW-" + id);
+ var ctr = $("headlinesInnerContainer");
+ var e = $("RROW-" + id);
if (!e || !ctr) return;
function cdmArticleIsActuallyVisible(id) {
try {
- var ctr = document.getElementById("headlinesInnerContainer");
- var e = document.getElementById("RROW-" + id);
+ var ctr = $("headlinesInnerContainer");
+ var e = $("RROW-" + id);
if (!e || !ctr) return;
try {
- var ctr = document.getElementById("headlinesInnerContainer");
+ var ctr = $("headlinesInnerContainer");
if (!ctr) return;
if (ids.length > 0) {
for (var i = 0; i < ids.length; i++) {
- var e = document.getElementById("RROW-" + ids[i]);
+ var e = $("RROW-" + ids[i]);
if (e) {
e.className = e.className.replace("Unread", "");
}
function cdmClicked(id) {
try {
- var elem = document.getElementById("RROW-" + id);
+ var elem = $("RROW-" + id);
if (elem) {
var id = elem.id.replace("RROW-", "");
function headlines_scroll_handler() {
try {
- var e = document.getElementById("headlinesInnerContainer");
+ var e = $("headlinesInnerContainer");
// don't do infinite scrolling when Limit == All
var visible_ids;
- if (document.getElementById("headlinesList")) {
+ if ($("headlinesList")) {
visible_ids = getVisibleHeadlineIds();
} else {
visible_ids = cdmGetVisibleArticles();
if (!below) {
for (var i = 0; i < visible_ids.length; i++) {
if (visible_ids[i] != getActiveArticleId()) {
- var e = document.getElementById("RROW-" + visible_ids[i]);
+ var e = $("RROW-" + visible_ids[i]);
if (e && e.className.match("Unread")) {
ids_to_mark.push(visible_ids[i]);
} else {
for (var i = visible_ids.length-1; i >= 0; i--) {
if (visible_ids[i] != getActiveArticleId()) {
- var e = document.getElementById("RROW-" + visible_ids[i]);
+ var e = $("RROW-" + visible_ids[i]);
if (e && e.className.match("Unread")) {
ids_to_mark.push(visible_ids[i]);
if (confirm(msg)) {
for (var i = 0; i < ids_to_mark.length; i++) {
- var e = document.getElementById("RROW-" + ids_to_mark[i]);
+ var e = $("RROW-" + ids_to_mark[i]);
e.className = e.className.replace("Unread", "");
}
Effect.Appear(id, {duration : 0.5,
beforeStart: function(effect) {
var h_id = 'CICH-' + a_id;
- var h_elem = document.getElementById(h_id);
+ var h_elem = $(h_id);
if (h_elem) { h_elem.style.display = "none"; }
toggleUnread(a_id, 0);
function fixHeadlinesOrder(ids) {
try {
for (var i = 0; i < ids.length; i++) {
- var e = document.getElementById("RROW-" + ids[i]);
+ var e = $("RROW-" + ids[i]);
if (e) {
if (i % 2 == 0) {
var ids = false;
var vis_ids = new Array();
- if (document.getElementById("headlinesList")) {
+ if ($("headlinesList")) {
ids = getVisibleHeadlineIds();
} else {
ids = cdmGetVisibleArticles();
var read_headlines_visible = true;
for (var i = 0; i < ids.length; i++) {
- var row = document.getElementById("RROW-" + ids[i]);
+ var row = $("RROW-" + ids[i]);
if (row && row.className) {
if (read_headlines_visible) {
for (var i = 0; i < rows.length; i++) {
var nc = rows[i].className;
var id = rows[i].id.replace("RROW-", "");
- var cb = document.getElementById("RCHK-" + id);
+ var cb = $("RCHK-" + id);
if (!rows[i].className.match("Selected")) {
nc = nc + "Selected";
if (link && id) {
link = link.firstChild.nodeValue;
- var ci = document.getElementById("content-insert");
+ var ci = $("content-insert");
var tmp = "<iframe id=\"inline_orig_article\" width=\""+ci.offsetWidth+"\" height=\""+ci.offsetHeight+"\" style=\"border-width : 0px;\" src=\""+link+"\"></iframe>";
function scrollArticle(offset) {
try {
if (!isCdmMode()) {
- var ci = document.getElementById("content-insert");
+ var ci = $("content-insert");
if (ci) {
ci.scrollTop += offset;
}
} else {
- var hi = document.getElementById("headlinesInnerContainer");
+ var hi = $("headlinesInnerContainer");
if (hi) {
hi.scrollTop += offset;
}
if (e_id) {
- var ctr = document.getElementById("HLLCTR-" + e_id);
+ var ctr = $("HLLCTR-" + e_id);
if (ctr) {
ctr.innerHTML = elems[l].firstChild.nodeValue;
function toggleHeadlineActions() {
try {
- var e = document.getElementById("headlineActionsBody");
- var p = document.getElementById("headlineActionsDrop");
+ var e = $("headlineActionsBody");
+ var p = $("headlineActionsDrop");
if (!Element.visible(e)) {
Element.show(e);