mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge remote-tracking branch 'upstream/master' into es6
With conflicts
This commit is contained in:
commit
3713091382
165 changed files with 4194 additions and 2714 deletions
|
@ -11,6 +11,7 @@
|
|||
src += `?v=${self.dashboardVersion}`;
|
||||
}
|
||||
script.src = src;
|
||||
script.setAttribute('async', '');
|
||||
|
||||
if (onload) {
|
||||
script.onload = onload;
|
||||
|
|
|
@ -60,7 +60,7 @@ define(['browser'], function (browser) {
|
|||
|
||||
function canPlayHlsWithMSE() {
|
||||
// text tracks don’t work with this in firefox
|
||||
return window.MediaSource != null;
|
||||
return window.MediaSource != null; /* eslint-disable-line compat/compat */
|
||||
}
|
||||
|
||||
function supportsAc3(videoTestElement) {
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
'MozAnimation': 'animationend',
|
||||
'WebkitAnimation': 'webkitAnimationEnd'
|
||||
};
|
||||
for (let t in animations) {
|
||||
for (const t in animations) {
|
||||
if (el.style[t] !== undefined) {
|
||||
_animationEvent = animations[t];
|
||||
return animations[t];
|
||||
|
@ -251,7 +251,7 @@
|
|||
'MozTransition': 'transitionend',
|
||||
'WebkitTransition': 'webkitTransitionEnd'
|
||||
};
|
||||
for (let t in transitions) {
|
||||
for (const t in transitions) {
|
||||
if (el.style[t] !== undefined) {
|
||||
_transitionEvent = transitions[t];
|
||||
return transitions[t];
|
||||
|
|
|
@ -201,6 +201,9 @@ import appHost from 'apphost';
|
|||
'rewind': () => {
|
||||
playbackManager.rewind();
|
||||
},
|
||||
'seek': () => {
|
||||
playbackManager.seekMs(options);
|
||||
},
|
||||
'togglefullscreen': () => {
|
||||
playbackManager.toggleFullscreen();
|
||||
},
|
||||
|
@ -235,9 +238,6 @@ import appHost from 'apphost';
|
|||
}
|
||||
}
|
||||
|
||||
// Alias for backward compatibility
|
||||
export const trigger = handleCommand;
|
||||
|
||||
dom.addEventListener(document, 'click', notify, {
|
||||
passive: true
|
||||
});
|
||||
|
@ -245,8 +245,7 @@ import appHost from 'apphost';
|
|||
/* eslint-enable indent */
|
||||
|
||||
export default {
|
||||
trigger: handleCommand,
|
||||
handle: handleCommand,
|
||||
handleCommand: handleCommand,
|
||||
notify: notify,
|
||||
notifyMouseMove: notifyMouseMove,
|
||||
idleTime: idleTime,
|
||||
|
|
|
@ -71,12 +71,12 @@ define(['connectionManager', 'listView', 'cardBuilder', 'imageLoader', 'libraryB
|
|||
|
||||
html += '<div class="' + sectionClass + '" data-type="' + section.type + '">';
|
||||
html += '<div class="sectionTitleContainer sectionTitleContainer-cards">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards padded-left">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">';
|
||||
html += section.name;
|
||||
html += '</h2>';
|
||||
html += '<a is="emby-linkbutton" href="#" class="clearLink hide" style="margin-left:1em;vertical-align:middle;"><button is="emby-button" type="button" class="raised more raised-mini noIcon">' + globalize.translate('ButtonMore') + '</button></a>';
|
||||
html += '</div>';
|
||||
html += '<div is="emby-itemscontainer" class="itemsContainer padded-left padded-right">';
|
||||
html += '<div is="emby-itemscontainer" class="itemsContainer padded-right">';
|
||||
html += '</div>';
|
||||
return html += '</div>';
|
||||
}).join('');
|
||||
|
|
|
@ -78,7 +78,7 @@ export function isNavigationKey(key) {
|
|||
}
|
||||
|
||||
export function enable() {
|
||||
document.addEventListener('keydown', function (e) {
|
||||
window.addEventListener('keydown', function (e) {
|
||||
const key = getKeyName(e);
|
||||
|
||||
// Ignore navigation keys for non-TV
|
||||
|
@ -90,53 +90,53 @@ export function enable() {
|
|||
|
||||
switch (key) {
|
||||
case 'ArrowLeft':
|
||||
inputManager.handle('left');
|
||||
inputManager.handleCommand('left');
|
||||
break;
|
||||
case 'ArrowUp':
|
||||
inputManager.handle('up');
|
||||
inputManager.handleCommand('up');
|
||||
break;
|
||||
case 'ArrowRight':
|
||||
inputManager.handle('right');
|
||||
inputManager.handleCommand('right');
|
||||
break;
|
||||
case 'ArrowDown':
|
||||
inputManager.handle('down');
|
||||
inputManager.handleCommand('down');
|
||||
break;
|
||||
|
||||
case 'Back':
|
||||
inputManager.handle('back');
|
||||
inputManager.handleCommand('back');
|
||||
break;
|
||||
|
||||
case 'Escape':
|
||||
if (layoutManager.tv) {
|
||||
inputManager.handle('back');
|
||||
inputManager.handleCommand('back');
|
||||
} else {
|
||||
capture = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'MediaPlay':
|
||||
inputManager.handle('play');
|
||||
inputManager.handleCommand('play');
|
||||
break;
|
||||
case 'Pause':
|
||||
inputManager.handle('pause');
|
||||
inputManager.handleCommand('pause');
|
||||
break;
|
||||
case 'MediaPlayPause':
|
||||
inputManager.handle('playpause');
|
||||
inputManager.handleCommand('playpause');
|
||||
break;
|
||||
case 'MediaRewind':
|
||||
inputManager.handle('rewind');
|
||||
inputManager.handleCommand('rewind');
|
||||
break;
|
||||
case 'MediaFastForward':
|
||||
inputManager.handle('fastforward');
|
||||
inputManager.handleCommand('fastforward');
|
||||
break;
|
||||
case 'MediaStop':
|
||||
inputManager.handle('stop');
|
||||
inputManager.handleCommand('stop');
|
||||
break;
|
||||
case 'MediaTrackPrevious':
|
||||
inputManager.handle('previoustrack');
|
||||
inputManager.handleCommand('previoustrack');
|
||||
break;
|
||||
case 'MediaTrackNext':
|
||||
inputManager.handle('nexttrack');
|
||||
inputManager.handleCommand('nexttrack');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -13,7 +13,7 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '
|
|||
html += '<div class="headerRight">';
|
||||
html += '<span class="headerSelectedPlayer"></span>';
|
||||
html += `<button is="paper-icon-button-light" class="headerSyncButton syncButton headerButton headerButtonRight hide" title="${globalize.translate('ButtonSyncPlay')}"><span class="material-icons sync_disabled"></span></button>`;
|
||||
html += '<button is="paper-icon-button-light" class="headerAudioPlayerButton audioPlayerButton headerButton headerButtonRight hide"><span class="material-icons music_note"></span></button>';
|
||||
html += `<button is="paper-icon-button-light" class="headerAudioPlayerButton audioPlayerButton headerButton headerButtonRight hide" title="${globalize.translate('ButtonPlayer')}"><span class="material-icons music_note"></span></button>`;
|
||||
html += `<button is="paper-icon-button-light" class="headerCastButton castButton headerButton headerButtonRight hide" title="${globalize.translate('ButtonCast')}"><span class="material-icons cast"></span></button>`;
|
||||
html += `<button type="button" is="paper-icon-button-light" class="headerButton headerButtonRight headerSearchButton hide" title="${globalize.translate('ButtonSearch')}"><span class="material-icons search"></span></button>`;
|
||||
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerUserButton hide"><span class="material-icons person"></span></button>';
|
||||
|
@ -89,7 +89,8 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '
|
|||
|
||||
var policy = user.Policy ? user.Policy : user.localUser.Policy;
|
||||
|
||||
if (headerSyncButton && policy && policy.SyncPlayAccess !== 'None') {
|
||||
var apiClient = getCurrentApiClient();
|
||||
if (headerSyncButton && policy && policy.SyncPlayAccess !== 'None' && apiClient.isMinServerVersion('10.6.0')) {
|
||||
headerSyncButton.classList.remove('hide');
|
||||
}
|
||||
} else {
|
||||
|
@ -116,7 +117,7 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '
|
|||
}
|
||||
|
||||
function showSearch() {
|
||||
inputManager.trigger('search');
|
||||
inputManager.handleCommand('search');
|
||||
}
|
||||
|
||||
function onHeaderUserButtonClick(e) {
|
||||
|
@ -967,8 +968,10 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '
|
|||
updateUserInHeader();
|
||||
});
|
||||
events.on(playbackManager, 'playerchange', updateCastIcon);
|
||||
|
||||
events.on(syncPlayManager, 'enabled', onSyncPlayEnabled);
|
||||
events.on(syncPlayManager, 'syncing', onSyncPlaySyncing);
|
||||
|
||||
loadNavDrawer();
|
||||
return LibraryMenu;
|
||||
});
|
||||
|
|
|
@ -136,6 +136,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
|
|||
|
||||
stopMouseInterval();
|
||||
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
dom.removeEventListener(document, (window.PointerEvent ? 'pointermove' : 'mousemove'), onPointerMove, {
|
||||
passive: true
|
||||
});
|
||||
|
@ -148,6 +149,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
|
|||
});
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
dom.removeEventListener(document, (window.PointerEvent ? 'pointerenter' : 'mouseenter'), onPointerEnter, {
|
||||
capture: true,
|
||||
passive: true
|
||||
|
|
|
@ -15,7 +15,7 @@ define([
|
|||
'detailtablecss'], function () {
|
||||
|
||||
function defineRoute(newRoute) {
|
||||
var path = newRoute.path;
|
||||
var path = newRoute.alias ? newRoute.alias : newRoute.path;
|
||||
console.debug('defining route: ' + path);
|
||||
newRoute.dictionary = 'core';
|
||||
Emby.Page.addRoute(path, newRoute);
|
||||
|
@ -240,8 +240,9 @@ define([
|
|||
transition: 'fade'
|
||||
});
|
||||
defineRoute({
|
||||
path: '/itemdetails.html',
|
||||
controller: 'itemDetails',
|
||||
alias: '/details',
|
||||
path: '/controllers/itemDetails/index.html',
|
||||
controller: 'itemDetails/index',
|
||||
autoFocus: false,
|
||||
transition: 'fade'
|
||||
});
|
||||
|
|
|
@ -36,28 +36,28 @@ define(['connectionManager', 'playbackManager', 'syncPlayManager', 'events', 'in
|
|||
console.debug('Received command: ' + cmd.Name);
|
||||
switch (cmd.Name) {
|
||||
case 'Select':
|
||||
inputManager.trigger('select');
|
||||
inputManager.handleCommand('select');
|
||||
return;
|
||||
case 'Back':
|
||||
inputManager.trigger('back');
|
||||
inputManager.handleCommand('back');
|
||||
return;
|
||||
case 'MoveUp':
|
||||
inputManager.trigger('up');
|
||||
inputManager.handleCommand('up');
|
||||
return;
|
||||
case 'MoveDown':
|
||||
inputManager.trigger('down');
|
||||
inputManager.handleCommand('down');
|
||||
return;
|
||||
case 'MoveLeft':
|
||||
inputManager.trigger('left');
|
||||
inputManager.handleCommand('left');
|
||||
return;
|
||||
case 'MoveRight':
|
||||
inputManager.trigger('right');
|
||||
inputManager.handleCommand('right');
|
||||
return;
|
||||
case 'PageUp':
|
||||
inputManager.trigger('pageup');
|
||||
inputManager.handleCommand('pageup');
|
||||
return;
|
||||
case 'PageDown':
|
||||
inputManager.trigger('pagedown');
|
||||
inputManager.handleCommand('pagedown');
|
||||
return;
|
||||
case 'PlayTrailers':
|
||||
playTrailers(apiClient, cmd.Arguments.ItemId);
|
||||
|
@ -65,26 +65,29 @@ define(['connectionManager', 'playbackManager', 'syncPlayManager', 'events', 'in
|
|||
case 'SetRepeatMode':
|
||||
playbackManager.setRepeatMode(cmd.Arguments.RepeatMode);
|
||||
break;
|
||||
case 'SetShuffleQueue':
|
||||
playbackManager.setQueueShuffleMode(cmd.Arguments.ShuffleMode);
|
||||
break;
|
||||
case 'VolumeUp':
|
||||
inputManager.trigger('volumeup');
|
||||
inputManager.handleCommand('volumeup');
|
||||
return;
|
||||
case 'VolumeDown':
|
||||
inputManager.trigger('volumedown');
|
||||
inputManager.handleCommand('volumedown');
|
||||
return;
|
||||
case 'ChannelUp':
|
||||
inputManager.trigger('channelup');
|
||||
inputManager.handleCommand('channelup');
|
||||
return;
|
||||
case 'ChannelDown':
|
||||
inputManager.trigger('channeldown');
|
||||
inputManager.handleCommand('channeldown');
|
||||
return;
|
||||
case 'Mute':
|
||||
inputManager.trigger('mute');
|
||||
inputManager.handleCommand('mute');
|
||||
return;
|
||||
case 'Unmute':
|
||||
inputManager.trigger('unmute');
|
||||
inputManager.handleCommand('unmute');
|
||||
return;
|
||||
case 'ToggleMute':
|
||||
inputManager.trigger('togglemute');
|
||||
inputManager.handleCommand('togglemute');
|
||||
return;
|
||||
case 'SetVolume':
|
||||
notifyApp();
|
||||
|
@ -99,19 +102,19 @@ define(['connectionManager', 'playbackManager', 'syncPlayManager', 'events', 'in
|
|||
playbackManager.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index));
|
||||
break;
|
||||
case 'ToggleFullscreen':
|
||||
inputManager.trigger('togglefullscreen');
|
||||
inputManager.handleCommand('togglefullscreen');
|
||||
return;
|
||||
case 'GoHome':
|
||||
inputManager.trigger('home');
|
||||
inputManager.handleCommand('home');
|
||||
return;
|
||||
case 'GoToSettings':
|
||||
inputManager.trigger('settings');
|
||||
inputManager.handleCommand('settings');
|
||||
return;
|
||||
case 'DisplayContent':
|
||||
displayContent(cmd, apiClient);
|
||||
break;
|
||||
case 'GoToSearch':
|
||||
inputManager.trigger('search');
|
||||
inputManager.handleCommand('search');
|
||||
return;
|
||||
case 'DisplayMessage':
|
||||
displayMessage(cmd);
|
||||
|
@ -162,19 +165,19 @@ define(['connectionManager', 'playbackManager', 'syncPlayManager', 'events', 'in
|
|||
}
|
||||
} else if (msg.MessageType === 'Playstate') {
|
||||
if (msg.Data.Command === 'Stop') {
|
||||
inputManager.trigger('stop');
|
||||
inputManager.handleCommand('stop');
|
||||
} else if (msg.Data.Command === 'Pause') {
|
||||
inputManager.trigger('pause');
|
||||
inputManager.handleCommand('pause');
|
||||
} else if (msg.Data.Command === 'Unpause') {
|
||||
inputManager.trigger('play');
|
||||
inputManager.handleCommand('play');
|
||||
} else if (msg.Data.Command === 'PlayPause') {
|
||||
inputManager.trigger('playpause');
|
||||
inputManager.handleCommand('playpause');
|
||||
} else if (msg.Data.Command === 'Seek') {
|
||||
playbackManager.seek(msg.Data.SeekPositionTicks);
|
||||
} else if (msg.Data.Command === 'NextTrack') {
|
||||
inputManager.trigger('next');
|
||||
inputManager.handleCommand('next');
|
||||
} else if (msg.Data.Command === 'PreviousTrack') {
|
||||
inputManager.trigger('previous');
|
||||
inputManager.handleCommand('previous');
|
||||
} else {
|
||||
notifyApp();
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ var Dashboard = {
|
|||
capabilities: function (appHost) {
|
||||
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', 'ChannelUp', 'ChannelDown', 'PlayMediaSource', 'PlayTrailers'],
|
||||
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,
|
||||
SupportsMediaControl: true
|
||||
};
|
||||
|
@ -387,8 +387,6 @@ var AppInfo = {};
|
|||
define('lazyLoader', [componentsPath + '/lazyLoader/lazyLoaderIntersectionObserver'], returnFirstDependency);
|
||||
define('shell', [scriptsPath + '/shell'], returnFirstDependency);
|
||||
|
||||
define('registerElement', ['document-register-element'], returnFirstDependency);
|
||||
|
||||
define('alert', [componentsPath + '/alert'], returnFirstDependency);
|
||||
|
||||
defineResizeObserver();
|
||||
|
@ -672,7 +670,6 @@ var AppInfo = {};
|
|||
},
|
||||
bundles: {
|
||||
bundle: [
|
||||
'document-register-element',
|
||||
'fetch',
|
||||
'flvjs',
|
||||
'jstree',
|
||||
|
@ -1039,7 +1036,7 @@ var AppInfo = {};
|
|||
}
|
||||
|
||||
if ('SeriesTimer' == itemType) {
|
||||
return 'itemdetails.html?seriesTimerId=' + id + '&serverId=' + serverId;
|
||||
return 'details?seriesTimerId=' + id + '&serverId=' + serverId;
|
||||
}
|
||||
|
||||
if ('livetv' == item.CollectionType) {
|
||||
|
@ -1109,13 +1106,13 @@ var AppInfo = {};
|
|||
var itemTypes = ['Playlist', 'TvChannel', 'Program', 'BoxSet', 'MusicAlbum', 'MusicGenre', 'Person', 'Recording', 'MusicArtist'];
|
||||
|
||||
if (itemTypes.indexOf(itemType) >= 0) {
|
||||
return 'itemdetails.html?id=' + id + '&serverId=' + serverId;
|
||||
return 'details?id=' + id + '&serverId=' + serverId;
|
||||
}
|
||||
|
||||
var contextSuffix = context ? '&context=' + context : '';
|
||||
|
||||
if ('Series' == itemType || 'Season' == itemType || 'Episode' == itemType) {
|
||||
return 'itemdetails.html?id=' + id + contextSuffix + '&serverId=' + serverId;
|
||||
return 'details?id=' + id + contextSuffix + '&serverId=' + serverId;
|
||||
}
|
||||
|
||||
if (item.IsFolder) {
|
||||
|
@ -1126,7 +1123,7 @@ var AppInfo = {};
|
|||
return '#';
|
||||
}
|
||||
|
||||
return 'itemdetails.html?id=' + id + '&serverId=' + serverId;
|
||||
return 'details?id=' + id + '&serverId=' + serverId;
|
||||
};
|
||||
|
||||
appRouter.showItem = showItem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue