]>
git.wh0rd.org - tt-rss.git/blob - viewfeed.js
1 var active_post_id
= false;
3 var article_cache
= new Array();
5 var vgroup_last_feed
= false;
6 var post_under_pointer
= false;
8 var last_requested_article
= false;
10 var catchup_id_batch
= [];
11 var catchup_timeout_id
= false;
12 var feed_precache_timeout_id
= false;
13 var precache_idle_timeout_id
= false;
15 var cids_requested
= [];
17 var has_storage
= 'sessionStorage' in window
&& window
['sessionStorage'] !== null;
19 function headlines_callback2(transport
, offset
, background
) {
21 handle_rpc_json(transport
);
23 loading_set_progress(25);
25 console
.log("headlines_callback2 [offset=" + offset
+ "] B:" + background
);
33 reply
= JSON
.parse(transport
.responseText
);
40 is_cat
= reply
['headlines']['is_cat'];
41 feed_id
= reply
['headlines']['id'];
44 cache_headlines(feed_id
, is_cat
, reply
['headlines']['toolbar'], reply
['headlines']['content']);
48 setActiveFeedId(feed_id
, is_cat
);
52 $("headlines-frame").scrollTop
= 0;
56 var headlines_count
= reply
['headlines-info']['count'];
58 vgroup_last_feed
= reply
['headlines-info']['vgroup_last_feed'];
60 if (parseInt(headlines_count
) < getInitParam("default_article_limit")) {
61 _infscroll_disable
= 1;
63 _infscroll_disable
= 0;
66 var counters
= reply
['counters'];
67 var articles
= reply
['articles'];
68 var runtime_info
= reply
['runtime-info'];
71 dijit
.byId("headlines-frame").attr('content',
72 reply
['headlines']['content']);
74 dijit
.byId("headlines-toolbar").attr('content',
75 reply
['headlines']['toolbar']);
77 var hsp
= $("headlines-spacer");
78 if (!hsp
) hsp
= new Element("DIV", {"id": "headlines-spacer"});
80 dijit
.byId('headlines-frame').domNode
.appendChild(hsp
);
86 if (headlines_count
> 0 && feed_id
== getActiveFeedId() && is_cat
== activeFeedIsCat()) {
87 console
.log("adding some more headlines...");
89 var c
= dijit
.byId("headlines-frame");
90 var ids
= getSelectedArticleIds2();
92 $("headlines-tmp").innerHTML
= reply
['headlines']['content'];
94 var hsp
= $("headlines-spacer");
97 c
.domNode
.removeChild(hsp
);
99 $$("#headlines-tmp > div").each(function(row
) {
100 if ($$("#headlines-frame DIV[id="+row
.id
+"]").length
== 0) {
101 row
.style
.display
= 'none';
102 c
.domNode
.appendChild(row
);
104 row
.parentNode
.removeChild(row
);
108 if (!hsp
) hsp
= new Element("DIV", {"id": "headlines-spacer"});
110 fixHeadlinesOrder(getLoadedArticleIds());
112 c
.domNode
.appendChild(hsp
);
114 console
.log("restore selected ids: " + ids
);
116 for (var i
= 0; i
< ids
.length
; i
++) {
117 markHeadline(ids
[i
]);
122 $$("#headlines-frame > div[id*=RROW]").each(
124 if (!Element
.visible(child
))
125 new Effect
.Appear(child
, { duration
: 0.5 });
129 console
.log("no new headlines received");
131 var hsp
= $("headlines-spacer");
133 if (hsp
) hsp
.innerHTML
= "";
137 if (headlines_count
> 0)
138 cache_headlines(feed_id
, is_cat
, reply
['headlines']['toolbar'], $("headlines-frame").innerHTML
);
141 for (var i
= 0; i
< articles
.length
; i
++) {
142 var a_id
= articles
[i
]['id'];
143 cache_set("article:" + a_id
, articles
[i
]['content']);
146 console
.log("no cached articles received");
149 // do not precache stuff after fresh feed
151 precache_headlines();
154 parse_counters(counters
);
159 console
.error("Invalid object received: " + transport
.responseText
);
160 dijit
.byId("headlines-frame").attr('content', "<div class='whiteBox'>" +
161 __('Could not update headlines (invalid object received - see error console for details)') +
165 _infscroll_request_sent
= 0;
170 exception_error("headlines_callback2", e
, transport
);
174 function render_article(article
) {
176 dijit
.byId("headlines-wrap-inner").addChild(
177 dijit
.byId("content-insert"));
179 var c
= dijit
.byId("content-insert");
182 c
.domNode
.scrollTop
= 0;
185 c
.attr('content', article
);
187 correctHeadlinesOffset(getActiveArticleId());
194 exception_error("render_article", e
);
198 function showArticleInHeadlines(id
) {
202 selectArticles("none");
204 var crow
= $("RROW-" + id
);
208 var article_is_unread
= crow
.hasClassName("Unread");
210 crow
.removeClassName("Unread");
212 selectArticles('none');
214 var upd_img_pic
= $("FUPDPIC-" + id
);
216 var view_mode
= false;
219 view_mode
= document
.forms
['main_toolbar_form'].view_mode
;
220 view_mode
= view_mode
[view_mode
.selectedIndex
].value
;
225 if (upd_img_pic
&& (upd_img_pic
.src
.match("updated.png") ||
226 upd_img_pic
.src
.match("fresh_sign.png"))) {
228 upd_img_pic
.src
= "images/blank_icon.gif";
230 cache_headlines(getActiveFeedId(), activeFeedIsCat(), null, $("headlines-frame").innerHTML
);
232 } else if (article_is_unread
&& view_mode
== "all_articles") {
233 cache_headlines(getActiveFeedId(), activeFeedIsCat(), null, $("headlines-frame").innerHTML
);
238 if (article_is_unread
)
239 _force_scheduled_update
= true;
242 exception_error("showArticleInHeadlines", e
);
246 function article_callback2(transport
, id
) {
248 console
.log("article_callback2 " + id
);
250 handle_rpc_json(transport
);
255 reply
= JSON
.parse(transport
.responseText
);
262 var upic
= $('FUPDPIC-' + id
);
264 if (upic
) upic
.src
= 'images/blank_icon.gif';
266 reply
.each(function(article
) {
267 if (active_post_id
== article
['id']) {
268 render_article(article
['content']);
270 cids_requested
.remove(article
['id']);
272 cache_set("article:" + article
['id'], article
['content']);
275 // if (id != last_requested_article) {
276 // console.log("requested article id is out of sequence, aborting");
281 console
.error("Invalid object received: " + transport
.responseText
);
283 render_article("<div class='whiteBox'>" +
284 __('Could not display article (invalid object received - see error console for details)') + "</div>");
290 if (!_infscroll_disable
&&
291 $$("#headlines-frame > div[id*=RROW]").last().hasClassName("Selected")) {
301 exception_error("article_callback2", e
, transport
);
307 console
.log("loading article: " + id
);
309 var cached_article
= cache_get("article:" + id
);
311 console
.log("cache check result: " + (cached_article
!= false));
315 var query
= "?op=view&id=" + param_escape(id
);
317 var neighbor_ids
= getRelativePostIds(id
);
319 /* only request uncached articles */
321 var cids_to_request
= [];
323 for (var i
= 0; i
< neighbor_ids
.length
; i
++) {
324 if (cids_requested
.indexOf(neighbor_ids
[i
]) == -1)
325 if (!cache_get("article:" + neighbor_ids
[i
])) {
326 cids_to_request
.push(neighbor_ids
[i
]);
327 cids_requested
.push(neighbor_ids
[i
]);
331 console
.log("additional ids: " + cids_to_request
.toString());
333 query
= query
+ "&cids=" + cids_to_request
.toString();
335 var crow
= $("RROW-" + id
);
336 var article_is_unread
= crow
.hasClassName("Unread");
339 showArticleInHeadlines(id
);
341 precache_headlines();
343 if (!cached_article
) {
345 var upic
= $('FUPDPIC-' + id
);
348 upic
.src
= getInitParam("sign_progress");
351 } else if (cached_article
&& article_is_unread
) {
353 query
= query
+ "&mode=prefetch";
355 render_article(cached_article
);
357 } else if (cached_article
) {
359 query
= query
+ "&mode=prefetch_old";
360 render_article(cached_article
);
362 // if we don't need to request any relative ids, we might as well skip
363 // the server roundtrip altogether
364 if (cids_to_request
.length
== 0) {
367 if (!_infscroll_disable
&&
368 $$("#headlines-frame > div[id*=RROW]").last().hasClassName("Selected")) {
380 last_requested_article
= id
;
384 new Ajax
.Request("backend.php", {
386 onComplete: function(transport
) {
387 article_callback2(transport
, id
);
393 exception_error("view", e
);
398 return toggleMark(id
);
402 return togglePub(id
);
405 function toggleMark(id
, client_only
) {
407 var query
= "?op=rpc&id=" + id
+ "&subop=mark";
409 var img
= $("FMPIC-" + id
);
413 if (img
.src
.match("mark_unset")) {
414 img
.src
= img
.src
.replace("mark_unset", "mark_set");
415 img
.alt
= __("Unstar article");
416 query
= query
+ "&mark=1";
419 img
.src
= img
.src
.replace("mark_set", "mark_unset");
420 img
.alt
= __("Star article");
421 query
= query
+ "&mark=0";
424 cache_headlines(getActiveFeedId(), activeFeedIsCat(), null, $("headlines-frame").innerHTML
);
427 new Ajax
.Request("backend.php", {
429 onComplete: function(transport
) {
430 handle_rpc_json(transport
);
435 exception_error("toggleMark", e
);
439 function togglePub(id
, client_only
, no_effects
, note
) {
441 var query
= "?op=rpc&id=" + id
+ "&subop=publ";
443 if (note
!= undefined) {
444 query
= query
+ "¬e=" + param_escape(note
);
446 query
= query
+ "¬e=undefined";
449 var img
= $("FPPIC-" + id
);
453 if (img
.src
.match("pub_unset") || note
!= undefined) {
454 img
.src
= img
.src
.replace("pub_unset", "pub_set");
455 img
.alt
= __("Unpublish article");
456 query
= query
+ "&pub=1";
459 img
.src
= img
.src
.replace("pub_set", "pub_unset");
460 img
.alt
= __("Publish article");
462 query
= query
+ "&pub=0";
465 cache_headlines(getActiveFeedId(), activeFeedIsCat(), null, $("headlines-frame").innerHTML
);
468 new Ajax
.Request("backend.php", {
470 onComplete: function(transport
) {
471 handle_rpc_json(transport
);
476 exception_error("togglePub", e
);
480 function moveToPost(mode
) {
484 var rows
= getVisibleArticleIds();
489 if (!$('RROW-' + active_post_id
)) {
490 active_post_id
= false;
493 if (active_post_id
== false) {
494 next_id
= getFirstVisibleHeadlineId();
495 prev_id
= getLastVisibleHeadlineId();
497 for (var i
= 0; i
< rows
.length
; i
++) {
498 if (rows
[i
] == active_post_id
) {
505 if (mode
== "next") {
509 cdmExpandArticle(next_id
);
510 cdmScrollToArticleId(next_id
);
513 correctHeadlinesOffset(next_id
);
514 view(next_id
, getActiveFeedId());
519 if (mode
== "prev") {
522 cdmExpandArticle(prev_id
);
523 cdmScrollToArticleId(prev_id
);
525 correctHeadlinesOffset(prev_id
);
526 view(prev_id
, getActiveFeedId());
532 exception_error("moveToPost", e
);
536 function toggleSelected(id
, force_on
) {
539 var cb
= $("RCHK-" + id
);
540 var row
= $("RROW-" + id
);
543 if (row
.hasClassName('Selected') && !force_on
) {
544 row
.removeClassName('Selected');
545 if (cb
) cb
.checked
= false;
547 row
.addClassName('Selected');
548 if (cb
) cb
.checked
= true;
552 exception_error("toggleSelected", e
);
556 function toggleUnread_afh(effect
) {
559 var elem
= effect
.element
;
560 elem
.style
.backgroundColor
= "";
563 exception_error("toggleUnread_afh", e
);
567 function toggleUnread(id
, cmode
, effect
) {
570 var row
= $("RROW-" + id
);
572 if (cmode
== undefined || cmode
== 2) {
573 if (row
.hasClassName("Unread")) {
574 row
.removeClassName("Unread");
577 new Effect
.Highlight(row
, {duration
: 1, startcolor
: "#fff7d5",
578 afterFinish
: toggleUnread_afh
,
579 queue
: { position
:'end', scope
: 'TMRQ-' + id
, limit
: 1 } } );
583 row
.addClassName("Unread");
586 } else if (cmode
== 0) {
588 row
.removeClassName("Unread");
591 new Effect
.Highlight(row
, {duration
: 1, startcolor
: "#fff7d5",
592 afterFinish
: toggleUnread_afh
,
593 queue
: { position
:'end', scope
: 'TMRQ-' + id
, limit
: 1 } } );
596 } else if (cmode
== 1) {
597 row
.addClassName("Unread");
600 if (cmode
== undefined) cmode
= 2;
602 var query
= "?op=rpc&subop=catchupSelected" +
603 "&cmode=" + param_escape(cmode
) + "&ids=" + param_escape(id
);
605 // notify_progress("Loading, please wait...");
607 new Ajax
.Request("backend.php", {
609 onComplete: function(transport
) {
610 handle_rpc_json(transport
);
616 exception_error("toggleUnread", e
);
620 function selectionRemoveLabel(id
, ids
) {
623 if (!ids
) var ids
= getSelectedArticleIds2();
625 if (ids
.length
== 0) {
626 alert(__("No articles are selected."));
630 var query
= "?op=rpc&subop=removeFromLabel&ids=" +
631 param_escape(ids
.toString()) + "&lid=" + param_escape(id
);
635 new Ajax
.Request("backend.php", {
637 onComplete: function(transport
) {
638 handle_rpc_json(transport
);
639 show_labels_in_headlines(transport
);
643 exception_error("selectionAssignLabel", e
);
648 function selectionAssignLabel(id
, ids
) {
651 if (!ids
) ids
= getSelectedArticleIds2();
653 if (ids
.length
== 0) {
654 alert(__("No articles are selected."));
658 var query
= "?op=rpc&subop=assignToLabel&ids=" +
659 param_escape(ids
.toString()) + "&lid=" + param_escape(id
);
663 new Ajax
.Request("backend.php", {
665 onComplete: function(transport
) {
666 handle_rpc_json(transport
);
667 show_labels_in_headlines(transport
);
671 exception_error("selectionAssignLabel", e
);
676 function selectionToggleUnread(set_state
, callback
, no_error
) {
678 var rows
= getSelectedArticleIds2();
680 if (rows
.length
== 0 && !no_error
) {
681 alert(__("No articles are selected."));
685 for (i
= 0; i
< rows
.length
; i
++) {
686 var row
= $("RROW-" + rows
[i
]);
688 if (set_state
== undefined) {
689 if (row
.hasClassName("Unread")) {
690 row
.removeClassName("Unread");
692 row
.addClassName("Unread");
696 if (set_state
== false) {
697 row
.removeClassName("Unread");
700 if (set_state
== true) {
701 row
.addClassName("Unread");
706 if (rows
.length
> 0) {
710 if (set_state
== undefined) {
712 } else if (set_state
== true) {
714 } else if (set_state
== false) {
718 var query
= "?op=rpc&subop=catchupSelected" +
719 "&cmode=" + cmode
+ "&ids=" + param_escape(rows
.toString());
721 notify_progress("Loading, please wait...");
723 new Ajax
.Request("backend.php", {
725 onComplete: function(transport
) {
726 handle_rpc_json(transport
);
727 if (callback
) callback(transport
);
733 exception_error("selectionToggleUnread", e
);
737 function selectionToggleMarked() {
740 var rows
= getSelectedArticleIds2();
742 if (rows
.length
== 0) {
743 alert(__("No articles are selected."));
747 for (i
= 0; i
< rows
.length
; i
++) {
748 toggleMark(rows
[i
], true, true);
751 if (rows
.length
> 0) {
753 var query
= "?op=rpc&subop=markSelected&ids=" +
754 param_escape(rows
.toString()) + "&cmode=2";
756 new Ajax
.Request("backend.php", {
758 onComplete: function(transport
) {
759 handle_rpc_json(transport
);
765 exception_error("selectionToggleMarked", e
);
769 function selectionTogglePublished() {
772 var rows
= getSelectedArticleIds2();
774 if (rows
.length
== 0) {
775 alert(__("No articles are selected."));
779 for (i
= 0; i
< rows
.length
; i
++) {
780 togglePub(rows
[i
], true, true);
783 if (rows
.length
> 0) {
785 var query
= "?op=rpc&subop=publishSelected&ids=" +
786 param_escape(rows
.toString()) + "&cmode=2";
788 new Ajax
.Request("backend.php", {
790 onComplete: function(transport
) {
791 handle_rpc_json(transport
);
797 exception_error("selectionToggleMarked", e
);
801 function getSelectedArticleIds2() {
805 $$("#headlines-frame > div[id*=RROW][class*=Selected]").each(
807 rv
.push(child
.id
.replace("RROW-", ""));
813 function getLoadedArticleIds() {
816 var children
= $$("#headlines-frame > div[id*=RROW-]");
818 children
.each(function(child
) {
819 rv
.push(child
.id
.replace("RROW-", ""));
826 // mode = all,none,unread,invert
827 function selectArticles(mode
) {
830 var children
= $$("#headlines-frame > div[id*=RROW]");
832 children
.each(function(child
) {
833 var id
= child
.id
.replace("RROW-", "");
834 var cb
= $("RCHK-" + id
);
837 child
.addClassName("Selected");
839 } else if (mode
== "unread") {
840 if (child
.hasClassName("Unread")) {
841 child
.addClassName("Selected");
844 child
.removeClassName("Selected");
847 } else if (mode
== "invert") {
848 if (child
.hasClassName("Selected")) {
849 child
.removeClassName("Selected");
852 child
.addClassName("Selected");
857 child
.removeClassName("Selected");
863 exception_error("selectArticles", e
);
867 function catchupPage() {
869 var fn
= getFeedName(getActiveFeedId(), activeFeedIsCat());
871 var str
= __("Mark all visible articles in %s as read?");
873 str
= str
.replace("%s", fn
);
875 if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str
)) {
879 selectArticles('all');
880 selectionToggleUnread(false, 'viewCurrentFeed()', true)
881 selectArticles('none');
884 function deleteSelection() {
888 var rows
= getSelectedArticleIds2();
890 if (rows
.length
== 0) {
891 alert(__("No articles are selected."));
895 var fn
= getFeedName(getActiveFeedId(), activeFeedIsCat());
899 if (getActiveFeedId() != 0) {
900 str
= __("Delete %d selected articles in %s?");
902 str
= __("Delete %d selected articles?");
905 str
= str
.replace("%d", rows
.length
);
906 str
= str
.replace("%s", fn
);
908 if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str
)) {
912 query
= "?op=rpc&subop=delete&ids=" + param_escape(rows
);
916 new Ajax
.Request("backend.php", {
918 onComplete: function(transport
) {
919 handle_rpc_json(transport
);
924 exception_error("deleteSelection", e
);
928 function archiveSelection() {
932 var rows
= getSelectedArticleIds2();
934 if (rows
.length
== 0) {
935 alert(__("No articles are selected."));
939 var fn
= getFeedName(getActiveFeedId(), activeFeedIsCat());
943 if (getActiveFeedId() != 0) {
944 str
= __("Archive %d selected articles in %s?");
947 str
= __("Move %d archived articles back?");
951 str
= str
.replace("%d", rows
.length
);
952 str
= str
.replace("%s", fn
);
954 if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str
)) {
958 query
= "?op=rpc&subop="+op
+"&ids=" + param_escape(rows
);
962 for (var i
= 0; i
< rows
.length
; i
++) {
963 cache_delete("article:" + rows
[i
]);
966 new Ajax
.Request("backend.php", {
968 onComplete: function(transport
) {
969 handle_rpc_json(transport
);
974 exception_error("archiveSelection", e
);
978 function catchupSelection() {
982 var rows
= getSelectedArticleIds2();
984 if (rows
.length
== 0) {
985 alert(__("No articles are selected."));
989 var fn
= getFeedName(getActiveFeedId(), activeFeedIsCat());
991 var str
= __("Mark %d selected articles in %s as read?");
993 str
= str
.replace("%d", rows
.length
);
994 str
= str
.replace("%s", fn
);
996 if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str
)) {
1000 selectionToggleUnread(false, 'viewCurrentFeed()', true)
1003 exception_error("catchupSelection", e
);
1007 function editArticleTags(id
) {
1008 var query
= "backend.php?op=dlg&id=editArticleTags¶m=" + param_escape(id
);
1010 if (dijit
.byId("editTagsDlg"))
1011 dijit
.byId("editTagsDlg").destroyRecursive();
1013 dialog
= new dijit
.Dialog({
1015 title
: __("Edit article Tags"),
1016 style
: "width: 600px",
1017 execute: function() {
1018 if (this.validate()) {
1019 var query
= dojo
.objectToQuery(this.attr('value'));
1021 notify_progress("Saving article tags...", true);
1023 new Ajax
.Request("backend.php", {
1025 onComplete: function(transport
) {
1029 var data
= JSON
.parse(transport
.responseText
);
1032 var tags_str
= article
.tags
;
1033 var id
= tags_str
.id
;
1035 var tags
= $("ATSTR-" + id
);
1036 var tooltip
= dijit
.byId("ATSTRTIP-" + id
);
1038 if (tags
) tags
.innerHTML
= tags_str
.content
;
1039 if (tooltip
) tooltip
.attr('label', tags_str
.content_full
);
1041 cache_delete("article:" + id
);
1050 var tmph
= dojo
.connect(dialog
, 'onLoad', function() {
1051 dojo
.disconnect(tmph
);
1053 new Ajax
.Autocompleter('tags_str', 'tags_choices',
1054 "backend.php?op=rpc&subop=completeTags",
1055 { tokens
: ',', paramName
: "search" });
1062 function cdmScrollToArticleId(id
) {
1064 var ctr
= $("headlines-frame");
1065 var e
= $("RROW-" + id
);
1067 if (!e
|| !ctr
) return;
1069 ctr
.scrollTop
= e
.offsetTop
;
1072 exception_error("cdmScrollToArticleId", e
);
1076 function getActiveArticleId() {
1077 return active_post_id
;
1080 function postMouseIn(id
) {
1081 post_under_pointer
= id
;
1084 function postMouseOut(id
) {
1085 post_under_pointer
= false;
1088 function headlines_scroll_handler(e
) {
1090 var hsp
= $("headlines-spacer");
1092 if (!_infscroll_disable
) {
1093 if (hsp
&& (e
.scrollTop
+ e
.offsetHeight
> hsp
.offsetTop
) ||
1094 e
.scrollTop
+ e
.offsetHeight
> e
.scrollHeight
- 100) {
1096 hsp
.innerHTML
= "<img src='images/indicator_tiny.gif'> " +
1097 __("Loading, please wait...");
1099 loadMoreHeadlines();
1101 //viewNextFeedPage();
1104 if (hsp
) hsp
.innerHTML
= "";
1107 if (getInitParam("cdm_auto_catchup") == 1) {
1109 $$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
1111 if ($("headlines-frame").scrollTop
>
1112 (child
.offsetTop
+ child
.offsetHeight
/2)) {
1114 var id
= child
.id
.replace("RROW-", "");
1116 if (catchup_id_batch
.indexOf(id
) == -1)
1117 catchup_id_batch
.push(id
);
1121 if (catchup_id_batch
.length
> 0 && !_infscroll_request_sent
) {
1122 window
.clearTimeout(catchup_timeout_id
);
1123 catchup_timeout_id
= window
.setTimeout('catchupBatchedArticles()',
1129 console
.warn("headlines_scroll_handler: " + e
);
1133 function catchupBatchedArticles() {
1135 if (catchup_id_batch
.length
> 0 && !_infscroll_request_sent
) {
1137 var query
= "?op=rpc&subop=catchupSelected" +
1138 "&cmode=0&ids=" + param_escape(catchup_id_batch
.toString());
1140 new Ajax
.Request("backend.php", {
1142 onComplete: function(transport
) {
1143 handle_rpc_json(transport
);
1145 catchup_id_batch
.each(function(id
) {
1146 var elem
= $("RROW-" + id
);
1147 if (elem
) elem
.removeClassName("Unread");
1150 catchup_id_batch
= [];
1155 exception_error("catchupBatchedArticles", e
);
1159 function catchupRelativeToArticle(below
) {
1164 if (!getActiveArticleId()) {
1165 alert(__("No article is selected."));
1169 var visible_ids
= getVisibleArticleIds();
1171 var ids_to_mark
= new Array();
1174 for (var i
= 0; i
< visible_ids
.length
; i
++) {
1175 if (visible_ids
[i
] != getActiveArticleId()) {
1176 var e
= $("RROW-" + visible_ids
[i
]);
1178 if (e
&& e
.hasClassName("Unread")) {
1179 ids_to_mark
.push(visible_ids
[i
]);
1186 for (var i
= visible_ids
.length
-1; i
>= 0; i
--) {
1187 if (visible_ids
[i
] != getActiveArticleId()) {
1188 var e
= $("RROW-" + visible_ids
[i
]);
1190 if (e
&& e
.hasClassName("Unread")) {
1191 ids_to_mark
.push(visible_ids
[i
]);
1199 if (ids_to_mark
.length
== 0) {
1200 alert(__("No articles found to mark"));
1202 var msg
= __("Mark %d article(s) as read?").replace("%d", ids_to_mark
.length
);
1204 if (getInitParam("confirm_feed_catchup") != 1 || confirm(msg
)) {
1206 for (var i
= 0; i
< ids_to_mark
.length
; i
++) {
1207 var e
= $("RROW-" + ids_to_mark
[i
]);
1208 e
.removeClassName("Unread");
1211 var query
= "?op=rpc&subop=catchupSelected" +
1212 "&cmode=0" + "&ids=" + param_escape(ids_to_mark
.toString());
1214 new Ajax
.Request("backend.php", {
1216 onComplete: function(transport
) {
1217 handle_rpc_json(transport
);
1224 exception_error("catchupRelativeToArticle", e
);
1228 function cdmExpandArticle(id
) {
1233 var elem
= $("CICD-" + active_post_id
);
1235 var upd_img_pic
= $("FUPDPIC-" + id
);
1237 if (upd_img_pic
&& (upd_img_pic
.src
.match("updated.png") ||
1238 upd_img_pic
.src
.match("fresh_sign.png"))) {
1240 upd_img_pic
.src
= "images/blank_icon.gif";
1243 if (id
== active_post_id
&& Element
.visible(elem
))
1246 selectArticles("none");
1248 var old_offset
= $("RROW-" + id
).offsetTop
;
1250 if (active_post_id
&& elem
&& !getInitParam("cdm_expanded")) {
1252 Element
.show("CEXC-" + active_post_id
);
1255 active_post_id
= id
;
1257 elem
= $("CICD-" + id
);
1259 if (!Element
.visible(elem
)) {
1261 Element
.hide("CEXC-" + id
);
1263 if ($("CWRAP-" + id
).innerHTML
== "") {
1265 $("FUPDPIC-" + id
).src
= "images/indicator_tiny.gif";
1267 $("CWRAP-" + id
).innerHTML
= "<div class=\"insensitive\">" +
1268 __("Loading, please wait...") + "</div>";
1270 var query
= "?op=rpc&subop=cdmGetArticle&id=" + param_escape(id
);
1272 var neighbor_ids
= getRelativePostIds(id
);
1274 /* only request uncached articles */
1275 var cids_to_request
= [];
1277 for (var i
= 0; i
< neighbor_ids
.length
; i
++) {
1278 if (cids_requested
.indexOf(neighbor_ids
[i
]) == -1)
1279 if ($("CWRAP-" + neighbor_ids
[i
]).innerHTML
== "") {
1280 cids_to_request
.push(neighbor_ids
[i
]);
1281 cids_requested
.push(neighbor_ids
[i
]);
1285 console
.log("additional ids: " + cids_to_request
.toString());
1287 query
= query
+ "&cids=" + cids_to_request
.toString();
1291 new Ajax
.Request("backend.php", {
1293 onComplete: function(transport
) {
1295 $("FUPDPIC-" + id
).src
= 'images/blank_icon.gif';
1297 handle_rpc_json(transport
);
1299 var reply
= JSON
.parse(transport
.responseText
);
1301 reply
.each(function(article
) {
1302 $("CWRAP-" + article
['id']).innerHTML
= article
['content']
1303 cids_requested
.remove(article
['id']);
1310 var new_offset
= $("RROW-" + id
).offsetTop
;
1312 $("headlines-frame").scrollTop
+= (new_offset
-old_offset
);
1314 if ($("RROW-" + id
).offsetTop
!= old_offset
)
1315 $("headlines-frame").scrollTop
= new_offset
;
1317 toggleUnread(id
, 0, true);
1321 exception_error("cdmExpandArticle", e
);
1327 function fixHeadlinesOrder(ids
) {
1329 for (var i
= 0; i
< ids
.length
; i
++) {
1330 var e
= $("RROW-" + ids
[i
]);
1334 e
.removeClassName("even");
1335 e
.addClassName("odd");
1337 e
.removeClassName("odd");
1338 e
.addClassName("even");
1343 exception_error("fixHeadlinesOrder", e
);
1347 function getArticleUnderPointer() {
1348 return post_under_pointer
;
1351 function zoomToArticle(event
, id
) {
1353 var cached_article
= cache_get("article: " + id
);
1355 if (dijit
.byId("ATAB-" + id
))
1356 if (!event
|| !event
.shiftKey
)
1357 return dijit
.byId("content-tabs").selectChild(dijit
.byId("ATAB-" + id
));
1359 if (dijit
.byId("ATSTRTIP-" + id
))
1360 dijit
.byId("ATSTRTIP-" + id
).destroyRecursive();
1362 if (cached_article
) {
1363 //closeArticlePanel();
1365 var article_pane
= new dijit
.layout
.ContentPane({
1366 title
: __("Loading...") , content
: cached_article
,
1367 style
: 'padding : 0px;',
1371 dijit
.byId("content-tabs").addChild(article_pane
);
1373 if (!event
|| !event
.shiftKey
)
1374 dijit
.byId("content-tabs").selectChild(article_pane
);
1376 if ($("PTITLE-" + id
))
1377 article_pane
.attr('title', $("PTITLE-" + id
).innerHTML
);
1381 var query
= "?op=rpc&subop=getArticles&ids=" + param_escape(id
);
1383 notify_progress("Loading, please wait...", true);
1385 new Ajax
.Request("backend.php", {
1387 onComplete: function(transport
) {
1390 var reply
= JSON
.parse(transport
.responseText
);
1393 //closeArticlePanel();
1395 var content
= reply
[0]['content'];
1397 var article_pane
= new dijit
.layout
.ContentPane({
1398 title
: "article-" + id
, content
: content
,
1399 style
: 'padding : 0px;',
1403 dijit
.byId("content-tabs").addChild(article_pane
);
1405 if (!event
|| !event
.shiftKey
)
1406 dijit
.byId("content-tabs").selectChild(article_pane
);
1408 if ($("PTITLE-" + id
))
1409 article_pane
.attr('title', $("PTITLE-" + id
).innerHTML
);
1416 exception_error("zoomToArticle", e
);
1420 function scrollArticle(offset
) {
1423 var ci
= $("content-insert");
1425 ci
.scrollTop
+= offset
;
1428 var hi
= $("headlines-frame");
1430 hi
.scrollTop
+= offset
;
1435 exception_error("scrollArticle", e
);
1439 function show_labels_in_headlines(transport
) {
1441 var data
= JSON
.parse(transport
.responseText
);
1444 data
['info-for-headlines'].each(function(elem
) {
1445 var ctr
= $("HLLCTR-" + elem
.id
);
1447 if (ctr
) ctr
.innerHTML
= elem
.labels
;
1450 cache_headlines(getActiveFeedId(), activeFeedIsCat(), null, $("headlines-frame").innerHTML
);
1454 exception_error("show_labels_in_headlines", e
);
1458 /* function toggleHeadlineActions() {
1460 var e = $("headlineActionsBody");
1461 var p = $("headlineActionsDrop");
1463 if (!Element.visible(e)) {
1470 e.style.left = (p.offsetLeft + 1) + "px";
1471 e.style.top = (p.offsetTop + p.offsetHeight + 2) + "px";
1474 exception_error("toggleHeadlineActions", e);
1478 /* function publishWithNote(id, def_note) {
1480 if (!def_note) def_note = '';
1482 var note = prompt(__("Please enter a note for this article:"), def_note);
1484 if (note != undefined) {
1485 togglePub(id, false, false, note);
1489 exception_error("publishWithNote", e);
1493 function emailArticle(id
) {
1496 var ids
= getSelectedArticleIds2();
1498 if (ids
.length
== 0) {
1499 alert(__("No articles are selected."));
1503 id
= ids
.toString();
1506 if (dijit
.byId("emailArticleDlg"))
1507 dijit
.byId("emailArticleDlg").destroyRecursive();
1509 var query
= "backend.php?op=dlg&id=emailArticle¶m=" + param_escape(id
);
1511 dialog
= new dijit
.Dialog({
1512 id
: "emailArticleDlg",
1513 title
: __("Forward article by email"),
1514 style
: "width: 600px",
1515 execute: function() {
1516 if (this.validate()) {
1518 new Ajax
.Request("backend.php", {
1519 parameters
: dojo
.objectToQuery(this.attr('value')),
1520 onComplete: function(transport
) {
1522 var reply
= JSON
.parse(transport
.responseText
);
1524 var error
= reply
['error'];
1527 alert(__('Error sending email:') + ' ' + error
);
1529 notify_info('Your message has been sent.');
1538 var tmph
= dojo
.connect(dialog
, 'onLoad', function() {
1539 dojo
.disconnect(tmph
);
1541 new Ajax
.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices',
1542 "backend.php?op=rpc&subop=completeEmails",
1543 { tokens
: '', paramName
: "search" });
1548 /* displayDlg('emailArticle', id,
1550 document.forms['article_email_form'].destination.focus();
1552 new Ajax.Autocompleter('destination', 'destination_choices',
1553 "backend.php?op=rpc&subop=completeEmails",
1554 { tokens: '', paramName: "search" });
1559 exception_error("emailArticle", e
);
1563 function dismissArticle(id
) {
1565 var elem
= $("RROW-" + id
);
1567 toggleUnread(id
, 0, true);
1569 new Effect
.Fade(elem
, {duration
: 0.5});
1571 active_post_id
= false;
1574 exception_error("dismissArticle", e
);
1578 function dismissSelectedArticles() {
1581 var ids
= getVisibleArticleIds();
1585 for (var i
= 0; i
< ids
.length
; i
++) {
1586 var elem
= $("RROW-" + ids
[i
]);
1588 if (elem
.className
&& elem
.hasClassName("Selected") &&
1589 ids
[i
] != active_post_id
) {
1590 new Effect
.Fade(elem
, {duration
: 0.5});
1598 selectionToggleUnread(false);
1600 fixHeadlinesOrder(tmp
);
1603 exception_error("dismissSelectedArticles", e
);
1607 function dismissReadArticles() {
1610 var ids
= getVisibleArticleIds();
1613 for (var i
= 0; i
< ids
.length
; i
++) {
1614 var elem
= $("RROW-" + ids
[i
]);
1616 if (elem
.className
&& !elem
.hasClassName("Unread") &&
1617 !elem
.hasClassName("Selected")) {
1619 new Effect
.Fade(elem
, {duration
: 0.5});
1625 fixHeadlinesOrder(tmp
);
1628 exception_error("dismissSelectedArticles", e
);
1632 function getVisibleArticleIds() {
1637 getLoadedArticleIds().each(function(id
) {
1638 var elem
= $("RROW-" + id
);
1639 if (elem
&& Element
.visible(elem
))
1644 exception_error("getVisibleArticleIds", e
);
1650 function cdmClicked(event
, id
) {
1652 var shift_key
= event
.shiftKey
;
1656 if (!event
.ctrlKey
) {
1658 if (!getInitParam("cdm_expanded")) {
1659 return cdmExpandArticle(id
);
1662 selectArticles("none");
1665 var elem
= $("RROW-" + id
);
1668 elem
.removeClassName("Unread");
1670 var upd_img_pic
= $("FUPDPIC-" + id
);
1672 if (upd_img_pic
&& (upd_img_pic
.src
.match("updated.png") ||
1673 upd_img_pic
.src
.match("fresh_sign.png"))) {
1675 upd_img_pic
.src
= "images/blank_icon.gif";
1678 active_post_id
= id
;
1680 var query
= "?op=rpc&subop=catchupSelected" +
1681 "&cmode=0&ids=" + param_escape(id
);
1683 new Ajax
.Request("backend.php", {
1685 onComplete: function(transport
) {
1686 handle_rpc_json(transport
);
1693 toggleSelected(id
, true);
1694 toggleUnread(id
, 0, false);
1695 zoomToArticle(event
, id
);
1699 exception_error("cdmClicked");
1705 function postClicked(event
, id
) {
1708 if (!event
.ctrlKey
) {
1711 postOpenInNewTab(event
, id
);
1716 exception_error("postClicked");
1720 function hlOpenInNewTab(event
, id
) {
1721 toggleUnread(id
, 0, false);
1722 zoomToArticle(event
, id
);
1725 function postOpenInNewTab(event
, id
) {
1726 closeArticlePanel(id
);
1727 zoomToArticle(event
, id
);
1730 function hlClicked(event
, id
) {
1732 if (event
.which
== 2) {
1735 } else if (event
.altKey
) {
1736 openArticleInNewWindow(id
);
1737 } else if (!event
.ctrlKey
) {
1742 toggleUnread(id
, 0, false);
1743 zoomToArticle(event
, id
);
1748 exception_error("hlClicked");
1752 function getFirstVisibleHeadlineId() {
1753 var rows
= getVisibleArticleIds();
1758 function getLastVisibleHeadlineId() {
1759 var rows
= getVisibleArticleIds();
1760 return rows
[rows
.length
-1];
1763 function openArticleInNewWindow(id
) {
1764 toggleUnread(id
, 0, false);
1765 window
.open("backend.php?op=la&id=" + id
);
1768 function isCdmMode() {
1769 return getInitParam("combined_display_mode");
1772 function markHeadline(id
) {
1773 var row
= $("RROW-" + id
);
1775 var check
= $("RCHK-" + id
);
1778 check
.checked
= true;
1781 row
.addClassName("Selected");
1785 function getRelativePostIds(id
, limit
) {
1791 if (!limit
) limit
= 6; //3
1793 var ids
= getVisibleArticleIds();
1795 for (var i
= 0; i
< ids
.length
; i
++) {
1797 for (var k
= 1; k
<= limit
; k
++) {
1798 //if (i > k-1) tmp.push(ids[i-k]);
1799 if (i
< ids
.length
-k
) tmp
.push(ids
[i
+k
]);
1806 exception_error("getRelativePostIds", e
);
1812 function correctHeadlinesOffset(id
) {
1816 var container
= $("headlines-frame");
1817 var row
= $("RROW-" + id
);
1819 var viewport
= container
.offsetHeight
;
1821 var rel_offset_top
= row
.offsetTop
- container
.scrollTop
;
1822 var rel_offset_bottom
= row
.offsetTop
+ row
.offsetHeight
- container
.scrollTop
;
1824 //console.log("Rtop: " + rel_offset_top + " Rbtm: " + rel_offset_bottom);
1825 //console.log("Vport: " + viewport);
1827 if (rel_offset_top
<= 0 || rel_offset_top
> viewport
) {
1828 container
.scrollTop
= row
.offsetTop
;
1829 } else if (rel_offset_bottom
> viewport
) {
1831 /* doesn't properly work with Opera in some cases because
1832 Opera fucks up element scrolling */
1834 container
.scrollTop
= row
.offsetTop
+ row
.offsetHeight
- viewport
;
1838 exception_error("correctHeadlinesOffset", e
);
1843 function headlineActionsChange(elem
) {
1846 elem
.attr('value', 'false');
1848 exception_error("headlineActionsChange", e
);
1852 function closeArticlePanel() {
1854 var tabs
= dijit
.byId("content-tabs");
1855 var child
= tabs
.selectedChildWidget
;
1857 if (child
&& tabs
.getIndexOfChild(child
) > 0) {
1858 tabs
.removeChild(child
);
1861 if (dijit
.byId("content-insert"))
1862 dijit
.byId("headlines-wrap-inner").removeChild(
1863 dijit
.byId("content-insert"));
1867 function initHeadlinesMenu() {
1869 if (dijit
.byId("headlinesMenu"))
1870 dijit
.byId("headlinesMenu").destroyRecursive();
1875 nodes
= $$("#headlines-frame > div[id*=RROW]");
1877 nodes
= $$("#headlines-frame span[id*=RTITLE]");
1880 nodes
.each(function(node
) {
1884 var menu
= new dijit
.Menu({
1885 id
: "headlinesMenu",
1889 var tmph
= dojo
.connect(menu
, '_openMyself', function (event
) {
1890 var callerNode
= event
.target
, match
= null, tries
= 0;
1892 while (match
== null && callerNode
&& tries
<= 3) {
1893 match
= callerNode
.id
.match("^[A-Z]+[-]([0-9]+)$");
1894 callerNode
= callerNode
.parentNode
;
1898 if (match
) this.callerRowId
= parseInt(match
[1]);
1902 /* if (!isCdmMode())
1903 menu.addChild(new dijit.MenuItem({
1904 label: __("View article"),
1905 onClick: function(event) {
1906 view(this.getParent().callerRowId);
1909 menu
.addChild(new dijit
.MenuItem({
1910 label
: __("Open original article"),
1911 onClick: function(event
) {
1912 openArticleInNewWindow(this.getParent().callerRowId
);
1915 menu
.addChild(new dijit
.MenuItem({
1916 label
: __("View in a tt-rss tab"),
1917 onClick: function(event
) {
1918 hlOpenInNewTab(event
, this.getParent().callerRowId
);
1921 // menu.addChild(new dijit.MenuSeparator());
1923 var labels
= dijit
.byId("feedTree").model
.getItemsInCategory(-2);
1927 menu
.addChild(new dijit
.MenuSeparator());
1929 var labelAddMenu
= new dijit
.Menu({ownerMenu
: menu
});
1930 var labelDelMenu
= new dijit
.Menu({ownerMenu
: menu
});
1932 labels
.each(function(label
) {
1933 var id
= label
.id
[0];
1934 var bare_id
= id
.substr(id
.indexOf(":")+1);
1935 var name
= label
.name
[0];
1937 bare_id
= -11-bare_id
;
1939 labelAddMenu
.addChild(new dijit
.MenuItem({
1942 onClick: function(event
) {
1943 selectionAssignLabel(this.labelId
,
1944 [this.getParent().ownerMenu
.callerRowId
]);
1947 labelDelMenu
.addChild(new dijit
.MenuItem({
1950 onClick: function(event
) {
1951 selectionRemoveLabel(this.labelId
,
1952 [this.getParent().ownerMenu
.callerRowId
]);
1957 menu
.addChild(new dijit
.PopupMenuItem({
1958 label
: __("Assign label"),
1959 popup
: labelAddMenu
,
1962 menu
.addChild(new dijit
.PopupMenuItem({
1963 label
: __("Remove label"),
1964 popup
: labelDelMenu
,
1972 exception_error("initHeadlinesMenu", e
);
1976 function tweetArticle(id
) {
1978 var query
= "?op=rpc&subop=getTweetInfo&id=" + param_escape(id
);
1983 var ts
= d
.getTime();
1985 var w
= window
.open('backend.php?op=loading', 'ttrss_tweet',
1986 "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
1988 new Ajax
.Request("backend.php", {
1990 onComplete: function(transport
) {
1991 var ti
= JSON
.parse(transport
.responseText
);
1993 var share_url
= "http://twitter.com/share?_=" + ts
+
1994 "&text=" + param_escape(ti
.title
) +
1995 "&url=" + param_escape(ti
.link
);
1997 w
.location
.href
= share_url
;
2003 exception_error("tweetArticle", e
);
2007 function editArticleNote(id
) {
2010 var query
= "backend.php?op=dlg&id=editArticleNote¶m=" + param_escape(id
);
2012 if (dijit
.byId("editNoteDlg"))
2013 dijit
.byId("editNoteDlg").destroyRecursive();
2015 dialog
= new dijit
.Dialog({
2017 title
: __("Edit article note"),
2018 style
: "width: 600px",
2019 execute: function() {
2020 if (this.validate()) {
2021 var query
= dojo
.objectToQuery(this.attr('value'));
2023 notify_progress("Saving article note...", true);
2025 new Ajax
.Request("backend.php", {
2027 onComplete: function(transport
) {
2031 var reply
= JSON
.parse(transport
.responseText
);
2033 cache_delete("article:" + id
);
2035 var elem
= $("POSTNOTE-" + id
);
2039 elem
.innerHTML
= reply
.note
;
2041 if (reply
.raw_length
!= 0)
2042 new Effect
.Appear(elem
);
2054 exception_error("editArticleNote", e
);
2058 function player(elem
) {
2059 var aid
= elem
.getAttribute("audio-id");
2060 var status
= elem
.getAttribute("status");
2068 elem
.innerHTML
= __("Playing...");
2069 elem
.title
= __("Click to pause");
2070 elem
.addClassName("playing");
2074 elem
.innerHTML
= __("Play");
2075 elem
.title
= __("Click to play");
2076 elem
.removeClassName("playing");
2079 elem
.setAttribute("status", status
);
2081 alert("Your browser doesn't seem to support HTML5 audio.");
2085 function cache_set(id
, obj
) {
2086 //console.log("cache_set: " + id);
2089 sessionStorage
[id
] = obj
;
2091 sessionStorage
.clear();
2095 function cache_get(id
) {
2097 return sessionStorage
[id
];
2100 function cache_clear() {
2102 sessionStorage
.clear();
2105 function cache_delete(id
) {
2107 sessionStorage
.removeItem(id
);
2110 function cache_headlines(feed
, is_cat
, toolbar_obj
, content_obj
) {
2111 if (toolbar_obj
&& content_obj
) {
2112 cache_set("feed:" + feed
+ ":" + is_cat
,
2113 JSON
.stringify({toolbar
: toolbar_obj
, content
: content_obj
}));
2116 obj
= cache_get("feed:" + feed
+ ":" + is_cat
);
2119 obj
= JSON
.parse(obj
);
2121 if (toolbar_obj
) obj
.toolbar
= toolbar_obj
;
2122 if (content_obj
) obj
.content
= content_obj
;
2124 cache_set("feed:" + feed
+ ":" + is_cat
, JSON
.stringify(obj
));
2128 console
.warn("cache_headlines failed: " + e
);
2133 function render_local_headlines(feed
, is_cat
, obj
) {
2136 dijit
.byId("headlines-toolbar").attr('content',
2139 dijit
.byId("headlines-frame").attr('content',
2142 dojo
.parser
.parse('headlines-toolbar');
2144 $("headlines-frame").scrollTop
= 0;
2145 selectArticles('none');
2146 setActiveFeedId(feed
, is_cat
);
2147 initHeadlinesMenu();
2149 precache_headlines();
2152 exception_error("render_local_headlines", e
);
2156 function precache_headlines_idle() {
2158 if (!feed_precache_timeout_id
) {
2159 var feeds
= dijit
.byId("feedTree").getVisibleUnreadFeeds();
2162 feeds
.each(function(item
) {
2163 if (parseInt(item
[0]) > 0 && !cache_get("feed:" + item
[0] + ":" + item
[1]))
2164 uncached
.push(item
);
2167 if (uncached
.length
> 0) {
2168 var rf
= uncached
[Math
.floor(Math
.random()*uncached
.length
)];
2169 viewfeed(rf
[0], '', rf
[1], 0, true);
2172 precache_idle_timeout_id
= setTimeout("precache_headlines_idle()", 5000);
2175 exception_error("precache_headlines_idle", e
);
2179 function precache_headlines() {
2182 if (!feed_precache_timeout_id
) {
2183 feed_precache_timeout_id
= window
.setTimeout(function() {
2184 var nuf
= getNextUnreadFeed(getActiveFeedId(), activeFeedIsCat());
2185 var nf
= dijit
.byId("feedTree").getNextFeed(getActiveFeedId(), activeFeedIsCat());
2187 if (nuf
&& !cache_get("feed:" + nuf
+ ":" + activeFeedIsCat()))
2188 viewfeed(nuf
, '', activeFeedIsCat(), 0, true);
2190 if (nf
!= nuf
&& nf
&& !cache_get("feed:" + nf
[0] + ":" + nf
[1]))
2191 viewfeed(nf
[0], '', nf
[1], 0, true);
2193 window
.setTimeout(function() {
2194 feed_precache_timeout_id
= false;
2200 exception_error("precache_headlines", e
);
2204 function shareArticle(id
) {
2206 if (dijit
.byId("shareArticleDlg"))
2207 dijit
.byId("shareArticleDlg").destroyRecursive();
2209 var query
= "backend.php?op=dlg&id=shareArticle¶m=" + param_escape(id
);
2211 dialog
= new dijit
.Dialog({
2212 id
: "shareArticleDlg",
2213 title
: __("Share article by URL"),
2214 style
: "width: 600px",
2220 exception_error("emailArticle", e
);