Skip to content

Commit f660940

Browse files
darkredjerone
authored andcommitted
Update after HTML changes (fix jerone#68) (jerone#140)
1 parent ecd6438 commit f660940

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Github_News_Feed_Filter/Github_News_Feed_Filter.user.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// @include https://github.com/?*
1818
// @include https://github.com/orgs/*/dashboard
1919
// @include https://github.com/orgs/*/dashboard?*
20-
// @version 8.2.5
20+
// @version 8.2.6
2121
// @grant none
2222
// ==/UserScript==
2323

@@ -265,11 +265,11 @@
265265
// Show/hide alerts.
266266
if (classNames.length === 0 || classNames.every(function (cl) { return cl.every(function (c) { return !!~c.indexOf('*'); }); })) {
267267
anyVisibleAlert = true;
268-
Array.prototype.forEach.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
268+
Array.prototype.forEach.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
269269
alert.parentNode.style.display = 'block';
270270
});
271271
} else {
272-
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
272+
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
273273
return alert.parentNode;
274274
}).forEach(function (alert) {
275275
var show = classNames.every(function (cl) { return cl.some(function (c) { return !!~c.indexOf('*') || alert.classList.contains(c); }); });
@@ -303,7 +303,7 @@
303303

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

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

380380
var users = new Set();
381-
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
381+
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
382382
return alert.parentNode;
383383
}).forEach(function (alert) {
384384
var usernameElms = alert.querySelectorAll(':scope [data-ga-click*="target:actor"]');
@@ -414,7 +414,7 @@
414414
}
415415
});
416416
}
417-
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
417+
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
418418
return alert.parentNode;
419419
}).forEach(function (alert) {
420420
var show = classNames.every(function (cl) { return cl.some(function (c) { return !!~c.indexOf('*') || alert.classList.contains(c); }); });
@@ -426,9 +426,9 @@
426426
// Count alerts based on current filter.
427427
var countAll = 0;
428428
if (!!~li.filterClassNames[0].indexOf('*')) {
429-
countAll = newsContainer.querySelectorAll(':scope > div > .body').length;
429+
countAll = newsContainer.querySelectorAll(':scope > div > div > .body').length;
430430
} else {
431-
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > .body'), function (alert) {
431+
Array.prototype.map.call(newsContainer.querySelectorAll(':scope > div > div > .body'), function (alert) {
432432
return alert.parentNode;
433433
}).forEach(function (alert) {
434434
if (li.filterClassNames.some(function (cl) { return alert.classList.contains(cl); })) {

0 commit comments

Comments
 (0)