1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

plugin catalog filtering change

This commit is contained in:
Techywarrior 2013-04-08 18:38:18 -07:00
parent d98e3d928e
commit 715787a888
2 changed files with 29 additions and 46 deletions

View file

@ -13,9 +13,14 @@
<a href="plugincatalog.html" data-role="button" class="ui-btn-active">Plugin Catalog</a> <a href="plugincatalog.html" data-role="button" class="ui-btn-active">Plugin Catalog</a>
<a href="pluginupdates.html" data-role="button">Automatic Updates</a> <a href="pluginupdates.html" data-role="button">Automatic Updates</a>
</div> </div>
<div class="viewSettings" style="margin: .5em 0;text-align:left;">
<h5>Displaying plugins for:</h5>
<fieldset data-role="controlgroup" data-type="horizontal" style="margin:auto;text-align: center;" id="pluginTabs">
<a href="" data-role="button" data-mini="true" class="ui-btn-active" rel="Server">MB Server</a>
<a href="" data-role="button" data-mini="true" rel="MBTheater">MB Theatre</a>
<a href="" data-role="button" data-mini="true" rel="MBClassic">MB Classic</a>
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button> <button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button>
</div> </fieldset>
<div id="pluginTiles"></div> <div id="pluginTiles"></div>
</div> </div>
@ -23,20 +28,6 @@
<div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true"> <div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<form> <form>
<fieldset data-role="controlgroup">
<legend>
<h3>Application:</h3>
</legend>
<input class="chkStandardFilter" type="checkbox" name="chkServer" id="chkServer" data-theme="c" data-filter="Server">
<label for="chkServer">MB Server</label>
<input class="chkStandardFilter" type="checkbox" name="chkTheatre" id="chkTheatre" data-theme="c" data-filter="MBTheater">
<label for="chkTheatre">MB Theater</label>
<input class="chkStandardFilter" type="checkbox" name="chkClassic" id="chkClassic" data-theme="c" data-filter="MBClassic">
<label for="chkClassic">MB Classic</label>
</fieldset>
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend> <legend>
<h3>Pricing:</h3> <h3>Pricing:</h3>

View file

@ -2,6 +2,7 @@
// The base query options // The base query options
var query = { var query = {
TargetSystems: 'Server'
}; };
function reloadList(page) { function reloadList(page) {
@ -70,31 +71,28 @@
} }
if (!availablePlugins.length) {
html = '<div style="text-align:center;margin: 10px;">No available plugins</div>';
}
$('#pluginTiles', page).html(html); $('#pluginTiles', page).html(html);
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
function selectTab(elem) {
$("#pluginTabs a").removeClass("ui-btn-active");
$(elem).addClass("ui-btn-active");
query.TargetSystems = $(elem).attr("rel");
reloadList($.mobile.activePage);
}
$(document).on('pageinit', "#pluginCatalogPage", function () { $(document).on('pageinit', "#pluginCatalogPage", function () {
var page = this; var page = this;
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.TargetSystems || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.TargetSystems = filters;
reloadList(page);
});
$('.chkPremiumFilter', this).on('change', function () { $('.chkPremiumFilter', this).on('change', function () {
if (this.checked) { if (this.checked) {
@ -103,24 +101,18 @@
query.IsPremium = null; query.IsPremium = null;
} }
reloadList(page); });
$('#pluginTabs a', this).each(function(){
$(this).on('click', function () {
selectTab(this);
});
}); });
}).on('pageshow', "#pluginCatalogPage", function () { }).on('pageshow', "#pluginCatalogPage", function () {
selectTab($("#pluginTabs a.ui-btn-active"));
reloadList(this);
// Reset form values using the last used query // Reset form values using the last used query
$('.chkStandardFilter', this).each(function () {
var filters = "," + (query.TargetSystems || "");
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1;
}).checkboxradio('refresh');
$('.chkPremiumFilter', this).each(function () { $('.chkPremiumFilter', this).each(function () {
var filters = query.IsPremium || false; var filters = query.IsPremium || false;