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

show apps in catalog

This commit is contained in:
Luke Pulverenti 2013-10-01 19:33:24 -04:00
parent bc19e7f928
commit b368226a95
2 changed files with 42 additions and 10 deletions

View file

@ -19,20 +19,21 @@
</p> </p>
<div style="display: inline-block;"> <div style="display: inline-block;">
<label for="selectTargetSystem">Show plugins for</label> <label for="selectTargetSystem">Show</label>
</div> </div>
<div style="display: inline-block;"> <div style="display: inline-block;">
<select id="selectTargetSystem" data-mini="true" data-inline="true" style="margin-left: .5em;"> <select id="selectTargetSystem" data-mini="true" data-inline="true" style="margin-left: .5em;">
<option value="Server">MB Server</option> <option value="Server">MB Server plugins</option>
<option value="MBTheater">MB Theater</option> <option value="MBTheater">MB Theater plugins</option>
<option value="MBClassic">MB Classic</option> <option value="MBClassic">MB Classic plugins</option>
<option value="Apps">Apps</option>
</select> </select>
</div> </div>
<div style="display: inline-block; vertical-align: bottom;"> <div style="display: inline-block; vertical-align: bottom; margin-left: 1em;">
<input class="chkPremiumFilter" type="checkbox" data-mini="true" data-inline="true" name="chkPremium" id="chkPremium" data-theme="c" data-filter="IsPremium"> <input class="chkPremiumFilter" type="checkbox" data-mini="true" data-inline="true" name="chkPremium" id="chkPremium" data-theme="c" data-filter="IsPremium">
<label for="chkPremium">Show Free Only</label> <label for="chkPremium">Free Only</label>
</div> </div>
<div id="noPlugins" class="hide"> <div id="noPlugins" class="hide">

View file

@ -5,11 +5,39 @@
TargetSystems: 'Server' TargetSystems: 'Server'
}; };
function getApps() {
var apps = [];
apps.push({
type: "UserInstalled",
name: "MBKinect",
category: "Voice Control",
isApp: true,
tileColor: "#050810",
thumbImage: "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/images/mbkinect/thumb.png",
externalUrl: "http://community.mediabrowser.tv/permalinks/14020/mb-kinect-and-control-public-alpha",
isPremium: false
});
return apps;
}
function getAppsPromise() {
var deferred = $.Deferred();
deferred.resolveWith(null, [[getApps()]]);
return deferred.promise();
}
function reloadList(page) { function reloadList(page) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var promise1 = ApiClient.getAvailablePlugins(query); var promise1 = query.TargetSystems == "Apps" ? getAppsPromise() : ApiClient.getAvailablePlugins(query);
var promise2 = ApiClient.getInstalledPlugins(); var promise2 = ApiClient.getInstalledPlugins();
$.when(promise1, promise2).done(function (response1, response2) { $.when(promise1, promise2).done(function (response1, response2) {
@ -48,7 +76,10 @@
currentCategory = category; currentCategory = category;
} }
html += "<a class='posterItem backdropPosterItem transparentPosterItem borderlessPosterItem' href='addPlugin.html?name=" + encodeURIComponent(plugin.name) + "'>"; var href = plugin.externalUrl ? plugin.externalUrl : "addPlugin.html?name=" + encodeURIComponent(plugin.name);
var target = plugin.externalUrl ? ' target="_blank"' : '';
html += "<a class='posterItem backdropPosterItem transparentPosterItem borderlessPosterItem' href='" + href + "' " + target + ">";
if (plugin.thumbImage) { if (plugin.thumbImage) {
html += '<div class="posterItemImage" style="background-image:url(\'' + plugin.thumbImage + '\');background-size:cover;"></div>'; html += '<div class="posterItemImage" style="background-image:url(\'' + plugin.thumbImage + '\');background-size:cover;"></div>';
@ -68,7 +99,7 @@
html += "<div class='posterItemText posterItemTextCentered' style='background:" + color + "'>"; html += "<div class='posterItemText posterItemTextCentered' style='background:" + color + "'>";
var installedPlugin = installedPlugins.filter(function (ip) { var installedPlugin = plugin.isApp ? null : installedPlugins.filter(function (ip) {
return ip.Name == plugin.name; return ip.Name == plugin.name;
})[0]; })[0];