|
17 | 17 | // @include https://github.com/?* |
18 | 18 | // @include https://github.com/orgs/*/dashboard |
19 | 19 | // @include https://github.com/orgs/*/dashboard?* |
20 | | -// @version 8.2.5 |
| 20 | +// @version 8.2.6 |
21 | 21 | // @grant none |
22 | 22 | // ==/UserScript== |
23 | 23 |
|
|
265 | 265 | // Show/hide alerts. |
266 | 266 | if (classNames.length === 0 || classNames.every(function (cl) { return cl.every(function (c) { return !!~c.indexOf('*'); }); })) { |
267 | 267 | 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) { |
269 | 269 | alert.parentNode.style.display = 'block'; |
270 | 270 | }); |
271 | 271 | } 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) { |
273 | 273 | return alert.parentNode; |
274 | 274 | }).forEach(function (alert) { |
275 | 275 | var show = classNames.every(function (cl) { return cl.some(function (c) { return !!~c.indexOf('*') || alert.classList.contains(c); }); }); |
|
303 | 303 |
|
304 | 304 | // Fix filter action identification. |
305 | 305 | 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) { |
307 | 307 | return alert.parentNode; |
308 | 308 | }).forEach(function (alert) { |
309 | 309 | if (!!~alert.textContent.indexOf('created branch')) { |
|
336 | 336 |
|
337 | 337 | // Get unique list of repos. |
338 | 338 | 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) { |
340 | 340 | return alert.parentNode; |
341 | 341 | }).forEach(function (alert) { |
342 | 342 | var alertRepo = alert.querySelector(':scope [data-ga-click*="target:repo"]:not([data-ga-click*="target:repositories"])'); |
|
378 | 378 | USERS = [{ id: '*-user', text: 'All users', icon: 'octicon-organization', classNames: ['*-user'] }]; |
379 | 379 |
|
380 | 380 | 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) { |
382 | 382 | return alert.parentNode; |
383 | 383 | }).forEach(function (alert) { |
384 | 384 | var usernameElms = alert.querySelectorAll(':scope [data-ga-click*="target:actor"]'); |
|
414 | 414 | } |
415 | 415 | }); |
416 | 416 | } |
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) { |
418 | 418 | return alert.parentNode; |
419 | 419 | }).forEach(function (alert) { |
420 | 420 | var show = classNames.every(function (cl) { return cl.some(function (c) { return !!~c.indexOf('*') || alert.classList.contains(c); }); }); |
|
426 | 426 | // Count alerts based on current filter. |
427 | 427 | var countAll = 0; |
428 | 428 | if (!!~li.filterClassNames[0].indexOf('*')) { |
429 | | - countAll = newsContainer.querySelectorAll(':scope > div > .body').length; |
| 429 | + countAll = newsContainer.querySelectorAll(':scope > div > div > .body').length; |
430 | 430 | } 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) { |
432 | 432 | return alert.parentNode; |
433 | 433 | }).forEach(function (alert) { |
434 | 434 | if (li.filterClassNames.some(function (cl) { return alert.classList.contains(cl); })) { |
|
0 commit comments