Setting btn - [ X ]

Add custom btn for setting menubar

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

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 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         Setting btn - [ X ]
// @namespace    http://tampermonkey.net/
// @version      2.9
// @description  Add custom btn for setting menubar
// @copyright    2022, terifash (https://greasyfork.org/en/users/964055-teri-fash)
// @author       teri.fash <[email protected]>
// @license      MIT
// @match        *://*.xvideos.com/video*
// @icon         https://www.xvideos.com/favicon-32x32.png
// @supportURL   https://github.com/TeriFash/x.scripts.user/issues
// @homepageURL  https://github.com/TeriFash/x.scripts.user
// @run-at       document-start
// ==/UserScript==

(()=> {
  const styles = {
    zIndex: 1000,
  }

  function setingsUpinit(seti) {
    let position = window.localStorage.getItem(`video-menu-position`);

		// maybe need added class "init-ok"
    seti.addClass(`btn-settings-top btn-settings-top--${position === 'left' ? 'right' : 'left'}`).css(styles);

    $('body').prepend(seti);
  }

  function init() {
    const settings = $('#site-settings').clone();

    setingsUpinit(settings);
  }

   window.addEventListener('DOMContentLoaded', init);
})();