// ==UserScript== // @name Github Notifications Dropdown // @namespace joeytwiddle // @author joeytwiddle // @contributors SkyzohKey // @copyright 2014-2020, Paul "Joey" Clark (http://neuralyte.org/~joey) // @version 1.2.0 // @license MIT // @description When clicking the notifications icon, displays notifications in a dropdown pane, without leaving the current page. // @include https://github.com/* // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @grant GM_addStyle // @downloadURL none // ==/UserScript== // bug: If the notifications list is longer than the page, scroll down to the bottom and then try to click on the white space below the Github document's content. The event does not fire there! // When using @grant none then we should also avoid messing with the page's jQuery (or lack of jQuery). this.$ = this.jQuery = jQuery.noConflict(true); // Contributors: joeytwiddle, SkyzohKeyx, Marti, darkred // ==Options== var makeBlocksCollapsableOnNotificationsPage = true; // Disabled by default because it was conflicting with other scripts (https://github.com/joeytwiddle/code/issues/2) var makeAllFileAndDiffBlocksCollapsable = false; // If you want to change the colour of the blue notification dot, uncomment one of these // Github's blue dot (2017) //var notificationDotStyle = 'linear-gradient(hsl(212, 100%, 66%), hsl(212, 100%, 46%))'; // Github's blue dot (2016) //var notificationDotStyle = 'linear-gradient(hsl(214, 50%, 65%), hsl(214, 50%, 50%))'; // Strong red dot //var notificationDotStyle = 'linear-gradient(hsla(0, 80%, 75%, 1), hsla(0, 80%, 50%, 1))'; // Calm amber dot //var notificationDotStyle = 'linear-gradient(hsla(35, 90%, 65%, 1), hsla(35, 90%, 40%, 1))'; // Gentle green dot //var notificationDotStyle = 'linear-gradient(hsla(120, 50%, 65%, 1), hsla(120, 50%, 40%, 1))'; // ==/Options== var mainNotificationsPath = "/notifications"; var notificationButtonLink = $("header a.notification-indicator[href]"); // In v1, the click listener was on the containing