page view optimize - "esdoc"

I love esdoc!

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         page view optimize - "esdoc"
// @namespace    https://xianghongai.github.io/
// @version      0.0.1
// @description  I love esdoc!
// @author       Nicholas Hsiang
// @icon         https://xinlu.ink/favicon.ico
// @match        https://esdoc.org/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function () {
  'use strict';
  
  const style = `
#all-tags+ul {
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9;
  background: white;
  list-style: none;
  overflow-y: auto;
  bottom: 0;
  width: 200px;
  box-shadow: -1px 0 10px rgba(0,0,0,.1);
  box-sizing: border-box;
}
#all-tags + ul li {
  list-style: none;
}
#all-tags + ul ul {
}
#all-tags + ul ul {
  padding-left: 0;
}
#all-tags + ul > li:first-child {
  margin-top: 20px;
}
#all-tags + ul>li>a {
  font-weight: bold;
  color: #666;
  font-size: 14px;
}
#all-tags + ul > li {
  margin-top: 10px;
}
body > .content {
  padding-right: 220px;
}
#all-tags + ul > li:last-child {
  margin-bottom: 50px;
}
`;

  GM_addStyle(style);

  function initial(style) {
    let headEle = document.head || document.getElementsByTagName('head')[0];
    let styleEle = document.createElement('style');

    styleEle.type = 'text/css';

    if (styleEle.styleSheet) {
      styleEle.styleSheet.cssText = style;
    } else {
      styleEle.appendChild(document.createTextNode(style));
    }

    headEle.appendChild(styleEle);
  }

  // initial(style);
})();