From 4c305903e5ab4f98aa8b828c7166652a9df1c26c Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Tue, 11 Feb 2025 11:09:02 -0300 Subject: [PATCH] Improve search form --- plugin/YouPHPFlix2/view/modeFlixBody.php | 3 ++- plugin/YouPHPFlix2/view/modeFlixCategory.php | 3 ++- view/include/navbarSearch.php | 21 +++++++++----------- view/js/navbarLogged.js | 18 +++++------------ view/js/script.js | 5 +++++ 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/plugin/YouPHPFlix2/view/modeFlixBody.php b/plugin/YouPHPFlix2/view/modeFlixBody.php index a63ebbc8c587..2b9b6ad7ebfd 100644 --- a/plugin/YouPHPFlix2/view/modeFlixBody.php +++ b/plugin/YouPHPFlix2/view/modeFlixBody.php @@ -482,6 +482,7 @@ Categories) { + $videoFound = true; // it will be decided inside the infinity scroll $url = "{$global['webSiteRootURL']}plugin/YouPHPFlix2/view/modeFlixCategory.php"; if (!empty($_REQUEST['catName'])) { $url = addQueryStringParameter($url, 'catName', $_REQUEST['catName']); @@ -505,7 +506,7 @@ - + \ No newline at end of file + + diff --git a/view/js/navbarLogged.js b/view/js/navbarLogged.js index 175512b06966..4167b7dbbe30 100644 --- a/view/js/navbarLogged.js +++ b/view/js/navbarLogged.js @@ -71,7 +71,8 @@ $(document).ready(function () { $("#buttonSearch").click(function (event) { event.stopPropagation(); if (isSearchOpen()) { - closeSearchMenu(); + modal.showPleaseWait(); + //closeSearchMenu(); } else { openSearchMenu(); } @@ -109,7 +110,6 @@ $(document).ready(function () { $(selector).attr('aria-expanded', 'false'); $("#mysearch").css({ display: '' }); - $("#mysearch").removeClass('animate__bounceOutUp'); } }); }); @@ -149,26 +149,18 @@ async function openRightMenu() { } var selector = '#buttonMyNavbar svg'; $(selector).addClass('active'); - $("#myNavbar").removeClass('animate__bounceOutRight'); $("#myNavbar").show(); - $("#myNavbar").addClass('animate__animated animate__bounceInRight'); } async function closeSearchMenu() { - $("#mysearch").removeClass('animate__bounceInDown'); - $("#mysearch").addClass('animate__bounceOutUp'); - setTimeout(function () { - $("#mysearch").hide(); - }, 500); + $("#mysearch").hide(); } async function openSearchMenu() { if (isScreeWidthCollapseSize()) { closeLeftMenu(); closeRightMenu(); } - $("#mysearch").removeClass('animate__bounceOutUp'); $("#mysearch").show(); - $("#mysearch").addClass('animate__animated animate__bounceInDown'); } async function seachFormPlayURL(url) { @@ -200,7 +192,7 @@ async function seachFormPlayURL(url) { } function isSearchOpen() { - return $('#mysearch').hasClass('animate__bounceInDown'); + return $("#mysearch").is(":visible"); } function isMyNMavbarOpen() { return $('#myNavbar').hasClass('animate__bounceInRight'); @@ -319,4 +311,4 @@ $(document).ready(function () { setTimeout(function () { flickityReload(); }, 5000); -}); \ No newline at end of file +}); diff --git a/view/js/script.js b/view/js/script.js index 55aa219ad651..6721b110bbd9 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -86,6 +86,7 @@ if (window.navigator.standalone || window.matchMedia('(display-mode: standalone) document.body.classList.add('pwa'); } + var queryString = window.location.search; var urlParams = new URLSearchParams(queryString); @@ -93,6 +94,10 @@ if (urlParams.has('debug')) { isDebuging = false; } +function getSearchParam(param) { + return urlParams.get(param) || ""; +} + function forwardToIframe(data) { var iframe = document.getElementById('avideoModalIframe'); // Get the iframe by ID if (iframe && iframe.contentWindow) {