use prototype instead of getElementById

This commit is contained in:
Andrew Dolgov 2009-02-10 12:06:15 +03:00
parent 0351576bd8
commit acac8448a4
6 changed files with 241 additions and 241 deletions

View File

@ -67,7 +67,7 @@ function printFeedEntry(id, title, row_class, unread, icon) {
function render_feedlist(data) { function render_feedlist(data) {
try { try {
var f = document.getElementById("feeds-frame"); var f = $("feeds-frame");
f.innerHTML = data; f.innerHTML = data;
// cache_invalidate("FEEDLIST"); // cache_invalidate("FEEDLIST");
// cache_inject("FEEDLIST", data, getInitParam("num_feeds")); // cache_inject("FEEDLIST", data, getInitParam("num_feeds"));
@ -175,7 +175,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
var query = "backend.php?op=viewfeed&feed=" + feed + "&" + var query = "backend.php?op=viewfeed&feed=" + feed + "&" +
toolbar_query + "&subop=" + param_escape(subop); toolbar_query + "&subop=" + param_escape(subop);
if (document.getElementById("search_form")) { if ($("search_form")) {
var search_query = Form.serialize("search_form"); var search_query = Form.serialize("search_form");
query = query + "&" + search_query; query = query + "&" + search_query;
closeInfoBox(true); closeInfoBox(true);
@ -194,7 +194,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
if (!activeFeedIsCat()) { if (!activeFeedIsCat()) {
var feedlist = document.getElementById('feedList'); var feedlist = $('feedList');
var next_unread_feed = getRelativeFeedId(feedlist, var next_unread_feed = getRelativeFeedId(feedlist,
feed, "next", true); feed, "next", true);
@ -260,7 +260,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
debug(query); debug(query);
var container = document.getElementById("headlinesInnerContainer"); var container = $("headlinesInnerContainer");
/* if (container && page_offset == 0 && !isCdmMode()) { /* if (container && page_offset == 0 && !isCdmMode()) {
new Effect.Fade(container, {duration: 1, to: 0.01, new Effect.Fade(container, {duration: 1, to: 0.01,
@ -288,19 +288,19 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
} }
if (cache_check) { if (cache_check) {
var f = document.getElementById("headlines-frame"); var f = $("headlines-frame");
clean_feed_selections(); clean_feed_selections();
setActiveFeedId(feed, is_cat); setActiveFeedId(feed, is_cat);
if (!is_cat) { if (!is_cat) {
var feedr = document.getElementById("FEEDR-" + feed); var feedr = $("FEEDR-" + feed);
if (feedr && !feedr.className.match("Selected")) { if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected"; feedr.className = feedr.className + "Selected";
} }
} else { } else {
var feedr = document.getElementById("FCAT-" + feed_id); var feedr = $("FCAT-" + feed_id);
if (feedr && !feedr.className.match("Selected")) { if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected"; feedr.className = feedr.className + "Selected";
} }
@ -335,7 +335,7 @@ function toggleCollapseCat_af(effect) {
var elem = effect.element; var elem = effect.element;
var cat = elem.id.replace("FCATLIST-", ""); var cat = elem.id.replace("FCATLIST-", "");
var cap = document.getElementById("FCAP-" + cat); var cap = $("FCAP-" + cat);
if (Element.visible(elem)) { if (Element.visible(elem)) {
cap.innerHTML = cap.innerHTML.replace("…", ""); cap.innerHTML = cap.innerHTML.replace("…", "");
@ -353,9 +353,9 @@ function toggleCollapseCat_af(effect) {
function toggleCollapseCat(cat) { function toggleCollapseCat(cat) {
try { try {
var cat_elem = document.getElementById("FCAT-" + cat); var cat_elem = $("FCAT-" + cat);
var cat_list = document.getElementById("FCATLIST-" + cat).parentNode; var cat_list = $("FCATLIST-" + cat).parentNode;
var caption = document.getElementById("FCAP-" + cat); var caption = $("FCAP-" + cat);
/* if (cat_list.className.match("invisible")) { /* if (cat_list.className.match("invisible")) {
cat_list.className = ""; cat_list.className = "";
@ -411,7 +411,7 @@ function toggleCollapseCat(cat) {
function feedlist_dragsorted(ctr) { function feedlist_dragsorted(ctr) {
try { try {
var elem = document.getElementById("feedList"); var elem = $("feedList");
var cats = elem.getElementsByTagName("LI"); var cats = elem.getElementsByTagName("LI");
var ordered_cats = new Array(); var ordered_cats = new Array();
@ -485,19 +485,19 @@ function feedlist_init() {
function hide_footer_af(effect) { function hide_footer_af(effect) {
try { try {
var c = document.getElementById("content-frame"); var c = $("content-frame");
if (c) { if (c) {
c.style.bottom = "0px"; c.style.bottom = "0px";
var ioa = document.getElementById("inline_orig_article"); var ioa = $("inline_orig_article");
if (ioa) { if (ioa) {
ioa.height = c.offsetHeight; ioa.height = c.offsetHeight;
} }
} else { } else {
var h = document.getElementById("headlines-frame"); var h = $("headlines-frame");
if (h) { if (h) {
h.style.bottom = "0px"; h.style.bottom = "0px";
@ -526,14 +526,14 @@ function init_hidden_feedlist(theme) {
if (theme != "" && theme != "compact") return; if (theme != "" && theme != "compact") return;
var fl = document.getElementById("feeds-holder"); var fl = $("feeds-holder");
var fh = document.getElementById("headlines-frame"); var fh = $("headlines-frame");
var fc = document.getElementById("content-frame"); var fc = $("content-frame");
var ft = document.getElementById("toolbar"); var ft = $("toolbar");
var ff = document.getElementById("footer"); var ff = $("footer");
var fhdr = document.getElementById("header"); var fhdr = $("header");
var fbtn = document.getElementById("toggle_feeds_btn"); var fbtn = $("toggle_feeds_btn");
if (fbtn) Element.show(fbtn); if (fbtn) Element.show(fbtn);
@ -564,7 +564,7 @@ function init_collapsable_feedlist(theme) {
if (theme != "" && theme != "compact" && theme != "graycube" && if (theme != "" && theme != "compact" && theme != "graycube" &&
theme != "compat") return; theme != "compat") return;
var fbtn = document.getElementById("collapse_feeds_btn"); var fbtn = $("collapse_feeds_btn");
if (fbtn) Element.show(fbtn); if (fbtn) Element.show(fbtn);
@ -647,7 +647,7 @@ function mouse_up_handler(e) {
if (!selection_disabled) { if (!selection_disabled) {
document.onselectstart = null; document.onselectstart = null;
var e = document.getElementById("headlineActionsBody"); var e = $("headlineActionsBody");
if (e) Element.hide(e); if (e) Element.hide(e);
} }

View File

@ -24,7 +24,7 @@ function exception_error(location, e, ext_info) {
try { try {
var ebc = document.getElementById("xebContent"); var ebc = $("xebContent");
if (ebc) { if (ebc) {
@ -106,7 +106,7 @@ function open_article_callback(transport) {
if (id) { if (id) {
id = id.firstChild.nodeValue; id = id.firstChild.nodeValue;
if (!document.getElementById("headlinesList")) { if (!$("headlinesList")) {
window.setTimeout("toggleUnread(" + id + ", 0)", 100); window.setTimeout("toggleUnread(" + id + ", 0)", 100);
} }
} }
@ -148,7 +148,7 @@ function delay(gap) {
var notify_hide_timerid = false; var notify_hide_timerid = false;
function hide_notify() { function hide_notify() {
var n = document.getElementById("notify"); var n = $("notify");
if (n) { if (n) {
n.style.display = "none"; n.style.display = "none";
} }
@ -165,8 +165,8 @@ function notify_real(msg, no_hide, n_type) {
return; return;
} }
var n = document.getElementById("notify"); var n = $("notify");
var nb = document.getElementById("notify_body"); var nb = $("notify_body");
if (!n || !nb) return; if (!n || !nb) return;
@ -240,7 +240,7 @@ function printLockingError() {
} }
function cleanSelected(element) { function cleanSelected(element) {
var content = document.getElementById(element); var content = $(element);
for (i = 0; i < content.rows.length; i++) { for (i = 0; i < content.rows.length; i++) {
content.rows[i].className = content.rows[i].className.replace("Selected", ""); content.rows[i].className = content.rows[i].className.replace("Selected", "");
@ -248,7 +248,7 @@ function cleanSelected(element) {
} }
function getVisibleUnreadHeadlines() { function getVisibleUnreadHeadlines() {
var content = document.getElementById("headlinesList"); var content = $("headlinesList");
var rows = new Array(); var rows = new Array();
@ -265,7 +265,7 @@ function getVisibleUnreadHeadlines() {
function getVisibleHeadlineIds() { function getVisibleHeadlineIds() {
var content = document.getElementById("headlinesList"); var content = $("headlinesList");
var rows = new Array(); var rows = new Array();
@ -301,7 +301,7 @@ function getLastVisibleHeadlineId() {
} }
function markHeadline(id) { function markHeadline(id) {
var row = document.getElementById("RROW-" + id); var row = $("RROW-" + id);
if (row) { if (row) {
var is_active = false; var is_active = false;
@ -316,7 +316,7 @@ function markHeadline(id) {
row.className = row.className = "Active"; row.className = row.className = "Active";
} }
var check = document.getElementById("RCHK-" + id); var check = $("RCHK-" + id);
if (check) { if (check) {
check.checked = true; check.checked = true;
@ -328,7 +328,7 @@ function markHeadline(id) {
} }
function getFeedIds() { function getFeedIds() {
var content = document.getElementById("feedsList"); var content = $("feedsList");
var rows = new Array(); var rows = new Array();
@ -398,7 +398,7 @@ function disableContainerChildren(id, disable, doc) {
if (!doc) doc = document; if (!doc) doc = document;
var container = doc.getElementById(id); var container = $(id);
if (!container) { if (!container) {
//alert("disableContainerChildren: element " + id + " not found"); //alert("disableContainerChildren: element " + id + " not found");
@ -469,7 +469,7 @@ function parse_counters(reply, scheduled_call) {
} }
if (t == "category") { if (t == "category") {
var catctr = document.getElementById("FCATCTR-" + id); var catctr = $("FCATCTR-" + id);
if (catctr) { if (catctr) {
catctr.innerHTML = "(" + ctr + ")"; catctr.innerHTML = "(" + ctr + ")";
if (ctr > 0) { if (ctr > 0) {
@ -481,12 +481,12 @@ function parse_counters(reply, scheduled_call) {
continue; continue;
} }
var feedctr = document.getElementById("FEEDCTR-" + id); var feedctr = $("FEEDCTR-" + id);
var feedu = document.getElementById("FEEDU-" + id); var feedu = $("FEEDU-" + id);
var feedr = document.getElementById("FEEDR-" + id); var feedr = $("FEEDR-" + id);
var feed_img = document.getElementById("FIMG-" + id); var feed_img = $("FIMG-" + id);
var feedlink = document.getElementById("FEEDL-" + id); var feedlink = $("FEEDL-" + id);
var feedupd = document.getElementById("FLUPD-" + id); var feedupd = $("FLUPD-" + id);
if (updated && feedlink) { if (updated && feedlink) {
if (error) { if (error) {
@ -581,7 +581,7 @@ function parse_counters(reply, scheduled_call) {
setTimeout('updateFeedList(false, false)', 50); setTimeout('updateFeedList(false, false)', 50);
} }
} else { } else {
/* var fl = document.getElementById("feeds-frame").innerHTML; /* var fl = $("feeds-frame").innerHTML;
if (fl) { if (fl) {
cache_invalidate("FEEDLIST"); cache_invalidate("FEEDLIST");
cache_inject("FEEDLIST", fl, getInitParam("num_feeds")); cache_inject("FEEDLIST", fl, getInitParam("num_feeds"));
@ -643,7 +643,7 @@ function all_counters_callback2(transport, async_call) {
function get_feed_unread(id) { function get_feed_unread(id) {
try { try {
return parseInt(document.getElementById("FEEDU-" + id).innerHTML); return parseInt($("FEEDU-" + id).innerHTML);
} catch (e) { } catch (e) {
return -1; return -1;
} }
@ -651,7 +651,7 @@ function get_feed_unread(id) {
function get_cat_unread(id) { function get_cat_unread(id) {
try { try {
var ctr = document.getElementById("FCATCTR-" + id).innerHTML; var ctr = $("FCATCTR-" + id).innerHTML;
ctr = ctr.replace("(", ""); ctr = ctr.replace("(", "");
ctr = ctr.replace(")", ""); ctr = ctr.replace(")", "");
return parseInt(ctr); return parseInt(ctr);
@ -669,7 +669,7 @@ function get_feed_entry_unread(elem) {
} }
try { try {
return parseInt(document.getElementById("FEEDU-" + id).innerHTML); return parseInt($("FEEDU-" + id).innerHTML);
} catch (e) { } catch (e) {
return -1; return -1;
} }
@ -719,7 +719,7 @@ function resort_category(node) {
function resort_feedlist() { function resort_feedlist() {
debug("resort_feedlist"); debug("resort_feedlist");
if (document.getElementById("FCATLIST--1")) { if ($("FCATLIST--1")) {
var lists = document.getElementsByTagName("UL"); var lists = document.getElementsByTagName("UL");
@ -730,7 +730,7 @@ function resort_feedlist() {
} }
} else { } else {
resort_category(document.getElementById("feedList")); resort_category($("feedList"));
} }
} }
@ -774,7 +774,7 @@ function hideOrShowFeeds(hide) {
debug("hideOrShowFeeds: " + hide); debug("hideOrShowFeeds: " + hide);
if (document.getElementById("FCATLIST--1")) { if ($("FCATLIST--1")) {
var lists = document.getElementsByTagName("UL"); var lists = document.getElementsByTagName("UL");
@ -803,10 +803,10 @@ function hideOrShowFeedsCategory(id, hide) {
var cat_node = null; var cat_node = null;
if (id) { if (id) {
node = document.getElementById("FCATLIST-" + id); node = $("FCATLIST-" + id);
cat_node = document.getElementById("FCAT-" + id); cat_node = $("FCAT-" + id);
} else { } else {
node = document.getElementById("feedList"); // no categories node = $("feedList"); // no categories
} }
// debug("hideOrShowFeedsCategory: " + node + " (" + hide + ")"); // debug("hideOrShowFeedsCategory: " + node + " (" + hide + ")");
@ -902,13 +902,13 @@ function selectTableRowById(elem_id, check_id, do_select) {
try { try {
var row = document.getElementById(elem_id); var row = $(elem_id);
if (row) { if (row) {
selectTableRow(row, do_select); selectTableRow(row, do_select);
} }
var check = document.getElementById(check_id); var check = $(check_id);
if (check) { if (check) {
check.checked = do_select; check.checked = do_select;
@ -921,7 +921,7 @@ function selectTableRowById(elem_id, check_id, do_select) {
function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select, function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
classcheck, reset_others) { classcheck, reset_others) {
var content = document.getElementById(content_id); var content = $(content_id);
if (!content) { if (!content) {
alert("[selectTableRows] Element " + content_id + " not found."); alert("[selectTableRows] Element " + content_id + " not found.");
@ -936,7 +936,7 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
selectTableRow(content.rows[i], do_select); selectTableRow(content.rows[i], do_select);
var row_id = content.rows[i].id.replace(prefix, ""); 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) { if (check) {
check.checked = do_select; check.checked = do_select;
@ -945,7 +945,7 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
selectTableRow(content.rows[i], false); selectTableRow(content.rows[i], false);
var row_id = content.rows[i].id.replace(prefix, ""); 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) { if (check) {
check.checked = false; check.checked = false;
@ -956,7 +956,7 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
selectTableRow(content.rows[i], false); selectTableRow(content.rows[i], false);
var row_id = content.rows[i].id.replace(prefix, ""); 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) { if (check) {
check.checked = false; check.checked = false;
@ -969,7 +969,7 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
function getSelectedTableRowIds(content_id, prefix) { function getSelectedTableRowIds(content_id, prefix) {
var content = document.getElementById(content_id); var content = $(content_id);
if (!content) { if (!content) {
alert("[getSelectedTableRowIds] Element " + content_id + " not found."); alert("[getSelectedTableRowIds] Element " + content_id + " not found.");
@ -992,7 +992,7 @@ function getSelectedTableRowIds(content_id, prefix) {
} }
function toggleSelectRowById(sender, id) { function toggleSelectRowById(sender, id) {
var row = document.getElementById(id); var row = $(id);
if (sender.checked) { if (sender.checked) {
if (!row.className.match("Selected")) { if (!row.className.match("Selected")) {
@ -1039,7 +1039,7 @@ function toggleSelectRow(sender) {
function getNextUnreadCat(id) { function getNextUnreadCat(id) {
try { try {
var rows = document.getElementById("feedList").getElementsByTagName("LI"); var rows = $("feedList").getElementsByTagName("LI");
var feeds = new Array(); var feeds = new Array();
var unread_only = true; var unread_only = true;
@ -1077,7 +1077,7 @@ function getRelativeFeedId2(id, is_cat, direction, unread_only) {
// alert(id + " IC: " + is_cat + " D: " + direction + " U: " + unread_only); // 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(); var feeds = new Array();
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
@ -1185,13 +1185,13 @@ function getRelativeFeedId(list, id, direction, unread_only) {
} }
function showBlockElement(id, h_id) { function showBlockElement(id, h_id) {
var elem = document.getElementById(id); var elem = $(id);
if (elem) { if (elem) {
elem.style.display = "block"; elem.style.display = "block";
if (h_id) { if (h_id) {
elem = document.getElementById(h_id); elem = $(h_id);
if (elem) { if (elem) {
elem.style.display = "none"; elem.style.display = "none";
} }
@ -1286,8 +1286,8 @@ function closeInfoBox(cleanup) {
if (Element.visible("infoBoxShadow")) { if (Element.visible("infoBoxShadow")) {
Element.hide("dialog_overlay"); Element.hide("dialog_overlay");
var shadow = document.getElementById('infoBoxShadow'); var shadow = $('infoBoxShadow');
var box = document.getElementById('infoBoxShadow'); var box = $('infoBoxShadow');
Element.hide(shadow); Element.hide(shadow);
@ -1341,8 +1341,8 @@ function infobox_callback2(transport) {
Element.show("dialog_overlay"); Element.show("dialog_overlay");
} }
var box = document.getElementById('infoBox'); var box = $('infoBox');
var shadow = document.getElementById('infoBoxShadow'); var shadow = $('infoBoxShadow');
if (box) { if (box) {
box.innerHTML=transport.responseText; box.innerHTML=transport.responseText;
@ -1355,7 +1355,7 @@ function infobox_callback2(transport) {
/* FIXME this needs to be moved out somewhere */ /* FIXME this needs to be moved out somewhere */
if (document.getElementById("tags_choices")) { if ($("tags_choices")) {
new Ajax.Autocompleter('tags_str', 'tags_choices', new Ajax.Autocompleter('tags_str', 'tags_choices',
"backend.php?op=rpc&subop=completeTags", "backend.php?op=rpc&subop=completeTags",
{ tokens: ',', paramName: "search" }); { tokens: ',', paramName: "search" });
@ -1402,7 +1402,7 @@ function createFilter() {
function toggleSubmitNotEmpty(e, submit_id) { function toggleSubmitNotEmpty(e, submit_id) {
try { try {
document.getElementById(submit_id).disabled = (e.value == "") $(submit_id).disabled = (e.value == "")
} catch (e) { } catch (e) {
exception_error("toggleSubmitNotEmpty", e); exception_error("toggleSubmitNotEmpty", e);
} }
@ -1474,7 +1474,7 @@ function debug(msg) {
debug_last_class = "even"; debug_last_class = "even";
} }
var c = document.getElementById('debug_output'); var c = $('debug_output');
if (c && Element.visible(c)) { if (c && Element.visible(c)) {
while (c.lastChild != 'undefined' && c.childNodes.length > 100) { while (c.lastChild != 'undefined' && c.childNodes.length > 100) {
c.removeChild(c.lastChild); c.removeChild(c.lastChild);
@ -1510,7 +1510,7 @@ function fatalError(code, msg, ext_info) {
if (msg == "") msg = "Unknown error"; if (msg == "") msg = "Unknown error";
var ebc = document.getElementById("xebContent"); var ebc = $("xebContent");
if (ebc) { if (ebc) {
@ -1541,9 +1541,9 @@ function getFeedName(id, is_cat) {
var e; var e;
if (is_cat) { if (is_cat) {
e = document.getElementById("FCATN-" + id); e = $("FCATN-" + id);
} else { } else {
e = document.getElementById("FEEDN-" + id); e = $("FEEDN-" + id);
} }
if (e) { if (e) {
return e.innerHTML.stripTags(); return e.innerHTML.stripTags();
@ -1602,7 +1602,7 @@ function filterDlgCheckAction(sender) {
return; return;
} }
var action_param = document.getElementById("filter_dlg_param_box"); var action_param = $("filter_dlg_param_box");
if (!action_param) { if (!action_param) {
debug("filterDlgCheckAction: can't find action param box!"); debug("filterDlgCheckAction: can't find action param box!");
@ -1690,7 +1690,7 @@ function getRelativePostIds(id, limit) {
debug("getRelativePostIds: " + id + " limit=" + limit); debug("getRelativePostIds: " + id + " limit=" + limit);
var ids = new Array(); var ids = new Array();
var container = document.getElementById("headlinesList"); var container = $("headlinesList");
if (container) { if (container) {
var rows = container.rows; var rows = container.rows;
@ -1773,7 +1773,7 @@ Position.Center = function(element, parent) {
function labeltest_callback(transport) { function labeltest_callback(transport) {
try { try {
var container = document.getElementById('label_test_result'); var container = $('label_test_result');
container.innerHTML = transport.responseText; container.innerHTML = transport.responseText;
if (!Element.visible(container)) { if (!Element.visible(container)) {
@ -1789,7 +1789,7 @@ function labeltest_callback(transport) {
function labelTest() { function labelTest() {
try { try {
var container = document.getElementById('label_test_result'); var container = $('label_test_result');
var form = document.forms['label_edit_form']; var form = document.forms['label_edit_form'];
@ -1814,7 +1814,7 @@ function labelTest() {
} }
function isCdmMode() { function isCdmMode() {
return !document.getElementById("headlinesList"); return !$("headlinesList");
} }
function getSelectedArticleIds2() { function getSelectedArticleIds2() {
@ -1830,7 +1830,7 @@ function getSelectedArticleIds2() {
var ids = new Array(); var ids = new Array();
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
var chk = document.getElementById("RCHK-" + rows[i]); var chk = $("RCHK-" + rows[i]);
if (chk && chk.checked) { if (chk && chk.checked) {
ids.push(rows[i]); ids.push(rows[i]);
} }
@ -1850,7 +1850,7 @@ function displayHelpInfobox(topic_id) {
function focus_element(id) { function focus_element(id) {
try { try {
var e = document.getElementById(id); var e = $(id);
if (e) e.focus(); if (e) e.focus();
} catch (e) { } catch (e) {
exception_error("focus_element", e); exception_error("focus_element", e);
@ -1864,7 +1864,7 @@ function loading_set_progress(p) {
debug("<b>loading_set_progress : " + p + " (" + last_progress_point + ")</b>"); 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"; // o.style.width = (p * 2) + "px";
@ -2011,8 +2011,8 @@ function labelFieldsCheck(elem) {
function getSelectedFeedsFromBrowser() { function getSelectedFeedsFromBrowser() {
var list = document.getElementById("browseFeedList"); var list = $("browseFeedList");
if (!list) list = document.getElementById("browseBigFeedList"); if (!list) list = $("browseBigFeedList");
var selected = new Array(); var selected = new Array();
@ -2021,7 +2021,7 @@ function getSelectedFeedsFromBrowser() {
if (child.id && child.id.match("FBROW-")) { if (child.id && child.id.match("FBROW-")) {
var id = child.id.replace("FBROW-", ""); var id = child.id.replace("FBROW-", "");
var cb = document.getElementById("FBCHK-" + id); var cb = $("FBCHK-" + id);
if (cb.checked) { if (cb.checked) {
selected.push(id); selected.push(id);
@ -2037,8 +2037,8 @@ function updateFeedBrowser() {
var query = "backend.php?op=rpc&subop=feedBrowser"; var query = "backend.php?op=rpc&subop=feedBrowser";
var search = document.getElementById("feed_browser_search"); var search = $("feed_browser_search");
var limit = document.getElementById("feed_browser_limit"); var limit = $("feed_browser_limit");
if (limit) { if (limit) {
query = query + "&limit=" + limit[limit.selectedIndex].value; query = query + "&limit=" + limit[limit.selectedIndex].value;
@ -2054,10 +2054,10 @@ function updateFeedBrowser() {
onComplete: function(transport) { onComplete: function(transport) {
notify(''); notify('');
var c = document.getElementById("browseFeedList"); var c = $("browseFeedList");
var r = transport.responseXML.getElementsByTagName("content")[0]; var r = transport.responseXML.getElementsByTagName("content")[0];
var nr = transport.responseXML.getElementsByTagName("num-results")[0]; var nr = transport.responseXML.getElementsByTagName("num-results")[0];
var sb = document.getElementById("feed_browser_subscribe"); var sb = $("feed_browser_subscribe");
if (c && r) { if (c && r) {
c.innerHTML = r.firstChild.nodeValue; c.innerHTML = r.firstChild.nodeValue;

View File

@ -92,12 +92,12 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
setActiveFeedId(feed_id, is_cat); setActiveFeedId(feed_id, is_cat);
if (!is_cat) { if (!is_cat) {
var feedr = document.getElementById("FEEDR-" + feed_id); var feedr = $("FEEDR-" + feed_id);
if (feedr && !feedr.className.match("Selected")) { if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected"; feedr.className = feedr.className + "Selected";
} }
} else { } else {
var feedr = document.getElementById("FCAT-" + feed_id); var feedr = $("FCAT-" + feed_id);
if (feedr && !feedr.className.match("Selected")) { if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected"; feedr.className = feedr.className + "Selected";
} }
@ -110,7 +110,7 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
disableContainerChildren("headlinesToolbar", false); disableContainerChildren("headlinesToolbar", false);
Form.enable("main_toolbar_form"); Form.enable("main_toolbar_form");
var f = document.getElementById("headlines-frame"); var f = $("headlines-frame");
try { try {
if (reply.offset == 0) { if (reply.offset == 0) {
debug("resetting headlines scrollTop"); debug("resetting headlines scrollTop");
@ -143,7 +143,7 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
var sel_none_link; var sel_none_link;
var sel_inv_link; var sel_inv_link;
if (document.getElementById("content-frame")) { if ($("content-frame")) {
sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)"; sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)";
sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)"; sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)";
sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)"; sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)";
@ -166,7 +166,7 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
tmp += "</div>"; tmp += "</div>";
tmp += "<div id=\"headlinesInnerContainer\" onscroll=\"headlines_scroll_handler()\">"; tmp += "<div id=\"headlinesInnerContainer\" onscroll=\"headlines_scroll_handler()\">";
if (document.getElementById("content-frame")) { if ($("content-frame")) {
tmp += "<table class=\"headlinesList\" id=\"headlinesList\" cellspacing=\"0\">"; tmp += "<table class=\"headlinesList\" id=\"headlinesList\" cellspacing=\"0\">";
} }
@ -291,7 +291,7 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
var content_preview = truncate_string(strip_tags(rs.fieldByName("content")), var content_preview = truncate_string(strip_tags(rs.fieldByName("content")),
100); 100);
if (document.getElementById("content-frame")) { if ($("content-frame")) {
tmp += "<tr class='"+row_class+"' id='RROW-"+id+"' "+mouseover_attrs+">"; tmp += "<tr class='"+row_class+"' id='RROW-"+id+"' "+mouseover_attrs+">";
@ -413,12 +413,12 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
} }
if (offset == 0) { if (offset == 0) {
var container = document.getElementById("headlines-frame"); var container = $("headlines-frame");
container.innerHTML = tmp; container.innerHTML = tmp;
} else { } else {
var ids = getSelectedArticleIds2(); var ids = getSelectedArticleIds2();
var container = document.getElementById("headlinesList"); var container = $("headlinesList");
container.innerHTML = container.innerHTML + tmp; container.innerHTML = container.innerHTML + tmp;
for (var i = 0; i < ids.length; i++) { for (var i = 0; i < ids.length; i++) {
@ -571,10 +571,10 @@ function init_offline() {
Element.hide("topLinksOnline"); Element.hide("topLinksOnline");
Element.show("topLinksOffline"); Element.show("topLinksOffline");
var tb_form = document.getElementById("main_toolbar_form"); var tb_form = $("main_toolbar_form");
Element.hide(tb_form.update); Element.hide(tb_form.update);
var chooser = document.getElementById("quickMenuChooser"); var chooser = $("quickMenuChooser");
chooser.disabled = true; chooser.disabled = true;
var rs = db.execute("SELECT key, value FROM init_params"); var rs = db.execute("SELECT key, value FROM init_params");
@ -792,12 +792,12 @@ function update_offline_data(stage) {
function set_feedlist_counter(id, ctr, is_cat) { function set_feedlist_counter(id, ctr, is_cat) {
try { try {
var feedctr = document.getElementById("FEEDCTR-" + id); var feedctr = $("FEEDCTR-" + id);
var feedu = document.getElementById("FEEDU-" + id); var feedu = $("FEEDU-" + id);
var feedr = document.getElementById("FEEDR-" + id); var feedr = $("FEEDR-" + id);
if (is_cat) { if (is_cat) {
var catctr = document.getElementById("FCATCTR-" + id); var catctr = $("FCATCTR-" + id);
if (catctr) { if (catctr) {
catctr.innerHTML = "(" + ctr + ")"; catctr.innerHTML = "(" + ctr + ")";
if (ctr > 0) { if (ctr > 0) {

View File

@ -13,7 +13,7 @@ var mouse_is_down = false;
function replace_pubkey_callback(transport) { function replace_pubkey_callback(transport) {
try { try {
var link = document.getElementById("pubGenAddress"); var link = $("pubGenAddress");
if (transport.responseXML) { if (transport.responseXML) {
@ -42,7 +42,7 @@ function feedlist_callback2(transport) {
try { try {
var container = document.getElementById('prefContent'); var container = $('prefContent');
container.innerHTML=transport.responseText; container.innerHTML=transport.responseText;
selectTab("feedConfig", true); selectTab("feedConfig", true);
@ -72,7 +72,7 @@ function dlg_frefresh_callback(transport) {
} }
function filterlist_callback2(transport) { function filterlist_callback2(transport) {
var container = document.getElementById('prefContent'); var container = $('prefContent');
container.innerHTML=transport.responseText; container.innerHTML=transport.responseText;
if (typeof correctPNG != 'undefined') { if (typeof correctPNG != 'undefined') {
correctPNG(); correctPNG();
@ -83,8 +83,8 @@ function filterlist_callback2(transport) {
function init_label_inline_editor() { function init_label_inline_editor() {
try { try {
if (document.getElementById("prefLabelList")) { if ($("prefLabelList")) {
var elems = document.getElementById("prefLabelList").getElementsByTagName("SPAN"); var elems = $("prefLabelList").getElementsByTagName("SPAN");
for (var i = 0; i < elems.length; i++) { for (var i = 0; i < elems.length; i++) {
if (elems[i].id && elems[i].id.match("LILT-")) { if (elems[i].id && elems[i].id.match("LILT-")) {
@ -108,7 +108,7 @@ function labellist_callback2(transport) {
try { try {
var container = document.getElementById('prefContent'); var container = $('prefContent');
closeInfoBox(); closeInfoBox();
container.innerHTML=transport.responseText; container.innerHTML=transport.responseText;
@ -127,7 +127,7 @@ function labellist_callback2(transport) {
function userlist_callback2(transport) { function userlist_callback2(transport) {
try { try {
var container = document.getElementById('prefContent'); var container = $('prefContent');
if (transport.readyState == 4) { if (transport.readyState == 4) {
container.innerHTML=transport.responseText; container.innerHTML=transport.responseText;
notify(""); notify("");
@ -140,7 +140,7 @@ function userlist_callback2(transport) {
function prefslist_callback2(transport) { function prefslist_callback2(transport) {
try { try {
var container = document.getElementById('prefContent'); var container = $('prefContent');
container.innerHTML=transport.responseText; container.innerHTML=transport.responseText;
notify(""); notify("");
remove_splash(); remove_splash();
@ -170,7 +170,7 @@ function changepass_callback2(transport) {
notify_error(transport.responseText.replace("ERROR: ", "")); notify_error(transport.responseText.replace("ERROR: ", ""));
} else { } else {
notify_info(transport.responseText); notify_info(transport.responseText);
var warn = document.getElementById("default_pass_warning"); var warn = $("default_pass_warning");
if (warn) warn.style.display = "none"; if (warn) warn.style.display = "none";
} }
@ -184,8 +184,8 @@ function changepass_callback2(transport) {
function init_cat_inline_editor() { function init_cat_inline_editor() {
try { try {
if (document.getElementById("prefFeedCatList")) { if ($("prefFeedCatList")) {
var elems = document.getElementById("prefFeedCatList").getElementsByTagName("SPAN"); var elems = $("prefFeedCatList").getElementsByTagName("SPAN");
for (var i = 0; i < elems.length; i++) { for (var i = 0; i < elems.length; i++) {
if (elems[i].id && elems[i].id.match("FCATT-")) { if (elems[i].id && elems[i].id.match("FCATT-")) {
@ -214,11 +214,11 @@ function updateFeedList(sort_key) {
try { try {
var feed_search = document.getElementById("feed_search"); var feed_search = $("feed_search");
var search = ""; var search = "";
if (feed_search) { search = feed_search.value; } 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; var slat_checked = false;
if (slat) { if (slat) {
@ -243,7 +243,7 @@ function updateUsersList(sort_key) {
try { try {
var user_search = document.getElementById("user_search"); var user_search = $("user_search");
var search = ""; var search = "";
if (user_search) { search = user_search.value; } if (user_search) { search = user_search.value; }
@ -296,7 +296,7 @@ function addFeed() {
try { try {
var link = document.getElementById("fadd_link"); var link = $("fadd_link");
if (link.value.length == 0) { if (link.value.length == 0) {
alert(__("Error: No feed URL given.")); alert(__("Error: No feed URL given."));
@ -325,7 +325,7 @@ function addFeed() {
function addFeedCat() { function addFeedCat() {
var cat = document.getElementById("fadd_cat"); var cat = $("fadd_cat");
if (cat.value.length == 0) { if (cat.value.length == 0) {
alert(__("Can't add category: no name specified.")); alert(__("Can't add category: no name specified."));
@ -695,8 +695,8 @@ function removeSelectedFeedCats() {
function feedEditCancel() { function feedEditCancel() {
try { try {
document.getElementById("subscribe_to_feed_btn").disabled = false; $("subscribe_to_feed_btn").disabled = false;
document.getElementById("top25_feeds_btn").disabled = false; $("top25_feeds_btn").disabled = false;
} catch (e) { } catch (e) {
// this button is not always available, no-op if not found // this button is not always available, no-op if not found
} }
@ -744,7 +744,7 @@ function userEditCancel() {
function filterEditCancel() { function filterEditCancel() {
try { try {
document.getElementById("create_filter_btn").disabled = false; $("create_filter_btn").disabled = false;
selectPrefRows('filter', false); // cleanup feed selection selectPrefRows('filter', false); // cleanup feed selection
} catch (e) { } } catch (e) { }
@ -795,7 +795,7 @@ function filterEditSave() {
closeInfoBox(); closeInfoBox();
document.getElementById("create_filter_btn").disabled = false; $("create_filter_btn").disabled = false;
new Ajax.Request(query, { new Ajax.Request(query, {
onComplete: function(transport) { onComplete: function(transport) {
@ -969,7 +969,7 @@ function editSelectedFeeds() {
function piggie(enable) { function piggie(enable) {
if (enable) { if (enable) {
debug("I LOVEDED IT!"); debug("I LOVEDED IT!");
var piggie = document.getElementById("piggie"); var piggie = $("piggie");
Element.show(piggie); Element.show(piggie);
Position.Center(piggie); Position.Center(piggie);
@ -980,7 +980,7 @@ function piggie(enable) {
function validateOpmlImport() { function validateOpmlImport() {
var opml_file = document.getElementById("opml_file"); var opml_file = $("opml_file");
if (opml_file.value.length == 0) { if (opml_file.value.length == 0) {
alert(__("No OPML file to upload.")); alert(__("No OPML file to upload."));
@ -993,7 +993,7 @@ function validateOpmlImport() {
function updateFilterList(sort_key) { function updateFilterList(sort_key) {
try { try {
var filter_search = document.getElementById("filter_search"); var filter_search = $("filter_search");
var search = ""; var search = "";
if (filter_search) { search = filter_search.value; } if (filter_search) { search = filter_search.value; }
@ -1016,7 +1016,7 @@ function updateLabelList(sort_key) {
try { try {
var label_search = document.getElementById("label_search"); var label_search = $("label_search");
var search = ""; var search = "";
if (label_search) { search = label_search.value; } if (label_search) { search = label_search.value; }
@ -1054,7 +1054,7 @@ function selectTab(id, noupdate, subop) {
try { try {
try { try {
var c = document.getElementById('prefContent'); var c = $('prefContent');
c.scrollTop = 0; c.scrollTop = 0;
} catch (e) { }; } catch (e) { };
@ -1088,7 +1088,7 @@ function selectTab(id, noupdate, subop) {
/* clean selection from all tabs */ /* clean selection from all tabs */
var tabs_holder = document.getElementById("prefTabs"); var tabs_holder = $("prefTabs");
var tab = tabs_holder.firstChild; var tab = tabs_holder.firstChild;
while (tab) { while (tab) {
@ -1100,7 +1100,7 @@ function selectTab(id, noupdate, subop) {
/* mark new tab as selected */ /* mark new tab as selected */
tab = document.getElementById(id + "Tab"); tab = $(id + "Tab");
if (tab) { if (tab) {
if (!tab.className.match("Selected")) { if (!tab.className.match("Selected")) {
@ -1175,7 +1175,7 @@ function init_second_stage() {
try { try {
active_tab = getInitParam("prefs_active_tab"); 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"; if (!active_tab || active_tab == '0') active_tab = "genConfig";
document.onkeydown = pref_hotkey_handler; document.onkeydown = pref_hotkey_handler;
@ -1238,7 +1238,7 @@ function categorizeSelectedFeeds() {
var sel_rows = getSelectedFeeds(); 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; var cat_id = cat_sel[cat_sel.selectedIndex].value;
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
@ -1481,7 +1481,7 @@ function pref_hotkey_handler(e) {
"feed_search", "filter_search", "user_search", "feed_browser_search"); "feed_search", "filter_search", "user_search", "feed_browser_search");
for (var i = 0; i < search_boxes.length; i++) { for (var i = 0; i < search_boxes.length; i++) {
var elem = document.getElementById(search_boxes[i]); var elem = $(search_boxes[i]);
if (elem) { if (elem) {
focus_element(search_boxes[i]); focus_element(search_boxes[i]);
return false; return false;
@ -1532,27 +1532,27 @@ function pref_hotkey_handler(e) {
hotkey_prefix = false; hotkey_prefix = false;
if (keycode == 49 && document.getElementById("genConfigTab")) { // 1 if (keycode == 49 && $("genConfigTab")) { // 1
selectTab("genConfig"); selectTab("genConfig");
return false; return false;
} }
if (keycode == 50 && document.getElementById("feedConfigTab")) { // 2 if (keycode == 50 && $("feedConfigTab")) { // 2
selectTab("feedConfig"); selectTab("feedConfig");
return false; return false;
} }
if (keycode == 51 && document.getElementById("filterConfigTab")) { // 4 if (keycode == 51 && $("filterConfigTab")) { // 4
selectTab("filterConfig"); selectTab("filterConfig");
return false; return false;
} }
if (keycode == 52 && document.getElementById("labelConfigTab")) { // 5 if (keycode == 52 && $("labelConfigTab")) { // 5
selectTab("labelConfig"); selectTab("labelConfig");
return false; return false;
} }
if (keycode == 53 && document.getElementById("userConfigTab")) { // 6 if (keycode == 53 && $("userConfigTab")) { // 6
selectTab("userConfig"); selectTab("userConfig");
return false; return false;
} }
@ -1563,7 +1563,7 @@ function pref_hotkey_handler(e) {
} }
if (document.getElementById("piggie")) { if ($("piggie")) {
if (seq.match("807371717369")) { if (seq.match("807371717369")) {
seq = ""; seq = "";
@ -1586,10 +1586,10 @@ function pref_hotkey_handler(e) {
function editFeedCats() { function editFeedCats() {
try { try {
document.getElementById("subscribe_to_feed_btn").disabled = true; $("subscribe_to_feed_btn").disabled = true;
try { try {
document.getElementById("top25_feeds_btn").disabled = true; $("top25_feeds_btn").disabled = true;
} catch (e) { } catch (e) {
// this button is not always available, no-op if not found // this button is not always available, no-op if not found
} }
@ -1736,7 +1736,7 @@ function validatePrefsSave() {
function feedActionChange() { function feedActionChange() {
try { try {
var chooser = document.getElementById("feedActionChooser"); var chooser = $("feedActionChooser");
var opid = chooser[chooser.selectedIndex].value; var opid = chooser[chooser.selectedIndex].value;
chooser.selectedIndex = 0; chooser.selectedIndex = 0;
@ -1961,7 +1961,7 @@ function feedsEditSave() {
function batchFeedsToggleField(cb, elem, label) { function batchFeedsToggleField(cb, elem, label) {
try { try {
var f = document.forms["batch_edit_feed_form"]; var f = document.forms["batch_edit_feed_form"];
var l = document.getElementById(label); var l = $(label);
if (cb.checked) { if (cb.checked) {
f[elem].disabled = false; f[elem].disabled = false;
@ -2026,7 +2026,7 @@ function labelColorAsk(id, kind) {
selectPrefRows('label', false); selectPrefRows('label', false);
var e = document.getElementById("LICID-" + id); var e = $("LICID-" + id);
if (e) { if (e) {
if (kind == "fg") { if (kind == "fg") {
@ -2047,7 +2047,7 @@ function labelColorAsk(id, kind) {
function colorPicker(id, fg, bg) { function colorPicker(id, fg, bg) {
try { try {
var picker = document.getElementById("colorPicker-" + id); var picker = $("colorPicker-" + id);
if (picker) Element.show(picker); if (picker) Element.show(picker);
@ -2058,9 +2058,9 @@ function colorPicker(id, fg, bg) {
function colorPickerHideAll() { function colorPickerHideAll() {
try { 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++) { for (var i = 0; i < elems.length; i++) {
if (elems[i].id && elems[i].id.match("colorPicker-")) { if (elems[i].id && elems[i].id.match("colorPicker-")) {
@ -2081,7 +2081,7 @@ function colorPickerDo(id, fg, bg) {
"&ids=" + param_escape(id) + "&fg=" + param_escape(fg) + "&ids=" + param_escape(id) + "&fg=" + param_escape(fg) +
"&bg=" + param_escape(bg); "&bg=" + param_escape(bg);
var e = document.getElementById("LICID-" + id); var e = $("LICID-" + id);
if (e) { if (e) {
e.style.color = fg; e.style.color = fg;

View File

@ -65,7 +65,7 @@ function toggleTags(show_all) {
debug("toggleTags: " + show_all + "; " + display_tags); debug("toggleTags: " + show_all + "; " + display_tags);
var p = document.getElementById("dispSwitchPrompt"); var p = $("dispSwitchPrompt");
if (!show_all && !display_tags) { if (!show_all && !display_tags) {
displayDlg("printTagCloud"); displayDlg("printTagCloud");
@ -89,7 +89,7 @@ function toggleTags(show_all) {
function dlg_frefresh_callback(transport, deleted_feed) { function dlg_frefresh_callback(transport, deleted_feed) {
if (getActiveFeedId() == deleted_feed) { if (getActiveFeedId() == deleted_feed) {
var h = document.getElementById("headlines-frame"); var h = $("headlines-frame");
if (h) { if (h) {
h.innerHTML = "<div class='whiteBox'>" + __('No feed selected.') + "</div>"; h.innerHTML = "<div class='whiteBox'>" + __('No feed selected.') + "</div>";
} }
@ -260,7 +260,7 @@ function updateFeedList(silent, fetch) {
if (fetch) query_str = query_str + "&fetch=yes"; 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; // feeds_frame.src = query_str;
debug("updateFeedList Q=" + query_str); debug("updateFeedList Q=" + query_str);
@ -324,7 +324,7 @@ function timeout() {
} }
function resetSearch() { function resetSearch() {
var searchbox = document.getElementById("searchbox") var searchbox = $("searchbox")
if (searchbox.value != "" && getActiveFeedId()) { if (searchbox.value != "" && getActiveFeedId()) {
searchbox.value = ""; searchbox.value = "";
@ -421,12 +421,12 @@ function resize_headlines(delta_x, delta_y) {
debug("resize_headlines: " + delta_x + ":" + delta_y); debug("resize_headlines: " + delta_x + ":" + delta_y);
var h_frame = document.getElementById("headlines-frame"); var h_frame = $("headlines-frame");
var c_frame = document.getElementById("content-frame"); var c_frame = $("content-frame");
var f_frame = document.getElementById("footer"); var f_frame = $("footer");
var feeds_frame = document.getElementById("feeds-holder"); var feeds_frame = $("feeds-holder");
var resize_grab = document.getElementById("resize-grabber"); var resize_grab = $("resize-grabber");
var resize_handle = document.getElementById("resize-handle"); var resize_handle = $("resize-handle");
if (!c_frame || !h_frame) return; if (!c_frame || !h_frame) return;
@ -524,7 +524,7 @@ function init_second_stage() {
if (fl) { if (fl) {
render_feedlist(fl); render_feedlist(fl);
if (document.getElementById("feedList")) { if ($("feedList")) {
request_counters(); request_counters();
} else { } else {
setTimeout('updateFeedList(false, false)', 50); setTimeout('updateFeedList(false, false)', 50);
@ -561,7 +561,7 @@ function init_second_stage() {
} }
function quickMenuChange() { function quickMenuChange() {
var chooser = document.getElementById("quickMenuChooser"); var chooser = $("quickMenuChooser");
var opid = chooser[chooser.selectedIndex].value; var opid = chooser[chooser.selectedIndex].value;
chooser.selectedIndex = 0; chooser.selectedIndex = 0;
@ -760,7 +760,7 @@ function parse_runtime_info(elem) {
} }
if (k == "new_version_available") { if (k == "new_version_available") {
var icon = document.getElementById("newVersionIcon"); var icon = $("newVersionIcon");
if (icon) { if (icon) {
if (v == "1") { if (v == "1") {
icon.style.display = "inline"; icon.style.display = "inline";
@ -786,7 +786,7 @@ function parse_runtime_info(elem) {
notify(''); notify('');
} }
/* var w = document.getElementById("noDaemonWarning"); /* var w = $("noDaemonWarning");
if (w) { if (w) {
if (k == "daemon_is_running" && v != 1) { if (k == "daemon_is_running" && v != 1) {
@ -916,13 +916,13 @@ function collapse_feedlist() {
if (theme != "" && theme != "compact" && theme != "graycube" && if (theme != "" && theme != "compact" && theme != "graycube" &&
theme != "compat") return; theme != "compat") return;
var fl = document.getElementById("feeds-holder"); var fl = $("feeds-holder");
var fh = document.getElementById("headlines-frame"); var fh = $("headlines-frame");
var fc = document.getElementById("content-frame"); var fc = $("content-frame");
var ft = document.getElementById("toolbar"); var ft = $("toolbar");
var ff = document.getElementById("footer"); var ff = $("footer");
var fhdr = document.getElementById("header"); var fhdr = $("header");
var fbtn = document.getElementById("collapse_feeds_btn"); var fbtn = $("collapse_feeds_btn");
if (!Element.visible(fl)) { if (!Element.visible(fl)) {
Element.show(fl); Element.show(fl);
@ -1036,7 +1036,7 @@ function hotkey_handler(e) {
var keycode; var keycode;
var shift_key = false; var shift_key = false;
var feedlist = document.getElementById('feedList'); var feedlist = $('feedList');
try { try {
shift_key = e.shiftKey; shift_key = e.shiftKey;
@ -1217,7 +1217,7 @@ function hotkey_handler(e) {
if (keycode == 9) { // tab if (keycode == 9) { // tab
var id = getArticleUnderPointer(); var id = getArticleUnderPointer();
if (id) { if (id) {
var cb = document.getElementById("RCHK-" + id); var cb = $("RCHK-" + id);
if (cb) { if (cb) {
cb.checked = !cb.checked; cb.checked = !cb.checked;

View File

@ -30,7 +30,7 @@ function catchup_callback2(transport, callback) {
function clean_feed_selections() { function clean_feed_selections() {
try { try {
var feeds = document.getElementById("feedList").getElementsByTagName("LI"); var feeds = $("feedList").getElementsByTagName("LI");
for (var i = 0; i < feeds.length; i++) { for (var i = 0; i < feeds.length; i++) {
if (feeds[i].id && feeds[i].id.match("FEEDR-")) { if (feeds[i].id && feeds[i].id.match("FEEDR-")) {
@ -69,18 +69,18 @@ function headlines_callback2(transport, feed_cur_page) {
} }
if (!is_cat) { if (!is_cat) {
var feedr = document.getElementById("FEEDR-" + feed_id); var feedr = $("FEEDR-" + feed_id);
if (feedr && !feedr.className.match("Selected")) { if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected"; feedr.className = feedr.className + "Selected";
} }
} else { } else {
var feedr = document.getElementById("FCAT-" + feed_id); var feedr = $("FCAT-" + feed_id);
if (feedr && !feedr.className.match("Selected")) { if (feedr && !feedr.className.match("Selected")) {
feedr.className = feedr.className + "Selected"; feedr.className = feedr.className + "Selected";
} }
} }
var f = document.getElementById("headlines-frame"); var f = $("headlines-frame");
try { try {
if (feed_cur_page == 0) { if (feed_cur_page == 0) {
debug("resetting headlines scrollTop"); debug("resetting headlines scrollTop");
@ -141,10 +141,10 @@ function headlines_callback2(transport, feed_cur_page) {
if (headlines_count > 0) { if (headlines_count > 0) {
debug("adding some more headlines..."); debug("adding some more headlines...");
var c = document.getElementById("headlinesList"); var c = $("headlinesList");
if (!c) { if (!c) {
c = document.getElementById("headlinesInnerContainer"); c = $("headlinesInnerContainer");
} }
var ids = getSelectedArticleIds2(); var ids = getSelectedArticleIds2();
@ -203,7 +203,7 @@ function headlines_callback2(transport, feed_cur_page) {
if (_cdm_wd_timeout) window.clearTimeout(_cdm_wd_timeout); if (_cdm_wd_timeout) window.clearTimeout(_cdm_wd_timeout);
if (!document.getElementById("headlinesList") && if (!$("headlinesList") &&
getActiveFeedId() != -3 && getActiveFeedId() != -3 &&
getInitParam("cdm_auto_catchup") == 1) { getInitParam("cdm_auto_catchup") == 1) {
debug("starting CDM watchdog"); debug("starting CDM watchdog");
@ -227,12 +227,12 @@ function headlines_callback2(transport, feed_cur_page) {
function render_article(article) { function render_article(article) {
try { try {
var f = document.getElementById("content-frame"); var f = $("content-frame");
try { try {
f.scrollTop = 0; f.scrollTop = 0;
} catch (e) { }; } catch (e) { };
var fi = document.getElementById("content-insert"); var fi = $("content-insert");
try { try {
fi.scrollTop = 0; fi.scrollTop = 0;
@ -251,7 +251,7 @@ function showArticleInHeadlines(id) {
cleanSelected("headlinesList"); cleanSelected("headlinesList");
var crow = document.getElementById("RROW-" + id); var crow = $("RROW-" + id);
if (!crow) return; if (!crow) return;
@ -261,7 +261,7 @@ function showArticleInHeadlines(id) {
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false); selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
var upd_img_pic = document.getElementById("FUPDPIC-" + id); var upd_img_pic = $("FUPDPIC-" + id);
var cache_prefix = ""; var cache_prefix = "";
@ -286,7 +286,7 @@ function showArticleInHeadlines(id) {
cache_invalidate(cache_prefix + getActiveFeedId()); cache_invalidate(cache_prefix + getActiveFeedId());
cache_inject(cache_prefix + getActiveFeedId(), cache_inject(cache_prefix + getActiveFeedId(),
document.getElementById("headlines-frame").innerHTML, $("headlines-frame").innerHTML,
get_feed_unread(getActiveFeedId())); get_feed_unread(getActiveFeedId()));
} else if (article_is_unread && view_mode == "all_articles") { } else if (article_is_unread && view_mode == "all_articles") {
@ -294,7 +294,7 @@ function showArticleInHeadlines(id) {
cache_invalidate(cache_prefix + getActiveFeedId()); cache_invalidate(cache_prefix + getActiveFeedId());
cache_inject(cache_prefix + getActiveFeedId(), cache_inject(cache_prefix + getActiveFeedId(),
document.getElementById("headlines-frame").innerHTML, $("headlines-frame").innerHTML,
get_feed_unread(getActiveFeedId())-1); get_feed_unread(getActiveFeedId())-1);
} else if (article_is_unread) { } else if (article_is_unread) {
@ -351,7 +351,7 @@ function article_callback2(transport, id, feed_id) {
} else { } else {
debug("article_callback: returned no XML object"); 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>"; //f.innerHTML = "<div class='whiteBox'>" + __('Could not display article (missing XML object)') + "</div>";
} }
@ -433,7 +433,7 @@ function view(id, feed_id, skip_history) {
query = query + "&cids=" + cids_to_request.toString(); 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"); var article_is_unread = crow.className.match("Unread");
if (!async_counters_work) { if (!async_counters_work) {
@ -531,12 +531,12 @@ function toggleMark(id, client_only, no_effects) {
query = query + "&omode=flc"; query = query + "&omode=flc";
} }
var mark_img = document.getElementById("FMPIC-" + id); var mark_img = $("FMPIC-" + id);
if (!mark_img) return; if (!mark_img) return;
var vfeedu = document.getElementById("FEEDU--1"); var vfeedu = $("FEEDU--1");
var crow = document.getElementById("RROW-" + id); var crow = $("RROW-" + id);
if (mark_img.src.match("mark_unset")) { if (mark_img.src.match("mark_unset")) {
mark_img.src = mark_img.src.replace("mark_unset", "mark_set"); mark_img.src = mark_img.src.replace("mark_unset", "mark_set");
@ -552,7 +552,7 @@ function toggleMark(id, client_only, no_effects) {
mark_img.alt = __("Please wait..."); mark_img.alt = __("Please wait...");
query = query + "&mark=0"; 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}); Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off});
} else { } else {
mark_img.src = mark_img.src.replace("mark_set", "mark_unset"); mark_img.src = mark_img.src.replace("mark_set", "mark_unset");
@ -596,12 +596,12 @@ function togglePub(id, client_only, no_effects) {
query = query + "&omode=flc"; query = query + "&omode=flc";
} }
var mark_img = document.getElementById("FPPIC-" + id); var mark_img = $("FPPIC-" + id);
if (!mark_img) return; if (!mark_img) return;
var vfeedu = document.getElementById("FEEDU--2"); var vfeedu = $("FEEDU--2");
var crow = document.getElementById("RROW-" + id); var crow = $("RROW-" + id);
if (mark_img.src.match("pub_unset")) { if (mark_img.src.match("pub_unset")) {
mark_img.src = mark_img.src.replace("pub_unset", "pub_set"); mark_img.src = mark_img.src.replace("pub_unset", "pub_set");
@ -614,7 +614,7 @@ function togglePub(id, client_only, no_effects) {
mark_img.alt = __("Please wait..."); mark_img.alt = __("Please wait...");
query = query + "&pub=0"; 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}); Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off});
} else { } else {
mark_img.src = mark_img.src.replace("pub_set", "pub_unset"); mark_img.src = mark_img.src.replace("pub_set", "pub_unset");
@ -639,9 +639,9 @@ function correctHeadlinesOffset(id) {
try { try {
var hlist = document.getElementById("headlinesList"); var hlist = $("headlinesList");
var container = document.getElementById("headlinesInnerContainer"); var container = $("headlinesInnerContainer");
var row = document.getElementById("RROW-" + id); var row = $("RROW-" + id);
var viewport = container.offsetHeight; var viewport = container.offsetHeight;
@ -682,7 +682,7 @@ function moveToPost(mode) {
var prev_id = false; var prev_id = false;
var next_id = false; var next_id = false;
if (!document.getElementById('RROW-' + active_post_id)) { if (!$('RROW-' + active_post_id)) {
active_post_id = false; active_post_id = false;
} }
@ -738,9 +738,9 @@ function moveToPost(mode) {
function toggleSelected(id) { function toggleSelected(id) {
try { try {
var cb = document.getElementById("RCHK-" + id); var cb = $("RCHK-" + id);
var row = document.getElementById("RROW-" + id); var row = $("RROW-" + id);
if (row) { if (row) {
var nc = row.className; var nc = row.className;
@ -781,7 +781,7 @@ function toggleUnread_afh(effect) {
function toggleUnread(id, cmode, effect) { function toggleUnread(id, cmode, effect) {
try { try {
var row = document.getElementById("RROW-" + id); var row = $("RROW-" + id);
if (row) { if (row) {
var nc = row.className; var nc = row.className;
var is_selected = row.className.match("Selected"); var is_selected = row.className.match("Selected");
@ -791,7 +791,7 @@ function toggleUnread(id, cmode, effect) {
// since we are removing selection from the object, uncheck // since we are removing selection from the object, uncheck
// corresponding checkbox // corresponding checkbox
var cb = document.getElementById("RCHK-" + id); var cb = $("RCHK-" + id);
if (cb) { if (cb) {
cb.checked = false; cb.checked = false;
} }
@ -951,7 +951,7 @@ function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
} }
for (i = 0; i < rows.length; i++) { for (i = 0; i < rows.length; i++) {
var row = document.getElementById("RROW-" + rows[i]); var row = $("RROW-" + rows[i]);
if (row) { if (row) {
var nc = row.className; var nc = row.className;
nc = nc.replace("Unread", ""); nc = nc.replace("Unread", "");
@ -1100,7 +1100,7 @@ function selectionTogglePublished(cdm_mode) {
function cdmGetSelectedArticles() { function cdmGetSelectedArticles() {
var sel_articles = new Array(); var sel_articles = new Array();
var container = document.getElementById("headlinesInnerContainer"); var container = $("headlinesInnerContainer");
for (i = 0; i < container.childNodes.length; i++) { for (i = 0; i < container.childNodes.length; i++) {
var child = container.childNodes[i]; var child = container.childNodes[i];
@ -1116,7 +1116,7 @@ function cdmGetSelectedArticles() {
function cdmGetVisibleArticles() { function cdmGetVisibleArticles() {
var sel_articles = new Array(); var sel_articles = new Array();
var container = document.getElementById("headlinesInnerContainer"); var container = $("headlinesInnerContainer");
if (!container) return sel_articles; if (!container) return sel_articles;
@ -1134,7 +1134,7 @@ function cdmGetVisibleArticles() {
function cdmGetUnreadArticles() { function cdmGetUnreadArticles() {
var sel_articles = new Array(); var sel_articles = new Array();
var container = document.getElementById("headlinesInnerContainer"); var container = $("headlinesInnerContainer");
for (i = 0; i < container.childNodes.length; i++) { for (i = 0; i < container.childNodes.length; i++) {
var child = container.childNodes[i]; var child = container.childNodes[i];
@ -1151,7 +1151,7 @@ function cdmGetUnreadArticles() {
// mode = all,none,unread // mode = all,none,unread
function cdmSelectArticles(mode) { function cdmSelectArticles(mode) {
var container = document.getElementById("headlinesInnerContainer"); var container = $("headlinesInnerContainer");
for (i = 0; i < container.childNodes.length; i++) { for (i = 0; i < container.childNodes.length; i++) {
var child = container.childNodes[i]; var child = container.childNodes[i];
@ -1159,7 +1159,7 @@ function cdmSelectArticles(mode) {
if (child.id && child.id.match("RROW-")) { if (child.id && child.id.match("RROW-")) {
var aid = child.id.replace("RROW-", ""); var aid = child.id.replace("RROW-", "");
var cb = document.getElementById("RCHK-" + aid); var cb = $("RCHK-" + aid);
if (mode == "all") { if (mode == "all") {
if (!child.className.match("Selected")) { if (!child.className.match("Selected")) {
@ -1191,7 +1191,7 @@ function catchupPage() {
return; return;
} }
if (document.getElementById("headlinesList")) { if ($("headlinesList")) {
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true); selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true);
selectionToggleUnread(false, false, 'viewCurrentFeed()', true); selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false); selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
@ -1208,7 +1208,7 @@ function catchupSelection() {
var rows; var rows;
if (document.getElementById("headlinesList")) { if ($("headlinesList")) {
rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK"); rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
} else { } else {
rows = cdmGetSelectedArticles(); rows = cdmGetSelectedArticles();
@ -1231,7 +1231,7 @@ function catchupSelection() {
return; return;
} }
if (document.getElementById("headlinesList")) { if ($("headlinesList")) {
selectionToggleUnread(false, false, 'viewCurrentFeed()', true); selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
// selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false); // selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
} else { } else {
@ -1268,7 +1268,7 @@ function tag_saved_callback(transport) {
var id = tags_str.getAttribute("id"); var id = tags_str.getAttribute("id");
if (id) { if (id) {
var tags = document.getElementById("ATSTR-" + id); var tags = $("ATSTR-" + id);
if (tags) { if (tags) {
tags.innerHTML = tags_str.firstChild.nodeValue; tags.innerHTML = tags_str.firstChild.nodeValue;
} }
@ -1328,7 +1328,7 @@ function editTagsInsert() {
function cdmScrollViewport(where) { function cdmScrollViewport(where) {
debug("cdmScrollViewport: " + where); debug("cdmScrollViewport: " + where);
var ctr = document.getElementById("headlinesInnerContainer"); var ctr = $("headlinesInnerContainer");
if (!ctr) return; if (!ctr) return;
@ -1341,8 +1341,8 @@ function cdmScrollViewport(where) {
function cdmArticleIsBelowViewport(id) { function cdmArticleIsBelowViewport(id) {
try { try {
var ctr = document.getElementById("headlinesInnerContainer"); var ctr = $("headlinesInnerContainer");
var e = document.getElementById("RROW-" + id); var e = $("RROW-" + id);
if (!e || !ctr) return; if (!e || !ctr) return;
@ -1361,8 +1361,8 @@ function cdmArticleIsBelowViewport(id) {
function cdmArticleIsAboveViewport(id) { function cdmArticleIsAboveViewport(id) {
try { try {
var ctr = document.getElementById("headlinesInnerContainer"); var ctr = $("headlinesInnerContainer");
var e = document.getElementById("RROW-" + id); var e = $("RROW-" + id);
if (!e || !ctr) return; if (!e || !ctr) return;
@ -1381,8 +1381,8 @@ function cdmArticleIsAboveViewport(id) {
function cdmScrollToArticleId(id) { function cdmScrollToArticleId(id) {
try { try {
var ctr = document.getElementById("headlinesInnerContainer"); var ctr = $("headlinesInnerContainer");
var e = document.getElementById("RROW-" + id); var e = $("RROW-" + id);
if (!e || !ctr) return; if (!e || !ctr) return;
@ -1395,8 +1395,8 @@ function cdmScrollToArticleId(id) {
function cdmArticleIsActuallyVisible(id) { function cdmArticleIsActuallyVisible(id) {
try { try {
var ctr = document.getElementById("headlinesInnerContainer"); var ctr = $("headlinesInnerContainer");
var e = document.getElementById("RROW-" + id); var e = $("RROW-" + id);
if (!e || !ctr) return; if (!e || !ctr) return;
@ -1427,7 +1427,7 @@ function cdmWatchdog() {
try { try {
var ctr = document.getElementById("headlinesInnerContainer"); var ctr = $("headlinesInnerContainer");
if (!ctr) return; if (!ctr) return;
@ -1478,7 +1478,7 @@ function cdmWatchdog() {
if (ids.length > 0) { if (ids.length > 0) {
for (var i = 0; i < ids.length; i++) { for (var i = 0; i < ids.length; i++) {
var e = document.getElementById("RROW-" + ids[i]); var e = $("RROW-" + ids[i]);
if (e) { if (e) {
e.className = e.className.replace("Unread", ""); e.className = e.className.replace("Unread", "");
} }
@ -1688,7 +1688,7 @@ function getActiveArticleId() {
function cdmClicked(id) { function cdmClicked(id) {
try { try {
var elem = document.getElementById("RROW-" + id); var elem = $("RROW-" + id);
if (elem) { if (elem) {
var id = elem.id.replace("RROW-", ""); var id = elem.id.replace("RROW-", "");
@ -1782,7 +1782,7 @@ function postMouseOut(id) {
function headlines_scroll_handler() { function headlines_scroll_handler() {
try { try {
var e = document.getElementById("headlinesInnerContainer"); var e = $("headlinesInnerContainer");
// don't do infinite scrolling when Limit == All // don't do infinite scrolling when Limit == All
@ -1819,7 +1819,7 @@ function catchupRelativeToArticle(below) {
var visible_ids; var visible_ids;
if (document.getElementById("headlinesList")) { if ($("headlinesList")) {
visible_ids = getVisibleHeadlineIds(); visible_ids = getVisibleHeadlineIds();
} else { } else {
visible_ids = cdmGetVisibleArticles(); visible_ids = cdmGetVisibleArticles();
@ -1830,7 +1830,7 @@ function catchupRelativeToArticle(below) {
if (!below) { if (!below) {
for (var i = 0; i < visible_ids.length; i++) { for (var i = 0; i < visible_ids.length; i++) {
if (visible_ids[i] != getActiveArticleId()) { 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")) { if (e && e.className.match("Unread")) {
ids_to_mark.push(visible_ids[i]); ids_to_mark.push(visible_ids[i]);
@ -1842,7 +1842,7 @@ function catchupRelativeToArticle(below) {
} else { } else {
for (var i = visible_ids.length-1; i >= 0; i--) { for (var i = visible_ids.length-1; i >= 0; i--) {
if (visible_ids[i] != getActiveArticleId()) { 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")) { if (e && e.className.match("Unread")) {
ids_to_mark.push(visible_ids[i]); ids_to_mark.push(visible_ids[i]);
@ -1861,7 +1861,7 @@ function catchupRelativeToArticle(below) {
if (confirm(msg)) { if (confirm(msg)) {
for (var i = 0; i < ids_to_mark.length; i++) { 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", ""); e.className = e.className.replace("Unread", "");
} }
@ -1892,7 +1892,7 @@ function cdmExpandArticle(a_id) {
Effect.Appear(id, {duration : 0.5, Effect.Appear(id, {duration : 0.5,
beforeStart: function(effect) { beforeStart: function(effect) {
var h_id = 'CICH-' + a_id; 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"; } if (h_elem) { h_elem.style.display = "none"; }
toggleUnread(a_id, 0); toggleUnread(a_id, 0);
@ -1908,7 +1908,7 @@ function cdmExpandArticle(a_id) {
function fixHeadlinesOrder(ids) { function fixHeadlinesOrder(ids) {
try { try {
for (var i = 0; i < ids.length; i++) { for (var i = 0; i < ids.length; i++) {
var e = document.getElementById("RROW-" + ids[i]); var e = $("RROW-" + ids[i]);
if (e) { if (e) {
if (i % 2 == 0) { if (i % 2 == 0) {
@ -1929,7 +1929,7 @@ function hideReadHeadlines() {
var ids = false; var ids = false;
var vis_ids = new Array(); var vis_ids = new Array();
if (document.getElementById("headlinesList")) { if ($("headlinesList")) {
ids = getVisibleHeadlineIds(); ids = getVisibleHeadlineIds();
} else { } else {
ids = cdmGetVisibleArticles(); ids = cdmGetVisibleArticles();
@ -1938,7 +1938,7 @@ function hideReadHeadlines() {
var read_headlines_visible = true; var read_headlines_visible = true;
for (var i = 0; i < ids.length; i++) { 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 (row && row.className) {
if (read_headlines_visible) { if (read_headlines_visible) {
@ -1985,7 +1985,7 @@ function invertHeadlineSelection() {
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
var nc = rows[i].className; var nc = rows[i].className;
var id = rows[i].id.replace("RROW-", ""); var id = rows[i].id.replace("RROW-", "");
var cb = document.getElementById("RCHK-" + id); var cb = $("RCHK-" + id);
if (!rows[i].className.match("Selected")) { if (!rows[i].className.match("Selected")) {
nc = nc + "Selected"; nc = nc + "Selected";
@ -2039,7 +2039,7 @@ function showOriginalArticleInline(id) {
if (link && id) { if (link && id) {
link = link.firstChild.nodeValue; 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>"; var tmp = "<iframe id=\"inline_orig_article\" width=\""+ci.offsetWidth+"\" height=\""+ci.offsetHeight+"\" style=\"border-width : 0px;\" src=\""+link+"\"></iframe>";
@ -2058,12 +2058,12 @@ function showOriginalArticleInline(id) {
function scrollArticle(offset) { function scrollArticle(offset) {
try { try {
if (!isCdmMode()) { if (!isCdmMode()) {
var ci = document.getElementById("content-insert"); var ci = $("content-insert");
if (ci) { if (ci) {
ci.scrollTop += offset; ci.scrollTop += offset;
} }
} else { } else {
var hi = document.getElementById("headlinesInnerContainer"); var hi = $("headlinesInnerContainer");
if (hi) { if (hi) {
hi.scrollTop += offset; hi.scrollTop += offset;
} }
@ -2086,7 +2086,7 @@ function show_labels_in_headlines(transport) {
if (e_id) { if (e_id) {
var ctr = document.getElementById("HLLCTR-" + e_id); var ctr = $("HLLCTR-" + e_id);
if (ctr) { if (ctr) {
ctr.innerHTML = elems[l].firstChild.nodeValue; ctr.innerHTML = elems[l].firstChild.nodeValue;
@ -2104,8 +2104,8 @@ function show_labels_in_headlines(transport) {
function toggleHeadlineActions() { function toggleHeadlineActions() {
try { try {
var e = document.getElementById("headlineActionsBody"); var e = $("headlineActionsBody");
var p = document.getElementById("headlineActionsDrop"); var p = $("headlineActionsDrop");
if (!Element.visible(e)) { if (!Element.visible(e)) {
Element.show(e); Element.show(e);