mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix all loneliness
This commit is contained in:
parent
aef99ce247
commit
20381bd3ec
22 changed files with 154 additions and 223 deletions
|
@ -803,8 +803,7 @@ function getCardFooterText(item, apiClient, options, footerClass, progressHtml,
|
||||||
} else {
|
} else {
|
||||||
lines.push(escapeHtml(item.SeriesName));
|
lines.push(escapeHtml(item.SeriesName));
|
||||||
}
|
}
|
||||||
} else {
|
} else if (isUsingLiveTvNaming(item)) {
|
||||||
if (isUsingLiveTvNaming(item)) {
|
|
||||||
lines.push(escapeHtml(item.Name));
|
lines.push(escapeHtml(item.Name));
|
||||||
|
|
||||||
if (!item.EpisodeTitle && !item.IndexNumber) {
|
if (!item.EpisodeTitle && !item.IndexNumber) {
|
||||||
|
@ -818,7 +817,6 @@ function getCardFooterText(item, apiClient, options, footerClass, progressHtml,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let showMediaTitle = (showTitle && !titleAdded) || (options.showParentTitleOrTitle && !lines.length);
|
let showMediaTitle = (showTitle && !titleAdded) || (options.showParentTitleOrTitle && !lines.length);
|
||||||
if (!showMediaTitle && !titleAdded && (showTitle || flags.forceName)) {
|
if (!showMediaTitle && !titleAdded && (showTitle || flags.forceName)) {
|
||||||
|
@ -898,14 +896,12 @@ function getCardFooterText(item, apiClient, options, footerClass, progressHtml,
|
||||||
if (item.Type === 'Series') {
|
if (item.Type === 'Series') {
|
||||||
if (item.Status === 'Continuing') {
|
if (item.Status === 'Continuing') {
|
||||||
lines.push(globalize.translate('SeriesYearToPresent', productionYear || ''));
|
lines.push(globalize.translate('SeriesYearToPresent', productionYear || ''));
|
||||||
} else {
|
} else if (item.EndDate && item.ProductionYear) {
|
||||||
if (item.EndDate && item.ProductionYear) {
|
|
||||||
const endYear = datetime.toLocaleString(datetime.parseISO8601Date(item.EndDate).getFullYear(), { useGrouping: false });
|
const endYear = datetime.toLocaleString(datetime.parseISO8601Date(item.EndDate).getFullYear(), { useGrouping: false });
|
||||||
lines.push(productionYear + ((endYear === item.ProductionYear) ? '' : (' - ' + endYear)));
|
lines.push(productionYear + ((endYear === item.ProductionYear) ? '' : (' - ' + endYear)));
|
||||||
} else {
|
} else {
|
||||||
lines.push(productionYear || '');
|
lines.push(productionYear || '');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
lines.push(productionYear || '');
|
lines.push(productionYear || '');
|
||||||
}
|
}
|
||||||
|
|
|
@ -762,14 +762,12 @@ function Guide(options) {
|
||||||
} else {
|
} else {
|
||||||
container.scrollTo(0, pos);
|
container.scrollTo(0, pos);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (horizontal) {
|
||||||
if (horizontal) {
|
|
||||||
container.scrollLeft = Math.round(pos);
|
container.scrollLeft = Math.round(pos);
|
||||||
} else {
|
} else {
|
||||||
container.scrollTop = Math.round(pos);
|
container.scrollTop = Math.round(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let lastGridScroll = 0;
|
let lastGridScroll = 0;
|
||||||
let lastHeaderScroll = 0;
|
let lastHeaderScroll = 0;
|
||||||
|
|
|
@ -216,15 +216,13 @@ function getFetchLatestItemsFn(serverId, parentId, collectionType) {
|
||||||
if (collectionType === 'music') {
|
if (collectionType === 'music') {
|
||||||
limit = 30;
|
limit = 30;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (collectionType === 'tvshows') {
|
||||||
if (collectionType === 'tvshows') {
|
|
||||||
limit = 5;
|
limit = 5;
|
||||||
} else if (collectionType === 'music') {
|
} else if (collectionType === 'music') {
|
||||||
limit = 9;
|
limit = 9;
|
||||||
} else {
|
} else {
|
||||||
limit = 8;
|
limit = 8;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
Limit: limit,
|
Limit: limit,
|
||||||
|
|
|
@ -76,8 +76,7 @@ export function handleHlsJsMediaError(instance, reject) {
|
||||||
recoverDecodingErrorDate = now;
|
recoverDecodingErrorDate = now;
|
||||||
console.debug('try to recover media Error ...');
|
console.debug('try to recover media Error ...');
|
||||||
hlsPlayer.recoverMediaError();
|
hlsPlayer.recoverMediaError();
|
||||||
} else {
|
} else if (!recoverSwapAudioCodecDate || (now - recoverSwapAudioCodecDate) > 3000) {
|
||||||
if (!recoverSwapAudioCodecDate || (now - recoverSwapAudioCodecDate) > 3000) {
|
|
||||||
recoverSwapAudioCodecDate = now;
|
recoverSwapAudioCodecDate = now;
|
||||||
console.debug('try to swap Audio Codec and recover media Error ...');
|
console.debug('try to swap Audio Codec and recover media Error ...');
|
||||||
hlsPlayer.swapAudioCodec();
|
hlsPlayer.swapAudioCodec();
|
||||||
|
@ -92,7 +91,6 @@ export function handleHlsJsMediaError(instance, reject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export function onErrorInternal(instance, type) {
|
export function onErrorInternal(instance, type) {
|
||||||
// Needed for video
|
// Needed for video
|
||||||
|
|
|
@ -171,15 +171,13 @@ function getRemoteImageHtml(image, imageType) {
|
||||||
shape = 'banner';
|
shape = 'banner';
|
||||||
} else if (imageType === 'Disc') {
|
} else if (imageType === 'Disc') {
|
||||||
shape = 'square';
|
shape = 'square';
|
||||||
} else {
|
} else if (currentItemType === 'Episode') {
|
||||||
if (currentItemType === 'Episode') {
|
|
||||||
shape = 'backdrop';
|
shape = 'backdrop';
|
||||||
} else if (currentItemType === 'MusicAlbum' || currentItemType === 'MusicArtist') {
|
} else if (currentItemType === 'MusicAlbum' || currentItemType === 'MusicArtist') {
|
||||||
shape = 'square';
|
shape = 'square';
|
||||||
} else {
|
} else {
|
||||||
shape = 'portrait';
|
shape = 'portrait';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
cssClass += ' ' + shape + 'Card ' + shape + 'Card-scalable';
|
cssClass += ' ' + shape + 'Card ' + shape + 'Card-scalable';
|
||||||
if (tagName === 'button') {
|
if (tagName === 'button') {
|
||||||
|
@ -230,11 +228,9 @@ function getRemoteImageHtml(image, imageType) {
|
||||||
if (image.Language) {
|
if (image.Language) {
|
||||||
html += ' • ' + image.Language;
|
html += ' • ' + image.Language;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (image.Language) {
|
||||||
if (image.Language) {
|
|
||||||
html += image.Language;
|
html += image.Language;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
@ -244,8 +240,7 @@ function getRemoteImageHtml(image, imageType) {
|
||||||
|
|
||||||
if (image.RatingType === 'Likes') {
|
if (image.RatingType === 'Likes') {
|
||||||
html += image.CommunityRating + (image.CommunityRating === 1 ? ' like' : ' likes');
|
html += image.CommunityRating + (image.CommunityRating === 1 ? ' like' : ' likes');
|
||||||
} else {
|
} else if (image.CommunityRating) {
|
||||||
if (image.CommunityRating) {
|
|
||||||
html += image.CommunityRating.toFixed(1);
|
html += image.CommunityRating.toFixed(1);
|
||||||
|
|
||||||
if (image.VoteCount) {
|
if (image.VoteCount) {
|
||||||
|
@ -254,7 +249,6 @@ function getRemoteImageHtml(image, imageType) {
|
||||||
} else {
|
} else {
|
||||||
html += 'Unrated';
|
html += 'Unrated';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,11 +164,9 @@ function getCardHtml(image, apiClient, options) {
|
||||||
} else {
|
} else {
|
||||||
html += '<button type="button" is="paper-icon-button-light" class="autoSize" disabled title="' + globalize.translate('MoveRight') + '"><span class="material-icons chevron_right" aria-hidden="true"></span></button>';
|
html += '<button type="button" is="paper-icon-button-light" class="autoSize" disabled title="' + globalize.translate('MoveRight') + '"><span class="material-icons chevron_right" aria-hidden="true"></span></button>';
|
||||||
}
|
}
|
||||||
} else {
|
} else if (options.imageProviders.length) {
|
||||||
if (options.imageProviders.length) {
|
|
||||||
html += '<button type="button" is="paper-icon-button-light" data-imagetype="' + image.ImageType + '" class="btnSearchImages autoSize" title="' + globalize.translate('Search') + '"><span class="material-icons search" aria-hidden="true"></span></button>';
|
html += '<button type="button" is="paper-icon-button-light" data-imagetype="' + image.ImageType + '" class="btnSearchImages autoSize" title="' + globalize.translate('Search') + '"><span class="material-icons search" aria-hidden="true"></span></button>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
html += '<button type="button" is="paper-icon-button-light" data-imagetype="' + image.ImageType + '" data-index="' + (image.ImageIndex != null ? image.ImageIndex : 'null') + '" class="btnDeleteImage autoSize" title="' + globalize.translate('Delete') + '"><span class="material-icons delete" aria-hidden="true"></span></button>';
|
html += '<button type="button" is="paper-icon-button-light" data-imagetype="' + image.ImageType + '" data-index="' + (image.ImageIndex != null ? image.ImageIndex : 'null') + '" class="btnDeleteImage autoSize" title="' + globalize.translate('Delete') + '"><span class="material-icons delete" aria-hidden="true"></span></button>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
|
@ -374,8 +374,7 @@ export function getListViewHtml(options) {
|
||||||
if (options.artist !== false && item.AlbumArtist && item.Type === 'MusicAlbum') {
|
if (options.artist !== false && item.AlbumArtist && item.Type === 'MusicAlbum') {
|
||||||
textlines.push(item.AlbumArtist);
|
textlines.push(item.AlbumArtist);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (options.artist) {
|
||||||
if (options.artist) {
|
|
||||||
const artistItems = item.ArtistItems;
|
const artistItems = item.ArtistItems;
|
||||||
if (artistItems && item.Type !== 'MusicAlbum') {
|
if (artistItems && item.Type !== 'MusicAlbum') {
|
||||||
textlines.push(artistItems.map(a => {
|
textlines.push(artistItems.map(a => {
|
||||||
|
@ -383,7 +382,6 @@ export function getListViewHtml(options) {
|
||||||
}).join(', '));
|
}).join(', '));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Type === 'TvChannel' && item.CurrentProgram) {
|
if (item.Type === 'TvChannel' && item.CurrentProgram) {
|
||||||
textlines.push(itemHelper.getDisplayName(item.CurrentProgram));
|
textlines.push(itemHelper.getDisplayName(item.CurrentProgram));
|
||||||
|
|
|
@ -649,12 +649,10 @@ function onPlaybackStopped(e, state) {
|
||||||
if (state.NextMediaType !== 'Audio') {
|
if (state.NextMediaType !== 'Audio') {
|
||||||
hideNowPlayingBar();
|
hideNowPlayingBar();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!state.NextMediaType) {
|
||||||
if (!state.NextMediaType) {
|
|
||||||
hideNowPlayingBar();
|
hideNowPlayingBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function onPlayPauseStateChanged() {
|
function onPlayPauseStateChanged() {
|
||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
|
|
|
@ -1437,9 +1437,8 @@ class PlaybackManager {
|
||||||
|
|
||||||
if (Screenfull.isEnabled) {
|
if (Screenfull.isEnabled) {
|
||||||
Screenfull.toggle();
|
Screenfull.toggle();
|
||||||
} else {
|
} else if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
||||||
// iOS Safari
|
// iOS Safari
|
||||||
if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
|
||||||
document.webkitCancelFullscreen();
|
document.webkitCancelFullscreen();
|
||||||
} else {
|
} else {
|
||||||
const elem = document.querySelector('video');
|
const elem = document.querySelector('video');
|
||||||
|
@ -1447,7 +1446,6 @@ class PlaybackManager {
|
||||||
elem.webkitEnterFullscreen();
|
elem.webkitEnterFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.togglePictureInPicture = function (player) {
|
self.togglePictureInPicture = function (player) {
|
||||||
|
|
|
@ -191,8 +191,7 @@ function onRecordChange(e) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else if (hasEnabledTimer) {
|
||||||
if (hasEnabledTimer) {
|
|
||||||
loading.show();
|
loading.show();
|
||||||
recordingHelper.cancelTimer(apiClient, this.TimerId, true).then(function () {
|
recordingHelper.cancelTimer(apiClient, this.TimerId, true).then(function () {
|
||||||
Events.trigger(self, 'recordingchanged');
|
Events.trigger(self, 'recordingchanged');
|
||||||
|
@ -201,7 +200,6 @@ function onRecordChange(e) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function onRecordSeriesChange(e) {
|
function onRecordSeriesChange(e) {
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
|
@ -223,14 +221,12 @@ function onRecordSeriesChange(e) {
|
||||||
fetchData(self);
|
fetchData(self);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this.SeriesTimerId) {
|
||||||
if (this.SeriesTimerId) {
|
|
||||||
apiClient.cancelLiveTvSeriesTimer(this.SeriesTimerId).then(function () {
|
apiClient.cancelLiveTvSeriesTimer(this.SeriesTimerId).then(function () {
|
||||||
toast(globalize.translate('RecordingCancelled'));
|
toast(globalize.translate('RecordingCancelled'));
|
||||||
fetchData(self);
|
fetchData(self);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export default RecordingEditor;
|
export default RecordingEditor;
|
||||||
|
|
|
@ -73,13 +73,11 @@ export function loadView(options) {
|
||||||
} else {
|
} else {
|
||||||
mainAnimatedPages.replaceChild(view, currentPage);
|
mainAnimatedPages.replaceChild(view, currentPage);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (newViewInfo.hasScript && window.$) {
|
||||||
if (newViewInfo.hasScript && window.$) {
|
|
||||||
view = $(view).appendTo(mainAnimatedPages)[0];
|
view = $(view).appendTo(mainAnimatedPages)[0];
|
||||||
} else {
|
} else {
|
||||||
mainAnimatedPages.appendChild(view);
|
mainAnimatedPages.appendChild(view);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (options.type) {
|
if (options.type) {
|
||||||
view.setAttribute('data-type', options.type);
|
view.setAttribute('data-type', options.type);
|
||||||
|
|
|
@ -484,14 +484,12 @@ window.DashboardPage = {
|
||||||
if (nowPlayingItem.Artists?.length) {
|
if (nowPlayingItem.Artists?.length) {
|
||||||
bottomText = topText;
|
bottomText = topText;
|
||||||
topText = escapeHtml(nowPlayingItem.Artists[0]);
|
topText = escapeHtml(nowPlayingItem.Artists[0]);
|
||||||
} else {
|
} else if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
|
||||||
if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
|
|
||||||
bottomText = topText;
|
bottomText = topText;
|
||||||
topText = escapeHtml(nowPlayingItem.SeriesName || nowPlayingItem.Album);
|
topText = escapeHtml(nowPlayingItem.SeriesName || nowPlayingItem.Album);
|
||||||
} else if (nowPlayingItem.ProductionYear) {
|
} else if (nowPlayingItem.ProductionYear) {
|
||||||
bottomText = nowPlayingItem.ProductionYear;
|
bottomText = nowPlayingItem.ProductionYear;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (nowPlayingItem.ImageTags?.Logo) {
|
if (nowPlayingItem.ImageTags?.Logo) {
|
||||||
imgUrl = ApiClient.getScaledImageUrl(nowPlayingItem.Id, {
|
imgUrl = ApiClient.getScaledImageUrl(nowPlayingItem.Id, {
|
||||||
|
|
|
@ -272,11 +272,9 @@ function renderDirectPlayProfiles(page, profiles) {
|
||||||
if (profile.Type == 'Video') {
|
if (profile.Type == 'Video') {
|
||||||
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
||||||
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
||||||
} else {
|
} else if (profile.Type == 'Audio') {
|
||||||
if (profile.Type == 'Audio') {
|
|
||||||
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
html += '</a>';
|
html += '</a>';
|
||||||
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile listItemButton" data-profileindex="' + index + '"><span class="material-icons delete" aria-hidden="true"></span></button>';
|
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile listItemButton" data-profileindex="' + index + '"><span class="material-icons delete" aria-hidden="true"></span></button>';
|
||||||
|
@ -333,11 +331,9 @@ function renderTranscodingProfiles(page, profiles) {
|
||||||
if (profile.Type == 'Video') {
|
if (profile.Type == 'Video') {
|
||||||
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
||||||
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
||||||
} else {
|
} else if (profile.Type == 'Audio') {
|
||||||
if (profile.Type == 'Audio') {
|
|
||||||
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
html += '</a>';
|
html += '</a>';
|
||||||
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile listItemButton" data-profileindex="' + i + '"><span class="material-icons delete" aria-hidden="true"></span></button>';
|
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile listItemButton" data-profileindex="' + i + '"><span class="material-icons delete" aria-hidden="true"></span></button>';
|
||||||
|
@ -561,11 +557,9 @@ function renderResponseProfiles(page, profiles) {
|
||||||
if (profile.Type == 'Video') {
|
if (profile.Type == 'Video') {
|
||||||
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
||||||
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
||||||
} else {
|
} else if (profile.Type == 'Audio') {
|
||||||
if (profile.Type == 'Audio') {
|
|
||||||
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (profile.Conditions?.length) {
|
if (profile.Conditions?.length) {
|
||||||
html += '<p>';
|
html += '<p>';
|
||||||
|
|
|
@ -392,12 +392,10 @@ export default function (view) {
|
||||||
case 'left':
|
case 'left':
|
||||||
if (currentVisibleMenu === 'osd') {
|
if (currentVisibleMenu === 'osd') {
|
||||||
showOsd();
|
showOsd();
|
||||||
} else {
|
} else if (!currentVisibleMenu) {
|
||||||
if (!currentVisibleMenu) {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
playbackManager.rewind(player);
|
playbackManager.rewind(player);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -285,11 +285,9 @@ ItemsContainerPrototype.attachedCallback = function () {
|
||||||
|
|
||||||
if (browser.touch) {
|
if (browser.touch) {
|
||||||
this.addEventListener('contextmenu', disableEvent);
|
this.addEventListener('contextmenu', disableEvent);
|
||||||
} else {
|
} else if (this.getAttribute('data-contextmenu') !== 'false') {
|
||||||
if (this.getAttribute('data-contextmenu') !== 'false') {
|
|
||||||
this.addEventListener('contextmenu', onContextMenu);
|
this.addEventListener('contextmenu', onContextMenu);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (layoutManager.desktop || layoutManager.mobile && this.getAttribute('data-multiselect') !== 'false') {
|
if (layoutManager.desktop || layoutManager.mobile && this.getAttribute('data-multiselect') !== 'false') {
|
||||||
this.enableMultiSelect(true);
|
this.enableMultiSelect(true);
|
||||||
|
|
|
@ -227,11 +227,9 @@ async function onAppReady() {
|
||||||
document.body.appendChild(localStyle);
|
document.body.appendChild(localStyle);
|
||||||
}
|
}
|
||||||
localStyle.textContent = localCss;
|
localStyle.textContent = localCss;
|
||||||
} else {
|
} else if (localStyle) {
|
||||||
if (localStyle) {
|
|
||||||
localStyle.textContent = '';
|
localStyle.textContent = '';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUserChange = () => {
|
const handleUserChange = () => {
|
||||||
|
|
|
@ -130,8 +130,7 @@ class NavDrawer {
|
||||||
|
|
||||||
if (this.isPeeking) {
|
if (this.isPeeking) {
|
||||||
this.onMenuTouchMove(e);
|
this.onMenuTouchMove(e);
|
||||||
} else {
|
} else if ((getTouches(e)[0]?.clientX || 0) <= options.handleSize) {
|
||||||
if ((getTouches(e)[0]?.clientX || 0) <= options.handleSize) {
|
|
||||||
this.isPeeking = true;
|
this.isPeeking = true;
|
||||||
|
|
||||||
if (e.type === 'touchstart') {
|
if (e.type === 'touchstart') {
|
||||||
|
@ -141,7 +140,6 @@ class NavDrawer {
|
||||||
|
|
||||||
this.onMenuTouchStart(e);
|
this.onMenuTouchStart(e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onEdgeTouchEnd = (e) => {
|
onEdgeTouchEnd = (e) => {
|
||||||
|
@ -246,16 +244,12 @@ class NavDrawer {
|
||||||
} else {
|
} else {
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this.newPos >= 100) {
|
||||||
if (this.newPos >= 100) {
|
|
||||||
this.open();
|
this.open();
|
||||||
} else {
|
} else if (this.newPos) {
|
||||||
if (this.newPos) {
|
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
const options = this.options;
|
const options = this.options;
|
||||||
|
@ -320,8 +314,7 @@ class NavDrawer {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this._edgeSwipeEnabled) {
|
||||||
if (this._edgeSwipeEnabled) {
|
|
||||||
this._edgeSwipeEnabled = false;
|
this._edgeSwipeEnabled = false;
|
||||||
dom.removeEventListener(this.edgeContainer, 'touchstart', this.onEdgeTouchStart, {
|
dom.removeEventListener(this.edgeContainer, 'touchstart', this.onEdgeTouchStart, {
|
||||||
passive: true
|
passive: true
|
||||||
|
@ -335,7 +328,6 @@ class NavDrawer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
const options = Object.assign({}, this.defaults, this.options || {});
|
const options = Object.assign({}, this.defaults, this.options || {});
|
||||||
|
|
|
@ -257,14 +257,12 @@ const scrollerFactory = function (frame, options) {
|
||||||
} else {
|
} else {
|
||||||
container.scrollTo(0, Math.round(pos));
|
container.scrollTo(0, Math.round(pos));
|
||||||
}
|
}
|
||||||
} else {
|
} else if (o.horizontal) {
|
||||||
if (o.horizontal) {
|
|
||||||
container.scrollLeft = Math.round(pos);
|
container.scrollLeft = Math.round(pos);
|
||||||
} else {
|
} else {
|
||||||
container.scrollTop = Math.round(pos);
|
container.scrollTop = Math.round(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let lastAnimate;
|
let lastAnimate;
|
||||||
|
|
||||||
|
@ -506,16 +504,14 @@ const scrollerFactory = function (frame, options) {
|
||||||
// If the pointer was released, the path will not become longer and it's
|
// If the pointer was released, the path will not become longer and it's
|
||||||
// definitely not a drag. If not released yet, decide on next iteration
|
// definitely not a drag. If not released yet, decide on next iteration
|
||||||
return dragging.released ? dragEnd() : undefined;
|
return dragging.released ? dragEnd() : undefined;
|
||||||
} else {
|
} else if (o.horizontal ? Math.abs(dragging.pathX) > Math.abs(dragging.pathY) : Math.abs(dragging.pathX) < Math.abs(dragging.pathY)) {
|
||||||
// If dragging path is sufficiently long we can confidently start a drag
|
// If dragging path is sufficiently long we can confidently start a drag
|
||||||
// if drag is in different direction than scroll, ignore it
|
// if drag is in different direction than scroll, ignore it
|
||||||
if (o.horizontal ? Math.abs(dragging.pathX) > Math.abs(dragging.pathY) : Math.abs(dragging.pathX) < Math.abs(dragging.pathY)) {
|
|
||||||
dragging.init = 1;
|
dragging.init = 1;
|
||||||
} else {
|
} else {
|
||||||
return dragEnd();
|
return dragEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Disable click on a source element, as it is unwelcome when dragging
|
// Disable click on a source element, as it is unwelcome when dragging
|
||||||
if (!dragging.locked && dragging.path > dragging.pathToLock) {
|
if (!dragging.locked && dragging.path > dragging.pathToLock) {
|
||||||
|
|
|
@ -864,13 +864,11 @@ export class HtmlVideoPlayer {
|
||||||
|
|
||||||
if (Screenfull.isEnabled) {
|
if (Screenfull.isEnabled) {
|
||||||
Screenfull.exit();
|
Screenfull.exit();
|
||||||
} else {
|
} else if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
||||||
// iOS Safari
|
// iOS Safari
|
||||||
if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
|
||||||
document.webkitCancelFullscreen();
|
document.webkitCancelFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
@ -1106,8 +1104,8 @@ export class HtmlVideoPlayer {
|
||||||
tryRemoveElement(this.#videoSecondarySubtitlesElem);
|
tryRemoveElement(this.#videoSecondarySubtitlesElem);
|
||||||
this.#videoSecondarySubtitlesElem = null;
|
this.#videoSecondarySubtitlesElem = null;
|
||||||
}
|
}
|
||||||
} else { // destroy all
|
} else if (this.#videoSubtitlesElem) {
|
||||||
if (this.#videoSubtitlesElem) {
|
// destroy all
|
||||||
const subtitlesContainer = this.#videoSubtitlesElem.parentNode;
|
const subtitlesContainer = this.#videoSubtitlesElem.parentNode;
|
||||||
if (subtitlesContainer) {
|
if (subtitlesContainer) {
|
||||||
tryRemoveElement(subtitlesContainer);
|
tryRemoveElement(subtitlesContainer);
|
||||||
|
@ -1116,7 +1114,6 @@ export class HtmlVideoPlayer {
|
||||||
this.#videoSecondarySubtitlesElem = null;
|
this.#videoSecondarySubtitlesElem = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
@ -1812,12 +1809,10 @@ export class HtmlVideoPlayer {
|
||||||
} else {
|
} else {
|
||||||
Windows.UI.ViewManagement.ApplicationView.getForCurrentView().tryEnterViewModeAsync(Windows.UI.ViewManagement.ApplicationViewMode.default);
|
Windows.UI.ViewManagement.ApplicationView.getForCurrentView().tryEnterViewModeAsync(Windows.UI.ViewManagement.ApplicationViewMode.default);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (video?.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function') {
|
||||||
if (video?.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function') {
|
|
||||||
video.webkitSetPresentationMode(isEnabled ? 'picture-in-picture' : 'inline');
|
video.webkitSetPresentationMode(isEnabled ? 'picture-in-picture' : 'inline');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
isPictureInPictureEnabled() {
|
isPictureInPictureEnabled() {
|
||||||
if (document.pictureInPictureEnabled) {
|
if (document.pictureInPictureEnabled) {
|
||||||
|
|
|
@ -352,12 +352,10 @@ class YoutubePlayer {
|
||||||
if (currentYoutubePlayer) {
|
if (currentYoutubePlayer) {
|
||||||
currentYoutubePlayer.mute();
|
currentYoutubePlayer.mute();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (currentYoutubePlayer) {
|
||||||
if (currentYoutubePlayer) {
|
|
||||||
currentYoutubePlayer.unMute();
|
currentYoutubePlayer.unMute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
isMuted() {
|
isMuted() {
|
||||||
const currentYoutubePlayer = this.currentYoutubePlayer;
|
const currentYoutubePlayer = this.currentYoutubePlayer;
|
||||||
|
|
||||||
|
|
|
@ -838,8 +838,7 @@ function updateMenuForPageType(isDashboardPage, isLibraryPage) {
|
||||||
if (navDrawerInstance) {
|
if (navDrawerInstance) {
|
||||||
navDrawerInstance.setEdgeSwipeEnabled(true);
|
navDrawerInstance.setEdgeSwipeEnabled(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (isDashboardPage) {
|
||||||
if (isDashboardPage) {
|
|
||||||
bodyClassList.remove('libraryDocument');
|
bodyClassList.remove('libraryDocument');
|
||||||
bodyClassList.add('dashboardDocument');
|
bodyClassList.add('dashboardDocument');
|
||||||
bodyClassList.remove('hideMainDrawer');
|
bodyClassList.remove('hideMainDrawer');
|
||||||
|
@ -857,7 +856,6 @@ function updateMenuForPageType(isDashboardPage, isLibraryPage) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (requiresUserRefresh) {
|
if (requiresUserRefresh) {
|
||||||
ServerConnections.user(getCurrentApiClient()).then(updateUserInHeader);
|
ServerConnections.user(getCurrentApiClient()).then(updateUserInHeader);
|
||||||
|
|
|
@ -54,14 +54,12 @@ export function toCenter(container, elem, horizontal, skipWhenVisible) {
|
||||||
} else {
|
} else {
|
||||||
container.scrollTo(0, pos.center);
|
container.scrollTo(0, pos.center);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (horizontal) {
|
||||||
if (horizontal) {
|
|
||||||
container.scrollLeft = Math.round(pos.center);
|
container.scrollLeft = Math.round(pos.center);
|
||||||
} else {
|
} else {
|
||||||
container.scrollTop = Math.round(pos.center);
|
container.scrollTop = Math.round(pos.center);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export function toStart(container, elem, horizontal, skipWhenVisible) {
|
export function toStart(container, elem, horizontal, skipWhenVisible) {
|
||||||
const pos = getPosition(container, elem, horizontal);
|
const pos = getPosition(container, elem, horizontal);
|
||||||
|
@ -76,14 +74,12 @@ export function toStart(container, elem, horizontal, skipWhenVisible) {
|
||||||
} else {
|
} else {
|
||||||
container.scrollTo(0, pos.start);
|
container.scrollTo(0, pos.start);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (horizontal) {
|
||||||
if (horizontal) {
|
|
||||||
container.scrollLeft = Math.round(pos.start);
|
container.scrollLeft = Math.round(pos.start);
|
||||||
} else {
|
} else {
|
||||||
container.scrollTop = Math.round(pos.start);
|
container.scrollTop = Math.round(pos.start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function centerOnFocus(e, scrollSlider, horizontal) {
|
function centerOnFocus(e, scrollSlider, horizontal) {
|
||||||
const focused = focusManager.focusableParent(e.target);
|
const focused = focusManager.focusableParent(e.target);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue