nc pdf header hide

nextcloud pdf header hide

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

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==
// @namespace yunyuyuan
// @name nc pdf header hide
// @description nextcloud pdf header hide
// @match *://*.yunyuyuan.net/*
// @version 0.0.1.1
// @license MIT
// ==/UserScript==

(function () {
  'use strict';
  let hided = false;
  document.addEventListener('keydown', (e) => {
    const container = document.querySelector('div[data-handler="pdf"]');
    if (container && e.key === '1'){
      const modalHeader = container.querySelector('.modal-header');
      const modalContainer = container.querySelector('.modal-container');
      const iframe = container.querySelector('iframe');
      if (!hided) {
        modalHeader.style.opacity = "0";
        modalHeader.style.zIndex = "0";
        modalContainer.style.top = "0";
        modalContainer.style.bottom = "0";
        iframe.style.height = '100%';
        hided = true;
      } else {
        hided = false;
        modalHeader.style.opacity = "1";
        modalHeader.style.zIndex = "10001";
        modalContainer.style.top = "var(--header-height)";
        modalContainer.style.bottom = "var(--header-height)";
        iframe.style.height = 'calc(100vh - var(--header-height))';
      }
    }
  })
})()