Github: Add Releases Button

Adds a releases button

Stan na 12-10-2014. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Github: Add Releases Button
// @namespace    https://github.com/phracker
// @version      0.1.0
// @description  Adds a releases button
// @include      http*://*github.com/*/*
// ==/UserScript==

// var owfn = document.getElementsByClassName('only-with-full-nav').item(0);

// var ur = 'hubc ' + document.URL.replace('https://github.com/','').replace('.git','').replace(/\/network$/,'').replace(/\/wiki$/,'').replace(/\/pull\/.*$/,'').replace(/\/commit\/.*$/,'').replace(/\/$/,'');
// // var ur = 'hubc ' + document.URL.replace(/(.*)github.com\/(.+)\/(.+)\/(.*)/,/hubc $2\/$3/);
// console.log(ur);
// var inner = '<h3><span class="text-emphasized">hubc</span> clone command</h3><div class="input-group"><input type="text" class="input-mini input-monospace js-url-field" value="' + ur + '" readonly="readonly"><span class="input-group-button"><button aria-label="Copy to clipboard" class="js-zeroclipboard minibutton zeroclipboard-button" data-clipboard-text="'+ur+'" data-copied-hint="Copied!" type="button"><span class="octicon octicon-clippy"></span></button></span></div>';
// var d = document.createElement('div');
// d.setAttribute("class","clone-url");
// d.setAttribute("style","display:inline;");
// d.innerHTML = inner;
// owfn.appendChild(d);

var releasesButton = document.evaluate('/html/body/div[1]/div[3]/div[3]/div[1]/div[1]/div[1]/div/ul[1]/li[4]',document,null,9,null).singleNodeValue.cloneNode(true);
releasesButton.setAttribute('aria-label','Releases');
var a = releasesButton.getElementsByTagName('a').item(0);
a.href = a.href.replace(/wiki$/,'releases');
a.setAttribute('aria-label','Releases');
a.setAttribute('data-hotkey','g r');
a.setAttribute('data-selected-links',a.getAttribute('data-selected-links').replace('repo_wiki','repo_releases').replace(/wiki$/,'releases'));
a.getElementsByClassName('full-word').item(0).textContent = 'Releases';
a.getElementsByClassName('octicon').item(0).class = 'octicon octicon-rocket';

var menu = document.evaluate('/html/body/div[1]/div[3]/div[3]/div[1]/div[1]/div[1]/div/ul[1]',document,null,9,null).singleNodeValue;
menu.appendChild(releasesButton);