summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/Feeds.js10
-rw-r--r--js/PrefFeedTree.js13
-rw-r--r--js/PrefFilterTree.js11
3 files changed, 28 insertions, 6 deletions
diff --git a/js/Feeds.js b/js/Feeds.js
index 714eb77d2..42641dc74 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -71,7 +71,7 @@ const Feeds = {
const kind = elems[l].kind;
const ctr = parseInt(elems[l].counter);
const error = elems[l].error;
- const has_img = elems[l].has_img;
+ const ts = elems[l].ts;
const updated = elems[l].updated;
if (id == "global-unread") {
@@ -98,9 +98,9 @@ const Feeds = {
this.setValue(id, false, 'updated', updated);
if (id > 0) {
- if (has_img) {
+ if (ts) {
this.setIcon(id, false,
- App.getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
+ App.getInitParam("icons_url") + '?' + dojo.objectToQuery({op: 'feed_icon', id: id, ts: ts}));
} else {
this.setIcon(id, false, 'images/blank_icon.gif');
}
@@ -678,8 +678,10 @@ const Feeds = {
});
},
renderIcon: function(feed_id, exists) {
+ const icon_url = App.getInitParam("icons_url") + '?' + dojo.objectToQuery({op: 'feed_icon', id: feed_id});
+
return feed_id && exists ?
- `<img class="icon" src="${App.escapeHtml(App.getInitParam("icons_url"))}/${feed_id}.ico">` :
+ `<img class="icon" src="${App.escapeHtml(icon_url)}">` :
`<i class='icon-no-feed material-icons'>rss_feed</i>`;
}
};
diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js
index 0585173c9..85b262b6d 100644
--- a/js/PrefFeedTree.js
+++ b/js/PrefFeedTree.js
@@ -1,5 +1,5 @@
/* eslint-disable prefer-rest-params */
-/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhrPost, xhr, fox, App */
+/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhr, fox, App */
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_base/array", "dojo/cookie"],
function (declare, domConstruct, checkBoxTree, array, cookie) {
@@ -14,6 +14,17 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b
this.checkInactiveFeeds();
this.checkErrorFeeds();
});
+
+ dojo.connect(this, 'onClick', (item) => {
+ const id = String(item.id);
+ const bare_id = id.substr(id.indexOf(':')+1);
+
+ if (id.match('FEED:')) {
+ CommonDialogs.editFeed(bare_id);
+ } else if (id.match('CAT:')) {
+ dijit.byId('feedTree').editCategory(bare_id, item);
+ }
+ });
},
// save state in localStorage instead of cookies
// reference: https://stackoverflow.com/a/27968996
diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js
index d4496b647..149261abd 100644
--- a/js/PrefFilterTree.js
+++ b/js/PrefFilterTree.js
@@ -1,5 +1,5 @@
/* eslint-disable prefer-rest-params */
-/* global __, define, lib, dijit, dojo, xhr, App, Notify */
+/* global __, define, lib, dijit, dojo, xhr, App, Notify, Filters */
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
@@ -10,6 +10,15 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
dijit.byId('filterTree').hideOrShowFilterRules(
parseInt(localStorage.getItem("ttrss:hide-filter-rules"))
);
+
+ dojo.connect(this, 'onClick', (item) => {
+ const id = String(item.id);
+ const bare_id = id.substr(id.indexOf(':')+1);
+
+ if (id.match('FILTER:')) {
+ Filters.edit(bare_id);
+ }
+ });
},
_createTreeNode: function(args) {
const tnode = this.inherited(arguments);