mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #372 - Plugin "Overview"
This commit is contained in:
parent
9e05644d21
commit
86df2296f7
2 changed files with 41 additions and 51 deletions
|
@ -14,26 +14,25 @@
|
|||
<a href="pluginupdates.html" data-role="button">Automatic Updates</a>
|
||||
</div>
|
||||
|
||||
<div style="display: inline-block; margin: .75em 0;">
|
||||
<div style="margin: .75em 0;">
|
||||
|
||||
<div style="display: inline-block; margin-right: 1em;">
|
||||
<label for="selectTargetSystem">Show plugins for</label>
|
||||
<select id="selectTargetSystem" data-role="none" style="margin-left: .5em;">
|
||||
<option value="Server">MB Server</option>
|
||||
<option value="MBTheater">MB Theater</option>
|
||||
<option value="MBClassic">MB Classic</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button>
|
||||
</div>
|
||||
|
||||
<div id="noPlugins" class="hide"><div style="text-align:center;margin: 10px;">No available plugins</div></div>
|
||||
|
||||
<div data-role="collapsible" id="pluginServerCollapsible" class="hide" data-collapsed="false" data-mini="true">
|
||||
<h3>MB Server</h3>
|
||||
<div id="pluginServerTiles"></div>
|
||||
<div id="noPlugins" class="hide">
|
||||
<div style="text-align: center; margin: 10px;">No available plugins</div>
|
||||
</div>
|
||||
|
||||
<div data-role="collapsible" id="pluginTheatreCollapsible" class="hide" data-mini="true">
|
||||
<h3>MB Theater</h3>
|
||||
<div id="pluginTheatreTiles"></div>
|
||||
</div>
|
||||
|
||||
<div data-role="collapsible" id="pluginClassicCollapsible" class="hide" data-mini="true">
|
||||
<h3>MB Classic</h3>
|
||||
<div id="pluginClassicTiles"></div>
|
||||
</div>
|
||||
<div id="pluginTiles"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// The base query options
|
||||
var query = {
|
||||
TargetSystems: 'Server,MBTheater,MBClassic'
|
||||
TargetSystems: 'Server'
|
||||
};
|
||||
|
||||
function reloadList(page) {
|
||||
|
@ -26,17 +26,28 @@
|
|||
availablePlugins = availablePlugins.filter(function (p) {
|
||||
return p.type == "UserInstalled";
|
||||
}).sort(function (a, b) {
|
||||
return a.name > b.name ? 1 : -1;
|
||||
|
||||
var aName = (a.category || "General") + " " + a.name;
|
||||
var bame = (b.category || "General") + " " + b.name;
|
||||
|
||||
return aName > bame ? 1 : -1;
|
||||
});
|
||||
|
||||
var serverhtml = '';
|
||||
var theatrehtml = '';
|
||||
var classichtml = "";
|
||||
var pluginhtml = '';
|
||||
|
||||
var currentCategory;
|
||||
|
||||
for (var i = 0, length = availablePlugins.length; i < length; i++) {
|
||||
var html = '';
|
||||
var plugin = availablePlugins[i];
|
||||
|
||||
var category = plugin.category || "General";
|
||||
|
||||
if (category != currentCategory) {
|
||||
html += '<h2 style="margin: .5em 0 0;">' + category + '</h2>';
|
||||
currentCategory = category;
|
||||
}
|
||||
|
||||
html += "<a class='posterItem smallBackdropPosterItem transparentPosterItem borderlessPosterItem' href='addPlugin.html?name=" + encodeURIComponent(plugin.name) + "'>";
|
||||
|
||||
if (plugin.thumbImage) {
|
||||
|
@ -62,7 +73,7 @@
|
|||
})[0];
|
||||
|
||||
if (installedPlugin) {
|
||||
html += "<span class='installedPluginTitle'>"+ plugin.name + "</span> (Installed)";
|
||||
html += "<span class='installedPluginTitle'>" + plugin.name + "</span> (Installed)";
|
||||
} else {
|
||||
html += plugin.name;
|
||||
}
|
||||
|
@ -71,13 +82,7 @@
|
|||
|
||||
html += "</a>";
|
||||
|
||||
if (plugin.targetSystem == "Server") {
|
||||
serverhtml += html;
|
||||
} else if (plugin.targetSystem == "MBTheater") {
|
||||
theatrehtml += html;
|
||||
} else if (plugin.targetSystem == "MBClassic") {
|
||||
classichtml += html;
|
||||
}
|
||||
pluginhtml += html;
|
||||
|
||||
}
|
||||
|
||||
|
@ -85,27 +90,7 @@
|
|||
$("#noPlugins", page).hide();
|
||||
}
|
||||
|
||||
$('#pluginServerTiles', page).html(serverhtml);
|
||||
$('#pluginTheatreTiles', page).html(theatrehtml);
|
||||
$('#pluginClassicTiles', page).html(classichtml);
|
||||
|
||||
if (serverhtml) {
|
||||
$('#pluginServerCollapsible', page).show();
|
||||
} else {
|
||||
$('#pluginServerCollapsible', page).hide();
|
||||
}
|
||||
|
||||
if (theatrehtml) {
|
||||
$('#pluginTheatreCollapsible', page).show();
|
||||
} else {
|
||||
$('#pluginTheatreCollapsible', page).hide();
|
||||
}
|
||||
|
||||
if (classichtml) {
|
||||
$('#pluginClassicCollapsible', page).show();
|
||||
} else {
|
||||
$('#pluginClassicCollapsible', page).hide();
|
||||
}
|
||||
$('#pluginTiles', page).html(pluginhtml);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
@ -127,6 +112,12 @@
|
|||
reloadList(page);
|
||||
});
|
||||
|
||||
$('#selectTargetSystem', page).on('change', function () {
|
||||
|
||||
query.TargetSystems = this.value;
|
||||
reloadList(page);
|
||||
});
|
||||
|
||||
}).on('pageshow', "#pluginCatalogPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue