Merge branch 'master' into migrate-to-ES6-42
This commit is contained in:
commit
a39834c705
270 changed files with 6321 additions and 8694 deletions
|
@ -6,7 +6,7 @@ function getWindowLocationSearch(win) {
|
|||
if (!search) {
|
||||
var index = window.location.href.indexOf('?');
|
||||
|
||||
if (-1 != index) {
|
||||
if (index != -1) {
|
||||
search = window.location.href.substring(index);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ window.getParameterByName = function (name, url) {
|
|||
var regex = new RegExp(regexS, 'i');
|
||||
var results = regex.exec(url || getWindowLocationSearch());
|
||||
|
||||
if (null == results) {
|
||||
if (results == null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ var Dashboard = {
|
|||
var urlLower = window.location.href.toLowerCase();
|
||||
var index = urlLower.lastIndexOf('/web');
|
||||
|
||||
if (-1 != index) {
|
||||
if (index != -1) {
|
||||
return urlLower.substring(0, index);
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ var Dashboard = {
|
|||
});
|
||||
},
|
||||
alert: function (options) {
|
||||
if ('string' == typeof options) {
|
||||
if (typeof options == 'string') {
|
||||
return void require(['toast'], function (toast) {
|
||||
toast.default({
|
||||
text: options
|
||||
|
@ -197,7 +197,7 @@ var Dashboard = {
|
|||
var capabilities = {
|
||||
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', 'SetShuffleQueue', 'ChannelUp', 'ChannelDown', 'PlayMediaSource', 'PlayTrailers'],
|
||||
SupportsPersistentIdentifier: 'cordova' === self.appMode || 'android' === self.appMode,
|
||||
SupportsPersistentIdentifier: self.appMode === 'cordova' || self.appMode === 'android',
|
||||
SupportsMediaControl: true
|
||||
};
|
||||
appHost.getPushTokenInfo();
|
||||
|
@ -452,8 +452,8 @@ function initClient() {
|
|||
}
|
||||
|
||||
function onGlobalizeInit(browser, globalize) {
|
||||
if ('android' === self.appMode) {
|
||||
if (-1 !== self.location.href.toString().toLowerCase().indexOf('start=backgroundsync')) {
|
||||
if (self.appMode === 'android') {
|
||||
if (self.location.href.toString().toLowerCase().indexOf('start=backgroundsync') !== -1) {
|
||||
return onAppReady(browser);
|
||||
}
|
||||
}
|
||||
|
@ -477,36 +477,30 @@ function initClient() {
|
|||
|
||||
function loadPlugins(appHost, browser, shell) {
|
||||
console.debug('loading installed plugins');
|
||||
var list = [
|
||||
'plugins/playAccessValidation/plugin',
|
||||
'plugins/experimentalWarnings/plugin',
|
||||
'plugins/htmlAudioPlayer/plugin',
|
||||
'plugins/htmlVideoPlayer/plugin',
|
||||
'plugins/photoPlayer/plugin',
|
||||
'plugins/bookPlayer/plugin',
|
||||
'plugins/youtubePlayer/plugin',
|
||||
'plugins/backdropScreensaver/plugin',
|
||||
'plugins/logoScreensaver/plugin'
|
||||
];
|
||||
|
||||
if (appHost.supports('remotecontrol')) {
|
||||
list.push('plugins/sessionPlayer/plugin');
|
||||
|
||||
if (browser.chrome || browser.opera) {
|
||||
list.push('plugins/chromecastPlayer/plugin');
|
||||
}
|
||||
}
|
||||
|
||||
if (window.NativeShell) {
|
||||
list = list.concat(window.NativeShell.getPlugins());
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
Promise.all(list.map(loadPlugin)).then(function () {
|
||||
require(['packageManager'], function (packageManager) {
|
||||
packageManager.init().then(resolve, reject);
|
||||
require(['webSettings'], function (webSettings) {
|
||||
webSettings.getPlugins().then(function (list) {
|
||||
// these two plugins are dependent on features
|
||||
if (!appHost.supports('remotecontrol')) {
|
||||
list.splice(list.indexOf('sessionPlayer'), 1);
|
||||
|
||||
if (!browser.chrome && !browser.opera) {
|
||||
list.splice(list.indexOf('chromecastPlayer', 1));
|
||||
}
|
||||
}
|
||||
|
||||
// add any native plugins
|
||||
if (window.NativeShell) {
|
||||
list = list.concat(window.NativeShell.getPlugins());
|
||||
}
|
||||
|
||||
Promise.all(list.map(loadPlugin)).then(function () {
|
||||
require(['packageManager'], function (packageManager) {
|
||||
packageManager.init().then(resolve, reject);
|
||||
});
|
||||
}, reject);
|
||||
});
|
||||
}, reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -532,7 +526,7 @@ function initClient() {
|
|||
|
||||
window.Emby.Page = appRouter;
|
||||
|
||||
require(['emby-button', 'scripts/themeLoader', 'libraryMenu', 'scripts/routes'], function () {
|
||||
require(['emby-button', 'scripts/autoThemes', 'libraryMenu', 'scripts/routes'], function () {
|
||||
Emby.Page.start({
|
||||
click: false,
|
||||
hashbang: true
|
||||
|
@ -653,8 +647,7 @@ function initClient() {
|
|||
nowPlayingHelper: componentsPath + '/playback/nowplayinghelper',
|
||||
pluginManager: componentsPath + '/pluginManager',
|
||||
packageManager: componentsPath + '/packageManager',
|
||||
screensaverManager: componentsPath + '/screensavermanager',
|
||||
chromecastHelper: 'plugins/chromecastPlayer/chromecastHelpers'
|
||||
screensaverManager: componentsPath + '/screensavermanager'
|
||||
};
|
||||
|
||||
requirejs.onError = onRequireJsError;
|
||||
|
@ -848,7 +841,7 @@ function initClient() {
|
|||
define('viewContainer', [componentsPath + '/viewContainer'], returnFirstDependency);
|
||||
define('dialogHelper', [componentsPath + '/dialogHelper/dialogHelper'], returnFirstDependency);
|
||||
define('serverNotifications', [scriptsPath + '/serverNotifications'], returnFirstDependency);
|
||||
define('skinManager', [componentsPath + '/skinManager'], returnFirstDependency);
|
||||
define('skinManager', [scriptsPath + '/themeManager'], returnFirstDependency);
|
||||
define('keyboardnavigation', [scriptsPath + '/keyboardNavigation'], returnFirstDependency);
|
||||
define('mouseManager', [scriptsPath + '/mouseManager'], returnFirstDependency);
|
||||
define('scrollManager', [componentsPath + '/scrollManager'], returnFirstDependency);
|
||||
|
@ -863,7 +856,7 @@ function initClient() {
|
|||
});
|
||||
define('appRouter', [componentsPath + '/appRouter', 'itemHelper'], function (appRouter, itemHelper) {
|
||||
function showItem(item, serverId, options) {
|
||||
if ('string' == typeof item) {
|
||||
if (typeof item == 'string') {
|
||||
require(['connectionManager'], function (connectionManager) {
|
||||
var apiClient = connectionManager.currentApiClient();
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) {
|
||||
|
@ -871,7 +864,7 @@ function initClient() {
|
|||
});
|
||||
});
|
||||
} else {
|
||||
if (2 == arguments.length) {
|
||||
if (arguments.length == 2) {
|
||||
options = arguments[1];
|
||||
}
|
||||
|
||||
|
@ -953,27 +946,27 @@ function initClient() {
|
|||
var itemType = item.Type || (options ? options.itemType : null);
|
||||
var serverId = item.ServerId || options.serverId;
|
||||
|
||||
if ('settings' === item) {
|
||||
if (item === 'settings') {
|
||||
return 'mypreferencesmenu.html';
|
||||
}
|
||||
|
||||
if ('wizard' === item) {
|
||||
if (item === 'wizard') {
|
||||
return 'wizardstart.html';
|
||||
}
|
||||
|
||||
if ('manageserver' === item) {
|
||||
if (item === 'manageserver') {
|
||||
return 'dashboard.html';
|
||||
}
|
||||
|
||||
if ('recordedtv' === item) {
|
||||
if (item === 'recordedtv') {
|
||||
return 'livetv.html?tab=3&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('nextup' === item) {
|
||||
if (item === 'nextup') {
|
||||
return 'list.html?type=nextup&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('list' === item) {
|
||||
if (item === 'list') {
|
||||
var url = 'list.html?serverId=' + options.serverId + '&type=' + options.itemTypes;
|
||||
|
||||
if (options.isFavorite) {
|
||||
|
@ -983,61 +976,61 @@ function initClient() {
|
|||
return url;
|
||||
}
|
||||
|
||||
if ('livetv' === item) {
|
||||
if ('programs' === options.section) {
|
||||
if (item === 'livetv') {
|
||||
if (options.section === 'programs') {
|
||||
return 'livetv.html?tab=0&serverId=' + options.serverId;
|
||||
}
|
||||
if ('guide' === options.section) {
|
||||
if (options.section === 'guide') {
|
||||
return 'livetv.html?tab=1&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('movies' === options.section) {
|
||||
if (options.section === 'movies') {
|
||||
return 'list.html?type=Programs&IsMovie=true&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('shows' === options.section) {
|
||||
if (options.section === 'shows') {
|
||||
return 'list.html?type=Programs&IsSeries=true&IsMovie=false&IsNews=false&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('sports' === options.section) {
|
||||
if (options.section === 'sports') {
|
||||
return 'list.html?type=Programs&IsSports=true&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('kids' === options.section) {
|
||||
if (options.section === 'kids') {
|
||||
return 'list.html?type=Programs&IsKids=true&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('news' === options.section) {
|
||||
if (options.section === 'news') {
|
||||
return 'list.html?type=Programs&IsNews=true&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('onnow' === options.section) {
|
||||
if (options.section === 'onnow') {
|
||||
return 'list.html?type=Programs&IsAiring=true&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('dvrschedule' === options.section) {
|
||||
if (options.section === 'dvrschedule') {
|
||||
return 'livetv.html?tab=4&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('seriesrecording' === options.section) {
|
||||
if (options.section === 'seriesrecording') {
|
||||
return 'livetv.html?tab=5&serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
return 'livetv.html?serverId=' + options.serverId;
|
||||
}
|
||||
|
||||
if ('SeriesTimer' == itemType) {
|
||||
if (itemType == 'SeriesTimer') {
|
||||
return 'details?seriesTimerId=' + id + '&serverId=' + serverId;
|
||||
}
|
||||
|
||||
if ('livetv' == item.CollectionType) {
|
||||
if (item.CollectionType == 'livetv') {
|
||||
return 'livetv.html';
|
||||
}
|
||||
|
||||
if ('Genre' === item.Type) {
|
||||
if (item.Type === 'Genre') {
|
||||
url = 'list.html?genreId=' + item.Id + '&serverId=' + serverId;
|
||||
|
||||
if ('livetv' === context) {
|
||||
if (context === 'livetv') {
|
||||
url += '&type=Programs';
|
||||
}
|
||||
|
||||
|
@ -1048,7 +1041,7 @@ function initClient() {
|
|||
return url;
|
||||
}
|
||||
|
||||
if ('MusicGenre' === item.Type) {
|
||||
if (item.Type === 'MusicGenre') {
|
||||
url = 'list.html?musicGenreId=' + item.Id + '&serverId=' + serverId;
|
||||
|
||||
if (options.parentId) {
|
||||
|
@ -1058,7 +1051,7 @@ function initClient() {
|
|||
return url;
|
||||
}
|
||||
|
||||
if ('Studio' === item.Type) {
|
||||
if (item.Type === 'Studio') {
|
||||
url = 'list.html?studioId=' + item.Id + '&serverId=' + serverId;
|
||||
|
||||
if (options.parentId) {
|
||||
|
@ -1068,28 +1061,28 @@ function initClient() {
|
|||
return url;
|
||||
}
|
||||
|
||||
if ('folders' !== context && !itemHelper.isLocalItem(item)) {
|
||||
if ('movies' == item.CollectionType) {
|
||||
if (context !== 'folders' && !itemHelper.isLocalItem(item)) {
|
||||
if (item.CollectionType == 'movies') {
|
||||
url = 'movies.html?topParentId=' + item.Id;
|
||||
|
||||
if (options && 'latest' === options.section) {
|
||||
if (options && options.section === 'latest') {
|
||||
url += '&tab=1';
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
if ('tvshows' == item.CollectionType) {
|
||||
if (item.CollectionType == 'tvshows') {
|
||||
url = 'tv.html?topParentId=' + item.Id;
|
||||
|
||||
if (options && 'latest' === options.section) {
|
||||
if (options && options.section === 'latest') {
|
||||
url += '&tab=2';
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
if ('music' == item.CollectionType) {
|
||||
if (item.CollectionType == 'music') {
|
||||
return 'music.html?topParentId=' + item.Id;
|
||||
}
|
||||
}
|
||||
|
@ -1102,7 +1095,7 @@ function initClient() {
|
|||
|
||||
var contextSuffix = context ? '&context=' + context : '';
|
||||
|
||||
if ('Series' == itemType || 'Season' == itemType || 'Episode' == itemType) {
|
||||
if (itemType == 'Series' || itemType == 'Season' || itemType == 'Episode') {
|
||||
return 'details?id=' + id + contextSuffix + '&serverId=' + serverId;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue