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

plugin catalog collapsible sections, add plugin install disabled for non server plugins

This commit is contained in:
Techywarrior 2013-04-03 19:25:14 -07:00
parent ee5007c55d
commit 74631a28d5
4 changed files with 43 additions and 13 deletions

View file

@ -26,9 +26,10 @@
<select id="selectVersion" name="selectVersion"></select> <select id="selectVersion" name="selectVersion"></select>
</p> </p>
<p> <p id="btnInstallDiv" class="hide">
<button id="btnInstall" type="submit" data-icon="download" data-theme="b">Install</button> <button id="btnInstall" type="submit" data-icon="download" data-theme="b">Install</button>
</p> </p>
<p id="nonServerMsg"></p>
</div> </div>
</form> </form>

View file

@ -14,7 +14,20 @@
<a href="pluginupdates.html" data-role="button">Automatic Updates</a> <a href="pluginupdates.html" data-role="button">Automatic Updates</a>
</div> </div>
<div id="pluginTiles"></div> <div class="hide" id="pluginServer" data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;" data-theme="a">
<h3>Server</h3>
<div id="pluginServerTiles"></div>
</div>
<div class="hide" id="pluginMBTheatre" data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;" data-theme="a">
<h3>MB Theatre</h3>
<div id="pluginMBTheatreTiles"></div>
</div>
<div class="hide" id="pluginMBClassic" data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;" data-theme="a">
<h3>MB Classic</h3>
<div id="pluginMBClassicTiles"></div>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -30,6 +30,14 @@
Dashboard.setPageTitle(pkg.name); Dashboard.setPageTitle(pkg.name);
if (pkg.targetSystem == 'Server') {
$("#btnInstallDiv", page).show();
$("#nonServerMsg", page).hide();
}else {
$("#btnInstallDiv", page).hide();
$("#nonServerMsg", page).html("This plugin must be installed from "+pkg.targetSystem).show();
}
if (pkg.shortDescription) { if (pkg.shortDescription) {
$('#tagline', page).show().html(pkg.shortDescription); $('#tagline', page).show().html(pkg.shortDescription);
} else { } else {

View file

@ -9,11 +9,9 @@
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var promise1 = ApiClient.getAvailablePlugins(); var promise1 = ApiClient.getAvailablePlugins();
var promise2 = ApiClient.getInstalledPlugins(); var promise2 = ApiClient.getInstalledPlugins();
$.when(promise1, promise2).done(function (response1, response2) { $.when(promise1, promise2).done(function (response1, response2) {
PluginCatalogPage.populateList(response1[0], response2[0]); PluginCatalogPage.populateList(response1[0], response2[0]);
}); });
}, },
@ -21,20 +19,18 @@
populateList: function (availablePlugins, installedPlugins) { populateList: function (availablePlugins, installedPlugins) {
var page = $($.mobile.activePage); var page = $($.mobile.activePage);
availablePlugins = availablePlugins.filter(function (p) { availablePlugins = availablePlugins.filter(function (p) {
return p.type == "UserInstalled"; return p.type == "UserInstalled";
}).sort(function (a, b) { }).sort(function (a, b) {
return a.name > b.name ? 1 : -1; return a.name > b.name ? 1 : -1;
}); });
var html = "";
var serverHtml = '';
var theatreHtml = '';
var classicHtml = '';
for (var i = 0, length = availablePlugins.length; i < length; i++) { for (var i = 0, length = availablePlugins.length; i < length; i++) {
var html = "";
var plugin = availablePlugins[i]; var plugin = availablePlugins[i];
@ -64,7 +60,6 @@
html += "<div>"; html += "<div>";
if (installedPlugin) { if (installedPlugin) {
html += plugin.name + " (Installed)"; html += plugin.name + " (Installed)";
} else { } else {
html += plugin.name; html += plugin.name;
@ -75,9 +70,22 @@
html += "</a></div>"; html += "</a></div>";
if (plugin.targetSystem == 'Server') {
serverHtml += html;
}else if (plugin.targetSystem == 'MBTheater') {
theatreHtml += html;
}else if (plugin.targetSystem == 'MBClassic') {
classicHtml += html;
}
} }
$('#pluginTiles', page).html(html); $('#pluginServerTiles', page).html(serverHtml);
$('#pluginMBTheatreTiles', page).html(theatreHtml);
$('#pluginMBClassicTiles', page).html(classicHtml);
if (serverHtml) $('#pluginServer', page).show();
if (theatreHtml) $('#pluginMBTheatre', page).show();
if (classicHtml) $('#pluginMBClassic', page).show();
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }