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
|
@ -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