Github: Add Releases Button

Adds a releases button

12.10.2014 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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);