Skip to content
This repository was archived by the owner on May 10, 2026. It is now read-only.

Commit 012a36f

Browse files
committed
Add changable icon indicating available sources
Make sources badge configurable closes #91
1 parent 06bfb0e commit 012a36f

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

src/options.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ <h3 class="section-header">Appearance</h3>
119119
</label>
120120
</div>
121121

122+
<div class="settings-row learn-more" title="Color of icon that shows up in extension button when new articles are downloaded.">
123+
<label class="web-content-select-label">
124+
<span class="selectLabel">New sources found icon:</span>
125+
<select id="sourcesFoundIcon">
126+
<option value="arrow-orange">Arrow Orange</option>
127+
<option value="orange">Orange</option>
128+
<option value="blue">Blue</option>
129+
<option value="green">Green</option>
130+
<option value="purple">Purple</option>
131+
<option value="red">Red</option>
132+
<option value="royalblue">Royal Blue</option>
133+
</select>
134+
</label>
135+
</div>
136+
122137
<div class="settings-row learn-more" title="">
123138
<label class="web-content-select-label">
124139
<span class="selectLabel">Disable date groups:</span>
@@ -218,6 +233,7 @@ <h3 class="section-header">Behaviour</h3>
218233
<option value="disabled">disabled</option>
219234
<option value="unread"># of unread</option>
220235
<option value="unvisited"># of unvisited</option>
236+
<option value="sources"># of sources</option>
221237
</select>
222238
</label>
223239
</div>

src/scripts/bgprocess/bg.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ define([
4141
chrome.contextMenus.removeAll();
4242
const feeds = message.value;
4343
if (feeds.length === 0) {
44+
animation.handleIconChange();
4445
return;
4546
}
47+
chrome.browserAction.setIcon({
48+
path: '/images/icon19-' + settings.get('sourcesFoundIcon') + '.png'
49+
});
4650
chrome.contextMenus.create({
4751
id: 'SmartRss',
4852
contexts: ['browser_action'],
@@ -55,17 +59,21 @@ define([
5559
contexts: ['browser_action'],
5660
parentId: 'SmartRss',
5761
onclick: function () {
58-
console.log('fff' + feed.url);
5962
addSource(feed.url);
6063
}
6164
});
6265
});
6366
});
64-
chrome.browserAction.setBadgeText({text: feeds.length > 0 ? feeds.length.toString() : ''});
67+
if (settings.get('badgeMode') === 'sources') {
68+
chrome.browserAction.setBadgeText({text: feeds.length.toString()});
69+
}
6570
}
6671
if (message.action === 'visibility-lost') {
72+
animation.handleIconChange();
6773
chrome.contextMenus.removeAll();
68-
chrome.browserAction.setBadgeText({text: ''});
74+
if (settings.get('badgeMode') === 'sources') {
75+
chrome.browserAction.setBadgeText({text: ''});
76+
}
6977
}
7078
}
7179

src/scripts/bgprocess/models/Settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ define(['backbone', 'preps/indexeddb'], function (BB) {
3636
sortOrder: 'desc',
3737
sortOrder2: 'asc',
3838
icon: 'orange',
39+
sourcesFoundIcon: 'arrow-orange',
3940
readOnVisit: false,
4041
askOnOpening: true,
4142
fullDate: false,
@@ -59,6 +60,7 @@ define(['backbone', 'preps/indexeddb'], function (BB) {
5960
disableAutoUpdate: false,
6061
openInNewTab: true,
6162
showFullHeadlines: 'false',
63+
6264
selectFirstArticle: 1,
6365
selectAllFeeds: 1,
6466
userStyle: '',

0 commit comments

Comments
 (0)