if (data) {
data['info-for-headlines'].each(function(elem) {
- var ctr = $("HLLCTR-" + elem.id);
-
- if (ctr) ctr.innerHTML = elem.labels;
+ $$(".HLLCTR-" + elem.id).each(function(ctr) {
+ ctr.innerHTML = elem.labels;
+ });
});
}
} catch (e) {
dijit.byId("content-insert"));
}
-function initHeadlinesMenu() {
+function initFloatingMenu() {
try {
- 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("floatingMenu"))
+ dijit.byId("floatingMenu").destroyRecursive();
- var menu = new dijit.Menu({
- id: "headlinesMenu",
- targetNodeIds: ids,
- });
+ var menu = new dijit.Menu({
+ id: "floatingMenu",
+ targetNodeIds: ["floatingTitle"]
+ });
- var tmph = dojo.connect(menu, '_openMyself', function (event) {
- var callerNode = event.target, match = null, tries = 0;
+ var id = $("floatingTitle").getAttribute("rowid").replace("RROW-", "");
- while (match == null && callerNode && tries <= 3) {
- match = callerNode.id.match("^[A-Z]+[-]([0-9]+)$");
- callerNode = callerNode.parentNode;
- ++tries;
- }
+ headlinesMenuCommon(menu, id);
- if (match) this.callerRowId = parseInt(match[1]);
-
- });
+ menu.startup();
+ } catch (e) {
+ exception_error("initFloatingMenu", e);
+ }
+}
-/* if (!isCdmMode())
- menu.addChild(new dijit.MenuItem({
- label: __("View article"),
- onClick: function(event) {
- view(this.getParent().callerRowId);
- }})); */
+function headlinesMenuCommon(menu, base_id) {
+ try {
menu.addChild(new dijit.MenuItem({
label: __("Open original article"),
onClick: function(event) {
- openArticleInNewWindow(this.getParent().callerRowId);
+ openArticleInNewWindow(base_id ? base_id : this.getParent().callerRowId);
}}));
menu.addChild(new dijit.MenuItem({
label: __("Display article URL"),
onClick: function(event) {
- displayArticleUrl(this.getParent().callerRowId);
+ displayArticleUrl(base_id ? base_id : this.getParent().callerRowId);
}}));
menu.addChild(new dijit.MenuSeparator());
onClick: function(event) {
var ids = getSelectedArticleIds2();
// cast to string
- var id = this.getParent().callerRowId + "";
+ var id = (base_id ? base_id : this.getParent().callerRowId) + "";
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
selectionToggleUnread(undefined, false, true, ids);
onClick: function(event) {
var ids = getSelectedArticleIds2();
// cast to string
- var id = this.getParent().callerRowId + "";
+ var id = (base_id ? base_id : this.getParent().callerRowId) + "";
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
selectionToggleMarked(undefined, false, true, ids);
onClick: function(event) {
var ids = getSelectedArticleIds2();
// cast to string
- var id = this.getParent().callerRowId + "";
+ var id = (base_id ? base_id : this.getParent().callerRowId) + "";
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
selectionTogglePublished(undefined, false, true, ids);
menu.addChild(new dijit.MenuItem({
label: __("Mark above as read"),
onClick: function(event) {
- catchupRelativeToArticle(0, this.getParent().callerRowId);
+ catchupRelativeToArticle(0, base_id ? base_id : this.getParent().callerRowId);
}}));
menu.addChild(new dijit.MenuItem({
label: __("Mark below as read"),
onClick: function(event) {
- catchupRelativeToArticle(1, this.getParent().callerRowId);
+ catchupRelativeToArticle(1, base_id ? base_id : this.getParent().callerRowId);
}}));
onClick: function(event) {
var ids = getSelectedArticleIds2();
// cast to string
- var id = this.getParent().ownerMenu.callerRowId + "";
+ var id = (base_id ? base_id : this.getParent().ownerMenu.callerRowId) + "";
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
onClick: function(event) {
var ids = getSelectedArticleIds2();
// cast to string
- var id = this.getParent().ownerMenu.callerRowId + "";
+ var id = (base_id ? base_id : this.getParent().ownerMenu.callerRowId) + "";
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
}
+
+ } catch (e) {
+ exception_error("headlinesMenuCommon", e);
+ }
+}
+
+function initHeadlinesMenu() {
+ try {
+ 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);
+ });
+
+ var menu = new dijit.Menu({
+ id: "headlinesMenu",
+ 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.id.match("^[A-Z]+[-]([0-9]+)$");
+ callerNode = callerNode.parentNode;
+ ++tries;
+ }
+
+ if (match) this.callerRowId = parseInt(match[1]);
+
+ });
+
+ headlinesMenuCommon(menu, false);
+
menu.startup();
} catch (e) {
$("floatingTitle").innerHTML = header.innerHTML;
$("floatingTitle").firstChild.innerHTML = "<img class='anchor markedPic' src='images/page_white_go.png' onclick=\"scrollToRowId('"+child.id+"')\">" + $("floatingTitle").firstChild.innerHTML;
+ initFloatingMenu();
+
PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
}