GitHub Latest

Always keep an eye on the latest activity of your favorite projects

目前為 2015-11-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name        GitHub Latest
// @namespace   https://github.com/Ede123/userscripts
// @version     0.9
// @description Always keep an eye on the latest activity of your favorite projects
// @icon        https://raw.githubusercontent.com/Ede123/userscripts/master/icons/GitHub.png
// @author      Eduard Braun <[email protected]>
// @license     GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @include     https://github.com/*
// @grant       none
// ==/UserScript==


// redirect link to automatically sort "your stars" by "recently active"
document.body.addEventListener('mousedown', function(e){
	var targ = e.target || e.srcElement;
	if ( targ && targ.href && targ.href.match(/\/stars$/) ) {
		targ.href = targ.href.replace(/\/stars$/, "/stars?sort=updated");
	}
});

// add a button to "latest issues"
function addLatestButton() {
	var reponav = document.getElementsByClassName("reponav");
	if (reponav && (reponav = reponav[0])) {
		var button = reponav.children[1].cloneNode(true);
		button.href += "?sort=updated";
		button.style.float = "right";
		button.firstElementChild.className = "octicon octicon-flame";
		button.removeChild(button.lastElementChild);
		button.normalize();
		button.lastChild.textContent = " Latest issues"
		button.removeAttribute("data-selected-links");
		button.classList.remove("selected");
		reponav.appendChild(button);
	}
}

addLatestButton();

// GitHub uses pjax to navigate between documents
unsafeWindow.$(document).on("pjax:success", function() {
	addLatestButton();
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址