Derpibooru Download Fix

Restores Derpibooru download button

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 Derpibooru Download Fix
// @namespace Violentmonkey Scripts
// @match *://derpibooru.org/*
// @description  Restores Derpibooru download button
// @author       novacrazy
// @version      0.0.1
// @license      MIT
// @grant none
// @run-at document-end
// ==/UserScript==

(function() {
  
  for(let e of document.getElementsByClassName("image-metabar")) {
    e.style.setProperty("width", "100%", "important");
    e.style.setProperty("max-width", "100%", "important");
  }
  
  for(let e of document.getElementsByClassName("flex--spaced-out")) {
    e.style.setProperty("justify-content", "normal", "important");
  }
 
  for(let dropdown of document.getElementsByClassName("dropdown block__header__dropdown-tab")) {
    let short = dropdown.children[0];

    // Filter out Galleries dropdown
    if(!short.href.endsWith('#')) {
      if(short.title.includes("Download")) {
        let long = dropdown.children[1].children[0];
        
        dropdown.innerHTML = `</i><div><a href=${long.href}><i class="fa fa-download"> Download</a></div>`;
      }
    }
  }
})();