1 var active_post_id
= false;
2 var last_article_view
= false;
3 var active_real_feed_id
= false;
5 // FIXME: kludges, needs proper implementation
6 var _reload_feedlist_after_view
= false;
8 var _cdm_wd_timeout
= false;
9 var _cdm_wd_vishist
= new Array();
11 var article_cache
= new Array();
13 var vgroup_last_feed
= false;
14 var post_under_pointer
= false;
16 var last_requested_article
= false;
18 function catchup_callback2(transport
, callback
) {
20 debug("catchup_callback2 " + transport
+ ", " + callback
);
22 all_counters_callback2(transport
);
24 setTimeout(callback
, 10);
27 exception_error("catchup_callback2", e
, transport
);
31 function clean_feed_selections() {
33 var feeds
= document
.getElementById("feedList").getElementsByTagName("LI");
35 for (var i
= 0; i
< feeds
.length
; i
++) {
36 if (feeds
[i
].id
&& feeds
[i
].id
.match("FEEDR-")) {
37 feeds
[i
].className
= feeds
[i
].className
.replace("Selected", "");
39 if (feeds
[i
].id
&& feeds
[i
].id
.match("FCAT-")) {
40 feeds
[i
].className
= feeds
[i
].className
.replace("Selected", "");
44 exception_error("clean_feed_selections", e
);
48 function headlines_callback2(transport
, feed_cur_page
) {
51 loading_set_progress(100);
53 debug("headlines_callback2 [page=" + feed_cur_page
+ "]");
55 if (!transport_error_check(transport
)) return;
57 clean_feed_selections();
62 if (transport
.responseXML
) {
63 var headlines
= transport
.responseXML
.getElementsByTagName("headlines")[0];
65 is_cat
= headlines
.getAttribute("is_cat");
66 feed_id
= headlines
.getAttribute("id");
67 setActiveFeedId(feed_id
, is_cat
);
72 var feedr
= document
.getElementById("FEEDR-" + feed_id
);
73 if (feedr
&& !feedr
.className
.match("Selected")) {
74 feedr
.className
= feedr
.className
+ "Selected";
77 var feedr
= document
.getElementById("FCAT-" + feed_id
);
78 if (feedr
&& !feedr
.className
.match("Selected")) {
79 feedr
.className
= feedr
.className
+ "Selected";
83 var f
= document
.getElementById("headlines-frame");
85 if (feed_cur_page
== 0) {
86 debug("resetting headlines scrollTop");
91 if (transport
.responseXML
) {
92 var headlines
= transport
.responseXML
.getElementsByTagName("headlines")[0];
93 var headlines_count_obj
= transport
.responseXML
.getElementsByTagName("headlines-count")[0];
94 var headlines_unread_obj
= transport
.responseXML
.getElementsByTagName("headlines-unread")[0];
95 var disable_cache_obj
= transport
.responseXML
.getElementsByTagName("disable-cache")[0];
97 var vgroup_last_feed_obj
= transport
.responseXML
.getElementsByTagName("vgroup-last-feed")[0];
99 var headlines_count
= headlines_count_obj
.getAttribute("value");
100 var headlines_unread
= headlines_unread_obj
.getAttribute("value");
101 var disable_cache
= disable_cache_obj
.getAttribute("value") != "0";
103 vgroup_last_feed
= vgroup_last_feed_obj
.getAttribute("value");
105 if (headlines_count
== 0) {
106 _infscroll_disable
= 1;
108 _infscroll_disable
= 0;
111 var counters
= transport
.responseXML
.getElementsByTagName("counters")[0];
112 var articles
= transport
.responseXML
.getElementsByTagName("article");
113 var runtime_info
= transport
.responseXML
.getElementsByTagName("runtime-info");
115 if (feed_cur_page
== 0) {
117 f
.innerHTML
= headlines
.firstChild
.nodeValue
;
119 var cache_prefix
= "";
127 cache_invalidate(cache_prefix
+ feed_id
);
129 if (!disable_cache
) {
130 cache_inject(cache_prefix
+ feed_id
,
131 headlines
.firstChild
.nodeValue
, headlines_unread
);
135 debug("headlines_callback: returned no data");
136 f
.innerHTML
= "<div class='whiteBox'>" + __('Could not update headlines (missing XML data)') + "</div>";
141 if (headlines_count
> 0) {
142 debug("adding some more headlines...");
144 var c
= document
.getElementById("headlinesList");
147 c
= document
.getElementById("headlinesInnerContainer");
150 var ids
= getSelectedArticleIds2();
152 c
.innerHTML
= c
.innerHTML
+ headlines
.firstChild
.nodeValue
;
154 debug("restore selected ids: " + ids
);
156 for (var i
= 0; i
< ids
.length
; i
++) {
157 markHeadline(ids
[i
]);
161 debug("no new headlines received");
164 debug("headlines_callback: returned no data");
165 notify_error("Error while trying to load more headlines");
171 for (var i
= 0; i
< articles
.length
; i
++) {
172 var a_id
= articles
[i
].getAttribute("id");
173 debug("found id: " + a_id
);
174 cache_inject(a_id
, articles
[i
].firstChild
.nodeValue
);
177 debug("no cached articles received");
181 debug("parsing piggybacked counters: " + counters
);
182 parse_counters(counters
, false);
184 debug("counters container not found in reply, requesting...");
189 debug("parsing runtime info: " + runtime_info
[0]);
190 parse_runtime_info(runtime_info
[0]);
192 debug("counters container not found in reply");
196 debug("headlines_callback: returned no XML object");
197 f
.innerHTML
= "<div class='whiteBox'>" + __('Could not update headlines (missing XML object)') + "</div>";
200 if (typeof correctPNG
!= 'undefined') {
204 if (_cdm_wd_timeout
) window
.clearTimeout(_cdm_wd_timeout
);
206 if (!document
.getElementById("headlinesList") &&
207 getActiveFeedId() != -3 &&
208 getInitParam("cdm_auto_catchup") == 1) {
209 debug("starting CDM watchdog");
210 _cdm_wd_timeout
= window
.setTimeout("cdmWatchdog()", 5000);
211 _cdm_wd_vishist
= new Array();
213 debug("not in CDM mode or watchdog disabled");
216 _feed_cur_page
= feed_cur_page
;
217 _infscroll_request_sent
= 0;
224 exception_error("headlines_callback2", e
, transport
);
228 function render_article(article
) {
230 var f
= document
.getElementById("content-frame");
235 var fi
= document
.getElementById("content-insert");
241 fi
.innerHTML
= article
;
244 exception_error("render_article", e
);
248 function showArticleInHeadlines(id
) {
252 cleanSelected("headlinesList");
254 var crow
= document
.getElementById("RROW-" + id
);
258 var article_is_unread
= crow
.className
.match("Unread");
260 crow
.className
= crow
.className
.replace("Unread", "");
262 selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
264 var upd_img_pic
= document
.getElementById("FUPDPIC-" + id
);
266 var cache_prefix
= "";
268 if (activeFeedIsCat()) {
274 var view_mode
= false;
277 view_mode
= document
.forms
['main_toolbar_form'].view_mode
;
278 view_mode
= view_mode
[view_mode
.selectedIndex
].value
;
283 if (upd_img_pic
&& upd_img_pic
.src
.match("updated.png")) {
284 upd_img_pic
.src
= "images/blank_icon.gif";
286 cache_invalidate(cache_prefix
+ getActiveFeedId());
288 cache_inject(cache_prefix
+ getActiveFeedId(),
289 document
.getElementById("headlines-frame").innerHTML
,
290 get_feed_unread(getActiveFeedId()));
292 } else if (article_is_unread
&& view_mode
== "all_articles") {
294 cache_invalidate(cache_prefix
+ getActiveFeedId());
296 cache_inject(cache_prefix
+ getActiveFeedId(),
297 document
.getElementById("headlines-frame").innerHTML
,
298 get_feed_unread(getActiveFeedId())-1);
300 } else if (article_is_unread
) {
301 cache_invalidate(cache_prefix
+ getActiveFeedId());
307 exception_error("showArticleInHeadlines", e
);
311 function article_callback2(transport
, id
, feed_id
) {
313 debug("article_callback2 " + id
);
315 if (transport
.responseXML
) {
317 if (!transport_error_check(transport
)) return;
319 debug("looking for articles to cache...");
321 var articles
= transport
.responseXML
.getElementsByTagName("article");
323 for (var i
= 0; i
< articles
.length
; i
++) {
324 var a_id
= articles
[i
].getAttribute("id");
326 debug("found id: " + a_id
);
328 if (a_id
== active_post_id
) {
329 debug("active article, rendering...");
330 render_article(articles
[i
].firstChild
.nodeValue
);
333 cache_inject(a_id
, articles
[i
].firstChild
.nodeValue
);
336 if (id
!= last_requested_article
) {
337 debug("requested article id is out of sequence, aborting");
341 active_real_feed_id
= feed_id
;
344 showArticleInHeadlines(id
);
347 db
.execute("UPDATE articles SET unread = 0 WHERE id = ?", [id
]);
350 var reply
= transport
.responseXML
.firstChild
.firstChild
;
353 debug("article_callback: returned no XML object");
354 //var f = document.getElementById("content-frame");
355 //f.innerHTML = "<div class='whiteBox'>" + __('Could not display article (missing XML object)') + "</div>";
358 var date
= new Date();
359 last_article_view
= date
.getTime() / 1000;
361 if (typeof correctPNG
!= 'undefined') {
365 if (_reload_feedlist_after_view
) {
366 setTimeout('updateFeedList(false, false)', 50);
367 _reload_feedlist_after_view
= false;
369 if (transport
.responseXML
) {
370 var counters
= transport
.responseXML
.getElementsByTagName("counters")[0];
373 debug("parsing piggybacked counters: " + counters
);
374 parse_counters(counters
, false);
376 debug("counters container not found in reply, requesting...");
384 exception_error("article_callback2", e
, transport
);
388 function view_offline(id
, feed_id
) {
392 showArticleInHeadlines(id
);
395 db
.execute("UPDATE articles SET unread = 0 WHERE id = ?", [id
]);
398 render_article("FIXME");
399 update_local_feedlist_counters();
404 exception_error("view_offline", e
);
408 function view(id
, feed_id
, skip_history
) {
411 debug("loading article: " + id
+ "/" + feed_id
);
413 if (offline_mode
) return view_offline(id
, feed_id
);
415 var cached_article
= cache_find(id
);
417 debug("cache check result: " + (cached_article
!= false));
421 //setActiveFeedId(feed_id);
423 var query
= "backend.php?op=view&id=" + param_escape(id
) +
424 "&feed=" + param_escape(feed_id
);
426 var date
= new Date();
428 var neighbor_ids
= getRelativePostIds(active_post_id
);
430 /* only request uncached articles */
432 var cids_to_request
= Array();
434 for (var i
= 0; i
< neighbor_ids
.length
; i
++) {
435 if (!cache_check(neighbor_ids
[i
])) {
436 cids_to_request
.push(neighbor_ids
[i
]);
440 debug("additional ids: " + cids_to_request
.toString());
442 /* additional info for piggyback counters */
444 if (tagsAreDisplayed()) {
445 query
= query
+ "&omode=lt";
447 query
= query
+ "&omode=flc";
450 var date
= new Date();
451 var timestamp
= Math
.round(date
.getTime() / 1000);
452 query
= query
+ "&ts=" + timestamp
;
454 query
= query
+ "&cids=" + cids_to_request
.toString();
456 var crow
= document
.getElementById("RROW-" + id
);
457 var article_is_unread
= crow
.className
.match("Unread");
459 if (!async_counters_work
) {
460 query
= query
+ "&csync=true";
463 showArticleInHeadlines(id
);
465 if (!cached_article
) {
467 notify_progress("Loading, please wait...", true);
469 } else if (cached_article
&& article_is_unread
) {
471 query
= query
+ "&mode=prefetch";
473 render_article(cached_article
);
475 } else if (cached_article
) {
477 query
= query
+ "&mode=prefetch_old";
478 render_article(cached_article
);
484 last_requested_article
= id
;
486 new Ajax
.Request(query
, {
487 onComplete: function(transport
) {
488 article_callback2(transport
, id
, feed_id
);
494 exception_error("view", e
);
499 return toggleMark(id
);
503 return togglePub(id
);
506 function tMark_afh_off(effect
) {
508 var elem
= effect
.effects
[0].element
;
510 debug("tMark_afh_off : " + elem
.id
);
513 elem
.src
= elem
.src
.replace("mark_set", "mark_unset");
514 elem
.alt
= __("Star article");
519 exception_error("tMark_afh_off", e
);
523 function tPub_afh_off(effect
) {
525 var elem
= effect
.effects
[0].element
;
527 debug("tPub_afh_off : " + elem
.id
);
530 elem
.src
= elem
.src
.replace("pub_set", "pub_unset");
531 elem
.alt
= __("Publish article");
536 exception_error("tPub_afh_off", e
);
540 function toggleMark(id
, client_only
, no_effects
) {
544 var query
= "backend.php?op=rpc&id=" + id
+ "&subop=mark";
546 query
= query
+ "&afid=" + getActiveFeedId();
548 if (tagsAreDisplayed()) {
549 query
= query
+ "&omode=tl";
551 query
= query
+ "&omode=flc";
554 var mark_img
= document
.getElementById("FMPIC-" + id
);
556 if (!mark_img
) return;
558 var vfeedu
= document
.getElementById("FEEDU--1");
559 var crow
= document
.getElementById("RROW-" + id
);
561 if (mark_img
.src
.match("mark_unset")) {
562 mark_img
.src
= mark_img
.src
.replace("mark_unset", "mark_set");
563 mark_img
.alt
= __("Unstar article");
564 query
= query
+ "&mark=1";
567 db
.execute("UPDATE articles SET marked = 1 WHERE id = ?", [id
]);
571 //mark_img.src = "images/mark_unset.png";
572 mark_img
.alt
= __("Please wait...");
573 query
= query
+ "&mark=0";
575 if (document
.getElementById("headlinesList") && !no_effects
) {
576 Effect
.Puff(mark_img
, {duration
: 0.25, afterFinish
: tMark_afh_off
});
578 mark_img
.src
= mark_img
.src
.replace("mark_set", "mark_unset");
579 mark_img
.alt
= __("Star article");
583 db
.execute("UPDATE articles SET marked = 0 WHERE id = ?", [id
]);
588 update_local_feedlist_counters();
593 new Ajax
.Request(query
, {
594 onComplete: function(transport
) {
595 all_counters_callback2(transport
);
601 exception_error("toggleMark", e
);
605 function togglePub(id
, client_only
, no_effects
) {
609 var query
= "backend.php?op=rpc&id=" + id
+ "&subop=publ";
611 query
= query
+ "&afid=" + getActiveFeedId();
613 if (tagsAreDisplayed()) {
614 query
= query
+ "&omode=tl";
616 query
= query
+ "&omode=flc";
619 var mark_img
= document
.getElementById("FPPIC-" + id
);
621 if (!mark_img
) return;
623 var vfeedu
= document
.getElementById("FEEDU--2");
624 var crow
= document
.getElementById("RROW-" + id
);
626 if (mark_img
.src
.match("pub_unset")) {
627 mark_img
.src
= mark_img
.src
.replace("pub_unset", "pub_set");
628 mark_img
.alt
= __("Unpublish article");
629 query
= query
+ "&pub=1";
633 //mark_img.src = "images/pub_unset.png";
634 mark_img
.alt
= __("Please wait...");
635 query
= query
+ "&pub=0";
637 if (document
.getElementById("headlinesList") && !no_effects
) {
638 Effect
.Puff(mark_img
, {duration
: 0.25, afterFinish
: tPub_afh_off
});
640 mark_img
.src
= mark_img
.src
.replace("pub_set", "pub_unset");
641 mark_img
.alt
= __("Publish article");
646 new Ajax
.Request(query
, {
647 onComplete: function(transport
) {
648 all_counters_callback2(transport
);
654 exception_error("togglePub", e
);
658 function correctHeadlinesOffset(id
) {
662 var hlist
= document
.getElementById("headlinesList");
663 var container
= document
.getElementById("headlinesInnerContainer");
664 var row
= document
.getElementById("RROW-" + id
);
666 var viewport
= container
.offsetHeight
;
668 var rel_offset_top
= row
.offsetTop
- container
.scrollTop
;
669 var rel_offset_bottom
= row
.offsetTop
+ row
.offsetHeight
- container
.scrollTop
;
671 debug("Rtop: " + rel_offset_top
+ " Rbtm: " + rel_offset_bottom
);
672 debug("Vport: " + viewport
);
674 if (rel_offset_top
<= 0 || rel_offset_top
> viewport
) {
675 container
.scrollTop
= row
.offsetTop
;
676 } else if (rel_offset_bottom
> viewport
) {
678 /* doesn't properly work with Opera in some cases because
679 Opera fucks up element scrolling */
681 container
.scrollTop
= row
.offsetTop
+ row
.offsetHeight
- viewport
;
685 exception_error("correctHeadlinesOffset", e
);
690 function moveToPost(mode
) {
697 rows
= cdmGetVisibleArticles();
699 rows
= getVisibleHeadlineIds();
705 if (!document
.getElementById('RROW-' + active_post_id
)) {
706 active_post_id
= false;
709 if (active_post_id
== false) {
710 next_id
= getFirstVisibleHeadlineId();
711 prev_id
= getLastVisibleHeadlineId();
713 for (var i
= 0; i
< rows
.length
; i
++) {
714 if (rows
[i
] == active_post_id
) {
721 if (mode
== "next") {
725 if (!cdmArticleIsActuallyVisible(next_id
)) {
726 cdmScrollToArticleId(next_id
);
728 cdmSelectArticles("none");
729 toggleUnread(next_id
, 0, true);
730 toggleSelected(next_id
);
733 correctHeadlinesOffset(next_id
);
734 view(next_id
, getActiveFeedId());
739 if (mode
== "prev") {
742 cdmScrollToArticleId(prev_id
);
743 cdmSelectArticles("none");
744 toggleUnread(prev_id
, 0, true);
745 toggleSelected(prev_id
);
747 correctHeadlinesOffset(prev_id
);
748 view(prev_id
, getActiveFeedId());
754 exception_error("moveToPost", e
);
758 function toggleSelected(id
) {
761 var cb
= document
.getElementById("RCHK-" + id
);
763 var row
= document
.getElementById("RROW-" + id
);
765 var nc
= row
.className
;
767 if (!nc
.match("Selected")) {
768 nc
= nc
+ "Selected";
773 // In CDM basically last selected article == active article
774 if (isCdmMode()) active_post_id
= id
;
776 nc
= nc
.replace("Selected", "");
786 exception_error("toggleSelected", e
);
790 function toggleUnread_afh(effect
) {
793 var elem
= effect
.element
;
794 elem
.style
.backgroundColor
= "";
797 exception_error("toggleUnread_afh", e
);
801 function toggleUnread(id
, cmode
, effect
) {
804 var row
= document
.getElementById("RROW-" + id
);
806 var nc
= row
.className
;
807 var is_selected
= row
.className
.match("Selected");
808 nc
= nc
.replace("Unread", "");
809 nc
= nc
.replace("Selected", "");
811 // since we are removing selection from the object, uncheck
812 // corresponding checkbox
814 var cb
= document
.getElementById("RCHK-" + id
);
819 // NOTE: I'm not sure that resetting selection here is a feature -fox
821 if (cmode
== undefined || cmode
== 2) {
822 if (row
.className
.match("Unread")) {
826 new Effect
.Highlight(row
, {duration
: 1, startcolor
: "#fff7d5",
827 afterFinish
: toggleUnread_afh
,
828 queue
: { position
:'end', scope
: 'TMRQ-' + id
, limit
: 1 } } );
832 row
.className
= nc
+ "Unread";
834 } else if (cmode
== 0) {
838 new Effect
.Highlight(row
, {duration
: 1, startcolor
: "#fff7d5",
839 afterFinish
: toggleUnread_afh
,
840 queue
: { position
:'end', scope
: 'TMRQ-' + id
, limit
: 1 } } );
842 } else if (cmode
== 1) {
843 row
.className
= nc
+ "Unread";
846 // Disable unmarking as selected for the time being (16.05.08) -fox
847 if (is_selected
) row
.className
= row
.className
+ "Selected";
849 if (cmode
== undefined) cmode
= 2;
851 var query
= "backend.php?op=rpc&subop=catchupSelected&ids=" +
852 param_escape(id
) + "&cmode=" + param_escape(cmode
);
854 // notify_progress("Loading, please wait...");
856 new Ajax
.Request(query
, {
857 onComplete: function(transport
) {
858 all_counters_callback2(transport
);
865 exception_error("toggleUnread", e
);
869 function selectionRemoveLabel(id
) {
872 var ids
= getSelectedArticleIds2();
874 if (ids
.length
== 0) {
875 alert(__("No articles are selected."));
879 // var ok = confirm(__("Remove selected articles from label?"));
883 var query
= "backend.php?op=rpc&subop=removeFromLabel&ids=" +
884 param_escape(ids
.toString()) + "&lid=" + param_escape(id
);
886 // notify_progress("Loading, please wait...");
888 cache_invalidate("F:" + (-11 - id
));
890 new Ajax
.Request(query
, {
891 onComplete: function(transport
) {
892 show_labels_in_headlines(transport
);
893 all_counters_callback2(transport
);
899 exception_error("selectionAssignLabel", e
);
904 function selectionAssignLabel(id
) {
907 var ids
= getSelectedArticleIds2();
909 if (ids
.length
== 0) {
910 alert(__("No articles are selected."));
914 // var ok = confirm(__("Assign selected articles to label?"));
918 cache_invalidate("F:" + (-11 - id
));
920 var query
= "backend.php?op=rpc&subop=assignToLabel&ids=" +
921 param_escape(ids
.toString()) + "&lid=" + param_escape(id
);
923 // notify_progress("Loading, please wait...");
925 new Ajax
.Request(query
, {
926 onComplete: function(transport
) {
927 show_labels_in_headlines(transport
);
928 all_counters_callback2(transport
);
934 exception_error("selectionAssignLabel", e
);
939 function selectionToggleUnread(cdm_mode
, set_state
, callback_func
, no_error
) {
944 rows
= cdmGetSelectedArticles();
946 rows
= getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
949 if (rows
.length
== 0 && !no_error
) {
950 alert(__("No articles are selected."));
954 for (i
= 0; i
< rows
.length
; i
++) {
955 var row
= document
.getElementById("RROW-" + rows
[i
]);
957 var nc
= row
.className
;
958 nc
= nc
.replace("Unread", "");
959 nc
= nc
.replace("Selected", "");
961 if (set_state
== undefined) {
962 if (row
.className
.match("Unread")) {
963 row
.className
= nc
+ "Selected";
965 row
.className
= nc
+ "UnreadSelected";
969 if (set_state
== false) {
970 row
.className
= nc
+ "Selected";
973 if (set_state
== true) {
974 row
.className
= nc
+ "UnreadSelected";
979 if (rows
.length
> 0) {
983 if (set_state
== undefined) {
985 } else if (set_state
== true) {
987 } else if (set_state
== false) {
991 var query
= "backend.php?op=rpc&subop=catchupSelected&ids=" +
992 param_escape(rows
.toString()) + "&cmode=" + cmode
;
994 notify_progress("Loading, please wait...");
996 new Ajax
.Request(query
, {
997 onComplete: function(transport
) {
998 catchup_callback2(transport
, callback_func
);
1004 exception_error("selectionToggleUnread", e
);
1008 function selectionToggleMarked(cdm_mode
) {
1014 rows
= cdmGetSelectedArticles();
1016 rows
= getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
1019 if (rows
.length
== 0) {
1020 alert(__("No articles are selected."));
1024 for (i
= 0; i
< rows
.length
; i
++) {
1025 toggleMark(rows
[i
], true, true);
1028 if (rows
.length
> 0) {
1030 var query
= "backend.php?op=rpc&subop=markSelected&ids=" +
1031 param_escape(rows
.toString()) + "&cmode=2";
1033 query
= query
+ "&afid=" + getActiveFeedId();
1035 /* if (tagsAreDisplayed()) {
1036 query = query + "&omode=tl";
1038 query = query + "&omode=flc";
1041 query
= query
+ "&omode=lc";
1043 new Ajax
.Request(query
, {
1044 onComplete: function(transport
) {
1045 all_counters_callback2(transport
);
1051 exception_error("selectionToggleMarked", e
);
1055 function selectionTogglePublished(cdm_mode
) {
1061 rows
= cdmGetSelectedArticles();
1063 rows
= getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
1066 if (rows
.length
== 0) {
1067 alert(__("No articles are selected."));
1071 for (i
= 0; i
< rows
.length
; i
++) {
1072 togglePub(rows
[i
], true, true);
1075 if (rows
.length
> 0) {
1077 var query
= "backend.php?op=rpc&subop=publishSelected&ids=" +
1078 param_escape(rows
.toString()) + "&cmode=2";
1080 query
= query
+ "&afid=" + getActiveFeedId();
1082 /* if (tagsAreDisplayed()) {
1083 query = query + "&omode=tl";
1085 query = query + "&omode=flc";
1088 query
= query
+ "&omode=lc";
1090 new Ajax
.Request(query
, {
1091 onComplete: function(transport
) {
1092 all_counters_callback2(transport
);
1098 exception_error("selectionToggleMarked", e
);
1102 function cdmGetSelectedArticles() {
1103 var sel_articles
= new Array();
1104 var container
= document
.getElementById("headlinesInnerContainer");
1106 for (i
= 0; i
< container
.childNodes
.length
; i
++) {
1107 var child
= container
.childNodes
[i
];
1109 if (child
.id
&& child
.id
.match("RROW-") && child
.className
.match("Selected")) {
1110 var c_id
= child
.id
.replace("RROW-", "");
1111 sel_articles
.push(c_id
);
1115 return sel_articles
;
1118 function cdmGetVisibleArticles() {
1119 var sel_articles
= new Array();
1120 var container
= document
.getElementById("headlinesInnerContainer");
1122 if (!container
) return sel_articles
;
1124 for (i
= 0; i
< container
.childNodes
.length
; i
++) {
1125 var child
= container
.childNodes
[i
];
1127 if (child
.id
&& child
.id
.match("RROW-")) {
1128 var c_id
= child
.id
.replace("RROW-", "");
1129 sel_articles
.push(c_id
);
1133 return sel_articles
;
1136 function cdmGetUnreadArticles() {
1137 var sel_articles
= new Array();
1138 var container
= document
.getElementById("headlinesInnerContainer");
1140 for (i
= 0; i
< container
.childNodes
.length
; i
++) {
1141 var child
= container
.childNodes
[i
];
1143 if (child
.id
&& child
.id
.match("RROW-") && child
.className
.match("Unread")) {
1144 var c_id
= child
.id
.replace("RROW-", "");
1145 sel_articles
.push(c_id
);
1149 return sel_articles
;
1153 // mode = all,none,unread
1154 function cdmSelectArticles(mode
) {
1155 var container
= document
.getElementById("headlinesInnerContainer");
1157 for (i
= 0; i
< container
.childNodes
.length
; i
++) {
1158 var child
= container
.childNodes
[i
];
1160 if (child
.id
&& child
.id
.match("RROW-")) {
1161 var aid
= child
.id
.replace("RROW-", "");
1163 var cb
= document
.getElementById("RCHK-" + aid
);
1165 if (mode
== "all") {
1166 if (!child
.className
.match("Selected")) {
1167 child
.className
= child
.className
+ "Selected";
1170 } else if (mode
== "unread") {
1171 if (child
.className
.match("Unread") && !child
.className
.match("Selected")) {
1172 child
.className
= child
.className
+ "Selected";
1176 child
.className
= child
.className
.replace("Selected", "");
1183 function catchupPage() {
1185 var fn
= getFeedName(getActiveFeedId(), activeFeedIsCat());
1187 var str
= __("Mark all visible articles in %s as read?");
1189 str
= str
.replace("%s", fn
);
1191 if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str
)) {
1195 if (document
.getElementById("headlinesList")) {
1196 selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true);
1197 selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
1198 selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
1200 cdmSelectArticles('all');
1201 selectionToggleUnread(true, false, 'viewCurrentFeed()', true)
1202 cdmSelectArticles('none');
1206 function catchupSelection() {
1212 if (document
.getElementById("headlinesList")) {
1213 rows
= getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
1215 rows
= cdmGetSelectedArticles();
1218 if (rows
.length
== 0) {
1219 alert(__("No articles are selected."));
1224 var fn
= getFeedName(getActiveFeedId(), activeFeedIsCat());
1226 var str
= __("Mark %d selected articles in %s as read?");
1228 str
= str
.replace("%d", rows
.length
);
1229 str
= str
.replace("%s", fn
);
1231 if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str
)) {
1235 if (document
.getElementById("headlinesList")) {
1236 selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
1237 // selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
1239 selectionToggleUnread(true, false, 'viewCurrentFeed()', true)
1240 // cdmSelectArticles('none');
1244 exception_error("catchupSelection", e
);
1248 function editArticleTags(id
, feed_id
, cdm_enabled
) {
1249 displayDlg('editArticleTags', id
);
1253 function tag_saved_callback(transport
) {
1255 debug("in tag_saved_callback");
1260 if (tagsAreDisplayed()) {
1261 _reload_feedlist_after_view
= true;
1265 if (transport
.responseXML
) {
1266 var tags_str
= transport
.responseXML
.getElementsByTagName("tags-str")[0];
1269 var id
= tags_str
.getAttribute("id");
1272 var tags
= document
.getElementById("ATSTR-" + id
);
1274 tags
.innerHTML
= tags_str
.firstChild
.nodeValue
;
1281 exception_error("tag_saved_callback", e
);
1285 function editTagsSave() {
1287 notify_progress("Saving article tags...");
1289 var form
= document
.forms
["tag_edit_form"];
1291 var query
= Form
.serialize("tag_edit_form");
1293 query
= "backend.php?op=rpc&subop=setArticleTags&" + query
;
1297 new Ajax
.Request(query
, {
1298 onComplete: function(transport
) {
1299 tag_saved_callback(transport
);
1304 function editTagsInsert() {
1307 var form
= document
.forms
["tag_edit_form"];
1309 var found_tags
= form
.found_tags
;
1310 var tags_str
= form
.tags_str
;
1312 var tag
= found_tags
[found_tags
.selectedIndex
].value
;
1314 if (tags_str
.value
.length
> 0 &&
1315 tags_str
.value
.lastIndexOf(", ") != tags_str
.value
.length
- 2) {
1317 tags_str
.value
= tags_str
.value
+ ", ";
1320 tags_str
.value
= tags_str
.value
+ tag
+ ", ";
1322 found_tags
.selectedIndex
= 0;
1325 exception_error("editTagsInsert", e
);
1329 function cdmScrollViewport(where
) {
1330 debug("cdmScrollViewport: " + where
);
1332 var ctr
= document
.getElementById("headlinesInnerContainer");
1336 if (where
== "bottom") {
1337 ctr
.scrollTop
= ctr
.scrollHeight
;
1339 ctr
.scrollTop
= where
;
1343 function cdmArticleIsBelowViewport(id
) {
1345 var ctr
= document
.getElementById("headlinesInnerContainer");
1346 var e
= document
.getElementById("RROW-" + id
);
1348 if (!e
|| !ctr
) return;
1350 // article starts below viewport
1352 if (ctr
.scrollTop
< e
.offsetTop
) {
1359 exception_error("cdmArticleIsVisible", e
);
1363 function cdmArticleIsAboveViewport(id
) {
1365 var ctr
= document
.getElementById("headlinesInnerContainer");
1366 var e
= document
.getElementById("RROW-" + id
);
1368 if (!e
|| !ctr
) return;
1370 // article starts above viewport
1372 if (ctr
.scrollTop
> e
.offsetTop
+ e
.offsetHeight
) {
1379 exception_error("cdmArticleIsVisible", e
);
1383 function cdmScrollToArticleId(id
) {
1385 var ctr
= document
.getElementById("headlinesInnerContainer");
1386 var e
= document
.getElementById("RROW-" + id
);
1388 if (!e
|| !ctr
) return;
1390 ctr
.scrollTop
= e
.offsetTop
;
1393 exception_error("cdmScrollToArticleId", e
);
1397 function cdmArticleIsActuallyVisible(id
) {
1399 var ctr
= document
.getElementById("headlinesInnerContainer");
1400 var e
= document
.getElementById("RROW-" + id
);
1402 if (!e
|| !ctr
) return;
1404 // article fits in viewport OR article is longer than viewport and
1405 // its bottom is visible
1407 if (ctr
.scrollTop
<= e
.offsetTop
&& e
.offsetTop
+ e
.offsetHeight
<=
1408 ctr
.scrollTop
+ ctr
.offsetHeight
) {
1412 } else if (e
.offsetHeight
> ctr
.offsetHeight
&&
1413 e
.offsetTop
+ e
.offsetHeight
>= ctr
.scrollTop
&&
1414 e
.offsetTop
+ e
.offsetHeight
<= ctr
.scrollTop
+ ctr
.offsetHeight
) {
1423 exception_error("cdmArticleIsVisible", e
);
1427 function cdmWatchdog() {
1431 var ctr
= document
.getElementById("headlinesInnerContainer");
1435 var ids
= new Array();
1437 var e
= ctr
.firstChild
;
1440 if (e
.className
&& e
.className
== "cdmArticleUnread" && e
.id
&&
1441 e
.id
.match("RROW-")) {
1443 // article fits in viewport OR article is longer than viewport and
1444 // its bottom is visible
1446 if (ctr
.scrollTop
<= e
.offsetTop
&& e
.offsetTop
+ e
.offsetHeight
<=
1447 ctr
.scrollTop
+ ctr
.offsetHeight
) {
1449 // debug(e.id + " is visible " + e.offsetTop + "." +
1450 // (e.offsetTop + e.offsetHeight) + " vs " + ctr.scrollTop + "." +
1451 // (ctr.scrollTop + ctr.offsetHeight));
1453 ids
.push(e
.id
.replace("RROW-", ""));
1455 } else if (e
.offsetHeight
> ctr
.offsetHeight
&&
1456 e
.offsetTop
+ e
.offsetHeight
>= ctr
.scrollTop
&&
1457 e
.offsetTop
+ e
.offsetHeight
<= ctr
.scrollTop
+ ctr
.offsetHeight
) {
1459 ids
.push(e
.id
.replace("RROW-", ""));
1463 // method 2: article bottom is visible and is in upper 1/2 of the viewport
1465 /* if (e.offsetTop + e.offsetHeight >= ctr.scrollTop &&
1466 e.offsetTop + e.offsetHeight <= ctr.scrollTop + ctr.offsetHeight/2) {
1468 ids.push(e.id.replace("RROW-", ""));
1477 debug("cdmWatchdog, ids= " + ids
.toString());
1479 if (ids
.length
> 0) {
1481 for (var i
= 0; i
< ids
.length
; i
++) {
1482 var e
= document
.getElementById("RROW-" + ids
[i
]);
1484 e
.className
= e
.className
.replace("Unread", "");
1488 var query
= "backend.php?op=rpc&subop=catchupSelected&ids=" +
1489 param_escape(ids
.toString()) + "&cmode=0";
1491 new Ajax
.Request(query
, {
1492 onComplete: function(transport
) {
1493 all_counters_callback2(transport
);
1498 _cdm_wd_timeout
= window
.setTimeout("cdmWatchdog()", 4000);
1501 exception_error("cdmWatchdog", e
);
1507 function cache_inject(id
, article
, param
) {
1509 if (!cache_check_param(id
, param
)) {
1510 debug("cache_article: miss: " + id
+ " [p=" + param
+ "]");
1515 var date
= new Date();
1516 var ts
= Math
.round(date
.getTime() / 1000);
1518 db
.execute("INSERT INTO cache (id, article, param, added) VALUES (?, ?, ?, ?)",
1519 [id
, article
, param
, ts
]);
1522 var cache_obj
= new Array();
1524 cache_obj
["id"] = id
;
1525 cache_obj
["data"] = article
;
1526 cache_obj
["param"] = param
;
1528 article_cache
.push(cache_obj
);
1532 debug("cache_article: hit: " + id
+ " [p=" + param
+ "]");
1535 exception_error("cache_inject", e
);
1539 function cache_find(id
) {
1542 var rs
= db
.execute("SELECT article FROM cache WHERE id = ?", [id
]);
1544 if (rs
.isValidRow()) {
1549 for (var i
= 0; i
< article_cache
.length
; i
++) {
1550 if (article_cache
[i
]["id"] == id
) {
1551 return article_cache
[i
]["data"];
1558 function cache_find_param(id
, param
) {
1561 var rs
= db
.execute("SELECT article FROM cache WHERE id = ? AND param = ?",
1564 if (rs
.isValidRow()) {
1569 for (var i
= 0; i
< article_cache
.length
; i
++) {
1570 if (article_cache
[i
]["id"] == id
&& article_cache
[i
]["param"] == param
) {
1571 return article_cache
[i
]["data"];
1578 function cache_check(id
) {
1581 var rs
= db
.execute("SELECT COUNT(*) AS c FROM cache WHERE id = ?",
1584 if (rs
.isValidRow()) {
1585 return rs
.field(0) != "0";
1589 for (var i
= 0; i
< article_cache
.length
; i
++) {
1590 if (article_cache
[i
]["id"] == id
) {
1598 function cache_check_param(id
, param
) {
1601 var rs
= db
.execute("SELECT COUNT(*) AS c FROM cache WHERE id = ? AND param = ?",
1604 if (rs
.isValidRow()) {
1605 return rs
.field(0) != "0";
1609 for (var i
= 0; i
< article_cache
.length
; i
++) {
1610 if (article_cache
[i
]["id"] == id
&& article_cache
[i
]["param"] == param
) {
1618 function cache_expire() {
1620 var date
= new Date();
1621 var ts
= Math
.round(date
.getTime() / 1000);
1623 db
.execute("DELETE FROM cache WHERE added < ? - 1800 AND id LIKE 'FEEDLIST'", [ts
]);
1624 db
.execute("DELETE FROM cache WHERE added < ? - 600 AND (id LIKE 'F:%' OR id LIKE 'C:%')", [ts
]);
1625 db
.execute("DELETE FROM cache WHERE added < ? - 86400", [ts
]);
1629 while (article_cache
.length
> 25) {
1630 article_cache
.shift();
1635 function cache_empty() {
1636 article_cache
= new Array();
1639 function cache_invalidate(id
) {
1643 rs
= db
.execute("DELETE FROM cache WHERE id = ?", [id
]);
1644 return rs
.rowsAffected
!= 0;
1649 while (i
< article_cache
.length
) {
1650 if (article_cache
[i
]["id"] == id
) {
1651 debug("cache_invalidate: removed id " + id
);
1652 article_cache
.splice(i
, 1);
1659 debug("cache_invalidate: id not found: " + id
);
1662 exception_error("cache_invalidate", e
);
1666 function getActiveArticleId() {
1667 return active_post_id
;
1670 function cdmClicked(id
) {
1672 var elem
= document
.getElementById("RROW-" + id
);
1675 var id
= elem
.id
.replace("RROW-", "");
1676 active_post_id
= id
;
1678 cdmSelectArticles("none");
1679 toggleUnread(id
, 0, true);
1684 exception_error("cdmClicked", e
);
1688 function preload_article_callback(transport
) {
1690 if (transport
.responseXML
) {
1691 var articles
= transport
.responseXML
.getElementsByTagName("article");
1693 for (var i
= 0; i
< articles
.length
; i
++) {
1694 var id
= articles
[i
].getAttribute("id");
1695 if (!cache_check(id
)) {
1696 cache_inject(id
, articles
[i
].firstChild
.nodeValue
);
1697 debug("preloaded article: " + id
);
1702 exception_error("preload_article_callback", e
);
1706 function preloadArticleUnderPointer(id
) {
1708 if (getInitParam("bw_limit") == "1") return;
1710 if (post_under_pointer
== id
&& !cache_check(id
)) {
1712 debug("trying to preload article " + id
);
1714 var neighbor_ids
= getRelativePostIds(id
, 1);
1716 /* only request uncached articles */
1718 var cids_to_request
= Array();
1720 for (var i
= 0; i
< neighbor_ids
.length
; i
++) {
1721 if (!cache_check(neighbor_ids
[i
])) {
1722 cids_to_request
.push(neighbor_ids
[i
]);
1725 debug("additional ids: " + cids_to_request
.toString());
1727 cids_to_request
.push(id
);
1729 var query
= "backend.php?op=rpc&subop=getArticles&ids=" +
1730 cids_to_request
.toString();
1731 new Ajax
.Request(query
, {
1732 onComplete: function(transport
) {
1733 preload_article_callback(transport
);
1737 exception_error("preloadArticleUnderPointer", e
);
1741 function postMouseIn(id
) {
1743 if (post_under_pointer
!= id
) {
1744 post_under_pointer
= id
;
1746 window
.setTimeout("preloadArticleUnderPointer(" + id
+ ")", 250);
1751 exception_error("postMouseIn", e
);
1755 function postMouseOut(id
) {
1757 post_under_pointer
= false;
1759 exception_error("postMouseOut", e
);
1763 function headlines_scroll_handler() {
1766 var e
= document
.getElementById("headlinesInnerContainer");
1768 // don't do infinite scrolling when Limit == All
1770 var toolbar_form
= document
.forms
["main_toolbar_form"];
1772 var limit
= toolbar_form
.limit
[toolbar_form
.limit
.selectedIndex
];
1773 if (limit
.value
!= 0) {
1775 debug((e
.scrollTop
+ e
.offsetHeight
) + " vs " + e
.scrollHeight
+ " dis? " +
1776 _infscroll_disable
);
1778 if (e
.scrollTop
+ e
.offsetHeight
> e
.scrollHeight
- 100) {
1779 if (!_infscroll_disable
) {
1780 debug("more cowbell!");
1787 exception_error("headlines_scroll_handler", e
);
1791 function catchupRelativeToArticle(below
) {
1796 if (!getActiveArticleId()) {
1797 alert(__("No article is selected."));
1803 if (document
.getElementById("headlinesList")) {
1804 visible_ids
= getVisibleHeadlineIds();
1806 visible_ids
= cdmGetVisibleArticles();
1809 var ids_to_mark
= new Array();
1812 for (var i
= 0; i
< visible_ids
.length
; i
++) {
1813 if (visible_ids
[i
] != getActiveArticleId()) {
1814 var e
= document
.getElementById("RROW-" + visible_ids
[i
]);
1816 if (e
&& e
.className
.match("Unread")) {
1817 ids_to_mark
.push(visible_ids
[i
]);
1824 for (var i
= visible_ids
.length
-1; i
>= 0; i
--) {
1825 if (visible_ids
[i
] != getActiveArticleId()) {
1826 var e
= document
.getElementById("RROW-" + visible_ids
[i
]);
1828 if (e
&& e
.className
.match("Unread")) {
1829 ids_to_mark
.push(visible_ids
[i
]);
1837 if (ids_to_mark
.length
== 0) {
1838 alert(__("No articles found to mark"));
1840 var msg
= __("Mark %d article(s) as read?").replace("%d", ids_to_mark
.length
);
1844 for (var i
= 0; i
< ids_to_mark
.length
; i
++) {
1845 var e
= document
.getElementById("RROW-" + ids_to_mark
[i
]);
1846 e
.className
= e
.className
.replace("Unread", "");
1849 var query
= "backend.php?op=rpc&subop=catchupSelected&ids=" +
1850 param_escape(ids_to_mark
.toString()) + "&cmode=0";
1852 new Ajax
.Request(query
, {
1853 onComplete: function(transport
) {
1854 catchup_callback2(transport
);
1861 exception_error("catchupRelativeToArticle", e
);
1865 function cdmExpandArticle(a_id
) {
1867 var id
= 'CICD-' + a_id
;
1870 Element
.hide("CEXC-" + a_id
);
1873 Effect
.Appear(id
, {duration
: 0.5,
1874 beforeStart: function(effect
) {
1875 var h_id
= 'CICH-' + a_id
;
1876 var h_elem
= document
.getElementById(h_id
);
1877 if (h_elem
) { h_elem
.style
.display
= "none"; }
1879 toggleUnread(a_id
, 0);
1884 exception_error("appearBlockElementF", e
);
1889 function fixHeadlinesOrder(ids
) {
1891 for (var i
= 0; i
< ids
.length
; i
++) {
1892 var e
= document
.getElementById("RROW-" + ids
[i
]);
1896 e
.className
= e
.className
.replace("even", "odd");
1898 e
.className
= e
.className
.replace("odd", "even");
1903 exception_error("fixHeadlinesOrder", e
);
1907 function hideReadHeadlines() {
1911 var vis_ids
= new Array();
1913 if (document
.getElementById("headlinesList")) {
1914 ids
= getVisibleHeadlineIds();
1916 ids
= cdmGetVisibleArticles();
1919 var read_headlines_visible
= true;
1921 for (var i
= 0; i
< ids
.length
; i
++) {
1922 var row
= document
.getElementById("RROW-" + ids
[i
]);
1924 if (row
&& row
.className
) {
1925 if (read_headlines_visible
) {
1926 if (row
.className
.match("Unread") || row
.className
.match("Selected")) {
1928 vis_ids
.push(ids
[i
]);
1930 //Effect.Fade(row, {duration : 0.3});
1935 vis_ids
.push(ids
[i
]);
1940 fixHeadlinesOrder(vis_ids
);
1942 read_headlines_visible
= !read_headlines_visible
;
1945 exception_error("hideReadHeadlines", e
);
1949 function invertHeadlineSelection() {
1951 var rows
= new Array();
1955 r
= document
.getElementsByTagName("TR");
1957 r
= document
.getElementsByTagName("DIV");
1960 for (var i
= 0; i
< r
.length
; i
++) {
1961 if (r
[i
].id
&& r
[i
].id
.match("RROW-")) {
1966 for (var i
= 0; i
< rows
.length
; i
++) {
1967 var nc
= rows
[i
].className
;
1968 var id
= rows
[i
].id
.replace("RROW-", "");
1969 var cb
= document
.getElementById("RCHK-" + id
);
1971 if (!rows
[i
].className
.match("Selected")) {
1972 nc
= nc
+ "Selected";
1975 nc
= nc
.replace("Selected", "");
1979 rows
[i
].className
= nc
;
1984 exception_error("invertHeadlineSelection", e
);
1988 function getArticleUnderPointer() {
1989 return post_under_pointer
;
1992 function zoomToArticle(id
) {
1994 var w
= window
.open("backend.php?op=view&mode=zoom&id=" + param_escape(id
),
1996 "status=0,toolbar=0,location=0,width=450,height=300,scrollbars=1,menubar=0");
1999 exception_error("zoomToArticle", e
);
2003 function showOriginalArticleInline(id
) {
2006 var query
= "backend.php?op=rpc&subop=getArticleLink&id=" + id
;
2008 notify_progress("Loading, please wait...", true);
2010 new Ajax
.Request(query
, {
2011 onComplete: function(transport
) {
2013 if (transport
.responseXML
) {
2015 var link
= transport
.responseXML
.getElementsByTagName("link")[0];
2016 var id
= transport
.responseXML
.getElementsByTagName("id")[0];
2021 link
= link
.firstChild
.nodeValue
;
2023 var ci
= document
.getElementById("content-insert");
2025 var tmp
= "<iframe id=\"inline_orig_article\" width=\""+ci
.offsetWidth
+"\" height=\""+ci
.offsetHeight
+"\" style=\"border-width : 0px;\" src=\""+link
+"\"></iframe>";
2027 render_article(tmp
);
2034 exception_error("showOriginalArticleInline", e
);
2039 function scrollArticle(offset
) {
2042 var ci
= document
.getElementById("content-insert");
2044 ci
.scrollTop
+= offset
;
2047 var hi
= document
.getElementById("headlinesInnerContainer");
2049 hi
.scrollTop
+= offset
;
2054 exception_error("scrollArticle", e
);
2058 function show_labels_in_headlines(transport
) {
2060 if (transport
.responseXML
) {
2061 var info
= transport
.responseXML
.getElementsByTagName("info-for-headlines")[0];
2063 var elems
= info
.getElementsByTagName("entry");
2065 for (var l
= 0; l
< elems
.length
; l
++) {
2066 var e_id
= elems
[l
].getAttribute("id");
2070 var ctr
= document
.getElementById("HLLCTR-" + e_id
);
2073 ctr
.innerHTML
= elems
[l
].firstChild
.nodeValue
;
2081 exception_error("show_labels_in_headlines", e
);
2086 function toggleHeadlineActions() {
2088 var e
= document
.getElementById("headlineActionsBody");
2089 var p
= document
.getElementById("headlineActionsDrop");
2091 if (!Element
.visible(e
)) {
2098 e
.style
.left
= (p
.offsetLeft
+ 1) + "px";
2099 // e.style.top = (p.offsetTop + p.offsetHeight - 1) + "px";
2102 exception_error("toggleHeadlineActions", e
);