Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Github_News_Feed_Filter/Github_News_Feed_Filter.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// @include https://github.com/?*
// @include https://github.com/orgs/*/dashboard
// @include https://github.com/orgs/*/dashboard?*
// @version 8.2.5
// @version 8.2.6
// @grant none
// ==/UserScript==

Expand Down Expand Up @@ -265,11 +265,11 @@
// Show/hide alerts.
if (classNames.length === 0 || classNames.every(function (cl) { return cl.every(function (c) { return !!~c.indexOf('*'); }); })) {
anyVisibleAlert = true;
Array.prototype.forEach.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.forEach.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
alert.parentNode.style.display = 'block';
});
} else {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
return alert.parentNode;
}).forEach(function (alert) {
var show = classNames.every(function (cl) { return cl.some(function (c) { return !!~c.indexOf('*') || alert.classList.contains(c); }); });
Expand Down Expand Up @@ -303,7 +303,7 @@

// Fix filter action identification.
function fixActionAlerts(newsContainer) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
return alert.parentNode;
}).forEach(function (alert) {
if (!!~alert.textContent.indexOf('created branch')) {
Expand Down Expand Up @@ -336,7 +336,7 @@

// Get unique list of repos.
var userRepos = new Set();
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
return alert.parentNode;
}).forEach(function (alert) {
var alertRepo = alert.querySelector(':scope [data-ga-click*="target:repo"]:not([data-ga-click*="target:repositories"])');
Expand Down Expand Up @@ -378,7 +378,7 @@
USERS = [{ id: '*-user', text: 'All users', icon: 'octicon-organization', classNames: ['*-user'] }];

var users = new Set();
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
return alert.parentNode;
}).forEach(function (alert) {
var usernameElms = alert.querySelectorAll(':scope [data-ga-click*="target:actor"]');
Expand Down Expand Up @@ -414,7 +414,7 @@
}
});
}
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
return alert.parentNode;
}).forEach(function (alert) {
var show = classNames.every(function (cl) { return cl.some(function (c) { return !!~c.indexOf('*') || alert.classList.contains(c); }); });
Expand All @@ -426,9 +426,9 @@
// Count alerts based on current filter.
var countAll = 0;
if (!!~li.filterClassNames[0].indexOf('*')) {
countAll = newsContainer.querySelectorAll(':scope > div > .body').length;
countAll = newsContainer.querySelectorAll(':scope > div > div > .body').length;
} else {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
return alert.parentNode;
}).forEach(function (alert) {
if (li.filterClassNames.some(function (cl) { return alert.classList.contains(cl); })) {
Expand Down