mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 18:45:56 +00:00
some more eslint-related stuff
This commit is contained in:
@@ -632,7 +632,7 @@ class Feeds extends Handler_Protected {
|
|||||||
|
|
||||||
$tmp_content .= "</div>"; // cdmIntermediate
|
$tmp_content .= "</div>"; // cdmIntermediate
|
||||||
|
|
||||||
$tmp_content .= "<div class=\"cdmFooter\" onclick=\"cdmFooterClick(event)\">";
|
$tmp_content .= "<div class=\"cdmFooter\" onclick=\"event.stopPropagation()\">";
|
||||||
|
|
||||||
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
|
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
|
||||||
$tmp_content .= $p->hook_article_left_button($line);
|
$tmp_content .= $p->hook_article_left_button($line);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* global dijit, __ */
|
||||||
|
|
||||||
var loading_progress = 0;
|
var loading_progress = 0;
|
||||||
var sanity_check_done = false;
|
var sanity_check_done = false;
|
||||||
var init_params = {};
|
var init_params = {};
|
||||||
@@ -459,12 +461,7 @@ function loading_set_progress(p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function remove_splash() {
|
function remove_splash() {
|
||||||
|
Element.hide("overlay");
|
||||||
if (Element.visible("overlay")) {
|
|
||||||
console.log("about to remove splash, OMG!");
|
|
||||||
Element.hide("overlay");
|
|
||||||
console.log("removed splash!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function strip_tags(s) {
|
function strip_tags(s) {
|
||||||
@@ -850,9 +847,9 @@ function editFilterTest(query) {
|
|||||||
const result = JSON.parse(transport.responseText);
|
const result = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
if (result && dijit.byId("filterTestDlg") && dijit.byId("filterTestDlg").open) {
|
if (result && dijit.byId("filterTestDlg") && dijit.byId("filterTestDlg").open) {
|
||||||
test_dlg.results += result.size();
|
test_dlg.results += result.length;
|
||||||
|
|
||||||
console.log("got results:" + result.size());
|
console.log("got results:" + result.length);
|
||||||
|
|
||||||
$("prefFilterProgressMsg").innerHTML = __("Looking for articles (%d processed, %f found)...")
|
$("prefFilterProgressMsg").innerHTML = __("Looking for articles (%d processed, %f found)...")
|
||||||
.replace("%f", test_dlg.results)
|
.replace("%f", test_dlg.results)
|
||||||
@@ -860,7 +857,7 @@ function editFilterTest(query) {
|
|||||||
|
|
||||||
console.log(offset + " " + test_dlg.max_offset);
|
console.log(offset + " " + test_dlg.max_offset);
|
||||||
|
|
||||||
for (let i = 0; i < result.size(); i++) {
|
for (let i = 0; i < result.length; i++) {
|
||||||
const tmp = new Element("table");
|
const tmp = new Element("table");
|
||||||
tmp.innerHTML = result[i];
|
tmp.innerHTML = result[i];
|
||||||
dojo.parser.parse(tmp);
|
dojo.parser.parse(tmp);
|
||||||
@@ -1291,7 +1288,7 @@ function feedBrowser() {
|
|||||||
style: "width: 600px",
|
style: "width: 600px",
|
||||||
getSelectedFeedIds: function () {
|
getSelectedFeedIds: function () {
|
||||||
const list = $$("#browseFeedList li[id*=FBROW]");
|
const list = $$("#browseFeedList li[id*=FBROW]");
|
||||||
const selected = new Array();
|
const selected = [];
|
||||||
|
|
||||||
list.each(function (child) {
|
list.each(function (child) {
|
||||||
const id = child.id.replace("FBROW-", "");
|
const id = child.id.replace("FBROW-", "");
|
||||||
@@ -1305,7 +1302,7 @@ function feedBrowser() {
|
|||||||
},
|
},
|
||||||
getSelectedFeeds: function () {
|
getSelectedFeeds: function () {
|
||||||
const list = $$("#browseFeedList li.Selected");
|
const list = $$("#browseFeedList li.Selected");
|
||||||
const selected = new Array();
|
const selected = [];
|
||||||
|
|
||||||
list.each(function (child) {
|
list.each(function (child) {
|
||||||
const title = child.getElementsBySelector("span.fb_feedTitle")[0].innerHTML;
|
const title = child.getElementsBySelector("span.fb_feedTitle")[0].innerHTML;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
let init_params = new Array();
|
/* global dijit, __ */
|
||||||
|
|
||||||
|
let init_params = [];
|
||||||
|
|
||||||
let hotkey_prefix = false;
|
let hotkey_prefix = false;
|
||||||
let hotkey_prefix_pressed = false;
|
let hotkey_prefix_pressed = false;
|
||||||
|
|||||||
61
js/tt-rss.js
61
js/tt-rss.js
@@ -1,3 +1,5 @@
|
|||||||
|
/* global dijit, __ */
|
||||||
|
|
||||||
let global_unread = -1;
|
let global_unread = -1;
|
||||||
let hotkey_prefix = false;
|
let hotkey_prefix = false;
|
||||||
let hotkey_prefix_pressed = false;
|
let hotkey_prefix_pressed = false;
|
||||||
@@ -79,14 +81,6 @@ function updateFeedList() {
|
|||||||
id: "feedTree",
|
id: "feedTree",
|
||||||
}, "feedTree");
|
}, "feedTree");
|
||||||
|
|
||||||
/* var menu = new dijit.Menu({id: 'feedMenu'});
|
|
||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
|
||||||
label: "Simple menu item"
|
|
||||||
}));
|
|
||||||
|
|
||||||
// menu.bindDomNode(tree.domNode); */
|
|
||||||
|
|
||||||
var tmph = dojo.connect(dijit.byId('feedMenu'), '_openMyself', function (event) {
|
var tmph = dojo.connect(dijit.byId('feedMenu'), '_openMyself', function (event) {
|
||||||
console.log(dijit.getEnclosingWidget(event.target));
|
console.log(dijit.getEnclosingWidget(event.target));
|
||||||
dojo.disconnect(tmph);
|
dojo.disconnect(tmph);
|
||||||
@@ -603,8 +597,6 @@ function init_second_stage() {
|
|||||||
dijit.getEnclosingWidget(toolbar.order_by).attr('value',
|
dijit.getEnclosingWidget(toolbar.order_by).attr('value',
|
||||||
getInitParam("default_view_order_by"));
|
getInitParam("default_view_order_by"));
|
||||||
|
|
||||||
const feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
|
|
||||||
|
|
||||||
const hash_feed_id = hash_get('f');
|
const hash_feed_id = hash_get('f');
|
||||||
const hash_feed_is_cat = hash_get('c') == "1";
|
const hash_feed_is_cat = hash_get('c') == "1";
|
||||||
|
|
||||||
@@ -829,7 +821,7 @@ function rescoreCurrentFeed() {
|
|||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function() {
|
||||||
viewCurrentFeed();
|
viewCurrentFeed();
|
||||||
} });
|
} });
|
||||||
}
|
}
|
||||||
@@ -839,24 +831,15 @@ function hotkey_handler(e) {
|
|||||||
|
|
||||||
if (e.target.nodeName == "INPUT" || e.target.nodeName == "TEXTAREA") return;
|
if (e.target.nodeName == "INPUT" || e.target.nodeName == "TEXTAREA") return;
|
||||||
|
|
||||||
let keycode = false;
|
let keycode = e.which;
|
||||||
|
|
||||||
const cmdline = $('cmdline');
|
if (keycode == 27) { // escape and drop prefix
|
||||||
|
|
||||||
if (window.event) {
|
|
||||||
keycode = window.event.keyCode;
|
|
||||||
} else if (e) {
|
|
||||||
keycode = e.which;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keycode == 27) { // escape
|
|
||||||
hotkey_prefix = false;
|
hotkey_prefix = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keycode == 16) return; // ignore lone shift
|
if (keycode == 16 || keycode == 17) return; // ignore lone shift / ctrl
|
||||||
if (keycode == 17) return; // ignore lone ctrl
|
|
||||||
|
|
||||||
var hotkeys = getInitParam("hotkeys");
|
const hotkeys = getInitParam("hotkeys");
|
||||||
const keychar = String.fromCharCode(keycode).toLowerCase();
|
const keychar = String.fromCharCode(keycode).toLowerCase();
|
||||||
|
|
||||||
if (!hotkey_prefix && hotkeys[0].indexOf(keychar) != -1) {
|
if (!hotkey_prefix && hotkeys[0].indexOf(keychar) != -1) {
|
||||||
@@ -867,8 +850,8 @@ function hotkey_handler(e) {
|
|||||||
hotkey_prefix = keychar;
|
hotkey_prefix = keychar;
|
||||||
hotkey_prefix_pressed = ts;
|
hotkey_prefix_pressed = ts;
|
||||||
|
|
||||||
cmdline.innerHTML = keychar;
|
$("cmdline").innerHTML = keychar;
|
||||||
Element.show(cmdline);
|
Element.show("cmdline");
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
@@ -876,7 +859,7 @@ function hotkey_handler(e) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element.hide(cmdline);
|
Element.hide("cmdline");
|
||||||
|
|
||||||
let hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
|
let hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
|
||||||
|
|
||||||
@@ -890,7 +873,6 @@ function hotkey_handler(e) {
|
|||||||
hotkey_prefix = false;
|
hotkey_prefix = false;
|
||||||
|
|
||||||
let hotkey_action = false;
|
let hotkey_action = false;
|
||||||
var hotkeys = getInitParam("hotkeys");
|
|
||||||
|
|
||||||
for (const sequence in hotkeys[1]) {
|
for (const sequence in hotkeys[1]) {
|
||||||
if (sequence == hotkey) {
|
if (sequence == hotkey) {
|
||||||
@@ -958,22 +940,18 @@ function handle_rpc_json(transport, scheduled_call) {
|
|||||||
|
|
||||||
const seq = reply['seq'];
|
const seq = reply['seq'];
|
||||||
|
|
||||||
if (seq) {
|
if (get_seq() != seq) {
|
||||||
if (get_seq() != seq) {
|
console.log("[handle_rpc_json] sequence mismatch: " + seq +
|
||||||
console.log("[handle_rpc_json] sequence mismatch: " + seq +
|
" (want: " + get_seq() + ")");
|
||||||
" (want: " + get_seq() + ")");
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const message = reply['message'];
|
const message = reply['message'];
|
||||||
|
|
||||||
if (message) {
|
if (message == "UPDATE_COUNTERS") {
|
||||||
if (message == "UPDATE_COUNTERS") {
|
console.log("need to refresh counters...");
|
||||||
console.log("need to refresh counters...");
|
setInitParam("last_article_id", -1);
|
||||||
setInitParam("last_article_id", -1);
|
request_counters(true);
|
||||||
request_counters(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const counters = reply['counters'];
|
const counters = reply['counters'];
|
||||||
@@ -988,7 +966,8 @@ function handle_rpc_json(transport, scheduled_call) {
|
|||||||
|
|
||||||
if (netalert) netalert.hide();
|
if (netalert) netalert.hide();
|
||||||
|
|
||||||
} else if (netalert)
|
} else
|
||||||
|
if (netalert)
|
||||||
netalert.show();
|
netalert.show();
|
||||||
else
|
else
|
||||||
notify_error("Communication problem with server.");
|
notify_error("Communication problem with server.");
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* global dijit, __ */
|
||||||
|
|
||||||
let _active_article_id = 0;
|
let _active_article_id = 0;
|
||||||
|
|
||||||
let vgroup_last_feed = false;
|
let vgroup_last_feed = false;
|
||||||
@@ -607,7 +609,7 @@ function toggleSelected(id, force_on) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateSelectedPrompt() {
|
function updateSelectedPrompt() {
|
||||||
const count = getSelectedArticleIds2().size();
|
const count = getSelectedArticleIds2().length;
|
||||||
const elem = $("selected_prompt");
|
const elem = $("selected_prompt");
|
||||||
|
|
||||||
if (elem) {
|
if (elem) {
|
||||||
@@ -1148,7 +1150,7 @@ function headlines_scroll_handler(e) {
|
|||||||
const rows = $$("#headlines-frame > div[id*=RROW]");
|
const rows = $$("#headlines-frame > div[id*=RROW]");
|
||||||
|
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
var child = rows[i];
|
const child = rows[i];
|
||||||
|
|
||||||
if ($("headlines-frame").scrollTop <= child.offsetTop &&
|
if ($("headlines-frame").scrollTop <= child.offsetTop &&
|
||||||
child.offsetTop - $("headlines-frame").scrollTop < 100 &&
|
child.offsetTop - $("headlines-frame").scrollTop < 100 &&
|
||||||
@@ -1193,8 +1195,7 @@ function headlines_scroll_handler(e) {
|
|||||||
|
|
||||||
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
|
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
|
||||||
function(child) {
|
function(child) {
|
||||||
if (child.hasClassName("Unread") && $("headlines-frame").scrollTop >
|
if ($("headlines-frame").scrollTop > (child.offsetTop + child.offsetHeight/2)) {
|
||||||
(child.offsetTop + child.offsetHeight/2)) {
|
|
||||||
|
|
||||||
const id = child.getAttribute("data-article-id")
|
const id = child.getAttribute("data-article-id")
|
||||||
|
|
||||||
@@ -1207,7 +1208,7 @@ function headlines_scroll_handler(e) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (_infscroll_disable) {
|
if (_infscroll_disable) {
|
||||||
var child = $$("#headlines-frame div[id*=RROW]").last();
|
const child = $$("#headlines-frame div[id*=RROW]").last();
|
||||||
|
|
||||||
if (child && $("headlines-frame").scrollTop >
|
if (child && $("headlines-frame").scrollTop >
|
||||||
(child.offsetTop + child.offsetHeight - 50)) {
|
(child.offsetTop + child.offsetHeight - 50)) {
|
||||||
@@ -1281,7 +1282,7 @@ function catchupRelativeToArticle(below, id) {
|
|||||||
|
|
||||||
const visible_ids = getLoadedArticleIds();
|
const visible_ids = getLoadedArticleIds();
|
||||||
|
|
||||||
const ids_to_mark = new Array();
|
const ids_to_mark = [];
|
||||||
|
|
||||||
if (!below) {
|
if (!below) {
|
||||||
for (var i = 0; i < visible_ids.length; i++) {
|
for (var i = 0; i < visible_ids.length; i++) {
|
||||||
@@ -1391,7 +1392,7 @@ function cdmExpandArticle(id, noexpand) {
|
|||||||
const old_offset = row.offsetTop;
|
const old_offset = row.offsetTop;
|
||||||
|
|
||||||
if (getActiveArticleId() && elem && !getInitParam("cdm_expanded")) {
|
if (getActiveArticleId() && elem && !getInitParam("cdm_expanded")) {
|
||||||
var collapse = oldrow.select("span[class='collapseBtn']")[0];
|
let collapse = oldrow.select("span[class='collapseBtn']")[0];
|
||||||
|
|
||||||
Element.hide(elem);
|
Element.hide(elem);
|
||||||
Element.show("CEXC-" + getActiveArticleId());
|
Element.show("CEXC-" + getActiveArticleId());
|
||||||
@@ -1404,7 +1405,7 @@ function cdmExpandArticle(id, noexpand) {
|
|||||||
|
|
||||||
elem = $("CICD-" + id);
|
elem = $("CICD-" + id);
|
||||||
|
|
||||||
var collapse = row.select("span[class='collapseBtn']")[0];
|
let collapse = row.select("span[class='collapseBtn']")[0];
|
||||||
|
|
||||||
const cencw = $("CENCW-" + id);
|
const cencw = $("CENCW-" + id);
|
||||||
|
|
||||||
@@ -1480,15 +1481,15 @@ function cdmClicked(event, id, in_body) {
|
|||||||
return cdmExpandArticle(id);
|
return cdmExpandArticle(id);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var elem = $("RROW-" + getActiveArticleId());
|
let elem = $("RROW-" + getActiveArticleId());
|
||||||
|
|
||||||
if (elem) elem.removeClassName("active");
|
if (elem) elem.removeClassName("active");
|
||||||
|
|
||||||
selectArticles("none");
|
selectArticles("none");
|
||||||
toggleSelected(id);
|
toggleSelected(id);
|
||||||
|
|
||||||
var elem = $("RROW-" + id);
|
elem = $("RROW-" + id);
|
||||||
var article_is_unread = elem.hasClassName("Unread");
|
const article_is_unread = elem.hasClassName("Unread");
|
||||||
|
|
||||||
elem.removeClassName("Unread");
|
elem.removeClassName("Unread");
|
||||||
elem.addClassName("active");
|
elem.addClassName("active");
|
||||||
@@ -1517,8 +1518,8 @@ function cdmClicked(event, id, in_body) {
|
|||||||
|
|
||||||
toggleSelected(id, true);
|
toggleSelected(id, true);
|
||||||
|
|
||||||
var elem = $("RROW-" + id);
|
let elem = $("RROW-" + id);
|
||||||
var article_is_unread = elem.hasClassName("Unread");
|
const article_is_unread = elem.hasClassName("Unread");
|
||||||
|
|
||||||
if (article_is_unread) {
|
if (article_is_unread) {
|
||||||
decrementFeedCounter(getActiveFeedId(), activeFeedIsCat());
|
decrementFeedCounter(getActiveFeedId(), activeFeedIsCat());
|
||||||
@@ -1674,12 +1675,12 @@ function headlinesMenuCommon(menu) {
|
|||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Toggle unread"),
|
label: __("Toggle unread"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
|
|
||||||
let ids = getSelectedArticleIds2();
|
let ids = getSelectedArticleIds2();
|
||||||
// cast to string
|
// cast to string
|
||||||
const id = (this.getParent().currentTarget.getAttribute("data-article-id")) + "";
|
const id = (this.getParent().currentTarget.getAttribute("data-article-id")) + "";
|
||||||
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
ids = ids.length != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
||||||
|
|
||||||
selectionToggleUnread(undefined, false, true, ids);
|
selectionToggleUnread(undefined, false, true, ids);
|
||||||
}
|
}
|
||||||
@@ -1687,11 +1688,11 @@ function headlinesMenuCommon(menu) {
|
|||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Toggle starred"),
|
label: __("Toggle starred"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
let ids = getSelectedArticleIds2();
|
let ids = getSelectedArticleIds2();
|
||||||
// cast to string
|
// cast to string
|
||||||
const id = (this.getParent().currentTarget.getAttribute("data-article-id")) + "";
|
const id = (this.getParent().currentTarget.getAttribute("data-article-id")) + "";
|
||||||
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
ids = ids.length != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
||||||
|
|
||||||
selectionToggleMarked(undefined, false, true, ids);
|
selectionToggleMarked(undefined, false, true, ids);
|
||||||
}
|
}
|
||||||
@@ -1699,11 +1700,11 @@ function headlinesMenuCommon(menu) {
|
|||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Toggle published"),
|
label: __("Toggle published"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
let ids = getSelectedArticleIds2();
|
let ids = getSelectedArticleIds2();
|
||||||
// cast to string
|
// cast to string
|
||||||
const id = (this.getParent().currentTarget.getAttribute("data-article-id")) + "";
|
const id = (this.getParent().currentTarget.getAttribute("data-article-id")) + "";
|
||||||
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
ids = ids.length != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
||||||
|
|
||||||
selectionTogglePublished(undefined, false, true, ids);
|
selectionTogglePublished(undefined, false, true, ids);
|
||||||
}
|
}
|
||||||
@@ -1713,14 +1714,14 @@ function headlinesMenuCommon(menu) {
|
|||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Mark above as read"),
|
label: __("Mark above as read"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
catchupRelativeToArticle(0, this.getParent().currentTarget.getAttribute("data-article-id"));
|
catchupRelativeToArticle(0, this.getParent().currentTarget.getAttribute("data-article-id"));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Mark below as read"),
|
label: __("Mark below as read"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
catchupRelativeToArticle(1, this.getParent().currentTarget.getAttribute("data-article-id"));
|
catchupRelativeToArticle(1, this.getParent().currentTarget.getAttribute("data-article-id"));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -1742,13 +1743,13 @@ function headlinesMenuCommon(menu) {
|
|||||||
labelAddMenu.addChild(new dijit.MenuItem({
|
labelAddMenu.addChild(new dijit.MenuItem({
|
||||||
label: name,
|
label: name,
|
||||||
labelId: bare_id,
|
labelId: bare_id,
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
|
|
||||||
let ids = getSelectedArticleIds2();
|
let ids = getSelectedArticleIds2();
|
||||||
// cast to string
|
// cast to string
|
||||||
const id = (this.getParent().ownerMenu.currentTarget.getAttribute("data-article-id")) + "";
|
const id = (this.getParent().ownerMenu.currentTarget.getAttribute("data-article-id")) + "";
|
||||||
|
|
||||||
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
ids = ids.length != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
||||||
|
|
||||||
selectionAssignLabel(this.labelId, ids);
|
selectionAssignLabel(this.labelId, ids);
|
||||||
}
|
}
|
||||||
@@ -1757,12 +1758,12 @@ function headlinesMenuCommon(menu) {
|
|||||||
labelDelMenu.addChild(new dijit.MenuItem({
|
labelDelMenu.addChild(new dijit.MenuItem({
|
||||||
label: name,
|
label: name,
|
||||||
labelId: bare_id,
|
labelId: bare_id,
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
let ids = getSelectedArticleIds2();
|
let ids = getSelectedArticleIds2();
|
||||||
// cast to string
|
// cast to string
|
||||||
const id = (this.getParent().ownerMenu.currentTarget.getAttribute("data-article-id")) + "";
|
const id = (this.getParent().ownerMenu.currentTarget.getAttribute("data-article-id")) + "";
|
||||||
|
|
||||||
ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
ids = ids.length != 0 && ids.indexOf(id) != -1 ? ids : [id];
|
||||||
|
|
||||||
selectionRemoveLabel(this.labelId, ids);
|
selectionRemoveLabel(this.labelId, ids);
|
||||||
}
|
}
|
||||||
@@ -1786,7 +1787,7 @@ function headlinesMenuCommon(menu) {
|
|||||||
function initHeadlinesMenu() {
|
function initHeadlinesMenu() {
|
||||||
if (!dijit.byId("headlinesMenu")) {
|
if (!dijit.byId("headlinesMenu")) {
|
||||||
|
|
||||||
var menu = new dijit.Menu({
|
const menu = new dijit.Menu({
|
||||||
id: "headlinesMenu",
|
id: "headlinesMenu",
|
||||||
targetNodeIds: ["headlines-frame"],
|
targetNodeIds: ["headlines-frame"],
|
||||||
selector: ".hlMenuAttach"
|
selector: ".hlMenuAttach"
|
||||||
@@ -1801,7 +1802,7 @@ function initHeadlinesMenu() {
|
|||||||
|
|
||||||
if (!dijit.byId("headlinesFeedTitleMenu")) {
|
if (!dijit.byId("headlinesFeedTitleMenu")) {
|
||||||
|
|
||||||
var menu = new dijit.Menu({
|
const menu = new dijit.Menu({
|
||||||
id: "headlinesFeedTitleMenu",
|
id: "headlinesFeedTitleMenu",
|
||||||
targetNodeIds: ["headlines-frame"],
|
targetNodeIds: ["headlines-frame"],
|
||||||
selector: "div.cdmFeedTitle"
|
selector: "div.cdmFeedTitle"
|
||||||
@@ -1819,7 +1820,7 @@ function initHeadlinesMenu() {
|
|||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Mark group as read"),
|
label: __("Mark group as read"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
selectArticles("none");
|
selectArticles("none");
|
||||||
selectArticles("all",
|
selectArticles("all",
|
||||||
"#headlines-frame > div[id*=RROW]" +
|
"#headlines-frame > div[id*=RROW]" +
|
||||||
@@ -1831,14 +1832,14 @@ function initHeadlinesMenu() {
|
|||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Mark feed as read"),
|
label: __("Mark feed as read"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
catchupFeedInGroup(this.getParent().currentTarget.getAttribute("data-feed-id"));
|
catchupFeedInGroup(this.getParent().currentTarget.getAttribute("data-feed-id"));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Edit feed"),
|
label: __("Edit feed"),
|
||||||
onClick: function (event) {
|
onClick: function () {
|
||||||
editFeed(this.getParent().currentTarget.getAttribute("data-feed-id"));
|
editFeed(this.getParent().currentTarget.getAttribute("data-feed-id"));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -1883,7 +1884,7 @@ function setSelectionScore() {
|
|||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
console.log(ids);
|
console.log(ids);
|
||||||
|
|
||||||
var score = prompt(__("Please enter new score for selected articles:"), score);
|
const score = prompt(__("Please enter new score for selected articles:"));
|
||||||
|
|
||||||
if (score != undefined) {
|
if (score != undefined) {
|
||||||
const query = "op=article&method=setScore&id=" + param_escape(ids.toString()) +
|
const query = "op=article&method=setScore&id=" + param_escape(ids.toString()) +
|
||||||
@@ -2051,7 +2052,3 @@ function catchupCurrentBatchIfNeeded() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cdmFooterClick(event) {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user