mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Merge pull request #159 from dkanada/plugin
remove some deprecated plugin code
This commit is contained in:
commit
8f03439b7e
@ -386,16 +386,13 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
||||
function addPluginPagesToMainMenu(links, pluginItems, section) {
|
||||
for (var i = 0, length = pluginItems.length; i < length; i++) {
|
||||
var pluginItem = pluginItems[i];
|
||||
|
||||
if (Dashboard.allowPluginPages(pluginItem.PluginId)) {
|
||||
if (pluginItem.EnableInMainMenu && pluginItem.MenuSection === section) {
|
||||
links.push({
|
||||
name: pluginItem.DisplayName,
|
||||
icon: pluginItem.MenuIcon || "folder",
|
||||
href: Dashboard.getConfigurationPageUrl(pluginItem.Name),
|
||||
pageUrls: [Dashboard.getConfigurationPageUrl(pluginItem.Name)]
|
||||
});
|
||||
}
|
||||
if (pluginItem.EnableInMainMenu && pluginItem.MenuSection === section) {
|
||||
links.push({
|
||||
name: pluginItem.DisplayName,
|
||||
icon: pluginItem.MenuIcon || "folder",
|
||||
href: Dashboard.getConfigurationPageUrl(pluginItem.Name),
|
||||
pageUrls: [Dashboard.getConfigurationPageUrl(pluginItem.Name)]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||
|
||||
function reloadList(page) {
|
||||
loading.show();
|
||||
query.IsAppStoreSafe = true;
|
||||
var promise1 = ApiClient.getAvailablePlugins(query);
|
||||
var promise2 = ApiClient.getInstalledPlugins();
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
@ -16,13 +15,8 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||
});
|
||||
}
|
||||
|
||||
function populateList(options) {
|
||||
populateListInternal(options);
|
||||
}
|
||||
|
||||
function getHeaderText(category) {
|
||||
category = category.replace(" ", "");
|
||||
|
||||
if ("Channel" === category) {
|
||||
category = "Channels";
|
||||
} else if ("Theme" === category) {
|
||||
@ -36,11 +30,7 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||
return globalize.translate(category);
|
||||
}
|
||||
|
||||
function isUserInstalledPlugin(plugin) {
|
||||
return -1 === ["02528C96-F727-44D7-BE87-9EEF040758C3", "0277E613-3EC0-4360-A3DE-F8AF0AABB5E9", "4DCB591C-0FA2-4C5D-A7E5-DABE37164C8B"].indexOf(plugin.guid);
|
||||
}
|
||||
|
||||
function populateListInternal(options) {
|
||||
function populateList(options) {
|
||||
var availablePlugins = options.availablePlugins;
|
||||
var installedPlugins = options.installedPlugins;
|
||||
var allPlugins = availablePlugins.filter(function (plugin) {
|
||||
@ -113,7 +103,7 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||
}
|
||||
|
||||
return 0;
|
||||
}).filter(isUserInstalledPlugin);
|
||||
});
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
var limit = screen.availWidth >= 1920 ? 15 : 12;
|
||||
|
||||
@ -215,11 +205,14 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||
|
||||
var query = {
|
||||
TargetSystems: "Server",
|
||||
IsAppStoreSafe: true,
|
||||
IsAdult: false
|
||||
};
|
||||
|
||||
window.PluginCatalog = {
|
||||
renderCatalog: populateList
|
||||
};
|
||||
|
||||
return function (view, params) {
|
||||
view.querySelector("#selectSystem").addEventListener("change", function () {
|
||||
query.TargetSystems = this.value;
|
||||
|
@ -32,12 +32,37 @@ define(["loading", "libraryMenu", "dom", "globalize", "cardStyle", "emby-linkbut
|
||||
function getPluginCardHtml(plugin, pluginConfigurationPages) {
|
||||
var configPage = pluginConfigurationPages.filter(function(pluginConfigurationPage) {
|
||||
return pluginConfigurationPage.PluginId == plugin.Id
|
||||
})[0],
|
||||
html = "",
|
||||
disallowPlugins = !Dashboard.allowPluginPages(plugin.Id),
|
||||
configPageUrl = configPage ? Dashboard.getConfigurationPageUrl(configPage.Name) : null,
|
||||
href = configPage && !disallowPlugins ? configPageUrl : null;
|
||||
return html += "<div data-id='" + plugin.Id + "' data-name='" + plugin.Name + "' class='card backdropCard'>", html += '<div class="cardBox visualCardBox">', html += '<div class="cardScalable">', html += '<div class="cardPadder cardPadder-backdrop"></div>', html += href ? '<a class="cardContent cardImageContainer" is="emby-linkbutton" href="' + href + '">' : configPageUrl ? disallowPlugins ? '<div class="cardContent connectModePluginCard cardImageContainer">' : '<div class="cardContent cardImageContainer">' : '<div class="cardContent noConfigPluginCard noHoverEffect cardImageContainer">', plugin.ImageUrl ? (html += '<div class="cardImage coveredImage" style="background-image:url(\'' + plugin.ImageUrl + "');\">", html += "</div>") : html += '<i class="cardImageIcon md-icon"></i>', html += href ? "</a>" : "</div>", html += "</div>", html += '<div class="cardFooter">', html += '<div style="text-align:right; float:right;padding-top:5px;">', html += '<button type="button" is="paper-icon-button-light" class="btnCardMenu autoSize"><i class="md-icon">more_horiz</i></button>', html += "</div>", html += "<div class='cardText'>", html += configPage ? configPage.DisplayName || plugin.Name : plugin.Name, html += "</div>", html += "<div class='cardText cardText-secondary'>", html += plugin.Version, html += "</div>", html += "</div>", html += "</div>", html += "</div>"
|
||||
})[0];
|
||||
var configPageUrl = configPage ? Dashboard.getConfigurationPageUrl(configPage.Name) : null;
|
||||
|
||||
var html = "";
|
||||
html += "<div data-id='" + plugin.Id + "' data-name='" + plugin.Name + "' class='card backdropCard'>";
|
||||
html += '<div class="cardBox visualCardBox">';
|
||||
html += '<div class="cardScalable">';
|
||||
html += '<div class="cardPadder cardPadder-backdrop"></div>';
|
||||
html += configPageUrl ? '<a class="cardContent cardImageContainer" is="emby-linkbutton" href="' + configPageUrl + '">' : '<div class="cardContent noConfigPluginCard noHoverEffect cardImageContainer">';
|
||||
if (plugin.ImageUrl) {
|
||||
html += '<div class="cardImage coveredImage" style="background-image:url(\'' + plugin.ImageUrl + "');\">";
|
||||
html += "</div>";
|
||||
} else {
|
||||
html += '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
html += configPageUrl ? "</a>" : "</div>";
|
||||
html += "</div>";
|
||||
html += '<div class="cardFooter">';
|
||||
html += '<div style="text-align:right; float:right;padding-top:5px;">';
|
||||
html += '<button type="button" is="paper-icon-button-light" class="btnCardMenu autoSize"><i class="md-icon">more_horiz</i></button>';
|
||||
html += "</div>";
|
||||
html += "<div class='cardText'>";
|
||||
html += configPage ? configPage.DisplayName || plugin.Name : plugin.Name;
|
||||
html += "</div>";
|
||||
html += "<div class='cardText cardText-secondary'>";
|
||||
html += plugin.Version;
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
return html;
|
||||
}
|
||||
|
||||
function renderPlugins(page, plugins, showNoPluginsMessage) {
|
||||
@ -117,4 +142,4 @@ define(["loading", "libraryMenu", "dom", "globalize", "cardStyle", "emby-linkbut
|
||||
}), window.PluginsPage = {
|
||||
renderPlugins: renderPlugins
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -32,9 +32,6 @@ function pageIdOn(eventName, id, fn) {
|
||||
})
|
||||
}
|
||||
var Dashboard = {
|
||||
allowPluginPages: function(pluginId) {
|
||||
return true;
|
||||
},
|
||||
getCurrentUser: function() {
|
||||
return window.ApiClient.getCurrentUser(!1)
|
||||
},
|
||||
@ -153,14 +150,8 @@ var Dashboard = {
|
||||
! function() {
|
||||
"use strict";
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
"cordova" !== self.appMode && "android" !== self.appMode || (apiClient.getAvailablePlugins = function() {
|
||||
return Promise.resolve([])
|
||||
})
|
||||
}
|
||||
|
||||
function onApiClientCreated(e, newApiClient) {
|
||||
initializeApiClient(newApiClient), window.$ && ($.ajax = newApiClient.ajax)
|
||||
window.$ && ($.ajax = newApiClient.ajax)
|
||||
}
|
||||
|
||||
function defineConnectionManager(connectionManager) {
|
||||
|
Loading…
Reference in New Issue
Block a user