Ye Olde Derpibooru Uploader Description Layout

Move uploader credit to its former location

Από την 21/03/2018. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name        Ye Olde Derpibooru Uploader Description Layout
// @description Move uploader credit to its former location
// @version     1.0.0
// @author      Marker
// @license     MIT
// @namespace   https://github.com/marktaiwan/
// @homepageURL https://github.com/marktaiwan/Ye-Olde-Derpibooru-Uploader-Description-Layout
// @supportURL  https://github.com/marktaiwan/Ye-Olde-Derpibooru-Uploader-Description-Layout/issues
// @include     https://derpibooru.org*
// @include     derpibooru.org*
// @include     https://trixiebooru.org*
// @include     trixiebooru.org*
// @grant       none
// @noframes
// ==/UserScript==
(function(){
  const block = document.querySelector('#content > .block:first-child');
  if (block === null)
    return;
  // Move uploader and image information
  const extrameta = document.querySelector('#extrameta');
  block.appendChild(extrameta);
  extrameta.appendChild(document.querySelector('.image-size'));

  // Copy and modify classes from its sibling
  extrameta.className = block.firstChild.className;
  extrameta.classList.remove('block__header');
  extrameta.classList.add('block__header--sub', 'block__header--light');
  extrameta.firstChild.classList.add('spacing-left');

  // Revert description box styling
  const imageDescription = document.querySelector('.image-description');
  imageDescription.style.background = 'whitesmoke';
  imageDescription.classList.add('layout--narrow');
  const descriptionHeader = document.createElement('h3');
  descriptionHeader.innerText = 'Uploader Description';
  descriptionHeader.style.margin = '5px';
  imageDescription.insertBefore(descriptionHeader, imageDescription.firstChild);

  // Revert description editor width
  const descriptionForm = document.querySelector('#description-form');
  if (descriptionForm !== null)
    descriptionForm.classList.add('layout--narrow');
})();