tmp.innerHTML = reply['headlines']['content'];
dojo.parser.parse(tmp);
- var new_rows = [];
-
while (tmp.hasChildNodes()) {
var row = tmp.removeChild(tmp.firstChild);
dijit.byId("headlines-frame").domNode.appendChild(row);
loaded_article_ids.push(row.id);
-
- if (!isCdmMode() || row.hasClassName("cdmFeedTitle")) {
- new_rows.push(row);
- } else if (isCdmMode()) {
- var titleWrap = $$("#" + row.id + " .titleWrap")[0];
-
- if (titleWrap) {
- new_rows.push(titleWrap);
- }
- }
}
}
markHeadline(ids[i]);
}
- initHeadlinesMenu(new_rows);
+ initHeadlinesMenu();
if (_infscroll_disable) {
hsp.innerHTML = "<a href='#' onclick='openNextUnreadFeed()'>" +
}
}
-function initHeadlinesMenu(append_rows) {
+function initHeadlinesMenu() {
try {
- if (!append_rows) {
-
- if (dijit.byId("headlinesMenu"))
- dijit.byId("headlinesMenu").destroyRecursive();
-
- var ids = [];
-
- if (!isCdmMode()) {
- nodes = $$("#headlines-frame > div[id*=RROW]");
- } else {
- nodes = $$("#headlines-frame span[id*=RTITLE]");
- }
-
- nodes.each(function (node) {
- ids.push(node.id);
- });
+ if (!dijit.byId("headlinesMenu")) {
var menu = new dijit.Menu({
id: "headlinesMenu",
- targetNodeIds: ids
+ targetNodeIds: ["headlines-frame"],
+ selector: ".hlMenuAttach"
});
var tmph = dojo.connect(menu, '_openMyself', function (event) {
headlinesMenuCommon(menu);
menu.startup();
-
- } else {
- var menu = dijit.byId("headlinesMenu");
-
- append_rows.each(function (row) {
- if (!row.hasClassName("cdmFeedTitle")) {
- menu.bindDomNode(row);
- }
- });
}
/* vgroup feed title menu */
- if (!append_rows) {
-
- var nodes = $$("#headlines-frame > div[class='cdmFeedTitle']");
- var ids = [];
+ if (!dijit.byId("headlinesFeedTitleMenu")) {
- nodes.each(function(node) {
- ids.push(node.id);
+ var menu = new dijit.Menu({
+ id: "headlinesFeedTitleMenu",
+ targetNodeIds: ["headlines-frame"],
+ selector: "div.cdmFeedTitle"
});
- if (ids.length > 0) {
- if (dijit.byId("headlinesFeedTitleMenu"))
- dijit.byId("headlinesFeedTitleMenu").destroyRecursive();
-
- var menu = new dijit.Menu({
- id: "headlinesFeedTitleMenu",
- targetNodeIds: ids
- });
-
- var tmph = dojo.connect(menu, '_openMyself', function (event) {
- var callerNode = event.target, match = null, tries = 0;
-
- while (match == null && callerNode && tries <= 3) {
- match = callerNode.getAttribute("data-feed-id")
- callerNode = callerNode.parentNode;
- ++tries;
- }
-
- if (match) this.callerRowId = match;
+ var tmph = dojo.connect(menu, '_openMyself', function (event) {
+ var callerNode = event.target, match = null, tries = 0;
- });
+ while (match == null && callerNode && tries <= 3) {
+ match = callerNode.getAttribute("data-feed-id")
+ callerNode = callerNode.parentNode;
+ ++tries;
+ }
- menu.addChild(new dijit.MenuItem({
- label: __("Select articles in group"),
- onClick: function (event) {
- selectArticles("all",
- "#headlines-frame > div[id*=RROW]" +
- "[data-orig-feed-id='" + menu.callerRowId + "']");
+ if (match) this.callerRowId = match;
- }
- }));
+ });
- menu.addChild(new dijit.MenuItem({
- label: __("Mark group as read"),
- onClick: function (event) {
- selectArticles("none");
- selectArticles("all",
- "#headlines-frame > div[id*=RROW]" +
- "[data-orig-feed-id='" + menu.callerRowId + "']");
+ menu.addChild(new dijit.MenuItem({
+ label: __("Select articles in group"),
+ onClick: function (event) {
+ selectArticles("all",
+ "#headlines-frame > div[id*=RROW]" +
+ "[data-orig-feed-id='" + menu.callerRowId + "']");
- catchupSelection();
- }
- }));
+ }
+ }));
- menu.addChild(new dijit.MenuItem({
- label: __("Mark feed as read"),
- onClick: function (event) {
- catchupFeedInGroup(menu.callerRowId);
- }
- }));
+ menu.addChild(new dijit.MenuItem({
+ label: __("Mark group as read"),
+ onClick: function (event) {
+ selectArticles("none");
+ selectArticles("all",
+ "#headlines-frame > div[id*=RROW]" +
+ "[data-orig-feed-id='" + menu.callerRowId + "']");
- menu.addChild(new dijit.MenuItem({
- label: __("Edit feed"),
- onClick: function (event) {
- editFeed(menu.callerRowId);
- }
- }));
+ catchupSelection();
+ }
+ }));
- menu.startup();
- }
- } else {
- var menu = dijit.byId("headlinesFeedTitleMenu");
+ menu.addChild(new dijit.MenuItem({
+ label: __("Mark feed as read"),
+ onClick: function (event) {
+ catchupFeedInGroup(menu.callerRowId);
+ }
+ }));
- append_rows.each(function (row) {
- if (row.hasClassName("cdmFeedTitle")) {
- menu.bindDomNode(row);
+ menu.addChild(new dijit.MenuItem({
+ label: __("Edit feed"),
+ onClick: function (event) {
+ editFeed(menu.callerRowId);
}
- });
+ }));
+
+ menu.startup();
}
} catch (e) {