Greasy Fork Links

Add links to navigate to the update tab and links to install scripts

Verze ze dne 10. 07. 2016. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Greasy Fork Links
// @namespace   chriskim06
// @description Add links to navigate to the update tab and links to install scripts
// @include     https://greasyfork.org/en/users/*
// @version     1.3.0
// @grant       none
// @locale      en
// ==/UserScript==

(function() {

  function createSpan(link, text) {
    var el = document.createElement('span');
    el.className = 'name-description-separator';
    el.innerHTML = text;
    link.parentNode.insertBefore(el, link.nextElementSibling);
  }

  var scripts = document.getElementById('user-script-list');
  if (scripts !== null) {
    var items = document.querySelectorAll('#user-script-list > li');
    for (var i = 0; i < items.length; i++) {
      var link = items[i].querySelector('a');
      var el = document.createElement('a');
      el.href = '/en/scripts/' + items[i].dataset.scriptId + '/versions/new';
      el.innerHTML = 'Edit';
      link.parentNode.insertBefore(el, link.nextElementSibling);
      createSpan(link, ' - ');
      el = document.createElement('a');
      el.href = link.href + '/delete';
      el.innerHTML = 'Delete';
      link.parentNode.insertBefore(el, link.nextElementSibling);
      createSpan(link, '/');
      el = document.createElement('a');
      el.href = link.href + '/code/' + link.innerHTML.replace(/ /g, '%20') + '.user.js';
      el.innerHTML = 'Install';
      link.parentNode.insertBefore(el, link.nextElementSibling);
      createSpan(link, ' - ');
      link.href = link.href + '/code';
    }
    scripts.previousElementSibling.querySelector('h3').innerHTML = 'Scripts (' + items.length + ')';
  }

})();