mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
cursory post-deuglification clean-up
This commit is contained in:
parent
dee0e6a5c7
commit
58264c5046
3 changed files with 99 additions and 139 deletions
|
@ -1,8 +1,8 @@
|
||||||
define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globalize", "loading", "connectionManager", "playMethodHelper", "cardBuilder", "imageLoader", "components/activitylog", "humanedate", "listViewStyle", "emby-linkbutton", "flexStyles", "emby-button", "emby-itemscontainer"], function (datetime, events, itemHelper, serverNotifications, dom, globalize, loading, connectionManager, playMethodHelper, cardBuilder, imageLoader, ActivityLog) {
|
define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globalize", "loading", "connectionManager", "playMethodHelper", "cardBuilder", "imageLoader", "components/activitylog", "humanedate", "listViewStyle", "emby-linkbutton", "flexStyles", "emby-button", "emby-itemscontainer"], function (datetime, events, itemHelper, serverNotifications, dom, globalize, loading, connectionManager, playMethodHelper, cardBuilder, imageLoader, ActivityLog) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function onConnectionHelpClick(e__q) {
|
function onConnectionHelpClick(evt) {
|
||||||
e__q.preventDefault();
|
evt.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEditServerNameClick(e__w) {
|
function onEditServerNameClick(evt) {
|
||||||
var page = dom.parentWithClass(this, "page");
|
var page = dom.parentWithClass(this, "page");
|
||||||
|
|
||||||
require(["prompt"], function (prompt) {
|
require(["prompt"], function (prompt) {
|
||||||
|
@ -36,7 +36,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
e__w.preventDefault();
|
evt.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,16 +54,14 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
text.push(globalize.translate("sharedcomponents#DirectStreamHelp1"));
|
text.push(globalize.translate("sharedcomponents#DirectStreamHelp1"));
|
||||||
text.push("<br/>");
|
text.push("<br/>");
|
||||||
text.push(globalize.translate("sharedcomponents#DirectStreamHelp2"));
|
text.push(globalize.translate("sharedcomponents#DirectStreamHelp2"));
|
||||||
} else {
|
} else if (isTranscode) {
|
||||||
if (isTranscode) {
|
title = globalize.translate("sharedcomponents#Transcoding");
|
||||||
title = globalize.translate("sharedcomponents#Transcoding");
|
text.push(globalize.translate("sharedcomponents#MediaIsBeingConverted"));
|
||||||
text.push(globalize.translate("sharedcomponents#MediaIsBeingConverted"));
|
|
||||||
|
|
||||||
if (session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length) {
|
if (session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length) {
|
||||||
text.push("<br/>");
|
text.push("<br/>");
|
||||||
text.push(globalize.translate("sharedcomponents#LabelReasonForTranscoding"));
|
text.push(globalize.translate("sharedcomponents#LabelReasonForTranscoding"));
|
||||||
showTranscodeReasons = true;
|
showTranscodeReasons = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,37 +129,29 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onActiveDevicesClick(e__r) {
|
function onActiveDevicesClick(evt) {
|
||||||
var btn = dom.parentWithClass(e__r.target, "sessionCardButton");
|
var btn = dom.parentWithClass(evt.target, "sessionCardButton");
|
||||||
|
|
||||||
if (btn) {
|
if (btn) {
|
||||||
var card = dom.parentWithClass(btn, "card");
|
var card = dom.parentWithClass(btn, "card");
|
||||||
|
|
||||||
if (card) {
|
if (card) {
|
||||||
var sessionId = card.id;
|
var sessionId = card.id;
|
||||||
var session = (DashboardPage.sessionsList || []).filter(function (s__t) {
|
var session = (DashboardPage.sessionsList || []).filter(function (dashboardSession) {
|
||||||
return "session" + s__t.Id === sessionId;
|
return "session" + dashboardSession.Id === sessionId;
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
if (btn.classList.contains("btnCardOptions")) {
|
if (btn.classList.contains("btnCardOptions")) {
|
||||||
showOptionsMenu(btn, session);
|
showOptionsMenu(btn, session);
|
||||||
} else {
|
} else if (btn.classList.contains("btnSessionInfo")) {
|
||||||
if (btn.classList.contains("btnSessionInfo")) {
|
showPlaybackInfo(btn, session);
|
||||||
showPlaybackInfo(btn, session);
|
} else if (btn.classList.contains("btnSessionSendMessage")) {
|
||||||
} else {
|
showSendMessageForm(btn, session);
|
||||||
if (btn.classList.contains("btnSessionSendMessage")) {
|
} else if (btn.classList.contains("btnSessionStop")) {
|
||||||
showSendMessageForm(btn, session);
|
connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id, "Stop");
|
||||||
} else {
|
} else if (btn.classList.contains("btnSessionPlayPause") && session.PlayState) {
|
||||||
if (btn.classList.contains("btnSessionStop")) {
|
connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id, "PlayPause");
|
||||||
connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id, "Stop");
|
|
||||||
} else {
|
|
||||||
if (btn.classList.contains("btnSessionPlayPause") && session.PlayState) {
|
|
||||||
connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id, "PlayPause");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +171,6 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,8 +267,8 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
cardElem.classList.add("deadSession");
|
cardElem.classList.add("deadSession");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i__u = 0, length = sessions.length; i__u < length; i__u++) {
|
for (var i = 0, length = sessions.length; i < length; i++) {
|
||||||
var session = sessions[i__u];
|
var session = sessions[i];
|
||||||
var rowId = "session" + session.Id;
|
var rowId = "session" + session.Id;
|
||||||
var elem = view.querySelector("#" + rowId);
|
var elem = view.querySelector("#" + rowId);
|
||||||
|
|
||||||
|
@ -383,9 +372,9 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
function renderRunningTasks(view, tasks) {
|
function renderRunningTasks(view, tasks) {
|
||||||
var html = "";
|
var html = "";
|
||||||
tasks = tasks.filter(function (t__o) {
|
tasks = tasks.filter(function (task) {
|
||||||
if ("Idle" != t__o.State) {
|
if ("Idle" != task.State) {
|
||||||
return !t__o.IsHidden;
|
return !task.IsHidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -397,8 +386,8 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
view.querySelector(".runningTasksContainer").classList.add("hide");
|
view.querySelector(".runningTasksContainer").classList.add("hide");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i__i = 0, length = tasks.length; i__i < length; i__i++) {
|
for (var i = 0, length = tasks.length; i < length; i++) {
|
||||||
var task = tasks[i__i];
|
var task = tasks[i];
|
||||||
|
|
||||||
if (html += "<p>", html += task.Name + "<br/>", "Running" == task.State) {
|
if (html += "<p>", html += task.Name + "<br/>", "Running" == task.State) {
|
||||||
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
|
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
|
||||||
|
@ -407,10 +396,8 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
html += "</progress>";
|
html += "</progress>";
|
||||||
html += "<span style='color:#009F00;margin-left:5px;margin-right:5px;'>" + progress + "%</span>";
|
html += "<span style='color:#009F00;margin-left:5px;margin-right:5px;'>" + progress + "%</span>";
|
||||||
html += '<button type="button" is="paper-icon-button-light" title="' + globalize.translate("ButtonStop") + '" onclick="DashboardPage.stopTask(this, \'' + task.Id + '\');" class="autoSize"><i class="md-icon">cancel</i></button>';
|
html += '<button type="button" is="paper-icon-button-light" title="' + globalize.translate("ButtonStop") + '" onclick="DashboardPage.stopTask(this, \'' + task.Id + '\');" class="autoSize"><i class="md-icon">cancel</i></button>';
|
||||||
} else {
|
} else if ("Cancelling" == task.State) {
|
||||||
if ("Cancelling" == task.State) {
|
html += '<span style="color:#cc0000;">' + globalize.translate("LabelStopping") + "</span>";
|
||||||
html += '<span style="color:#cc0000;">' + globalize.translate("LabelStopping") + "</span>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html += "</p>";
|
html += "</p>";
|
||||||
|
@ -519,10 +506,8 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
|
if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
|
||||||
bottomText = topText;
|
bottomText = topText;
|
||||||
topText = nowPlayingItem.SeriesName || nowPlayingItem.Album;
|
topText = nowPlayingItem.SeriesName || nowPlayingItem.Album;
|
||||||
} else {
|
} else if (nowPlayingItem.ProductionYear) {
|
||||||
if (nowPlayingItem.ProductionYear) {
|
bottomText = nowPlayingItem.ProductionYear;
|
||||||
bottomText = nowPlayingItem.ProductionYear;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,8 +545,8 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
html.push(session.UserName);
|
html.push(session.UserName);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i__p = 0, length = session.AdditionalUsers.length; i__p < length; i__p++) {
|
for (var i = 0, length = session.AdditionalUsers.length; i < length; i++) {
|
||||||
html.push(session.AdditionalUsers[i__p].UserName);
|
html.push(session.AdditionalUsers[i].UserName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return html.join(", ");
|
return html.join(", ");
|
||||||
|
@ -809,45 +794,45 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return function (view, params) {
|
return function (view, params) {
|
||||||
function onRestartRequired(e__a, apiClient) {
|
function onRestartRequired(evt, apiClient) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
renderHasPendingRestart(view, apiClient, true);
|
renderHasPendingRestart(view, apiClient, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onServerShuttingDown(e__s, apiClient) {
|
function onServerShuttingDown(evt, apiClient) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
renderHasPendingRestart(view, apiClient, true);
|
renderHasPendingRestart(view, apiClient, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onServerRestarting(e__d, apiClient) {
|
function onServerRestarting(evt, apiClient) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
renderHasPendingRestart(view, apiClient, true);
|
renderHasPendingRestart(view, apiClient, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPackageInstalling(e__f, apiClient) {
|
function onPackageInstalling(evt, apiClient) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
pollForInfo(view, apiClient, true);
|
pollForInfo(view, apiClient, true);
|
||||||
reloadSystemInfo(view, apiClient);
|
reloadSystemInfo(view, apiClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPackageInstallationCompleted(e__g, apiClient) {
|
function onPackageInstallationCompleted(evt, apiClient) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
pollForInfo(view, apiClient, true);
|
pollForInfo(view, apiClient, true);
|
||||||
reloadSystemInfo(view, apiClient);
|
reloadSystemInfo(view, apiClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSessionsUpdate(e__h, apiClient, info) {
|
function onSessionsUpdate(evt, apiClient, info) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
renderInfo(view, info);
|
renderInfo(view, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onScheduledTasksUpdate(e__j, apiClient, info) {
|
function onScheduledTasksUpdate(evt, apiClient, info) {
|
||||||
if (apiClient.serverId() === serverId) {
|
if (apiClient.serverId() === serverId) {
|
||||||
renderRunningTasks(view, info);
|
renderRunningTasks(view, info);
|
||||||
}
|
}
|
||||||
|
@ -865,6 +850,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
loading.show();
|
loading.show();
|
||||||
pollForInfo(page, apiClient);
|
pollForInfo(page, apiClient);
|
||||||
DashboardPage.startInterval(apiClient);
|
DashboardPage.startInterval(apiClient);
|
||||||
|
// TODO we currently don't support packages and thus these events are useless
|
||||||
events.on(serverNotifications, "RestartRequired", onRestartRequired);
|
events.on(serverNotifications, "RestartRequired", onRestartRequired);
|
||||||
events.on(serverNotifications, "ServerShuttingDown", onServerShuttingDown);
|
events.on(serverNotifications, "ServerShuttingDown", onServerShuttingDown);
|
||||||
events.on(serverNotifications, "ServerRestarting", onServerRestarting);
|
events.on(serverNotifications, "ServerRestarting", onServerRestarting);
|
||||||
|
@ -896,8 +882,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
view.addEventListener("viewbeforehide", function () {
|
view.addEventListener("viewbeforehide", function () {
|
||||||
var apiClient = ApiClient; // TODO we currently don't support packages and thus these events are useless
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
events.off(serverNotifications, "RestartRequired", onRestartRequired);
|
events.off(serverNotifications, "RestartRequired", onRestartRequired);
|
||||||
events.off(serverNotifications, "ServerShuttingDown", onServerShuttingDown);
|
events.off(serverNotifications, "ServerShuttingDown", onServerShuttingDown);
|
||||||
events.off(serverNotifications, "ServerRestarting", onServerRestarting);
|
events.off(serverNotifications, "ServerRestarting", onServerRestarting);
|
||||||
|
@ -913,13 +898,10 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
view.addEventListener("viewdestroy", function () {
|
view.addEventListener("viewdestroy", function () {
|
||||||
var page = this;
|
var page = this;
|
||||||
var userActivityLog = page.userActivityLog;
|
var userActivityLog = page.userActivityLog;
|
||||||
|
|
||||||
if (userActivityLog) {
|
if (userActivityLog) {
|
||||||
userActivityLog.destroy();
|
userActivityLog.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
var serverActivityLog = page.serverActivityLog;
|
var serverActivityLog = page.serverActivityLog;
|
||||||
|
|
||||||
if (serverActivityLog) {
|
if (serverActivityLog) {
|
||||||
serverActivityLog.destroy();
|
serverActivityLog.destroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
if (enableScrollX()) {
|
if (enableScrollX()) {
|
||||||
return "overflowBackdrop";
|
return "overflowBackdrop";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "backdrop";
|
return "backdrop";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +16,6 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
if (enableScrollX()) {
|
if (enableScrollX()) {
|
||||||
return "overflowPortrait";
|
return "overflowPortrait";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "portrait";
|
return "portrait";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +23,6 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
if (enableScrollX()) {
|
if (enableScrollX()) {
|
||||||
return 12;
|
return 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 9;
|
return 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,22 +150,15 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTabs() {
|
function getTabs() {
|
||||||
return [{
|
return [
|
||||||
name: globalize.translate("Programs")
|
{ name: globalize.translate("Programs") },
|
||||||
}, {
|
{ name: globalize.translate("TabGuide") },
|
||||||
name: globalize.translate("TabGuide")
|
{ name: globalize.translate("TabChannels") },
|
||||||
}, {
|
{ name: globalize.translate("TabRecordings") },
|
||||||
name: globalize.translate("TabChannels")
|
{ name: globalize.translate("HeaderSchedule") },
|
||||||
}, {
|
{ name: globalize.translate("TabSeries") },
|
||||||
name: globalize.translate("TabRecordings")
|
{ name: globalize.translate("ButtonSearch"), cssClass: "searchTabButton" }
|
||||||
}, {
|
];
|
||||||
name: globalize.translate("HeaderSchedule")
|
|
||||||
}, {
|
|
||||||
name: globalize.translate("TabSeries")
|
|
||||||
}, {
|
|
||||||
name: globalize.translate("ButtonSearch"),
|
|
||||||
cssClass: "searchTabButton"
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setScrollClasses(elem, scrollX) {
|
function setScrollClasses(elem, scrollX) {
|
||||||
|
@ -190,13 +180,10 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultTabIndex(folderId) {
|
function getDefaultTabIndex(folderId) {
|
||||||
switch (userSettings.get("landing-" + folderId)) {
|
if (userSettings.get("landing-" + folderId) === "guide") {
|
||||||
case "guide":
|
return 1;
|
||||||
return 1;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return function (view, params) {
|
return function (view, params) {
|
||||||
|
@ -204,18 +191,18 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
return new Date().getTime() - lastFullRender > 3e5;
|
return new Date().getTime() - lastFullRender > 3e5;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBeforeTabChange(e__q) {
|
function onBeforeTabChange(evt) {
|
||||||
preLoadTab(view, parseInt(e__q.detail.selectedTabIndex));
|
preLoadTab(view, parseInt(evt.detail.selectedTabIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTabChange(e__w) {
|
function onTabChange(evt) {
|
||||||
var previousTabController = tabControllers[parseInt(e__w.detail.previousIndex)];
|
var previousTabController = tabControllers[parseInt(evt.detail.previousIndex)];
|
||||||
|
|
||||||
if (previousTabController && previousTabController.onHide) {
|
if (previousTabController && previousTabController.onHide) {
|
||||||
previousTabController.onHide();
|
previousTabController.onHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadTab(view, parseInt(e__w.detail.selectedTabIndex));
|
loadTab(view, parseInt(evt.detail.selectedTabIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTabContainers() {
|
function getTabContainers() {
|
||||||
|
@ -229,30 +216,25 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
function getTabController(page, index, callback) {
|
function getTabController(page, index, callback) {
|
||||||
var depends = [];
|
var depends = [];
|
||||||
|
|
||||||
|
// TODO int is a little hard to read
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
depends.push("scripts/livetvguide");
|
depends.push("scripts/livetvguide");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
depends.push("scripts/livetvchannels");
|
depends.push("scripts/livetvchannels");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
depends.push("scripts/livetvrecordings");
|
depends.push("scripts/livetvrecordings");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
depends.push("scripts/livetvschedule");
|
depends.push("scripts/livetvschedule");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
depends.push("scripts/livetvseriestimers");
|
depends.push("scripts/livetvseriestimers");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
depends.push("scripts/searchtab");
|
depends.push("scripts/searchtab");
|
||||||
}
|
}
|
||||||
|
@ -269,9 +251,15 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
|
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
|
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
|
||||||
controller = 0 === index ? self : 6 === index ? new controllerFactory(view, tabContent, {
|
if (0 === index) {
|
||||||
collectionType: "livetv"
|
controller = self;
|
||||||
}) : new controllerFactory(view, params, tabContent);
|
} else if (6 === index) {
|
||||||
|
controller = new controllerFactory(view, tabContent, {
|
||||||
|
collectionType: "livetv"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
controller = new controllerFactory(view, params, tabContent);
|
||||||
|
}
|
||||||
tabControllers[index] = controller;
|
tabControllers[index] = controller;
|
||||||
|
|
||||||
if (controller.initTab) {
|
if (controller.initTab) {
|
||||||
|
@ -285,7 +273,7 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
|
|
||||||
function preLoadTab(page, index) {
|
function preLoadTab(page, index) {
|
||||||
getTabController(page, index, function (controller) {
|
getTabController(page, index, function (controller) {
|
||||||
if (-1 == renderedTabs.indexOf(index) && controller.preRender) {
|
if (renderedTabs.indexOf(index) === -1 && controller.preRender) {
|
||||||
controller.preRender();
|
controller.preRender();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -308,21 +296,18 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
}
|
}
|
||||||
|
|
||||||
controller.renderTab();
|
controller.renderTab();
|
||||||
} else {
|
} else if (controller.onShow) {
|
||||||
if (controller.onShow) {
|
controller.onShow();
|
||||||
controller.onShow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTabController = controller;
|
currentTabController = controller;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onInputCommand(e__e) {
|
function onInputCommand(evt) {
|
||||||
switch (e__e.detail.command) {
|
if (evt.detail.command === "search") {
|
||||||
case "search":
|
evt.preventDefault();
|
||||||
e__e.preventDefault();
|
Dashboard.navigate("search.html?collectionType=livetv");
|
||||||
Dashboard.navigate("search.html?collectionType=livetv");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,8 +328,8 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
var tabContent = view.querySelector(".pageTabContent[data-index='0']");
|
var tabContent = view.querySelector(".pageTabContent[data-index='0']");
|
||||||
var containers = tabContent.querySelectorAll(".itemsContainer");
|
var containers = tabContent.querySelectorAll(".itemsContainer");
|
||||||
|
|
||||||
for (var i__r = 0, length = containers.length; i__r < length; i__r++) {
|
for (var i = 0, length = containers.length; i < length; i++) {
|
||||||
setScrollClasses(containers[i__r], enableScrollX());
|
setScrollClasses(containers[i], enableScrollX());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -362,31 +347,28 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
var currentTabController;
|
var currentTabController;
|
||||||
var tabControllers = [];
|
var tabControllers = [];
|
||||||
var renderedTabs = [];
|
var renderedTabs = [];
|
||||||
view.addEventListener("viewbeforeshow", function (e__t) {
|
view.addEventListener("viewbeforeshow", function (evt) {
|
||||||
isViewRestored = e__t.detail.isRestored;
|
isViewRestored = evt.detail.isRestored;
|
||||||
initTabs();
|
initTabs();
|
||||||
});
|
});
|
||||||
view.addEventListener("viewshow", function (e__y) {
|
view.addEventListener("viewshow", function (evt) {
|
||||||
isViewRestored = e__y.detail.isRestored;
|
isViewRestored = evt.detail.isRestored;
|
||||||
|
|
||||||
if (!isViewRestored) {
|
if (!isViewRestored) {
|
||||||
mainTabsManager.selectedTabIndex(initialTabIndex);
|
mainTabsManager.selectedTabIndex(initialTabIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
inputManager.on(window, onInputCommand);
|
inputManager.on(window, onInputCommand);
|
||||||
});
|
});
|
||||||
view.addEventListener("viewbeforehide", function (e__u) {
|
view.addEventListener("viewbeforehide", function (e__u) {
|
||||||
if (currentTabController && currentTabController.onHide) {
|
if (currentTabController && currentTabController.onHide) {
|
||||||
currentTabController.onHide();
|
currentTabController.onHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.classList.remove("autoScrollY");
|
document.body.classList.remove("autoScrollY");
|
||||||
inputManager.off(window, onInputCommand);
|
inputManager.off(window, onInputCommand);
|
||||||
});
|
});
|
||||||
view.addEventListener("viewdestroy", function (e__i) {
|
view.addEventListener("viewdestroy", function (evt) {
|
||||||
tabControllers.forEach(function (t__o) {
|
tabControllers.forEach(function (tabController) {
|
||||||
if (t__o.destroy) {
|
if (tabController.destroy) {
|
||||||
t__o.destroy();
|
tabController.destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,14 +28,10 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||||
} else {
|
} else {
|
||||||
if ("Theme" === category) {
|
if ("Theme" === category) {
|
||||||
category = "Themes";
|
category = "Themes";
|
||||||
} else {
|
} else if ("LiveTV" === category) {
|
||||||
if ("LiveTV" === category) {
|
category = "HeaderLiveTV";
|
||||||
category = "HeaderLiveTV";
|
} else if ("ScreenSaver" === category) {
|
||||||
} else {
|
category = "HeaderScreenSavers";
|
||||||
if ("ScreenSaver" === category) {
|
|
||||||
category = "HeaderScreenSavers";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,13 +45,13 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
||||||
function populateListInternal(options) {
|
function populateListInternal(options) {
|
||||||
var availablePlugins = options.availablePlugins;
|
var availablePlugins = options.availablePlugins;
|
||||||
var installedPlugins = options.installedPlugins;
|
var installedPlugins = options.installedPlugins;
|
||||||
var allPlugins = availablePlugins.filter(function (p__w) {
|
var allPlugins = availablePlugins.filter(function (plugin) {
|
||||||
p__w.category = p__w.category || "General";
|
plugin.category = plugin.category || "General";
|
||||||
p__w.categoryDisplayName = getHeaderText(p__w.category);
|
plugin.categoryDisplayName = getHeaderText(plugin.category);
|
||||||
|
|
||||||
if (!options.categories || -1 != options.categories.indexOf(p__w.category)) {
|
if (!options.categories || -1 != options.categories.indexOf(plugin.category)) {
|
||||||
if (!options.targetSystem || p__w.targetSystem == options.targetSystem) {
|
if (!options.targetSystem || plugin.targetSystem == options.targetSystem) {
|
||||||
return "UserInstalled" == p__w.type;
|
return "UserInstalled" == plugin.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue