mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update episode filters
This commit is contained in:
parent
e11d02694d
commit
d42d6c123a
8 changed files with 282 additions and 489 deletions
|
@ -106,7 +106,33 @@
|
|||
$('.chkHDFilter', context).checked(query.IsHD == true);
|
||||
$('.chkSDFilter', context).checked(query.IsHD == false);
|
||||
|
||||
$('#chkSubtitle', context).checked(query.HasSubtitles == true);
|
||||
$('#chkTrailer', context).checked(query.HasTrailer == true);
|
||||
$('#chkThemeSong', context).checked(query.HasThemeSong == true);
|
||||
$('#chkThemeVideo', context).checked(query.HasThemeVideo == true);
|
||||
$('#chkSpecialFeature', context).checked(query.HasSpecialFeature == true);
|
||||
|
||||
$('#chkSpecialEpisode', context).checked(query.ParentIndexNumber == 0);
|
||||
$('#chkMissingEpisode', context).checked(query.IsMissing == true);
|
||||
$('#chkFutureEpisode', context).checked(query.IsUnaired == true);
|
||||
|
||||
context.querySelector('.playersRadioGroup').selected = query.MinPlayers == null ? 'all' : query.MinPlayers;
|
||||
|
||||
$('.chkStatus', context).each(function () {
|
||||
|
||||
var filters = "," + (query.SeriesStatus || "");
|
||||
var filterName = this.getAttribute('data-filter');
|
||||
|
||||
this.checked = filters.indexOf(',' + filterName) != -1;
|
||||
});
|
||||
|
||||
$('.chkAirDays', context).each(function () {
|
||||
|
||||
var filters = "," + (query.AirDays || "");
|
||||
var filterName = this.getAttribute('data-filter');
|
||||
|
||||
this.checked = filters.indexOf(',' + filterName) != -1;
|
||||
});
|
||||
}
|
||||
|
||||
function triggerChange(instance) {
|
||||
|
@ -212,12 +238,119 @@
|
|||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('.chkStatus', context).on('change', function () {
|
||||
|
||||
var filterName = this.getAttribute('data-filter');
|
||||
var filters = query.SeriesStatus || "";
|
||||
|
||||
filters = (',' + filters).replace(',' + filterName, '').substring(1);
|
||||
|
||||
if (this.checked) {
|
||||
filters = filters ? (filters + ',' + filterName) : filterName;
|
||||
}
|
||||
|
||||
query.SeriesStatus = filters;
|
||||
query.StartIndex = 0;
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('.chkAirDays', context).on('change', function () {
|
||||
|
||||
var filterName = this.getAttribute('data-filter');
|
||||
var filters = query.AirDays || "";
|
||||
|
||||
filters = (',' + filters).replace(',' + filterName, '').substring(1);
|
||||
|
||||
if (this.checked) {
|
||||
filters = filters ? (filters + ',' + filterName) : filterName;
|
||||
}
|
||||
|
||||
query.AirDays = filters;
|
||||
query.StartIndex = 0;
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkTrailer', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.HasTrailer = this.checked ? true : null;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkThemeSong', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.HasThemeSong = this.checked ? true : null;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkSpecialFeature', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.HasSpecialFeature = this.checked ? true : null;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkThemeVideo', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.HasThemeVideo = this.checked ? true : null;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkMissingEpisode', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.IsMissing = this.checked ? true : false;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkSpecialEpisode', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.ParentIndexNumber = this.checked ? 0 : null;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkFutureEpisode', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
|
||||
if (this.checked) {
|
||||
query.IsUnaired = true;
|
||||
query.IsVirtualUnaired = null;
|
||||
} else {
|
||||
query.IsUnaired = null;
|
||||
query.IsVirtualUnaired = false;
|
||||
}
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
$('#chkSubtitle', context).on('change', function () {
|
||||
|
||||
query.StartIndex = 0;
|
||||
query.HasSubtitles = this.checked ? true : null;
|
||||
|
||||
triggerChange(instance);
|
||||
});
|
||||
|
||||
context.querySelector('.playersRadioGroup').addEventListener('iron-select', function(e) {
|
||||
|
||||
query.StartIndex = 0;
|
||||
var val = e.target.selected;
|
||||
query.MinPlayers = val == "all" ? null : val;
|
||||
triggerChange(instance);
|
||||
var newValue = val == "all" ? null : val;
|
||||
var changed = query.MinPlayers != newValue;
|
||||
query.MinPlayers = newValue;
|
||||
if (changed) {
|
||||
triggerChange(instance);
|
||||
}
|
||||
});
|
||||
|
||||
context.addEventListener('change', function(e) {
|
||||
|
@ -313,13 +446,35 @@
|
|||
context.querySelector('.yearFilters').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (options.mode == 'movies') {
|
||||
if (options.mode == 'movies' || options.mode == 'episodes') {
|
||||
context.querySelector('.videoTypeFilters').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (options.mode == 'games') {
|
||||
context.querySelector('.players').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (options.mode == 'movies' || options.mode == 'series' || options.mode == 'games' || options.mode == 'episodes') {
|
||||
context.querySelector('.features').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (options.mode == 'series') {
|
||||
context.querySelector('.airdays').classList.remove('hide');
|
||||
context.querySelector('.seriesStatus').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (options.mode == 'episodes') {
|
||||
showByClass(context, 'episodeFilter');
|
||||
}
|
||||
}
|
||||
|
||||
function showByClass(context, className) {
|
||||
|
||||
var elems = context.querySelectorAll('.' + className);
|
||||
|
||||
for (var i = 0, length = elems.length; i < length; i++) {
|
||||
elems[i].classList.remove('hide');
|
||||
}
|
||||
}
|
||||
|
||||
function hideByClass(context, className) {
|
||||
|
@ -332,7 +487,7 @@
|
|||
}
|
||||
|
||||
function enableDynamicFilters(mode) {
|
||||
return mode == 'movies' || mode == 'games';
|
||||
return mode == 'movies' || mode == 'games' || mode == 'series';
|
||||
}
|
||||
|
||||
return function (options) {
|
||||
|
|
|
@ -9,9 +9,48 @@
|
|||
<paper-checkbox class="chkStandardFilter chkFavorite" data-filter="IsFavorite">${OptionFavorite}</paper-checkbox>
|
||||
<paper-checkbox class="chkStandardFilter chkLikes" data-filter="Likes">${OptionLikes}</paper-checkbox>
|
||||
<paper-checkbox class="chkStandardFilter chkDislikes" data-filter="Dislikes">${OptionDislikes}</paper-checkbox>
|
||||
|
||||
<paper-checkbox id="chkSpecialEpisode" class="episodeFilter hide">${OptionSpecialEpisode}</paper-checkbox>
|
||||
<paper-checkbox id="chkMissingEpisode" class="episodeFilter hide">${OptionMissingEpisode}</paper-checkbox>
|
||||
<paper-checkbox id="chkFutureEpisode" class="episodeFilter hide">${OptionUnairedEpisode}</paper-checkbox>
|
||||
</div>
|
||||
<div class="seriesStatus hide">
|
||||
<br />
|
||||
<h2 style="margin-bottom: .25em;">
|
||||
${HeaderStatus}
|
||||
</h2>
|
||||
<div class="paperCheckboxList">
|
||||
<paper-checkbox class="chkStatus" id="chkStatusContinuing" data-filter="Continuing">${OptionContinuing}</paper-checkbox>
|
||||
<paper-checkbox class="chkStatus" id="chkStatusEnded" data-filter="Ended">${OptionEnded}</paper-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div data-role="collapsible" data-collapsed="true" data-mini="true" class="airdays hide">
|
||||
<h2>${HeaderAirDays}</h2>
|
||||
|
||||
<div class="paperCheckboxList">
|
||||
<paper-checkbox class="chkAirDays" id="chkSunday" data-filter="Sunday">${OptionSunday}</paper-checkbox>
|
||||
<paper-checkbox class="chkAirDays" id="chkMonday" data-filter="Monday">${OptionMonday}</paper-checkbox>
|
||||
<paper-checkbox class="chkAirDays" id="chkTuesday" data-filter="Tuesday">${OptionTuesday}</paper-checkbox>
|
||||
<paper-checkbox class="chkAirDays" id="chkWednesday" data-filter="Wednesday">${OptionWednesday}</paper-checkbox>
|
||||
<paper-checkbox class="chkAirDays" id="chkThursday" data-filter="Thursday">${OptionThursday}</paper-checkbox>
|
||||
<paper-checkbox class="chkAirDays" id="chkFriday" data-filter="Friday">${OptionFriday}</paper-checkbox>
|
||||
<paper-checkbox class="chkAirDays" id="chkSaturday" data-filter="Saturday">${OptionSaturday}</paper-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="collapsible" data-collapsed="true" data-mini="true" class="features hide">
|
||||
<h2>${HeaderFeatures}</h2>
|
||||
|
||||
<div class="paperCheckboxList">
|
||||
<paper-checkbox class="chkFeatureFilter" id="chkSubtitle">${OptionHasSubtitles}</paper-checkbox>
|
||||
<paper-checkbox class="chkFeatureFilter" id="chkTrailer">${OptionHasTrailer}</paper-checkbox>
|
||||
<paper-checkbox class="chkFeatureFilter" id="chkSpecialFeature">${OptionHasSpecialFeatures}</paper-checkbox>
|
||||
<paper-checkbox class="chkFeatureFilter" id="chkThemeSong">${OptionHasThemeSong}</paper-checkbox>
|
||||
<paper-checkbox class="chkFeatureFilter" id="chkThemeVideo">${OptionHasThemeVideo}</paper-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="players hide" style="margin-top:1.5em;">
|
||||
<div class="players hide">
|
||||
<h2 style="margin-bottom: .25em;">
|
||||
${HeaderNumberOfPlayers}
|
||||
</h2>
|
||||
|
@ -22,8 +61,7 @@
|
|||
<paper-radio-button class="radioPlayers" name="4">${Option4Player}</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
|
||||
<div data-role="collapsible" data-collapsed="true" data-mini="true" class="genreFilters hide" style="margin-top:2em;">
|
||||
<div data-role="collapsible" data-collapsed="true" data-mini="true" class="genreFilters hide">
|
||||
<h2>${HeaderGenres}</h2>
|
||||
|
||||
<div class="filterOptions">
|
||||
|
|
|
@ -2,11 +2,14 @@
|
|||
position: fixed !important;
|
||||
top: 5% !important;
|
||||
bottom: 5% !important;
|
||||
margin: 0 !important;
|
||||
left: 50%!important;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
max-height: none !important;
|
||||
max-width: none !important;
|
||||
min-width: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
@media all and (min-height: 300px) {
|
||||
|
@ -20,7 +23,16 @@
|
|||
@media all and (min-width: 300px) {
|
||||
|
||||
.dynamicFilterDialog {
|
||||
min-width: 240px;
|
||||
width: 240px;
|
||||
margin-left: -120px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 400px) {
|
||||
|
||||
.dynamicFilterDialog {
|
||||
width: 300px;
|
||||
margin-left: -150px !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue