From 167b015e80710e7455438e530c2e1916eda8dffa Mon Sep 17 00:00:00 2001 From: Ribas160 Date: Fri, 13 Sep 2024 20:14:28 +0300 Subject: [PATCH] #1392: use dvh instead of javascript --- css/bootstrap/privatebin.css | 3 +-- css/bootstrap5/privatebin.css | 3 +-- js/privatebin.js | 39 ----------------------------------- lib/Configuration.php | 2 +- 4 files changed, 3 insertions(+), 44 deletions(-) diff --git a/css/bootstrap/privatebin.css b/css/bootstrap/privatebin.css index d4e68e84..36cf00fd 100644 --- a/css/bootstrap/privatebin.css +++ b/css/bootstrap/privatebin.css @@ -178,8 +178,7 @@ html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose { .wrapper { display: flex; - min-height: 100vh; - min-height: calc(var(--vh, 1vh) * 100); + min-height: 100dvh; flex-direction: column; justify-content: space-between; } \ No newline at end of file diff --git a/css/bootstrap5/privatebin.css b/css/bootstrap5/privatebin.css index 3520069f..db2a258f 100644 --- a/css/bootstrap5/privatebin.css +++ b/css/bootstrap5/privatebin.css @@ -87,8 +87,7 @@ html[dir="rtl"] #deletelink, html[dir="rtl"] #qrcodemodalClose { .wrapper { display: flex; - min-height: 100vh; - min-height: calc(var(--vh, 1vh) * 100); + min-height: 100dvh; flex-direction: column; justify-content: space-between; } \ No newline at end of file diff --git a/js/privatebin.js b/js/privatebin.js index efa8020c..9c843628 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -1743,43 +1743,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { return me; })(); - /** - * Calculate css variables - * - * @class - */ - const CssVariables = (function () { - const me = {}; - - /** - * Calculate 1/100 viewport height on each page resize event - * - * @name CssVariables.viewportHeight - * @private - * @function - */ - function viewportHeight() - { - window.addEventListener('resize', function () { - const vh = window.innerHeight * 0.01; - document.documentElement.style.setProperty('--vh', `${vh}px`); - }); - } - - /** - * Init css variables calculation - * - * @name CssVariables.init - * @function - */ - me.init = function() - { - viewportHeight(); - }; - - return me; - })(); - /** * Alert/error manager * @@ -5649,7 +5612,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { Prompt.init(); TopNav.init(); UiHelper.init(); - CssVariables.init(); // check for legacy browsers before going any further if (!Legacy.Check.getInit()) { @@ -5695,7 +5657,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { CryptTool: CryptTool, Model: Model, UiHelper: UiHelper, - CssVariables: CssVariables, Alert: Alert, PasteStatus: PasteStatus, Prompt: Prompt, diff --git a/lib/Configuration.php b/lib/Configuration.php index 36fb4661..9b2717ca 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -108,7 +108,7 @@ class Configuration 'js/kjua-0.9.0.js' => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==', 'js/legacy.js' => 'sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==', 'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==', - 'js/privatebin.js' => 'sha512-y4pE1SxEjiwdUMi+TmIPb3oEELmdrA00SJ4B3Og7pH0UO8l6hNqLrXzlTjMJ6/RCyYlirSwJzLf5MpknQpQ1zA==', + 'js/privatebin.js' => 'sha512-cbmXvtZ/5gZPFjQDzP3IEhUAIhFPAoM31gw2kRYCT5xOh8wv9gXeDqI/t798luRW1xdC4gaYodjEFCzrsZR4mA==', 'js/purify-3.1.6.js' => 'sha512-SDwfsqHZFhbcBo/6AN7Te4KoUkWHHw7TzyZCuRkkpl0o8oV4owT/lprznWWe9+qFtigb6MrF81K4CQRLN6be+A==', 'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==', 'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',