2018-10-23 01:05:09 +03:00
|
|
|
function getWindowLocationSearch(win) {
|
|
|
|
"use strict";
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
var search = (win || window).location.search;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
if (!search) {
|
2019-02-23 16:38:53 +00:00
|
|
|
var index = window.location.href.indexOf("?");
|
|
|
|
|
|
|
|
if (-1 != index) {
|
|
|
|
search = window.location.href.substring(index);
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
return search || "";
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getParameterByName(name, url) {
|
|
|
|
"use strict";
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
2019-02-23 16:38:53 +00:00
|
|
|
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
|
|
|
var regex = new RegExp(regexS, "i");
|
|
|
|
var results = regex.exec(url || getWindowLocationSearch());
|
|
|
|
|
|
|
|
if (null == results) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function pageClassOn(eventName, className, fn) {
|
|
|
|
"use strict";
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-03-04 20:38:39 +00:00
|
|
|
document.addEventListener(eventName, function (event) {
|
|
|
|
var target = event.target;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (target.classList.contains(className)) {
|
2019-03-04 20:38:39 +00:00
|
|
|
fn.call(target, event);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function pageIdOn(eventName, id, fn) {
|
|
|
|
"use strict";
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-03-04 20:38:39 +00:00
|
|
|
document.addEventListener(eventName, function (event) {
|
|
|
|
var target = event.target;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (target.id === id) {
|
2019-03-04 20:38:39 +00:00
|
|
|
fn.call(target, event);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
var Dashboard = {
|
2019-02-23 16:38:53 +00:00
|
|
|
getCurrentUser: function () {
|
|
|
|
return window.ApiClient.getCurrentUser(false);
|
|
|
|
},
|
|
|
|
serverAddress: function () {
|
|
|
|
if (AppInfo.isNativeApp) {
|
|
|
|
var apiClient = window.ApiClient;
|
|
|
|
|
|
|
|
if (apiClient) {
|
|
|
|
return apiClient.serverAddress();
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
var urlLower = window.location.href.toLowerCase();
|
|
|
|
var index = urlLower.lastIndexOf("/web");
|
|
|
|
|
|
|
|
if (-1 != index) {
|
|
|
|
return urlLower.substring(0, index);
|
|
|
|
}
|
|
|
|
|
|
|
|
var loc = window.location;
|
|
|
|
var address = loc.protocol + "//" + loc.hostname;
|
|
|
|
|
|
|
|
if (loc.port) {
|
|
|
|
address += ":" + loc.port;
|
|
|
|
}
|
|
|
|
|
|
|
|
return address;
|
|
|
|
},
|
|
|
|
getCurrentUserId: function () {
|
|
|
|
var apiClient = window.ApiClient;
|
|
|
|
|
|
|
|
if (apiClient) {
|
|
|
|
return apiClient.getCurrentUserId();
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
onServerChanged: function (userId, accessToken, apiClient) {
|
|
|
|
apiClient = apiClient || window.ApiClient;
|
|
|
|
window.ApiClient = apiClient;
|
|
|
|
},
|
|
|
|
logout: function () {
|
|
|
|
ConnectionManager.logout().then(function () {
|
|
|
|
var loginPage;
|
|
|
|
|
2019-01-04 12:32:24 +01:00
|
|
|
if (AppInfo.isNativeApp) {
|
2019-02-23 16:38:53 +00:00
|
|
|
loginPage = "selectserver.html";
|
|
|
|
window.ApiClient = null;
|
|
|
|
} else {
|
|
|
|
loginPage = "login.html";
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
Dashboard.navigate(loginPage);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getConfigurationPageUrl: function (name) {
|
|
|
|
return "configurationpage?name=" + encodeURIComponent(name);
|
|
|
|
},
|
|
|
|
getConfigurationResourceUrl: function (name) {
|
|
|
|
if (AppInfo.isNativeApp) {
|
|
|
|
return ApiClient.getUrl("web/ConfigurationPage", {
|
2018-10-23 01:05:09 +03:00
|
|
|
name: name
|
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return Dashboard.getConfigurationPageUrl(name);
|
|
|
|
},
|
|
|
|
navigate: function (url, preserveQueryString) {
|
|
|
|
if (!url) {
|
|
|
|
throw new Error("url cannot be null or empty");
|
|
|
|
}
|
|
|
|
|
|
|
|
var queryString = getWindowLocationSearch();
|
|
|
|
|
|
|
|
if (preserveQueryString && queryString) {
|
|
|
|
url += queryString;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
require(["appRouter"], function (appRouter) {
|
|
|
|
return appRouter.show(url).then(resolve, reject);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
navigate_direct: function (path) {
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
require(["appRouter"], function (appRouter) {
|
|
|
|
return appRouter.showDirect(path).then(resolve, reject);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
processPluginConfigurationUpdateResult: function () {
|
|
|
|
require(["loading", "toast"], function (loading, toast) {
|
|
|
|
loading.hide();
|
|
|
|
toast(Globalize.translate("MessageSettingsSaved"));
|
|
|
|
});
|
|
|
|
},
|
|
|
|
processServerConfigurationUpdateResult: function (result) {
|
|
|
|
require(["loading", "toast"], function (loading, toast) {
|
|
|
|
loading.hide();
|
|
|
|
toast(Globalize.translate("MessageSettingsSaved"));
|
|
|
|
});
|
|
|
|
},
|
|
|
|
processErrorResponse: function (response) {
|
|
|
|
require(["loading"], function (loading) {
|
|
|
|
loading.hide();
|
|
|
|
});
|
|
|
|
|
|
|
|
var status = "" + response.status;
|
|
|
|
|
|
|
|
if (response.statusText) {
|
|
|
|
status = response.statusText;
|
|
|
|
}
|
|
|
|
|
|
|
|
Dashboard.alert({
|
|
|
|
title: status,
|
|
|
|
message: response.headers ? response.headers.get("X-Application-Error-Code") : null
|
|
|
|
});
|
|
|
|
},
|
|
|
|
alert: function (options) {
|
|
|
|
if ("string" == typeof options) {
|
|
|
|
return void require(["toast"], function (toast) {
|
2018-10-23 01:05:09 +03:00
|
|
|
toast({
|
|
|
|
text: options
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
require(["alert"], function (alert) {
|
|
|
|
alert({
|
|
|
|
title: options.title || Globalize.translate("HeaderAlert"),
|
|
|
|
text: options.message
|
|
|
|
}).then(options.callback || function () {});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
restartServer: function () {
|
|
|
|
var apiClient = window.ApiClient;
|
|
|
|
|
|
|
|
if (apiClient) {
|
|
|
|
require(["serverRestartDialog", "events"], function (ServerRestartDialog, events) {
|
2018-10-23 01:05:09 +03:00
|
|
|
var dialog = new ServerRestartDialog({
|
|
|
|
apiClient: apiClient
|
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
events.on(dialog, "restarted", function () {
|
|
|
|
if (AppInfo.isNativeApp) {
|
|
|
|
apiClient.ensureWebSocket();
|
|
|
|
} else {
|
|
|
|
window.location.reload(true);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
dialog.show();
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
},
|
2019-02-23 16:38:53 +00:00
|
|
|
capabilities: function (appHost) {
|
|
|
|
var caps = {
|
|
|
|
PlayableMediaTypes: ["Audio", "Video"],
|
|
|
|
SupportedCommands: ["MoveUp", "MoveDown", "MoveLeft", "MoveRight", "PageUp", "PageDown", "PreviousLetter", "NextLetter", "ToggleOsd", "ToggleContextMenu", "Select", "Back", "SendKey", "SendString", "GoHome", "GoToSettings", "VolumeUp", "VolumeDown", "Mute", "Unmute", "ToggleMute", "SetVolume", "SetAudioStreamIndex", "SetSubtitleStreamIndex", "DisplayContent", "GoToSearch", "DisplayMessage", "SetRepeatMode", "ChannelUp", "ChannelDown", "PlayMediaSource", "PlayTrailers"],
|
|
|
|
SupportsPersistentIdentifier: "cordova" === self.appMode || "android" === self.appMode,
|
|
|
|
SupportsMediaControl: true
|
|
|
|
};
|
|
|
|
caps.IconUrl = appHost.deviceIconUrl();
|
|
|
|
caps.SupportsSync = appHost.supports("sync");
|
|
|
|
caps.SupportsContentUploading = appHost.supports("cameraupload");
|
|
|
|
appHost.getPushTokenInfo();
|
|
|
|
return caps = Object.assign(caps, appHost.getPushTokenInfo());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var AppInfo = {};
|
|
|
|
!function () {
|
2018-10-23 01:05:09 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
function onApiClientCreated(e, newApiClient) {
|
2019-02-23 16:38:53 +00:00
|
|
|
if (window.$) {
|
|
|
|
$.ajax = newApiClient.ajax;
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function defineConnectionManager(connectionManager) {
|
2019-02-23 16:38:53 +00:00
|
|
|
window.ConnectionManager = connectionManager;
|
|
|
|
define("connectionManager", [], function () {
|
|
|
|
return connectionManager;
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function bindConnectionManagerEvents(connectionManager, events, userSettings) {
|
2019-02-23 16:38:53 +00:00
|
|
|
window.Events = events;
|
|
|
|
events.on(ConnectionManager, "apiclientcreated", onApiClientCreated);
|
|
|
|
|
|
|
|
connectionManager.currentApiClient = function () {
|
2018-10-23 01:05:09 +03:00
|
|
|
if (!localApiClient) {
|
|
|
|
var server = connectionManager.getLastUsedServer();
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (server) {
|
|
|
|
localApiClient = connectionManager.getApiClient(server.Id);
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
return localApiClient;
|
|
|
|
};
|
|
|
|
|
|
|
|
connectionManager.onLocalUserSignedIn = function (user) {
|
|
|
|
localApiClient = connectionManager.getApiClient(user.ServerId);
|
|
|
|
window.ApiClient = localApiClient;
|
|
|
|
return userSettings.setUserInfo(user.Id, localApiClient);
|
|
|
|
};
|
|
|
|
|
|
|
|
events.on(connectionManager, "localusersignedout", function () {
|
|
|
|
userSettings.setUserInfo(null, null);
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function createConnectionManager() {
|
2019-02-23 17:12:14 +00:00
|
|
|
return require(["connectionManagerFactory", "apphost", "credentialprovider", "events", "userSettings"], function (ConnectionManager, apphost, credentialProvider, events, userSettings) {
|
2019-03-04 20:30:42 +00:00
|
|
|
var credentialProviderInstance = new credentialProvider();
|
2019-03-04 20:25:42 +00:00
|
|
|
var promises = [apphost.getSyncProfile(), apphost.init()];
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
Promise.all(promises).then(function (responses) {
|
2019-03-04 20:30:42 +00:00
|
|
|
var deviceProfile = responses[0];
|
|
|
|
var capabilities = Dashboard.capabilities(apphost);
|
2019-02-23 17:12:14 +00:00
|
|
|
|
|
|
|
capabilities.DeviceProfile = deviceProfile;
|
|
|
|
|
|
|
|
var connectionManager = new ConnectionManager(credentialProviderInstance, apphost.appName(), apphost.appVersion(), apphost.deviceName(), apphost.deviceId(), capabilities, window.devicePixelRatio);
|
|
|
|
|
|
|
|
defineConnectionManager(connectionManager);
|
|
|
|
bindConnectionManagerEvents(connectionManager, events, userSettings);
|
|
|
|
|
|
|
|
if (!AppInfo.isNativeApp) {
|
|
|
|
console.log("loading ApiClient singleton");
|
|
|
|
|
|
|
|
return require(["apiclient"], function (apiClientFactory) {
|
|
|
|
console.log("creating ApiClient singleton");
|
|
|
|
|
|
|
|
var apiClient = new apiClientFactory(Dashboard.serverAddress(), apphost.appName(), apphost.appVersion(), apphost.deviceName(), apphost.deviceId(), window.devicePixelRatio);
|
|
|
|
|
|
|
|
apiClient.enableAutomaticNetworking = false;
|
2019-03-04 20:27:29 +00:00
|
|
|
apiClient.manualAddressOnly = true;
|
2019-02-23 17:12:14 +00:00
|
|
|
|
|
|
|
connectionManager.addApiClient(apiClient);
|
|
|
|
|
|
|
|
window.ApiClient = apiClient;
|
|
|
|
localApiClient = apiClient;
|
|
|
|
|
|
|
|
console.log("loaded ApiClient singleton");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return Promise.resolve();
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function returnFirstDependency(obj) {
|
2019-02-23 16:38:53 +00:00
|
|
|
return obj;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getSettingsBuilder(UserSettings, layoutManager, browser) {
|
2019-02-23 16:38:53 +00:00
|
|
|
UserSettings.prototype.enableThemeVideos = function (val) {
|
2019-01-22 02:24:12 +09:00
|
|
|
if (val != null) {
|
|
|
|
return this.set('enableThemeVideos', val.toString(), false);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-01-22 02:24:12 +09:00
|
|
|
val = this.get('enableThemeVideos', false);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-01-22 02:24:12 +09:00
|
|
|
if (val !== 'false') {
|
|
|
|
return !layoutManager.mobile;
|
|
|
|
} else {
|
|
|
|
return !browser.slow;
|
|
|
|
}
|
2019-01-21 17:47:10 +09:00
|
|
|
};
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-01-21 17:47:10 +09:00
|
|
|
return UserSettings;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getBowerPath() {
|
2019-01-21 17:47:10 +09:00
|
|
|
return "bower_components";
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getPlaybackManager(playbackManager) {
|
2019-03-04 20:38:39 +00:00
|
|
|
window.addEventListener("beforeunload", function () {
|
2018-10-23 01:05:09 +03:00
|
|
|
try {
|
2019-01-21 17:47:10 +09:00
|
|
|
playbackManager.onAppClose();
|
2018-10-23 01:05:09 +03:00
|
|
|
} catch (err) {
|
2019-01-21 17:47:10 +09:00
|
|
|
console.log("error in onAppClose: " + err);
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
|
|
|
return playbackManager;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getLayoutManager(layoutManager, appHost) {
|
2019-01-21 17:47:10 +09:00
|
|
|
if (appHost.getDefaultLayout) {
|
|
|
|
layoutManager.defaultLayout = appHost.getDefaultLayout();
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-01-21 17:47:10 +09:00
|
|
|
layoutManager.init();
|
|
|
|
return layoutManager;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getAppStorage(basePath) {
|
|
|
|
try {
|
2019-01-21 17:47:10 +09:00
|
|
|
localStorage.setItem("_test", "0");
|
|
|
|
localStorage.removeItem("_test");
|
|
|
|
return basePath + "/appstorage-localstorage";
|
2018-10-23 01:05:09 +03:00
|
|
|
} catch (e) {
|
2019-01-21 17:47:10 +09:00
|
|
|
return basePath + "/appstorage-memory";
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function createWindowHeadroom(Headroom) {
|
|
|
|
var headroom = new Headroom([], {});
|
2019-01-21 17:47:10 +09:00
|
|
|
headroom.init();
|
|
|
|
return headroom;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getCastSenderApiLoader() {
|
2019-01-21 17:47:10 +09:00
|
|
|
var ccLoaded = false;
|
2018-10-23 01:05:09 +03:00
|
|
|
return {
|
2019-02-23 16:38:53 +00:00
|
|
|
load: function () {
|
|
|
|
if (ccLoaded) {
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
2018-10-23 01:05:09 +03:00
|
|
|
var fileref = document.createElement("script");
|
2019-01-21 17:47:10 +09:00
|
|
|
fileref.setAttribute("type", "text/javascript");
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
fileref.onload = function () {
|
|
|
|
ccLoaded = true;
|
|
|
|
resolve();
|
2019-01-21 17:47:10 +09:00
|
|
|
};
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-01-21 17:47:10 +09:00
|
|
|
fileref.setAttribute("src", "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js");
|
|
|
|
document.querySelector("head").appendChild(fileref);
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
};
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getDummyCastSenderApiLoader() {
|
|
|
|
return {
|
2019-02-23 16:38:53 +00:00
|
|
|
load: function () {
|
|
|
|
window.chrome = window.chrome || {};
|
|
|
|
return Promise.resolve();
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
};
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function createSharedAppFooter(appFooter) {
|
2019-01-21 17:47:10 +09:00
|
|
|
return new appFooter({});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function onRequireJsError(requireType, requireModules) {
|
2019-01-21 17:47:10 +09:00
|
|
|
console.log("RequireJS error: " + (requireType || "unknown") + ". Failed modules: " + (requireModules || []).join(","));
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function defineResizeObserver() {
|
2019-02-23 16:38:53 +00:00
|
|
|
if (self.ResizeObserver) {
|
|
|
|
define("ResizeObserver", [], function () {
|
|
|
|
return self.ResizeObserver;
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
define("ResizeObserver", ["bower_components/emby-webcomponents/resize-observer-polyfill/ResizeObserver"], returnFirstDependency);
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function initRequireWithBrowser(browser) {
|
2019-01-16 02:47:29 +09:00
|
|
|
var bowerPath = getBowerPath();
|
|
|
|
var apiClientBowerPath = bowerPath + "/emby-apiclient";
|
|
|
|
var embyWebComponentsBowerPath = bowerPath + "/emby-webcomponents";
|
|
|
|
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("android" === self.appMode) {
|
|
|
|
define("filesystem", ["cordova/filesystem"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("filesystem", [embyWebComponentsBowerPath + "/filesystem"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window.IntersectionObserver && !browser.edge) {
|
|
|
|
define("lazyLoader", [embyWebComponentsBowerPath + "/lazyloader/lazyloader-intersectionobserver"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("lazyLoader", [embyWebComponentsBowerPath + "/lazyloader/lazyloader-scroll"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("android" === self.appMode) {
|
|
|
|
define("shell", ["cordova/shell"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("shell", [embyWebComponentsBowerPath + "/shell"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("cordova" === self.appMode || "android" === self.appMode) {
|
|
|
|
define("apiclientcore", ["bower_components/emby-apiclient/apiclient"], returnFirstDependency);
|
|
|
|
define("apiclient", ["bower_components/emby-apiclient/apiclientex"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("apiclient", ["bower_components/emby-apiclient/apiclient"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:47:29 +09:00
|
|
|
define("actionsheet", ["webActionSheet"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if ("registerElement" in document) {
|
|
|
|
define("registerElement", []);
|
2019-03-04 20:36:51 +00:00
|
|
|
} else if (browser.msie) {
|
|
|
|
define("registerElement", [bowerPath + "/webcomponentsjs/webcomponents-lite.min.js"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
} else {
|
2019-03-04 20:36:51 +00:00
|
|
|
define("registerElement", [bowerPath + "/document-register-element/build/document-register-element"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ("cordova" === self.appMode || "android" === self.appMode) {
|
|
|
|
define("serverdiscovery", ["cordova/serverdiscovery"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("serverdiscovery", [apiClientBowerPath + "/serverdiscovery"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("cordova" === self.appMode && browser.iOSVersion && browser.iOSVersion < 11) {
|
|
|
|
define("imageFetcher", ["cordova/imagestore"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("imageFetcher", [embyWebComponentsBowerPath + "/images/basicimagefetcher"], returnFirstDependency);
|
|
|
|
}
|
2019-01-16 02:47:29 +09:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
var preferNativeAlerts = browser.tv;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (preferNativeAlerts && window.alert) {
|
|
|
|
define("alert", [embyWebComponentsBowerPath + "/alert/nativealert"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("alert", [embyWebComponentsBowerPath + "/alert/alert"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:47:29 +09:00
|
|
|
defineResizeObserver();
|
|
|
|
define("dialog", [embyWebComponentsBowerPath + "/dialog/dialog"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (preferNativeAlerts && window.confirm) {
|
|
|
|
define("confirm", [embyWebComponentsBowerPath + "/confirm/nativeconfirm"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("confirm", [embyWebComponentsBowerPath + "/confirm/confirm"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((preferNativeAlerts || browser.xboxOne) && window.confirm) {
|
|
|
|
define("prompt", [embyWebComponentsBowerPath + "/prompt/nativeprompt"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("prompt", [embyWebComponentsBowerPath + "/prompt/prompt"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (browser.tizen || browser.operaTv || browser.chromecast || browser.orsay || browser.web0s || browser.ps4) {
|
|
|
|
define("loading", [embyWebComponentsBowerPath + "/loading/loading-legacy"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("loading", [embyWebComponentsBowerPath + "/loading/loading-lite"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:47:29 +09:00
|
|
|
define("multi-download", [embyWebComponentsBowerPath + "/multidownload"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if ("android" === self.appMode) {
|
|
|
|
define("fileDownloader", ["cordova/filedownloader"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("fileDownloader", [embyWebComponentsBowerPath + "/filedownloader"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:47:29 +09:00
|
|
|
define("localassetmanager", [apiClientBowerPath + "/localassetmanager"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if ("cordova" === self.appMode || "android" === self.appMode) {
|
|
|
|
define("castSenderApiLoader", [], getDummyCastSenderApiLoader);
|
|
|
|
} else {
|
|
|
|
define("castSenderApiLoader", [], getCastSenderApiLoader);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (self.Windows) {
|
|
|
|
define("bgtaskregister", ["environments/windows-uwp/bgtaskregister"], returnFirstDependency);
|
|
|
|
define("transfermanager", ["environments/windows-uwp/transfermanager"], returnFirstDependency);
|
|
|
|
define("filerepository", ["environments/windows-uwp/filerepository"], returnFirstDependency);
|
2019-03-04 20:38:39 +00:00
|
|
|
} else if ("cordova" === self.appMode) {
|
|
|
|
define("filerepository", ["cordova/filerepository"], returnFirstDependency);
|
|
|
|
define("transfermanager", ["filerepository"], returnFirstDependency);
|
|
|
|
} else if ("android" === self.appMode) {
|
|
|
|
define("transfermanager", ["cordova/transfermanager"], returnFirstDependency);
|
|
|
|
define("filerepository", ["cordova/filerepository"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
} else {
|
2019-03-04 20:38:39 +00:00
|
|
|
define("transfermanager", [apiClientBowerPath + "/sync/transfermanager"], returnFirstDependency);
|
|
|
|
define("filerepository", [apiClientBowerPath + "/sync/filerepository"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ("android" === self.appMode) {
|
|
|
|
define("localsync", ["cordova/localsync"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("localsync", [apiClientBowerPath + "/sync/localsync"], returnFirstDependency);
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function init() {
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("android" === self.appMode) {
|
|
|
|
define("nativedirectorychooser", ["cordova/nativedirectorychooser"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
|
|
|
define("livetvcss", ["css!css/livetv.css"], returnFirstDependency);
|
|
|
|
define("detailtablecss", ["css!css/detailtable.css"], returnFirstDependency);
|
|
|
|
define("buttonenabled", ["legacy/buttonenabled"], returnFirstDependency);
|
2019-02-23 17:12:14 +00:00
|
|
|
var promises = [];
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (!window.fetch) {
|
2019-02-23 17:12:14 +00:00
|
|
|
promises.push(require(["fetch"]));
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ("function" != typeof Object.assign) {
|
2019-02-23 17:12:14 +00:00
|
|
|
promises.push(require(["objectassign"]));
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!Array.prototype.filter) {
|
2019-02-23 17:12:14 +00:00
|
|
|
promises.push(require(["arraypolyfills"]));
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!Function.prototype.bind) {
|
2019-02-23 17:12:14 +00:00
|
|
|
promises.push(require(["functionbind"]));
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.requestAnimationFrame) {
|
2019-02-23 17:12:14 +00:00
|
|
|
promises.push(require(["raf"]));
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
Promise.all(promises).then(function () {
|
2019-02-23 16:38:53 +00:00
|
|
|
createConnectionManager().then(function () {
|
|
|
|
console.log("initAfterDependencies promises resolved");
|
|
|
|
|
|
|
|
require(["globalize", "browser"], function (globalize, browser) {
|
|
|
|
window.Globalize = globalize;
|
|
|
|
loadCoreDictionary(globalize).then(function () {
|
|
|
|
onGlobalizeInit(browser);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadCoreDictionary(globalize) {
|
2019-02-03 02:31:09 +09:00
|
|
|
var languages = ["ar", "be-by", "bg-bg", "ca", "cs", "da", "de", "el", "en-gb", "en-us", "es", "es-ar", "es-mx", "fa", "fi", "fr", "fr-ca", "gsw", "he", "hi-in", "hr", "hu", "id", "it", "kk", "ko", "lt-lt", "ms", "nb", "nl", "pl", "pt-br", "pt-pt", "ro", "ru", "sk", "sl-si", "sv", "tr", "uk", "vi", "zh-cn", "zh-hk", "zh-tw"];
|
2019-03-04 20:38:39 +00:00
|
|
|
var translations = languages.map(function (language) {
|
2019-02-03 02:31:09 +09:00
|
|
|
return {
|
2019-03-04 20:38:39 +00:00
|
|
|
lang: language,
|
|
|
|
path: "strings/" + language + ".json"
|
2019-02-23 16:38:53 +00:00
|
|
|
};
|
2019-02-03 02:31:09 +09:00
|
|
|
});
|
|
|
|
globalize.defaultModule("core");
|
|
|
|
return globalize.loadStrings({
|
2018-10-23 01:05:09 +03:00
|
|
|
name: "core",
|
|
|
|
translations: translations
|
2019-02-03 02:31:09 +09:00
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function onGlobalizeInit(browser) {
|
|
|
|
if ("android" === self.appMode) {
|
2019-02-23 16:38:53 +00:00
|
|
|
if (-1 !== self.location.href.toString().toLowerCase().indexOf("start=backgroundsync")) {
|
|
|
|
return onAppReady(browser);
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
document.title = Globalize.translateDocument(document.title, "core");
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (browser.tv && !browser.android) {
|
|
|
|
console.log("Using system fonts with explicit sizes");
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["systemFontsSizedCss"]);
|
2019-02-23 16:38:53 +00:00
|
|
|
} else {
|
|
|
|
console.log("Using default fonts");
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["systemFontsCss"]);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["apphost", "css!css/librarybrowser"], function (appHost) {
|
2019-02-23 16:38:53 +00:00
|
|
|
loadPlugins([], appHost, browser).then(function () {
|
2019-01-21 17:47:10 +09:00
|
|
|
onAppReady(browser);
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function defineRoute(newRoute, dictionary) {
|
2019-01-21 17:47:10 +09:00
|
|
|
var baseRoute = Emby.Page.baseUrl();
|
|
|
|
var path = newRoute.path;
|
|
|
|
path = path.replace(baseRoute, "");
|
|
|
|
console.log("Defining route: " + path);
|
|
|
|
newRoute.dictionary = newRoute.dictionary || dictionary || "core";
|
|
|
|
Emby.Page.addRoute(path, newRoute);
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function defineCoreRoutes(appHost) {
|
2019-01-21 17:47:10 +09:00
|
|
|
console.log("Defining core routes");
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/addplugin.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "scripts/addpluginpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/appservices.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/autoorganizelog.html",
|
|
|
|
dependencies: [],
|
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/channelsettings.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2019-01-11 20:36:17 +09:00
|
|
|
path: "/addserver.html",
|
2018-10-23 01:05:09 +03:00
|
|
|
dependencies: ["emby-button", "emby-input"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
|
|
|
startup: true,
|
2019-01-11 20:36:17 +09:00
|
|
|
controller: "scripts/addserver"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dashboard.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "scripts/dashboardpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dashboardgeneral.html",
|
|
|
|
controller: "dashboard/dashboardgeneral",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dashboardhosting.html",
|
|
|
|
dependencies: ["emby-input", "emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "dashboard/dashboardhosting"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/devices/devices.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "devices/devices"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/devices/device.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "devices/device"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dlnaprofile.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dlnaprofiles.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dlnaserversettings.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/dlnasettings.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/edititemmetadata.html",
|
|
|
|
dependencies: [],
|
|
|
|
controller: "scripts/edititemmetadata",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/encodingsettings.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2019-02-14 18:59:52 +01:00
|
|
|
path: "/opensubtitles.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2019-02-14 18:59:52 +01:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/forgotpassword.html",
|
|
|
|
dependencies: ["emby-input", "emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
anonymous: true,
|
|
|
|
startup: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/forgotpassword"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/forgotpasswordpin.html",
|
|
|
|
dependencies: ["emby-input", "emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
|
|
|
startup: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/forgotpasswordpin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/home.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "home/home",
|
|
|
|
transition: "fade",
|
|
|
|
type: "home"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/list/list.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "list/list",
|
|
|
|
transition: "fade"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/index.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
isDefaultRoute: true
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/itemdetails.html",
|
|
|
|
dependencies: ["emby-button", "scripts/livetvcomponents", "paper-icon-button-light", "emby-itemscontainer"],
|
|
|
|
controller: "scripts/itemdetailpage",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/library.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/librarydisplay.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "dashboard/librarydisplay"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/librarysettings.html",
|
|
|
|
dependencies: ["emby-collapse", "emby-input", "emby-button", "emby-select"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "dashboard/librarysettings"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/livetv.html",
|
|
|
|
dependencies: ["emby-button", "livetvcss"],
|
|
|
|
controller: "scripts/livetvsuggested",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/livetvguideprovider.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/livetvseriestimer.html",
|
|
|
|
dependencies: ["emby-checkbox", "emby-input", "emby-button", "emby-collapse", "scripts/livetvcomponents", "scripts/livetvseriestimer", "livetvcss"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/livetvseriestimer"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/livetvsettings.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/livetvstatus.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/livetvtuner.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "dashboard/livetvtuner"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/log.html",
|
|
|
|
dependencies: ["emby-checkbox"],
|
|
|
|
roles: "admin",
|
|
|
|
controller: "dashboard/logpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/login.html",
|
|
|
|
dependencies: ["emby-button", "emby-input"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
|
|
|
startup: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/loginpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/metadataadvanced.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/metadataimages.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/metadatanfo.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/movies.html",
|
|
|
|
dependencies: ["emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/moviesrecommended",
|
|
|
|
transition: "fade"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/music.html",
|
|
|
|
dependencies: [],
|
|
|
|
controller: "scripts/musicrecommended",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/mypreferencesdisplay.html",
|
|
|
|
dependencies: ["emby-checkbox", "emby-button", "emby-select"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/mypreferencesdisplay"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/mypreferenceshome.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/mypreferenceshome"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/mypreferencessubtitles.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/mypreferencessubtitles"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/mypreferenceslanguages.html",
|
|
|
|
dependencies: ["emby-button", "emby-checkbox", "emby-select"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/mypreferenceslanguages"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/mypreferencesmenu.html",
|
|
|
|
dependencies: ["emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/mypreferencescommon"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/myprofile.html",
|
|
|
|
dependencies: ["emby-button", "emby-collapse", "emby-checkbox", "emby-input"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/myprofile"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/notificationsetting.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/notificationsettings.html",
|
|
|
|
controller: "scripts/notificationsettings",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/nowplaying.html",
|
|
|
|
dependencies: ["paper-icon-button-light", "emby-slider", "emby-button", "emby-input", "emby-itemscontainer"],
|
|
|
|
controller: "scripts/nowplayingpage",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
transition: "fade",
|
2019-02-23 16:38:53 +00:00
|
|
|
fullscreen: true,
|
|
|
|
supportsThemeMedia: true,
|
|
|
|
enableMediaControl: false
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/playbackconfiguration.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/plugincatalog.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "scripts/plugincatalogpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/plugins.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/scheduledtask.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "scripts/scheduledtaskpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/scheduledtasks.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "scripts/scheduledtaskspage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/search.html",
|
|
|
|
dependencies: [],
|
|
|
|
controller: "scripts/searchpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/selectserver.html",
|
|
|
|
dependencies: ["listViewStyle", "emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
|
|
|
startup: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/selectserver"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/serveractivity.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin",
|
|
|
|
controller: "dashboard/serveractivity"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/serversecurity.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/streamingsettings.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/support.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/tv.html",
|
|
|
|
dependencies: ["paper-icon-button-light", "emby-button"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/tvrecommended",
|
|
|
|
transition: "fade"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/useredit.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/userlibraryaccess.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/usernew.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/userparentalcontrol.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/userpassword.html",
|
|
|
|
dependencies: ["emby-input", "emby-button", "emby-checkbox"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "scripts/userpasswordpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/userprofiles.html",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/wizardremoteaccess.html",
|
|
|
|
dependencies: ["dashboardcss"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "dashboard/wizardremoteaccess"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/wizardfinish.html",
|
|
|
|
dependencies: ["emby-button", "dashboardcss"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "dashboard/wizardfinishpage"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/wizardlibrary.html",
|
|
|
|
dependencies: ["dashboardcss"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/wizardsettings.html",
|
|
|
|
dependencies: ["dashboardcss"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "dashboard/wizardsettings"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/wizardstart.html",
|
|
|
|
dependencies: ["dashboardcss"],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
controller: "dashboard/wizardstart"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/wizarduser.html",
|
|
|
|
dependencies: ["dashboardcss", "emby-input"],
|
|
|
|
controller: "scripts/wizarduserpage",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
anonymous: true
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/videoosd.html",
|
|
|
|
dependencies: [],
|
|
|
|
transition: "fade",
|
|
|
|
controller: "scripts/videoosd",
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
type: "video-osd",
|
2019-02-23 16:38:53 +00:00
|
|
|
supportsThemeMedia: true,
|
|
|
|
fullscreen: true,
|
|
|
|
enableMediaControl: false
|
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/configurationpage",
|
|
|
|
dependencies: [],
|
2019-02-23 16:38:53 +00:00
|
|
|
autoFocus: false,
|
|
|
|
enableCache: false,
|
|
|
|
enableContentQueryString: true,
|
2018-10-23 01:05:09 +03:00
|
|
|
roles: "admin"
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
|
|
|
defineRoute({
|
2018-10-23 01:05:09 +03:00
|
|
|
path: "/",
|
2019-02-23 16:38:53 +00:00
|
|
|
isDefaultRoute: true,
|
|
|
|
autoFocus: false,
|
2018-10-23 01:05:09 +03:00
|
|
|
dependencies: []
|
2019-02-23 16:38:53 +00:00
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getPluginPageContentPath() {
|
2019-02-23 16:38:53 +00:00
|
|
|
if (window.ApiClient) {
|
|
|
|
return ApiClient.getUrl("web/ConfigurationPage");
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadPlugins(externalPlugins, appHost, browser, shell) {
|
|
|
|
console.log("Loading installed plugins");
|
2019-03-04 20:40:13 +00:00
|
|
|
var list = [
|
|
|
|
"bower_components/emby-webcomponents/playback/playbackvalidation",
|
|
|
|
"bower_components/emby-webcomponents/playback/playaccessvalidation",
|
|
|
|
"bower_components/emby-webcomponents/playback/experimentalwarnings",
|
|
|
|
"bower_components/emby-webcomponents/htmlaudioplayer/plugin",
|
|
|
|
"bower_components/emby-webcomponents/htmlvideoplayer/plugin",
|
|
|
|
"bower_components/emby-webcomponents/photoplayer/plugin",
|
|
|
|
"bower_components/emby-webcomponents/youtubeplayer/plugin"
|
|
|
|
];
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-01 10:22:26 +00:00
|
|
|
if ("cordova" === self.appMode) {
|
|
|
|
list.push("cordova/chromecast");
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-01 10:22:26 +00:00
|
|
|
if ("android" === self.appMode) {
|
|
|
|
list.push("cordova/externalplayer");
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-01 10:22:26 +00:00
|
|
|
if (appHost.supports("remotecontrol")) {
|
|
|
|
list.push("bower_components/emby-webcomponents/sessionplayer");
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-01 10:22:26 +00:00
|
|
|
if (browser.chrome || browser.opera) {
|
|
|
|
list.push("bower_components/emby-webcomponents/chromecast/chromecastplayer");
|
|
|
|
}
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-03-04 20:38:39 +00:00
|
|
|
for (var index = 0, length = externalPlugins.length; index < length; index++) {
|
|
|
|
list.push(externalPlugins[index]);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
Promise.all(list.map(loadPlugin)).then(function () {
|
|
|
|
require(["packageManager"], function (packageManager) {
|
|
|
|
packageManager.init().then(resolve, reject);
|
|
|
|
});
|
|
|
|
}, reject);
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadPlugin(url) {
|
2019-02-23 16:38:53 +00:00
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
require(["pluginManager"], function (pluginManager) {
|
|
|
|
pluginManager.loadPlugin(url).then(resolve, reject);
|
|
|
|
});
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function enableNativeGamepadKeyMapping() {
|
2019-03-04 20:43:37 +00:00
|
|
|
if (window.navigator && "string" == typeof window.navigator.gamepadInputEmulation) {
|
2019-02-23 16:38:53 +00:00
|
|
|
window.navigator.gamepadInputEmulation = "keyboard";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function isGamepadSupported() {
|
2019-02-23 16:38:53 +00:00
|
|
|
return "ongamepadconnected" in window || navigator.getGamepads || navigator.webkitGetGamepads;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function onAppReady(browser) {
|
|
|
|
console.log("Begin onAppReady");
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
var isInBackground = -1 !== self.location.href.toString().toLowerCase().indexOf("start=backgroundsync");
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
window.Emby = {};
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
console.log("onAppReady - loading dependencies");
|
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (isInBackground) {
|
|
|
|
syncNow();
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (browser.iOS) {
|
|
|
|
require(['css!devices/ios/ios.css']);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
require(['apphost', 'appRouter', 'scripts/themeloader', 'libraryMenu'], function (appHost, pageObjects) {
|
|
|
|
window.Emby.Page = pageObjects;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
defineCoreRoutes(appHost);
|
|
|
|
|
|
|
|
Emby.Page.start({
|
|
|
|
click: false,
|
|
|
|
hashbang: true
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!enableNativeGamepadKeyMapping() && isGamepadSupported()) {
|
|
|
|
require(["bower_components/emby-webcomponents/input/gamepadtokey"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["bower_components/emby-webcomponents/thememediaplayer", "scripts/autobackdrops"]);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-03-04 20:44:27 +00:00
|
|
|
if ("cordova" === self.appMode || "android" === self.appMode) {
|
2019-02-23 17:12:14 +00:00
|
|
|
if (browser.android) {
|
|
|
|
require(["cordova/mediasession", "cordova/chromecast", "cordova/appshortcuts"]);
|
|
|
|
} else if (browser.safari) {
|
|
|
|
require(["cordova/mediasession", "cordova/volume", "cordova/statusbar", "cordova/backgroundfetch"]);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-04 20:45:19 +00:00
|
|
|
if (!browser.tv && !browser.xboxOne && !browser.ps4) {
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["bower_components/emby-webcomponents/nowplayingbar/nowplayingbar"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (appHost.supports("remotecontrol")) {
|
|
|
|
require(["playerSelectionMenu", "bower_components/emby-webcomponents/playback/remotecontrolautoplay"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (!(appHost.supports("physicalvolumecontrol") && !browser.touch || browser.edge)) {
|
|
|
|
require(["bower_components/emby-webcomponents/playback/volumeosd"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (navigator.mediaSession) {
|
|
|
|
require(["mediaSession"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["apiInput", "mouseManager"]);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-03-04 20:45:44 +00:00
|
|
|
if (!browser.tv && !browser.xboxOne) {
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["bower_components/emby-webcomponents/playback/playbackorientation"]);
|
|
|
|
registerServiceWorker();
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (window.Notification) {
|
|
|
|
require(["bower_components/emby-webcomponents/notifications/notifications"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
require(["playerSelectionMenu"]);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (appHost.supports("fullscreenchange") && (browser.edgeUwp || -1 !== navigator.userAgent.toLowerCase().indexOf("electron"))) {
|
|
|
|
require(["fullscreen-doubleclick"]);
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (appHost.supports("sync")) {
|
|
|
|
initLocalSyncEvents();
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-03-04 20:47:00 +00:00
|
|
|
if (!AppInfo.isNativeApp && window.ApiClient) {
|
|
|
|
require(["css!" + ApiClient.getUrl("Branding/Css")]);
|
2019-02-23 16:38:53 +00:00
|
|
|
}
|
2019-02-23 17:12:14 +00:00
|
|
|
});
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function registerServiceWorker() {
|
2019-02-23 16:38:53 +00:00
|
|
|
if (navigator.serviceWorker && "cordova" !== self.appMode && "android" !== self.appMode) {
|
|
|
|
try {
|
|
|
|
navigator.serviceWorker.register("serviceworker.js").then(function () {
|
|
|
|
return navigator.serviceWorker.ready;
|
|
|
|
}).then(function (reg) {
|
|
|
|
if (reg && reg.sync) {
|
|
|
|
return reg.sync.register("emby-sync").then(function () {// TODO cvium: the sync serviceworker is a noop?
|
|
|
|
//window.SyncRegistered = Dashboard.isConnectMode()
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} catch (err) {
|
|
|
|
console.log("Error registering serviceWorker: " + err);
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function syncNow() {
|
2019-02-23 16:38:53 +00:00
|
|
|
require(["localsync"], function (localSync) {
|
|
|
|
localSync.sync();
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function initLocalSyncEvents() {
|
2019-02-23 16:38:53 +00:00
|
|
|
require(["serverNotifications", "events"], function (serverNotifications, events) {
|
|
|
|
events.on(serverNotifications, "SyncJobItemReady", syncNow);
|
|
|
|
events.on(serverNotifications, "SyncJobCancelled", syncNow);
|
|
|
|
events.on(serverNotifications, "SyncJobItemCancelled", syncNow);
|
|
|
|
});
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function onWebComponentsReady(browser) {
|
2019-02-05 03:50:16 +09:00
|
|
|
initRequireWithBrowser(browser);
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-05 03:50:16 +09:00
|
|
|
if (self.appMode === 'cordova' || self.appMode === 'android' || self.appMode === 'standalone') {
|
|
|
|
AppInfo.isNativeApp = true;
|
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2019-02-23 17:12:14 +00:00
|
|
|
if (!window.Promise || browser.web0s) {
|
|
|
|
initialDependencies.push();
|
|
|
|
require(["bower_components/emby-webcomponents/native-promise-only/lib/npo.src"], init);
|
|
|
|
} else {
|
|
|
|
init();
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-05 03:50:16 +09:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
var localApiClient;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
(function () {
|
|
|
|
var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate());
|
2019-01-21 17:47:10 +09:00
|
|
|
var bowerPath = getBowerPath();
|
|
|
|
var apiClientBowerPath = bowerPath + "/emby-apiclient";
|
|
|
|
var embyWebComponentsBowerPath = bowerPath + "/emby-webcomponents";
|
|
|
|
var paths = {
|
2019-02-23 16:38:53 +00:00
|
|
|
velocity: bowerPath + "/velocity/velocity.min",
|
|
|
|
vibrant: bowerPath + "/vibrant/dist/vibrant",
|
|
|
|
staticBackdrops: embyWebComponentsBowerPath + "/staticbackdrops",
|
|
|
|
ironCardList: "components/ironcardlist/ironcardlist",
|
|
|
|
scrollThreshold: "components/scrollthreshold",
|
|
|
|
playlisteditor: "components/playlisteditor/playlisteditor",
|
|
|
|
medialibrarycreator: "components/medialibrarycreator/medialibrarycreator",
|
|
|
|
medialibraryeditor: "components/medialibraryeditor/medialibraryeditor",
|
|
|
|
imageoptionseditor: "components/imageoptionseditor/imageoptionseditor",
|
|
|
|
howler: bowerPath + "/howlerjs/dist/howler.min",
|
|
|
|
sortable: bowerPath + "/Sortable/Sortable.min",
|
|
|
|
isMobile: bowerPath + "/isMobile/isMobile.min",
|
|
|
|
masonry: bowerPath + "/masonry/dist/masonry.pkgd.min",
|
|
|
|
humanedate: "components/humanedate",
|
|
|
|
libraryBrowser: "scripts/librarybrowser",
|
|
|
|
events: apiClientBowerPath + "/events",
|
|
|
|
credentialprovider: apiClientBowerPath + "/credentials",
|
|
|
|
connectionManagerFactory: bowerPath + "/emby-apiclient/connectionmanager",
|
|
|
|
visibleinviewport: embyWebComponentsBowerPath + "/visibleinviewport",
|
|
|
|
browserdeviceprofile: embyWebComponentsBowerPath + "/browserdeviceprofile",
|
|
|
|
browser: embyWebComponentsBowerPath + "/browser",
|
|
|
|
inputManager: embyWebComponentsBowerPath + "/inputmanager",
|
|
|
|
qualityoptions: embyWebComponentsBowerPath + "/qualityoptions",
|
|
|
|
hammer: bowerPath + "/hammerjs/hammer.min",
|
|
|
|
pageJs: embyWebComponentsBowerPath + "/pagejs/page",
|
|
|
|
focusManager: embyWebComponentsBowerPath + "/focusmanager",
|
|
|
|
datetime: embyWebComponentsBowerPath + "/datetime",
|
|
|
|
globalize: embyWebComponentsBowerPath + "/globalize",
|
|
|
|
itemHelper: embyWebComponentsBowerPath + "/itemhelper",
|
|
|
|
itemShortcuts: embyWebComponentsBowerPath + "/shortcuts",
|
|
|
|
playQueueManager: embyWebComponentsBowerPath + "/playback/playqueuemanager",
|
|
|
|
autoPlayDetect: embyWebComponentsBowerPath + "/playback/autoplaydetect",
|
|
|
|
nowPlayingHelper: embyWebComponentsBowerPath + "/playback/nowplayinghelper",
|
|
|
|
pluginManager: embyWebComponentsBowerPath + "/pluginmanager",
|
|
|
|
packageManager: embyWebComponentsBowerPath + "/packagemanager"
|
2019-01-21 17:47:10 +09:00
|
|
|
};
|
|
|
|
paths.hlsjs = bowerPath + "/hlsjs/dist/hls.min";
|
|
|
|
paths.flvjs = embyWebComponentsBowerPath + "/flvjs/flv.min";
|
|
|
|
paths.shaka = embyWebComponentsBowerPath + "/shaka/shaka-player.compiled";
|
|
|
|
define("chromecastHelper", [embyWebComponentsBowerPath + "/chromecast/chromecasthelpers"], returnFirstDependency);
|
|
|
|
define("mediaSession", [embyWebComponentsBowerPath + "/playback/mediasession"], returnFirstDependency);
|
|
|
|
define("webActionSheet", [embyWebComponentsBowerPath + "/actionsheet/actionsheet"], returnFirstDependency);
|
|
|
|
define("libjass", [bowerPath + "/libjass/libjass.min", "css!" + bowerPath + "/libjass/libjass"], returnFirstDependency);
|
|
|
|
define("tunerPicker", ["components/tunerpicker"], returnFirstDependency);
|
|
|
|
define("mainTabsManager", [embyWebComponentsBowerPath + "/maintabsmanager"], returnFirstDependency);
|
|
|
|
define("imageLoader", [embyWebComponentsBowerPath + "/images/imagehelper"], returnFirstDependency);
|
|
|
|
define("appFooter", [embyWebComponentsBowerPath + "/appfooter/appfooter"], returnFirstDependency);
|
|
|
|
define("directorybrowser", ["components/directorybrowser/directorybrowser"], returnFirstDependency);
|
|
|
|
define("metadataEditor", [embyWebComponentsBowerPath + "/metadataeditor/metadataeditor"], returnFirstDependency);
|
|
|
|
define("personEditor", [embyWebComponentsBowerPath + "/metadataeditor/personeditor"], returnFirstDependency);
|
|
|
|
define("playerSelectionMenu", [embyWebComponentsBowerPath + "/playback/playerselection"], returnFirstDependency);
|
|
|
|
define("playerSettingsMenu", [embyWebComponentsBowerPath + "/playback/playersettingsmenu"], returnFirstDependency);
|
|
|
|
define("playMethodHelper", [embyWebComponentsBowerPath + "/playback/playmethodhelper"], returnFirstDependency);
|
|
|
|
define("brightnessOsd", [embyWebComponentsBowerPath + "/playback/brightnessosd"], returnFirstDependency);
|
|
|
|
define("libraryMenu", ["scripts/librarymenu"], returnFirstDependency);
|
|
|
|
define("emby-collapse", [embyWebComponentsBowerPath + "/emby-collapse/emby-collapse"], returnFirstDependency);
|
|
|
|
define("emby-button", [embyWebComponentsBowerPath + "/emby-button/emby-button"], returnFirstDependency);
|
|
|
|
define("emby-linkbutton", ["emby-button"], returnFirstDependency);
|
|
|
|
define("emby-itemscontainer", [embyWebComponentsBowerPath + "/emby-itemscontainer/emby-itemscontainer"], returnFirstDependency);
|
|
|
|
define("alphaNumericShortcuts", [embyWebComponentsBowerPath + "/alphanumericshortcuts/alphanumericshortcuts"], returnFirstDependency);
|
|
|
|
define("emby-scroller", [embyWebComponentsBowerPath + "/emby-scroller/emby-scroller"], returnFirstDependency);
|
|
|
|
define("emby-tabs", [embyWebComponentsBowerPath + "/emby-tabs/emby-tabs"], returnFirstDependency);
|
|
|
|
define("emby-scrollbuttons", [embyWebComponentsBowerPath + "/emby-scrollbuttons/emby-scrollbuttons"], returnFirstDependency);
|
|
|
|
define("emby-progressring", [embyWebComponentsBowerPath + "/emby-progressring/emby-progressring"], returnFirstDependency);
|
|
|
|
define("emby-itemrefreshindicator", [embyWebComponentsBowerPath + "/emby-itemrefreshindicator/emby-itemrefreshindicator"], returnFirstDependency);
|
|
|
|
define("multiSelect", [embyWebComponentsBowerPath + "/multiselect/multiselect"], returnFirstDependency);
|
|
|
|
define("alphaPicker", [embyWebComponentsBowerPath + "/alphapicker/alphapicker"], returnFirstDependency);
|
|
|
|
define("paper-icon-button-light", [embyWebComponentsBowerPath + "/emby-button/paper-icon-button-light"], returnFirstDependency);
|
|
|
|
define("tabbedView", [embyWebComponentsBowerPath + "/tabbedview/tabbedview"], returnFirstDependency);
|
|
|
|
define("itemsTab", [embyWebComponentsBowerPath + "/tabbedview/itemstab"], returnFirstDependency);
|
|
|
|
define("emby-input", [embyWebComponentsBowerPath + "/emby-input/emby-input"], returnFirstDependency);
|
|
|
|
define("emby-select", [embyWebComponentsBowerPath + "/emby-select/emby-select"], returnFirstDependency);
|
|
|
|
define("emby-slider", [embyWebComponentsBowerPath + "/emby-slider/emby-slider"], returnFirstDependency);
|
|
|
|
define("emby-checkbox", [embyWebComponentsBowerPath + "/emby-checkbox/emby-checkbox"], returnFirstDependency);
|
|
|
|
define("emby-toggle", [embyWebComponentsBowerPath + "/emby-toggle/emby-toggle"], returnFirstDependency);
|
|
|
|
define("emby-radio", [embyWebComponentsBowerPath + "/emby-radio/emby-radio"], returnFirstDependency);
|
|
|
|
define("emby-textarea", [embyWebComponentsBowerPath + "/emby-textarea/emby-textarea"], returnFirstDependency);
|
|
|
|
define("collectionEditor", [embyWebComponentsBowerPath + "/collectioneditor/collectioneditor"], returnFirstDependency);
|
|
|
|
define("serverRestartDialog", [embyWebComponentsBowerPath + "/serverrestartdialog/serverrestartdialog"], returnFirstDependency);
|
|
|
|
define("playlistEditor", [embyWebComponentsBowerPath + "/playlisteditor/playlisteditor"], returnFirstDependency);
|
|
|
|
define("recordingCreator", [embyWebComponentsBowerPath + "/recordingcreator/recordingcreator"], returnFirstDependency);
|
|
|
|
define("recordingEditor", [embyWebComponentsBowerPath + "/recordingcreator/recordingeditor"], returnFirstDependency);
|
|
|
|
define("seriesRecordingEditor", [embyWebComponentsBowerPath + "/recordingcreator/seriesrecordingeditor"], returnFirstDependency);
|
|
|
|
define("recordingFields", [embyWebComponentsBowerPath + "/recordingcreator/recordingfields"], returnFirstDependency);
|
|
|
|
define("recordingButton", [embyWebComponentsBowerPath + "/recordingcreator/recordingbutton"], returnFirstDependency);
|
|
|
|
define("recordingHelper", [embyWebComponentsBowerPath + "/recordingcreator/recordinghelper"], returnFirstDependency);
|
|
|
|
define("subtitleEditor", [embyWebComponentsBowerPath + "/subtitleeditor/subtitleeditor"], returnFirstDependency);
|
|
|
|
define("itemIdentifier", [embyWebComponentsBowerPath + "/itemidentifier/itemidentifier"], returnFirstDependency);
|
|
|
|
define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency);
|
|
|
|
define("itemContextMenu", [embyWebComponentsBowerPath + "/itemcontextmenu"], returnFirstDependency);
|
|
|
|
define("imageEditor", [embyWebComponentsBowerPath + "/imageeditor/imageeditor"], returnFirstDependency);
|
|
|
|
define("imageDownloader", [embyWebComponentsBowerPath + "/imagedownloader/imagedownloader"], returnFirstDependency);
|
|
|
|
define("dom", [embyWebComponentsBowerPath + "/dom"], returnFirstDependency);
|
|
|
|
define("playerStats", [embyWebComponentsBowerPath + "/playerstats/playerstats"], returnFirstDependency);
|
|
|
|
define("searchFields", [embyWebComponentsBowerPath + "/search/searchfields"], returnFirstDependency);
|
|
|
|
define("searchResults", [embyWebComponentsBowerPath + "/search/searchresults"], returnFirstDependency);
|
|
|
|
define("upNextDialog", [embyWebComponentsBowerPath + "/upnextdialog/upnextdialog"], returnFirstDependency);
|
|
|
|
define("fullscreen-doubleclick", [embyWebComponentsBowerPath + "/fullscreen/fullscreen-dc"], returnFirstDependency);
|
|
|
|
define("fullscreenManager", [embyWebComponentsBowerPath + "/fullscreen/fullscreenmanager", "events"], returnFirstDependency);
|
|
|
|
define("headroom", [embyWebComponentsBowerPath + "/headroom/headroom"], returnFirstDependency);
|
|
|
|
define("subtitleAppearanceHelper", [embyWebComponentsBowerPath + "/subtitlesettings/subtitleappearancehelper"], returnFirstDependency);
|
|
|
|
define("subtitleSettings", [embyWebComponentsBowerPath + "/subtitlesettings/subtitlesettings"], returnFirstDependency);
|
|
|
|
define("displaySettings", [embyWebComponentsBowerPath + "/displaysettings/displaysettings"], returnFirstDependency);
|
|
|
|
define("playbackSettings", [embyWebComponentsBowerPath + "/playbacksettings/playbacksettings"], returnFirstDependency);
|
|
|
|
define("homescreenSettings", [embyWebComponentsBowerPath + "/homescreensettings/homescreensettings"], returnFirstDependency);
|
|
|
|
define("homescreenSettingsDialog", [embyWebComponentsBowerPath + "/homescreensettings/homescreensettingsdialog"], returnFirstDependency);
|
|
|
|
define("playbackManager", [embyWebComponentsBowerPath + "/playback/playbackmanager"], getPlaybackManager);
|
|
|
|
define("layoutManager", [embyWebComponentsBowerPath + "/layoutmanager", "apphost"], getLayoutManager);
|
|
|
|
define("homeSections", [embyWebComponentsBowerPath + "/homesections/homesections"], returnFirstDependency);
|
|
|
|
define("playMenu", [embyWebComponentsBowerPath + "/playmenu"], returnFirstDependency);
|
|
|
|
define("refreshDialog", [embyWebComponentsBowerPath + "/refreshdialog/refreshdialog"], returnFirstDependency);
|
|
|
|
define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency);
|
|
|
|
define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency);
|
|
|
|
define("roundCardStyle", ["cardStyle", "css!" + embyWebComponentsBowerPath + "/cardbuilder/roundcard"], returnFirstDependency);
|
|
|
|
define("cardStyle", ["css!" + embyWebComponentsBowerPath + "/cardbuilder/card"], returnFirstDependency);
|
|
|
|
define("cardBuilder", [embyWebComponentsBowerPath + "/cardbuilder/cardbuilder"], returnFirstDependency);
|
|
|
|
define("peoplecardbuilder", [embyWebComponentsBowerPath + "/cardbuilder/peoplecardbuilder"], returnFirstDependency);
|
|
|
|
define("chaptercardbuilder", [embyWebComponentsBowerPath + "/cardbuilder/chaptercardbuilder"], returnFirstDependency);
|
|
|
|
define("mouseManager", [embyWebComponentsBowerPath + "/input/mouse"], returnFirstDependency);
|
|
|
|
define("flexStyles", ["css!" + embyWebComponentsBowerPath + "/flexstyles"], returnFirstDependency);
|
|
|
|
define("deleteHelper", [embyWebComponentsBowerPath + "/deletehelper"], returnFirstDependency);
|
|
|
|
define("tvguide", [embyWebComponentsBowerPath + "/guide/guide"], returnFirstDependency);
|
|
|
|
define("programStyles", ["css!" + embyWebComponentsBowerPath + "/guide/programs"], returnFirstDependency);
|
|
|
|
define("guide-settings-dialog", [embyWebComponentsBowerPath + "/guide/guide-settings"], returnFirstDependency);
|
|
|
|
define("loadingDialog", [embyWebComponentsBowerPath + "/loadingdialog/loadingdialog"], returnFirstDependency);
|
|
|
|
define("syncDialog", [embyWebComponentsBowerPath + "/sync/sync"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
define("viewManager", [embyWebComponentsBowerPath + "/viewmanager/viewmanager"], function (viewManager) {
|
|
|
|
window.ViewManager = viewManager;
|
|
|
|
viewManager.dispatchPageEvents(true);
|
|
|
|
return viewManager;
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
|
|
|
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("cordova" === self.appMode || "android" === self.appMode) {
|
|
|
|
paths.apphost = "cordova/apphost";
|
|
|
|
} else {
|
|
|
|
paths.apphost = "components/apphost";
|
|
|
|
}
|
|
|
|
|
|
|
|
paths.appStorage = getAppStorage(apiClientBowerPath);
|
|
|
|
requirejs.config({
|
2018-10-23 01:05:09 +03:00
|
|
|
waitSeconds: 0,
|
|
|
|
map: {
|
|
|
|
"*": {
|
|
|
|
css: bowerPath + "/emby-webcomponents/require/requirecss",
|
|
|
|
text: bowerPath + "/emby-webcomponents/require/requiretext"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
urlArgs: urlArgs,
|
|
|
|
paths: paths,
|
|
|
|
onError: onRequireJsError
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
|
|
|
requirejs.onError = onRequireJsError;
|
|
|
|
define("jstree", ["thirdparty/jstree/jstree", "css!thirdparty/jstree/themes/default/style.css"], returnFirstDependency);
|
|
|
|
define("dashboardcss", ["css!css/dashboard"], returnFirstDependency);
|
|
|
|
define("slideshow", [embyWebComponentsBowerPath + "/slideshow/slideshow"], returnFirstDependency);
|
|
|
|
define("fetch", [bowerPath + "/fetch/fetch"], returnFirstDependency);
|
|
|
|
define("raf", [embyWebComponentsBowerPath + "/polyfills/raf"], returnFirstDependency);
|
|
|
|
define("functionbind", [embyWebComponentsBowerPath + "/polyfills/bind"], returnFirstDependency);
|
|
|
|
define("arraypolyfills", [embyWebComponentsBowerPath + "/polyfills/array"], returnFirstDependency);
|
|
|
|
define("objectassign", [embyWebComponentsBowerPath + "/polyfills/objectassign"], returnFirstDependency);
|
|
|
|
define("clearButtonStyle", ["css!" + embyWebComponentsBowerPath + "/clearbutton"], returnFirstDependency);
|
|
|
|
define("userdataButtons", [embyWebComponentsBowerPath + "/userdatabuttons/userdatabuttons"], returnFirstDependency);
|
|
|
|
define("emby-playstatebutton", [embyWebComponentsBowerPath + "/userdatabuttons/emby-playstatebutton"], returnFirstDependency);
|
|
|
|
define("emby-ratingbutton", [embyWebComponentsBowerPath + "/userdatabuttons/emby-ratingbutton"], returnFirstDependency);
|
|
|
|
define("emby-downloadbutton", [embyWebComponentsBowerPath + "/sync/emby-downloadbutton"], returnFirstDependency);
|
|
|
|
define("listView", [embyWebComponentsBowerPath + "/listview/listview"], returnFirstDependency);
|
|
|
|
define("listViewStyle", ["css!" + embyWebComponentsBowerPath + "/listview/listview"], returnFirstDependency);
|
|
|
|
define("formDialogStyle", ["css!" + embyWebComponentsBowerPath + "/formdialog"], returnFirstDependency);
|
|
|
|
define("indicators", [embyWebComponentsBowerPath + "/indicators/indicators"], returnFirstDependency);
|
|
|
|
define("viewSettings", [embyWebComponentsBowerPath + "/viewsettings/viewsettings"], returnFirstDependency);
|
|
|
|
define("filterMenu", [embyWebComponentsBowerPath + "/filtermenu/filtermenu"], returnFirstDependency);
|
|
|
|
define("sortMenu", [embyWebComponentsBowerPath + "/sortmenu/sortmenu"], returnFirstDependency);
|
|
|
|
define("registrationServices", [embyWebComponentsBowerPath + "/registrationservices/registrationservices"], returnFirstDependency);
|
|
|
|
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("cordova" === self.appMode || "android" === self.appMode) {
|
|
|
|
define("fileupload", ["cordova/fileupload"], returnFirstDependency);
|
|
|
|
} else {
|
|
|
|
define("fileupload", [apiClientBowerPath + "/fileupload"], returnFirstDependency);
|
|
|
|
}
|
|
|
|
|
2019-01-21 17:47:10 +09:00
|
|
|
define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]);
|
|
|
|
define("serversync", [apiClientBowerPath + "/sync/serversync"], returnFirstDependency);
|
|
|
|
define("multiserversync", [apiClientBowerPath + "/sync/multiserversync"], returnFirstDependency);
|
|
|
|
define("mediasync", [apiClientBowerPath + "/sync/mediasync"], returnFirstDependency);
|
|
|
|
define("idb", [embyWebComponentsBowerPath + "/idb"], returnFirstDependency);
|
|
|
|
define("sanitizefilename", [embyWebComponentsBowerPath + "/sanitizefilename"], returnFirstDependency);
|
|
|
|
define("itemrepository", [apiClientBowerPath + "/sync/itemrepository"], returnFirstDependency);
|
|
|
|
define("useractionrepository", [apiClientBowerPath + "/sync/useractionrepository"], returnFirstDependency);
|
|
|
|
define("swiper", [bowerPath + "/Swiper/dist/js/swiper.min", "css!" + bowerPath + "/Swiper/dist/css/swiper.min"], returnFirstDependency);
|
|
|
|
define("scroller", [embyWebComponentsBowerPath + "/scroller/smoothscroller"], returnFirstDependency);
|
|
|
|
define("toast", [embyWebComponentsBowerPath + "/toast/toast"], returnFirstDependency);
|
|
|
|
define("scrollHelper", [embyWebComponentsBowerPath + "/scrollhelper"], returnFirstDependency);
|
|
|
|
define("touchHelper", [embyWebComponentsBowerPath + "/touchhelper"], returnFirstDependency);
|
|
|
|
define("appSettings", [embyWebComponentsBowerPath + "/appsettings"], returnFirstDependency);
|
|
|
|
define("userSettings", [embyWebComponentsBowerPath + "/usersettings/usersettings"], returnFirstDependency);
|
|
|
|
define("userSettingsBuilder", [embyWebComponentsBowerPath + "/usersettings/usersettingsbuilder", "layoutManager", "browser"], getSettingsBuilder);
|
|
|
|
define("material-icons", ["css!" + embyWebComponentsBowerPath + "/fonts/material-icons/style"], returnFirstDependency);
|
|
|
|
define("systemFontsCss", ["css!" + embyWebComponentsBowerPath + "/fonts/fonts"], returnFirstDependency);
|
|
|
|
define("systemFontsSizedCss", ["css!" + embyWebComponentsBowerPath + "/fonts/fonts.sized"], returnFirstDependency);
|
|
|
|
define("scrollStyles", ["css!" + embyWebComponentsBowerPath + "/scrollstyles"], returnFirstDependency);
|
|
|
|
define("imageUploader", [embyWebComponentsBowerPath + "/imageuploader/imageuploader"], returnFirstDependency);
|
|
|
|
define("navdrawer", ["components/navdrawer/navdrawer"], returnFirstDependency);
|
|
|
|
define("htmlMediaHelper", [embyWebComponentsBowerPath + "/htmlvideoplayer/htmlmediahelper"], returnFirstDependency);
|
|
|
|
define("viewcontainer", ["components/viewcontainer-lite", "css!" + embyWebComponentsBowerPath + "/viewmanager/viewcontainer-lite"], returnFirstDependency);
|
2019-02-23 16:38:53 +00:00
|
|
|
define("queryString", [bowerPath + "/query-string/index"], function () {
|
|
|
|
return queryString;
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
define("jQuery", [bowerPath + "/jquery/dist/jquery.slim.min"], function () {
|
|
|
|
if (window.ApiClient) {
|
|
|
|
jQuery.ajax = ApiClient.ajax;
|
|
|
|
}
|
|
|
|
|
|
|
|
return jQuery;
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
|
|
|
define("fnchecked", ["legacy/fnchecked"], returnFirstDependency);
|
|
|
|
define("dialogHelper", [embyWebComponentsBowerPath + "/dialoghelper/dialoghelper"], returnFirstDependency);
|
|
|
|
define("inputmanager", ["inputManager"], returnFirstDependency);
|
|
|
|
define("apiInput", [embyWebComponentsBowerPath + "/input/api"], returnFirstDependency);
|
|
|
|
define("serverNotifications", ["apiInput"], returnFirstDependency);
|
|
|
|
define("headroom-window", ["headroom"], createWindowHeadroom);
|
|
|
|
define("appFooter-shared", ["appFooter"], createSharedAppFooter);
|
2019-02-23 16:38:53 +00:00
|
|
|
define("skinManager", [embyWebComponentsBowerPath + "/skinmanager"], function (skinManager) {
|
|
|
|
skinManager.loadUserSkin = function (options) {
|
|
|
|
require(["appRouter"], function (appRouter) {
|
|
|
|
options = options || {};
|
|
|
|
|
|
|
|
if (options.start) {
|
|
|
|
appRouter.invokeShortcut(options.start);
|
|
|
|
} else {
|
|
|
|
appRouter.goHome();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
skinManager.getThemes = function () {
|
2018-10-23 01:05:09 +03:00
|
|
|
return [{
|
|
|
|
name: "Apple TV",
|
|
|
|
id: "appletv"
|
|
|
|
}, {
|
|
|
|
name: "Blue Radiance",
|
|
|
|
id: "blueradiance"
|
|
|
|
}, {
|
|
|
|
name: "Dark",
|
|
|
|
id: "dark",
|
2019-02-23 16:38:53 +00:00
|
|
|
isDefault: true,
|
|
|
|
isDefaultServerDashboard: true
|
2018-10-23 01:05:09 +03:00
|
|
|
}, {
|
|
|
|
name: "Dark (green accent)",
|
|
|
|
id: "dark-green"
|
|
|
|
}, {
|
|
|
|
name: "Dark (red accent)",
|
|
|
|
id: "dark-red"
|
|
|
|
}, {
|
|
|
|
name: "Light",
|
2019-02-23 16:38:53 +00:00
|
|
|
id: "light"
|
2018-10-23 01:05:09 +03:00
|
|
|
}, {
|
|
|
|
name: "Light (blue accent)",
|
|
|
|
id: "light-blue"
|
|
|
|
}, {
|
|
|
|
name: "Light (green accent)",
|
|
|
|
id: "light-green"
|
|
|
|
}, {
|
|
|
|
name: "Light (pink accent)",
|
|
|
|
id: "light-pink"
|
|
|
|
}, {
|
|
|
|
name: "Light (purple accent)",
|
|
|
|
id: "light-purple"
|
|
|
|
}, {
|
|
|
|
name: "Light (red accent)",
|
|
|
|
id: "light-red"
|
|
|
|
}, {
|
|
|
|
name: "Windows Media Center",
|
|
|
|
id: "wmc"
|
2019-02-23 16:38:53 +00:00
|
|
|
}];
|
|
|
|
};
|
|
|
|
|
|
|
|
return skinManager;
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
define("connectionManager", [], function () {
|
|
|
|
return ConnectionManager;
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
define("apiClientResolver", [], function () {
|
|
|
|
return function () {
|
|
|
|
return window.ApiClient;
|
|
|
|
};
|
2019-01-21 17:47:10 +09:00
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
define("appRouter", [embyWebComponentsBowerPath + "/router", "itemHelper"], function (appRouter, itemHelper) {
|
2018-10-23 01:05:09 +03:00
|
|
|
function showItem(item, serverId, options) {
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("string" == typeof item) {
|
|
|
|
require(["connectionManager"], function (connectionManager) {
|
|
|
|
var apiClient = connectionManager.currentApiClient();
|
|
|
|
apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) {
|
|
|
|
appRouter.showItem(item, options);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
if (2 == arguments.length) {
|
|
|
|
options = arguments[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
appRouter.show("/" + appRouter.getRouteUrl(item, options), {
|
|
|
|
item: item
|
|
|
|
});
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
appRouter.showLocalLogin = function (serverId, manualLogin) {
|
|
|
|
Dashboard.navigate("login.html?serverid=" + serverId);
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showVideoOsd = function () {
|
|
|
|
return Dashboard.navigate("videoosd.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showSelectServer = function () {
|
|
|
|
Dashboard.navigate(AppInfo.isNativeApp ? "selectserver.html" : "login.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showWelcome = function () {
|
|
|
|
Dashboard.navigate(AppInfo.isNativeApp ? "selectserver.html" : "login.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showSettings = function () {
|
|
|
|
Dashboard.navigate("mypreferencesmenu.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showGuide = function () {
|
|
|
|
Dashboard.navigate("livetv.html?tab=1");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.goHome = function () {
|
|
|
|
Dashboard.navigate("home.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showSearch = function () {
|
|
|
|
Dashboard.navigate("search.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showLiveTV = function () {
|
|
|
|
Dashboard.navigate("livetv.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showRecordedTV = function () {
|
|
|
|
Dashboard.navigate("livetv.html?tab=3");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showFavorites = function () {
|
|
|
|
Dashboard.navigate("home.html?tab=1");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showSettings = function () {
|
|
|
|
Dashboard.navigate("mypreferencesmenu.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showNowPlaying = function () {
|
|
|
|
Dashboard.navigate("nowplaying.html");
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.setTitle = function (title) {
|
|
|
|
LibraryMenu.setTitle(title);
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.getRouteUrl = function (item, options) {
|
|
|
|
if (!item) {
|
|
|
|
throw new Error("item cannot be null");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item.url) {
|
|
|
|
return item.url;
|
|
|
|
}
|
|
|
|
|
|
|
|
var context = options ? options.context : null;
|
|
|
|
var id = item.Id || item.ItemId;
|
|
|
|
|
|
|
|
if (!options) {
|
|
|
|
options = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
var url;
|
|
|
|
var itemType = item.Type || (options ? options.itemType : null);
|
|
|
|
var serverId = item.ServerId || options.serverId;
|
|
|
|
|
|
|
|
if ("settings" === item) {
|
|
|
|
return "mypreferencesmenu.html";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("wizard" === item) {
|
|
|
|
return "wizardstart.html";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("manageserver" === item) {
|
|
|
|
return "dashboard.html";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("recordedtv" === item) {
|
|
|
|
return "livetv.html?tab=3&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("nextup" === item) {
|
|
|
|
return "list/list.html?type=nextup&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
if ("list" === item) {
|
|
|
|
var url = "list/list.html?serverId=" + options.serverId + "&type=" + options.itemTypes;
|
2019-02-23 16:38:53 +00:00
|
|
|
|
|
|
|
if (options.isFavorite) {
|
|
|
|
url += "&IsFavorite=true";
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("livetv" === item) {
|
|
|
|
if ("guide" === options.section) {
|
|
|
|
return "livetv.html?tab=1&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("movies" === options.section) {
|
|
|
|
return "list/list.html?type=Programs&IsMovie=true&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("shows" === options.section) {
|
|
|
|
return "list/list.html?type=Programs&IsSeries=true&IsMovie=false&IsNews=false&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("sports" === options.section) {
|
|
|
|
return "list/list.html?type=Programs&IsSports=true&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("kids" === options.section) {
|
|
|
|
return "list/list.html?type=Programs&IsKids=true&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("news" === options.section) {
|
|
|
|
return "list/list.html?type=Programs&IsNews=true&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("onnow" === options.section) {
|
|
|
|
return "list/list.html?type=Programs&IsAiring=true&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("dvrschedule" === options.section) {
|
|
|
|
return "livetv.html?tab=4&serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "livetv.html?serverId=" + options.serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("SeriesTimer" == itemType) {
|
|
|
|
return "itemdetails.html?seriesTimerId=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("livetv" == item.CollectionType) {
|
|
|
|
return "livetv.html";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("Genre" === item.Type) {
|
|
|
|
url = "list/list.html?genreId=" + item.Id + "&serverId=" + serverId;
|
|
|
|
|
|
|
|
if ("livetv" === context) {
|
|
|
|
url += "&type=Programs";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (options.parentId) {
|
|
|
|
url += "&parentId=" + options.parentId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("MusicGenre" === item.Type) {
|
|
|
|
url = "list/list.html?musicGenreId=" + item.Id + "&serverId=" + serverId;
|
|
|
|
|
|
|
|
if (options.parentId) {
|
|
|
|
url += "&parentId=" + options.parentId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("Studio" === item.Type) {
|
|
|
|
url = "list/list.html?studioId=" + item.Id + "&serverId=" + serverId;
|
|
|
|
|
|
|
|
if (options.parentId) {
|
|
|
|
url += "&parentId=" + options.parentId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
if ("folders" !== context && !itemHelper.isLocalItem(item)) {
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("movies" == item.CollectionType) {
|
|
|
|
url = "movies.html?topParentId=" + item.Id;
|
|
|
|
|
|
|
|
if (options && "latest" === options.section) {
|
|
|
|
url += "&tab=1";
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("tvshows" == item.CollectionType) {
|
|
|
|
url = "tv.html?topParentId=" + item.Id;
|
|
|
|
|
|
|
|
if (options && "latest" === options.section) {
|
|
|
|
url += "&tab=2";
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("music" == item.CollectionType) {
|
|
|
|
return "music.html?topParentId=" + item.Id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("Playlist" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("TvChannel" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("Program" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("BoxSet" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("MusicAlbum" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("MusicGenre" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("Person" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("Recording" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("MusicArtist" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-02-23 16:38:53 +00:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
var contextSuffix = context ? "&context=" + context : "";
|
2019-01-21 17:47:10 +09:00
|
|
|
|
2019-02-23 16:38:53 +00:00
|
|
|
if ("Series" == itemType || "Season" == itemType || "Episode" == itemType) {
|
|
|
|
return "itemdetails.html?id=" + id + contextSuffix + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item.IsFolder) {
|
|
|
|
if (id) {
|
|
|
|
return "list/list.html?parentId=" + id + "&serverId=" + serverId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "#";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "itemdetails.html?id=" + id + "&serverId=" + serverId;
|
|
|
|
};
|
|
|
|
|
|
|
|
appRouter.showItem = showItem;
|
|
|
|
return appRouter;
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
|
|
|
|
require(["css!css/site"]);
|
|
|
|
|
|
|
|
return require(["browser"], onWebComponentsReady);
|
|
|
|
}();
|
|
|
|
pageClassOn("viewshow", "standalonePage", function () {
|
2019-01-21 17:47:10 +09:00
|
|
|
document.querySelector(".skinHeader").classList.add("noHeaderRight");
|
|
|
|
});
|
2019-02-23 16:38:53 +00:00
|
|
|
pageClassOn("viewhide", "standalonePage", function () {
|
2019-01-21 17:47:10 +09:00
|
|
|
document.querySelector(".skinHeader").classList.remove("noHeaderRight");
|
2018-12-11 00:46:50 -05:00
|
|
|
});
|