mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Improve search form
This commit is contained in:
parent
be16a356f6
commit
4c305903e5
5 changed files with 23 additions and 27 deletions
|
@ -482,6 +482,7 @@ $videoFound = false;
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if ($obj->Categories) {
|
if ($obj->Categories) {
|
||||||
|
$videoFound = true; // it will be decided inside the infinity scroll
|
||||||
$url = "{$global['webSiteRootURL']}plugin/YouPHPFlix2/view/modeFlixCategory.php";
|
$url = "{$global['webSiteRootURL']}plugin/YouPHPFlix2/view/modeFlixCategory.php";
|
||||||
if (!empty($_REQUEST['catName'])) {
|
if (!empty($_REQUEST['catName'])) {
|
||||||
$url = addQueryStringParameter($url, 'catName', $_REQUEST['catName']);
|
$url = addQueryStringParameter($url, 'catName', $_REQUEST['catName']);
|
||||||
|
@ -505,7 +506,7 @@ $videoFound = false;
|
||||||
<i class="fas fa-spinner fa-pulse text-muted"></i>
|
<i class="fas fa-spinner fa-pulse text-muted"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="<?php echo getCDN(); ?>node_modules/infinite-scroll/dist/infinite-scroll.pkgd.min.js" type="text/javascript"></script>
|
<script src="<?php echo getURL('node_modules/infinite-scroll/dist/infinite-scroll.pkgd.min.js'); ?>" type="text/javascript"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$container = $('#categoriesContainer').infiniteScroll({
|
$container = $('#categoriesContainer').infiniteScroll({
|
||||||
|
|
|
@ -135,6 +135,7 @@ $videosCounter = 0;
|
||||||
}
|
}
|
||||||
TimeLogEnd($timeLog, __LINE__);
|
TimeLogEnd($timeLog, __LINE__);
|
||||||
if (empty($videosCounter)) {
|
if (empty($videosCounter)) {
|
||||||
|
include_once __DIR__.'/notFoundHTML.php';
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -165,4 +166,4 @@ $cache = _ob_get_clean();
|
||||||
ObjectYPT::setCache($cacheName, $cache);
|
ObjectYPT::setCache($cacheName, $cache);
|
||||||
|
|
||||||
echo str_replace('{serie_uid}', uniqid(), $cache);
|
echo str_replace('{serie_uid}', uniqid(), $cache);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -2,24 +2,20 @@
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
|
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<button type="button" class="visible-xs navbar-toggle btn btn-default navbar-btn faa-parent animated-hover animate__animated animate__bounceIn" data-toggle="collapse" data-target="#mysearch" style="padding: 6px 12px;">
|
<button type="button" class="visible-xs navbar-toggle btn btn-default navbar-btn faa-parent animated-hover" data-toggle="collapse" data-target="#mysearch" style="padding: 6px 12px;">
|
||||||
<span class="fa fa-search faa-shake"></span>
|
<span class="fa fa-search faa-shake"></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group" id="mysearch">
|
<div class="input-group" id="mysearch">
|
||||||
<form class="navbar-form form-inline input-group" role="search" id="searchForm" method="get" action="<?php echo $global['webSiteRootURL']; ?>">
|
<form class="navbar-form form-inline input-group" role="search" id="searchForm" method="get" action="<?php echo $global['webSiteRootURL']; ?>">
|
||||||
<span class="input-group-prepend">
|
<span class="input-group-prepend">
|
||||||
<button type="button" id="filterButton"
|
<button type="button" id="filterButton"
|
||||||
class="btn btn-default navbar-btn dropdown-toggle faa-parent animated-hover animate__animated animate__bounceIn"
|
class="btn btn-default navbar-btn dropdown-toggle"
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<i class="fas fa-sliders-h"></i>
|
<i class="fas fa-sliders-h"></i>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<input class="form-control globalsearchfield" type="text" value="<?php
|
<input class="form-control globalsearchfield" type="text" name="search" placeholder="<?php echo __("Search"); ?>" id="searchFormInput">
|
||||||
if (!empty($_GET['search'])) {
|
|
||||||
echo htmlentities($_GET['search']);
|
|
||||||
}
|
|
||||||
?>" name="search" placeholder="<?php echo __("Search"); ?>" id="searchFormInput">
|
|
||||||
<span class="input-group-append">
|
<span class="input-group-append">
|
||||||
<button class="btn btn-default btn-outline-secondary border-right-0 border py-2 faa-parent animated-hover" type="submit" id="buttonSearch" data-toggle="collapse" data-target="#mysearch">
|
<button class="btn btn-default btn-outline-secondary border-right-0 border py-2 faa-parent animated-hover" type="submit" id="buttonSearch" data-toggle="collapse" data-target="#mysearch">
|
||||||
<i class="fas fa-search faa-shake notLoadingIcon"></i>
|
<i class="fas fa-search faa-shake notLoadingIcon"></i>
|
||||||
|
@ -42,7 +38,7 @@
|
||||||
var searchSelectedTagVal = '';
|
var searchSelectedTagVal = '';
|
||||||
var searchSelectedCategory = '';
|
var searchSelectedCategory = '';
|
||||||
var searchSelectedTag = '';
|
var searchSelectedTag = '';
|
||||||
|
|
||||||
function updateSearchSelectedValues() {
|
function updateSearchSelectedValues() {
|
||||||
searchTotalSelectedSearchIn = $('#search-tab .form-check-input:checked').length;
|
searchTotalSelectedSearchIn = $('#search-tab .form-check-input:checked').length;
|
||||||
searchSelectedCategoryVal = $('#filter-tab .form-check-input:checked').val();
|
searchSelectedCategoryVal = $('#filter-tab .form-check-input:checked').val();
|
||||||
|
@ -50,12 +46,13 @@
|
||||||
searchSelectedCategory = $('#filter-tab .form-check-input:checked').parent().find('.form-check-label').html();
|
searchSelectedCategory = $('#filter-tab .form-check-input:checked').parent().find('.form-check-label').html();
|
||||||
searchSelectedTag = $('#filter-tags-tab .form-check-input:checked').parent().find('.form-check-label').html();
|
searchSelectedTag = $('#filter-tags-tab .form-check-input:checked').parent().find('.form-check-label').html();
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('#filterButton').click(function () {
|
$('#filterButton').click(function () {
|
||||||
$('#filterDropdown').toggleClass('show');
|
$('#filterDropdown').toggleClass('show');
|
||||||
});
|
});
|
||||||
setSearchFilterIcon();
|
setSearchFilterIcon();
|
||||||
|
$("#searchFormInput").val(getSearchParam("search"));
|
||||||
});
|
});
|
||||||
function setSearchFilterIcon() {
|
function setSearchFilterIcon() {
|
||||||
updateSearchSelectedValues();
|
updateSearchSelectedValues();
|
||||||
|
@ -71,5 +68,5 @@
|
||||||
$('#filterButton').addClass('active');
|
$('#filterButton').addClass('active');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -71,7 +71,8 @@ $(document).ready(function () {
|
||||||
$("#buttonSearch").click(function (event) {
|
$("#buttonSearch").click(function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (isSearchOpen()) {
|
if (isSearchOpen()) {
|
||||||
closeSearchMenu();
|
modal.showPleaseWait();
|
||||||
|
//closeSearchMenu();
|
||||||
} else {
|
} else {
|
||||||
openSearchMenu();
|
openSearchMenu();
|
||||||
}
|
}
|
||||||
|
@ -109,7 +110,6 @@ $(document).ready(function () {
|
||||||
$(selector).attr('aria-expanded', 'false');
|
$(selector).attr('aria-expanded', 'false');
|
||||||
|
|
||||||
$("#mysearch").css({ display: '' });
|
$("#mysearch").css({ display: '' });
|
||||||
$("#mysearch").removeClass('animate__bounceOutUp');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -149,26 +149,18 @@ async function openRightMenu() {
|
||||||
}
|
}
|
||||||
var selector = '#buttonMyNavbar svg';
|
var selector = '#buttonMyNavbar svg';
|
||||||
$(selector).addClass('active');
|
$(selector).addClass('active');
|
||||||
$("#myNavbar").removeClass('animate__bounceOutRight');
|
|
||||||
$("#myNavbar").show();
|
$("#myNavbar").show();
|
||||||
$("#myNavbar").addClass('animate__animated animate__bounceInRight');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function closeSearchMenu() {
|
async function closeSearchMenu() {
|
||||||
$("#mysearch").removeClass('animate__bounceInDown');
|
$("#mysearch").hide();
|
||||||
$("#mysearch").addClass('animate__bounceOutUp');
|
|
||||||
setTimeout(function () {
|
|
||||||
$("#mysearch").hide();
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
async function openSearchMenu() {
|
async function openSearchMenu() {
|
||||||
if (isScreeWidthCollapseSize()) {
|
if (isScreeWidthCollapseSize()) {
|
||||||
closeLeftMenu();
|
closeLeftMenu();
|
||||||
closeRightMenu();
|
closeRightMenu();
|
||||||
}
|
}
|
||||||
$("#mysearch").removeClass('animate__bounceOutUp');
|
|
||||||
$("#mysearch").show();
|
$("#mysearch").show();
|
||||||
$("#mysearch").addClass('animate__animated animate__bounceInDown');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function seachFormPlayURL(url) {
|
async function seachFormPlayURL(url) {
|
||||||
|
@ -200,7 +192,7 @@ async function seachFormPlayURL(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSearchOpen() {
|
function isSearchOpen() {
|
||||||
return $('#mysearch').hasClass('animate__bounceInDown');
|
return $("#mysearch").is(":visible");
|
||||||
}
|
}
|
||||||
function isMyNMavbarOpen() {
|
function isMyNMavbarOpen() {
|
||||||
return $('#myNavbar').hasClass('animate__bounceInRight');
|
return $('#myNavbar').hasClass('animate__bounceInRight');
|
||||||
|
@ -319,4 +311,4 @@ $(document).ready(function () {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
flickityReload();
|
flickityReload();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -86,6 +86,7 @@ if (window.navigator.standalone || window.matchMedia('(display-mode: standalone)
|
||||||
document.body.classList.add('pwa');
|
document.body.classList.add('pwa');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var queryString = window.location.search;
|
var queryString = window.location.search;
|
||||||
var urlParams = new URLSearchParams(queryString);
|
var urlParams = new URLSearchParams(queryString);
|
||||||
|
|
||||||
|
@ -93,6 +94,10 @@ if (urlParams.has('debug')) {
|
||||||
isDebuging = false;
|
isDebuging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSearchParam(param) {
|
||||||
|
return urlParams.get(param) || "";
|
||||||
|
}
|
||||||
|
|
||||||
function forwardToIframe(data) {
|
function forwardToIframe(data) {
|
||||||
var iframe = document.getElementById('avideoModalIframe'); // Get the iframe by ID
|
var iframe = document.getElementById('avideoModalIframe'); // Get the iframe by ID
|
||||||
if (iframe && iframe.contentWindow) {
|
if (iframe && iframe.contentWindow) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue