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

deuglification

This commit is contained in:
cvium 2019-01-10 21:37:02 +01:00
parent c93cd26774
commit dee0e6a5c7
3 changed files with 1240 additions and 487 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,129 +1,155 @@
define(["layoutManager", "userSettings", "inputManager", "loading", "globalize", "libraryBrowser", "mainTabsManager", "cardBuilder", "apphost", "imageLoader", "scrollStyles", "emby-itemscontainer", "emby-tabs", "emby-button"], function(layoutManager, userSettings, inputManager, loading, globalize, libraryBrowser, mainTabsManager, cardBuilder, appHost, imageLoader) {
define(["layoutManager", "userSettings", "inputManager", "loading", "globalize", "libraryBrowser", "mainTabsManager", "cardBuilder", "apphost", "imageLoader", "scrollStyles", "emby-itemscontainer", "emby-tabs", "emby-button"], function (layoutManager, userSettings, inputManager, loading, globalize, libraryBrowser, mainTabsManager, cardBuilder, appHost, imageLoader) {
"use strict";
function enableScrollX() {
return !layoutManager.desktop
return !layoutManager.desktop;
}
function getBackdropShape() {
return enableScrollX() ? "overflowBackdrop" : "backdrop"
if (enableScrollX()) {
return "overflowBackdrop";
}
return "backdrop";
}
function getPortraitShape() {
return enableScrollX() ? "overflowPortrait" : "portrait"
if (enableScrollX()) {
return "overflowPortrait";
}
return "portrait";
}
function getLimit() {
return enableScrollX() ? 12 : 9
if (enableScrollX()) {
return 12;
}
return 9;
}
function loadRecommendedPrograms(page) {
loading.show();
var limit = getLimit();
enableScrollX() && (limit *= 2), ApiClient.getLiveTvRecommendedPrograms({
if (enableScrollX()) {
limit *= 2;
}
ApiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: !0,
IsAiring: true,
limit: limit,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Thumb,Backdrop",
EnableTotalRecordCount: !1,
EnableTotalRecordCount: false,
Fields: "ChannelInfo,PrimaryImageAspectRatio"
}).then(function(result) {
}).then(function (result) {
renderItems(page, result.Items, "activeProgramItems", "play", {
showAirDateTime: !1,
showAirEndTime: !0
}), loading.hide()
})
showAirDateTime: false,
showAirEndTime: true
});
loading.hide();
});
}
function reload(page, enableFullRender) {
enableFullRender && (loadRecommendedPrograms(page), ApiClient.getLiveTvPrograms({
if (enableFullRender) {
loadRecommendedPrograms(page);
ApiClient.getLiveTvPrograms({
userId: Dashboard.getCurrentUserId(),
HasAired: !1,
HasAired: false,
limit: getLimit(),
IsMovie: !1,
IsSports: !1,
IsKids: !1,
IsNews: !1,
IsSeries: !0,
EnableTotalRecordCount: !1,
IsMovie: false,
IsSports: false,
IsKids: false,
IsNews: false,
IsSeries: true,
EnableTotalRecordCount: false,
Fields: "ChannelInfo,PrimaryImageAspectRatio",
EnableImageTypes: "Primary,Thumb"
}).then(function(result) {
renderItems(page, result.Items, "upcomingEpisodeItems")
}), ApiClient.getLiveTvPrograms({
}).then(function (result) {
renderItems(page, result.Items, "upcomingEpisodeItems");
});
ApiClient.getLiveTvPrograms({
userId: Dashboard.getCurrentUserId(),
HasAired: !1,
HasAired: false,
limit: getLimit(),
IsMovie: !0,
EnableTotalRecordCount: !1,
IsMovie: true,
EnableTotalRecordCount: false,
Fields: "ChannelInfo",
EnableImageTypes: "Primary,Thumb"
}).then(function(result) {
}).then(function (result) {
renderItems(page, result.Items, "upcomingTvMovieItems", null, {
shape: getPortraitShape(),
preferThumb: null,
showParentTitle: !1
})
}), ApiClient.getLiveTvPrograms({
showParentTitle: false
});
});
ApiClient.getLiveTvPrograms({
userId: Dashboard.getCurrentUserId(),
HasAired: !1,
HasAired: false,
limit: getLimit(),
IsSports: !0,
EnableTotalRecordCount: !1,
IsSports: true,
EnableTotalRecordCount: false,
Fields: "ChannelInfo,PrimaryImageAspectRatio",
EnableImageTypes: "Primary,Thumb"
}).then(function(result) {
renderItems(page, result.Items, "upcomingSportsItems")
}), ApiClient.getLiveTvPrograms({
}).then(function (result) {
renderItems(page, result.Items, "upcomingSportsItems");
});
ApiClient.getLiveTvPrograms({
userId: Dashboard.getCurrentUserId(),
HasAired: !1,
HasAired: false,
limit: getLimit(),
IsKids: !0,
EnableTotalRecordCount: !1,
IsKids: true,
EnableTotalRecordCount: false,
Fields: "ChannelInfo,PrimaryImageAspectRatio",
EnableImageTypes: "Primary,Thumb"
}).then(function(result) {
renderItems(page, result.Items, "upcomingKidsItems")
}), ApiClient.getLiveTvPrograms({
}).then(function (result) {
renderItems(page, result.Items, "upcomingKidsItems");
});
ApiClient.getLiveTvPrograms({
userId: Dashboard.getCurrentUserId(),
HasAired: !1,
HasAired: false,
limit: getLimit(),
IsNews: !0,
EnableTotalRecordCount: !1,
IsNews: true,
EnableTotalRecordCount: false,
Fields: "ChannelInfo,PrimaryImageAspectRatio",
EnableImageTypes: "Primary,Thumb"
}).then(function(result) {
}).then(function (result) {
renderItems(page, result.Items, "upcomingNewsItems", null, {
showParentTitleOrTitle: !0,
showTitle: !1,
showParentTitle: !1
})
}))
showParentTitleOrTitle: true,
showTitle: false,
showParentTitle: false
});
});
}
}
function renderItems(page, items, sectionClass, overlayButton, cardOptions) {
var html = cardBuilder.getCardsHtml(Object.assign({
items: items,
preferThumb: "auto",
inheritThumb: !1,
inheritThumb: false,
shape: enableScrollX() ? "autooverflow" : "auto",
defaultShape: getBackdropShape(),
showParentTitle: !0,
showTitle: !0,
centerText: !0,
coverImage: !0,
overlayText: !1,
lazy: !0,
showParentTitle: true,
showTitle: true,
centerText: true,
coverImage: true,
overlayText: false,
lazy: true,
overlayPlayButton: "play" === overlayButton,
overlayMoreButton: "more" === overlayButton,
overlayInfoButton: "info" === overlayButton,
allowBottomPadding: !enableScrollX(),
showAirTime: !0,
showAirDateTime: !0
}, cardOptions || {})),
elem = page.querySelector("." + sectionClass);
elem.innerHTML = html, imageLoader.lazyChildren(elem)
showAirTime: true,
showAirDateTime: true
}, cardOptions || {}));
var elem = page.querySelector("." + sectionClass);
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
}
function getTabs() {
@ -142,119 +168,227 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
}, {
name: globalize.translate("ButtonSearch"),
cssClass: "searchTabButton"
}]
}];
}
function setScrollClasses(elem, scrollX) {
scrollX ? (elem.classList.add("hiddenScrollX"), layoutManager.tv && elem.classList.add("smoothScrollX"), elem.classList.add("scrollX"), elem.classList.remove("vertical-wrap")) : (elem.classList.remove("hiddenScrollX"), elem.classList.remove("smoothScrollX"), elem.classList.remove("scrollX"), elem.classList.add("vertical-wrap"))
if (scrollX) {
elem.classList.add("hiddenScrollX");
if (layoutManager.tv) {
elem.classList.add("smoothScrollX");
}
elem.classList.add("scrollX");
elem.classList.remove("vertical-wrap");
} else {
elem.classList.remove("hiddenScrollX");
elem.classList.remove("smoothScrollX");
elem.classList.remove("scrollX");
elem.classList.add("vertical-wrap");
}
}
function getDefaultTabIndex(folderId) {
switch (userSettings.get("landing-" + folderId)) {
case "guide":
return 1;
default:
return 0
return 0;
}
}
return function(view, params) {
return function (view, params) {
function enableFullRender() {
return (new Date).getTime() - lastFullRender > 3e5
return new Date().getTime() - lastFullRender > 3e5;
}
function onBeforeTabChange(e) {
preLoadTab(view, parseInt(e.detail.selectedTabIndex))
function onBeforeTabChange(e__q) {
preLoadTab(view, parseInt(e__q.detail.selectedTabIndex));
}
function onTabChange(e) {
var previousTabController = tabControllers[parseInt(e.detail.previousIndex)];
previousTabController && previousTabController.onHide && previousTabController.onHide(), loadTab(view, parseInt(e.detail.selectedTabIndex))
function onTabChange(e__w) {
var previousTabController = tabControllers[parseInt(e__w.detail.previousIndex)];
if (previousTabController && previousTabController.onHide) {
previousTabController.onHide();
}
loadTab(view, parseInt(e__w.detail.selectedTabIndex));
}
function getTabContainers() {
return view.querySelectorAll(".pageTabContent")
return view.querySelectorAll(".pageTabContent");
}
function initTabs() {
mainTabsManager.setTabs(view, currentTabIndex, getTabs, getTabContainers, onBeforeTabChange, onTabChange)
mainTabsManager.setTabs(view, currentTabIndex, getTabs, getTabContainers, onBeforeTabChange, onTabChange);
}
function getTabController(page, index, callback) {
var depends = [];
switch (index) {
case 0:
break;
case 1:
depends.push("scripts/livetvguide");
break;
case 2:
depends.push("scripts/livetvchannels");
break;
case 3:
depends.push("scripts/livetvrecordings");
break;
case 4:
depends.push("scripts/livetvschedule");
break;
case 5:
depends.push("scripts/livetvseriestimers");
break;
case 6:
depends.push("scripts/searchtab")
depends.push("scripts/searchtab");
}
require(depends, function(controllerFactory) {
require(depends, function (controllerFactory) {
var tabContent;
0 == index && (tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']"), self.tabContent = tabContent);
if (0 == index) {
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
self.tabContent = tabContent;
}
var controller = tabControllers[index];
controller || (tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']"), controller = 0 === index ? self : 6 === index ? new controllerFactory(view, tabContent, {
if (!controller) {
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
controller = 0 === index ? self : 6 === index ? new controllerFactory(view, tabContent, {
collectionType: "livetv"
}) : new controllerFactory(view, params, tabContent), tabControllers[index] = controller, controller.initTab && controller.initTab()), callback(controller)
})
}) : new controllerFactory(view, params, tabContent);
tabControllers[index] = controller;
if (controller.initTab) {
controller.initTab();
}
}
callback(controller);
});
}
function preLoadTab(page, index) {
getTabController(page, index, function(controller) {
-1 == renderedTabs.indexOf(index) && controller.preRender && controller.preRender()
})
getTabController(page, index, function (controller) {
if (-1 == renderedTabs.indexOf(index) && controller.preRender) {
controller.preRender();
}
});
}
function loadTab(page, index) {
currentTabIndex = index, getTabController(page, index, function(controller) {
initialTabIndex = null, 1 === index ? document.body.classList.add("autoScrollY") : document.body.classList.remove("autoScrollY"), -1 == renderedTabs.indexOf(index) ? (1 === index && renderedTabs.push(index), controller.renderTab()) : controller.onShow && controller.onShow(), currentTabController = controller
})
currentTabIndex = index;
getTabController(page, index, function (controller) {
initialTabIndex = null;
if (1 === index) {
document.body.classList.add("autoScrollY");
} else {
document.body.classList.remove("autoScrollY");
}
function onInputCommand(e) {
switch (e.detail.command) {
if (-1 == renderedTabs.indexOf(index)) {
if (1 === index) {
renderedTabs.push(index);
}
controller.renderTab();
} else {
if (controller.onShow) {
controller.onShow();
}
}
currentTabController = controller;
});
}
function onInputCommand(e__e) {
switch (e__e.detail.command) {
case "search":
e.preventDefault(), Dashboard.navigate("search.html?collectionType=livetv")
e__e.preventDefault();
Dashboard.navigate("search.html?collectionType=livetv");
}
}
var isViewRestored, self = this,
currentTabIndex = parseInt(params.tab || getDefaultTabIndex("livetv")),
initialTabIndex = currentTabIndex,
lastFullRender = 0;
[].forEach.call(view.querySelectorAll(".sectionTitleTextButton-programs"), function(link) {
var isViewRestored;
var self = this;
var currentTabIndex = parseInt(params.tab || getDefaultTabIndex("livetv"));
var initialTabIndex = currentTabIndex;
var lastFullRender = 0;
[].forEach.call(view.querySelectorAll(".sectionTitleTextButton-programs"), function (link) {
var href = link.href;
href && (link.href = href + "&serverId=" + ApiClient.serverId())
}), self.initTab = function() {
for (var tabContent = view.querySelector(".pageTabContent[data-index='0']"), containers = tabContent.querySelectorAll(".itemsContainer"), i = 0, length = containers.length; i < length; i++) setScrollClasses(containers[i], enableScrollX())
}, self.renderTab = function() {
var tabContent = view.querySelector(".pageTabContent[data-index='0']");
enableFullRender() ? (reload(tabContent, !0), lastFullRender = (new Date).getTime()) : reload(tabContent)
};
var currentTabController, tabControllers = [],
renderedTabs = [];
view.addEventListener("viewbeforeshow", function(e) {
isViewRestored = e.detail.isRestored, initTabs()
}), view.addEventListener("viewshow", function(e) {
isViewRestored = e.detail.isRestored, isViewRestored || mainTabsManager.selectedTabIndex(initialTabIndex), inputManager.on(window, onInputCommand)
}), view.addEventListener("viewbeforehide", function(e) {
currentTabController && currentTabController.onHide && currentTabController.onHide(), document.body.classList.remove("autoScrollY"), inputManager.off(window, onInputCommand)
}), view.addEventListener("viewdestroy", function(e) {
tabControllers.forEach(function(t) {
t.destroy && t.destroy()
})
})
if (href) {
link.href = href + "&serverId=" + ApiClient.serverId();
}
});
self.initTab = function () {
var tabContent = view.querySelector(".pageTabContent[data-index='0']");
var containers = tabContent.querySelectorAll(".itemsContainer");
for (var i__r = 0, length = containers.length; i__r < length; i__r++) {
setScrollClasses(containers[i__r], enableScrollX());
}
};
self.renderTab = function () {
var tabContent = view.querySelector(".pageTabContent[data-index='0']");
if (enableFullRender()) {
reload(tabContent, true);
lastFullRender = new Date().getTime();
} else {
reload(tabContent);
}
};
var currentTabController;
var tabControllers = [];
var renderedTabs = [];
view.addEventListener("viewbeforeshow", function (e__t) {
isViewRestored = e__t.detail.isRestored;
initTabs();
});
view.addEventListener("viewshow", function (e__y) {
isViewRestored = e__y.detail.isRestored;
if (!isViewRestored) {
mainTabsManager.selectedTabIndex(initialTabIndex);
}
inputManager.on(window, onInputCommand);
});
view.addEventListener("viewbeforehide", function (e__u) {
if (currentTabController && currentTabController.onHide) {
currentTabController.onHide();
}
document.body.classList.remove("autoScrollY");
inputManager.off(window, onInputCommand);
});
view.addEventListener("viewdestroy", function (e__i) {
tabControllers.forEach(function (t__o) {
if (t__o.destroy) {
t__o.destroy();
}
});
});
};
});

View file

@ -1,78 +1,212 @@
define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "emby-checkbox", "emby-select"], function(loading, libraryMenu, globalize) {
define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "emby-checkbox", "emby-select"], function (loading, libraryMenu, globalize) {
"use strict";
function reloadList(page) {
loading.show(), query.IsAppStoreSafe = !0;
var promise1 = ApiClient.getAvailablePlugins(query),
promise2 = ApiClient.getInstalledPlugins();
Promise.all([promise1, promise2]).then(function(responses) {
loading.show();
query.IsAppStoreSafe = true;
var promise1 = ApiClient.getAvailablePlugins(query);
var promise2 = ApiClient.getInstalledPlugins();
Promise.all([promise1, promise2]).then(function (responses) {
populateList({
catalogElement: page.querySelector("#pluginTiles"),
noItemsElement: page.querySelector("#noPlugins"),
availablePlugins: responses[0],
installedPlugins: responses[1]
})
})
});
});
}
function populateList(options) {
populateListInternal(options)
populateListInternal(options);
}
function getHeaderText(category) {
category.replace(" ", "").replace(" ", "");
return "Channel" === category ? category = "Channels" : "Theme" === category ? category = "Themes" : "LiveTV" === category ? category = "HeaderLiveTV" : "ScreenSaver" === category && (category = "HeaderScreenSavers"), globalize.translate(category)
if ("Channel" === category) {
category = "Channels";
} else {
if ("Theme" === category) {
category = "Themes";
} else {
if ("LiveTV" === category) {
category = "HeaderLiveTV";
} else {
if ("ScreenSaver" === category) {
category = "HeaderScreenSavers";
}
}
}
}
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)
return -1 === ["02528C96-F727-44D7-BE87-9EEF040758C3", "0277E613-3EC0-4360-A3DE-F8AF0AABB5E9", "4DCB591C-0FA2-4C5D-A7E5-DABE37164C8B"].indexOf(plugin.guid);
}
function populateListInternal(options) {
var availablePlugins = options.availablePlugins,
installedPlugins = options.installedPlugins,
allPlugins = availablePlugins.filter(function(p) {
return p.category = p.category || "General", p.categoryDisplayName = getHeaderText(p.category), (!options.categories || -1 != options.categories.indexOf(p.category)) && ((!options.targetSystem || p.targetSystem == options.targetSystem) && "UserInstalled" == p.type)
var availablePlugins = options.availablePlugins;
var installedPlugins = options.installedPlugins;
var allPlugins = availablePlugins.filter(function (p__w) {
p__w.category = p__w.category || "General";
p__w.categoryDisplayName = getHeaderText(p__w.category);
if (!options.categories || -1 != options.categories.indexOf(p__w.category)) {
if (!options.targetSystem || p__w.targetSystem == options.targetSystem) {
return "UserInstalled" == p__w.type;
}
return false;
}
return false;
});
availablePlugins = allPlugins.sort(function(a, b) {
var aName = a.category,
bName = b.category;
return aName > bName ? 1 : bName > aName ? -1 : (aName = a.name, bName = b.name, aName > bName ? 1 : bName > aName ? -1 : 0)
availablePlugins = allPlugins.sort(function (a__e, b__r) {
var aName = a__e.category;
var bName = b__r.category;
if (aName > bName) {
return 1;
}
if (bName > aName) {
return -1;
}
aName = a__e.name;
bName = b__r.name;
if (aName > bName) {
return 1;
}
if (bName > aName) {
return -1;
}
return 0;
});
var i, length, plugin, currentCategory, html = "";
var i__q;
var length;
var plugin;
var currentCategory;
var html = "";
if (!options.categories) {
currentCategory = globalize.translate("HeaderTopPlugins"), html += '<div class="verticalSection">', html += '<h2 class="sectionTitle sectionTitle-cards">' + currentCategory + "</h2>";
var topPlugins = allPlugins.slice(0).sort(function(a, b) {
if (a.installs > b.installs) return -1;
if (b.installs > a.installs) return 1;
var aName = a.name,
bName = b.name;
return aName > bName ? 1 : bName > aName ? -1 : 0
currentCategory = globalize.translate("HeaderTopPlugins");
html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards">' + currentCategory + "</h2>";
var topPlugins = allPlugins.slice(0).sort(function (a__t, b__y) {
if (a__t.installs > b__y.installs) {
return -1;
}
if (b__y.installs > a__t.installs) {
return 1;
}
var aName = a__t.name;
var bName = b__y.name;
if (aName > bName) {
return 1;
}
if (bName > aName) {
return -1;
}
return 0;
}).filter(isUserInstalledPlugin);
html += '<div class="itemsContainer vertical-wrap">';
var limit = screen.availWidth >= 1920 ? 15 : 12;
for (i = 0, length = Math.min(topPlugins.length, limit); i < length; i++) html += getPluginHtml(topPlugins[i], options, installedPlugins);
html += "</div>", html += "</div>"
for (i__q = 0, length = Math.min(topPlugins.length, limit); i__q < length; i__q++) {
html += getPluginHtml(topPlugins[i__q], options, installedPlugins);
}
var hasOpenTag = !1;
for (currentCategory = null, !1 === options.showCategory && (html += '<div class="itemsContainer vertical-wrap">', hasOpenTag = !0), i = 0, length = availablePlugins.length; i < length; i++) {
plugin = availablePlugins[i];
html += "</div>";
html += "</div>";
}
var hasOpenTag = false;
for (currentCategory = null, false === options.showCategory && (html += '<div class="itemsContainer vertical-wrap">', hasOpenTag = true), i__q = 0, length = availablePlugins.length; i__q < length; i__q++) {
plugin = availablePlugins[i__q];
var category = plugin.categoryDisplayName;
category != currentCategory && (!1 !== options.showCategory && (currentCategory && (hasOpenTag = !1, html += "</div>", html += "</div>"), html += '<div class="verticalSection">', html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>", html += '<div class="itemsContainer vertical-wrap">', hasOpenTag = !0), currentCategory = category), html += getPluginHtml(plugin, options, installedPlugins)
if (category != currentCategory) {
if (false !== options.showCategory) {
if (currentCategory) {
hasOpenTag = false;
html += "</div>";
html += "</div>";
}
hasOpenTag && (html += "</div>", html += "</div>"), !availablePlugins.length && options.noItemsElement && options.noItemsElement.classList.add("hide"), options.catalogElement.innerHTML = html, loading.hide()
html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>";
html += '<div class="itemsContainer vertical-wrap">';
hasOpenTag = true;
}
currentCategory = category;
}
html += getPluginHtml(plugin, options, installedPlugins);
}
if (hasOpenTag) {
html += "</div>";
html += "</div>";
}
if (!availablePlugins.length && options.noItemsElement) {
options.noItemsElement.classList.add("hide");
}
options.catalogElement.innerHTML = html;
loading.hide();
}
function getPluginHtml(plugin, options, installedPlugins) {
var html = "",
href = plugin.externalUrl ? plugin.externalUrl : "addplugin.html?name=" + encodeURIComponent(plugin.name) + "&guid=" + plugin.guid;
options.context && (href += "&context=" + options.context);
var html = "";
var href = plugin.externalUrl ? plugin.externalUrl : "addplugin.html?name=" + encodeURIComponent(plugin.name) + "&guid=" + plugin.guid;
if (options.context) {
href += "&context=" + options.context;
}
var target = plugin.externalUrl ? ' target="_blank"' : "";
html += "<div class='card backdropCard'>", html += '<div class="cardBox visualCardBox">', html += '<div class="cardScalable visualCardBox-cardScalable">', html += '<div class="cardPadder cardPadder-backdrop"></div>', html += '<a class="cardContent cardImageContainer" is="emby-linkbutton" href="' + href + '"' + target + ">", plugin.thumbImage ? (html += '<div class="cardImage coveredImage" style="background-image:url(\'' + plugin.thumbImage + "');\">", html += "</div>") : html += '<i class="cardImageIcon md-icon">&#xE2C7;</i>', html += "</a>", html += "</div>", html += '<div class="cardFooter">', html += "<div class='cardText'>", html += plugin.name, html += "</div>";
var installedPlugin = plugin.isApp ? null : installedPlugins.filter(function(ip) {
return ip.Id == plugin.guid
html += "<div class='card backdropCard'>";
html += '<div class="cardBox visualCardBox">';
html += '<div class="cardScalable visualCardBox-cardScalable">';
html += '<div class="cardPadder cardPadder-backdrop"></div>';
html += '<a class="cardContent cardImageContainer" is="emby-linkbutton" href="' + href + '"' + target + ">";
if (plugin.thumbImage) {
html += '<div class="cardImage coveredImage" style="background-image:url(\'' + plugin.thumbImage + "');\">";
html += "</div>";
} else {
html += '<i class="cardImageIcon md-icon">&#xE2C7;</i>';
}
html += "</a>";
html += "</div>";
html += '<div class="cardFooter">';
html += "<div class='cardText'>";
html += plugin.name;
html += "</div>";
var installedPlugin = plugin.isApp ? null : installedPlugins.filter(function (ip) {
return ip.Id == plugin.guid;
})[0];
return html += "<div class='cardText cardText-secondary'>", html += installedPlugin ? globalize.translate("LabelVersionInstalled").replace("{0}", installedPlugin.Version) : "&nbsp;", html += "</div>", html += "</div>", html += "</div>", html += "</div>"
html += "<div class='cardText cardText-secondary'>";
html += installedPlugin ? globalize.translate("LabelVersionInstalled").replace("{0}", installedPlugin.Version) : "&nbsp;";
html += "</div>";
html += "</div>";
html += "</div>";
return html += "</div>";
}
function getTabs() {
@ -82,20 +216,24 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
}, {
href: "plugincatalog.html",
name: globalize.translate("TabCatalog")
}]
}];
}
var query = {
TargetSystems: "Server",
IsAdult: !1
IsAdult: false
};
return window.PluginCatalog = {
window.PluginCatalog = {
renderCatalog: populateList
},
function(view, params) {
view.querySelector("#selectSystem").addEventListener("change", function() {
query.TargetSystems = this.value, reloadList(view)
}), view.addEventListener("viewshow", function() {
libraryMenu.setTabs("plugins", 1, getTabs), reloadList(this)
})
}
};
return function (view, params) {
view.querySelector("#selectSystem").addEventListener("change", function () {
query.TargetSystems = this.value;
reloadList(view);
});
view.addEventListener("viewshow", function () {
libraryMenu.setTabs("plugins", 1, getTabs);
reloadList(this);
});
};
});