mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
refactor: give variables more descriptive names
This commit is contained in:
parent
e79f326c53
commit
bf145a602c
3 changed files with 22 additions and 22 deletions
|
@ -293,21 +293,21 @@ import toast from './toast/toast';
|
||||||
const apiClient = ServerConnections.getApiClient(serverId);
|
const apiClient = ServerConnections.getApiClient(serverId);
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const myServerId = apiClient.serverInfo().Id;
|
const currentServerId = apiClient.serverInfo().Id;
|
||||||
|
|
||||||
if (item.Type === 'Timer') {
|
if (item.Type === 'Timer') {
|
||||||
if (item.ProgramId) {
|
if (item.ProgramId) {
|
||||||
import('./recordingcreator/recordingcreator').then(({default: recordingCreator}) => {
|
import('./recordingcreator/recordingcreator').then(({default: recordingCreator}) => {
|
||||||
recordingCreator.show(item.ProgramId, myServerId).then(resolve, reject);
|
recordingCreator.show(item.ProgramId, currentServerId).then(resolve, reject);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
import('./recordingcreator/recordingeditor').then(({default: recordingEditor}) => {
|
import('./recordingcreator/recordingeditor').then(({default: recordingEditor}) => {
|
||||||
recordingEditor.show(item.Id, myServerId).then(resolve, reject);
|
recordingEditor.show(item.Id, currentServerId).then(resolve, reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
import('./metadataEditor/metadataEditor').then(({default: metadataEditor}) => {
|
import('./metadataEditor/metadataEditor').then(({default: metadataEditor}) => {
|
||||||
metadataEditor.show(item.Id, myServerId).then(resolve, reject);
|
metadataEditor.show(item.Id, currentServerId).then(resolve, reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1346,13 +1346,13 @@ function tryRemoveElement(elem) {
|
||||||
return import('./style.scss').then(() => {
|
return import('./style.scss').then(() => {
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
||||||
const newdlg = document.createElement('div');
|
const playerDlg = document.createElement('div');
|
||||||
newdlg.setAttribute('dir', 'ltr');
|
playerDlg.setAttribute('dir', 'ltr');
|
||||||
|
|
||||||
newdlg.classList.add('videoPlayerContainer');
|
playerDlg.classList.add('videoPlayerContainer');
|
||||||
|
|
||||||
if (options.fullscreen) {
|
if (options.fullscreen) {
|
||||||
newdlg.classList.add('videoPlayerContainer-onTop');
|
playerDlg.classList.add('videoPlayerContainer-onTop');
|
||||||
}
|
}
|
||||||
|
|
||||||
let html = '';
|
let html = '';
|
||||||
|
@ -1371,8 +1371,8 @@ function tryRemoveElement(elem) {
|
||||||
|
|
||||||
html += '</video>';
|
html += '</video>';
|
||||||
|
|
||||||
newdlg.innerHTML = html;
|
playerDlg.innerHTML = html;
|
||||||
const videoElement = newdlg.querySelector('video');
|
const videoElement = playerDlg.querySelector('video');
|
||||||
|
|
||||||
videoElement.volume = getSavedVolume();
|
videoElement.volume = getSavedVolume();
|
||||||
videoElement.addEventListener('timeupdate', this.onTimeUpdate);
|
videoElement.addEventListener('timeupdate', this.onTimeUpdate);
|
||||||
|
@ -1388,8 +1388,8 @@ function tryRemoveElement(elem) {
|
||||||
videoElement.poster = options.backdropUrl;
|
videoElement.poster = options.backdropUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.insertBefore(newdlg, document.body.firstChild);
|
document.body.insertBefore(playerDlg, document.body.firstChild);
|
||||||
this.#videoDialog = newdlg;
|
this.#videoDialog = playerDlg;
|
||||||
this.#mediaElement = videoElement;
|
this.#mediaElement = videoElement;
|
||||||
|
|
||||||
delete this.forcedFullscreen;
|
delete this.forcedFullscreen;
|
||||||
|
@ -1408,7 +1408,7 @@ function tryRemoveElement(elem) {
|
||||||
|
|
||||||
// don't animate on smart tv's, too slow
|
// don't animate on smart tv's, too slow
|
||||||
if (!browser.slow && browser.supportsCssAnimation()) {
|
if (!browser.slow && browser.supportsCssAnimation()) {
|
||||||
return zoomIn(newdlg).then(function () {
|
return zoomIn(playerDlg).then(function () {
|
||||||
return videoElement;
|
return videoElement;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,26 +32,26 @@ function createMediaElement(instance, options) {
|
||||||
import('./style.scss').then(() => {
|
import('./style.scss').then(() => {
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
||||||
const newdlg = document.createElement('div');
|
const playerDlg = document.createElement('div');
|
||||||
|
|
||||||
newdlg.classList.add('youtubePlayerContainer');
|
playerDlg.classList.add('youtubePlayerContainer');
|
||||||
|
|
||||||
if (options.fullscreen) {
|
if (options.fullscreen) {
|
||||||
newdlg.classList.add('onTop');
|
playerDlg.classList.add('onTop');
|
||||||
}
|
}
|
||||||
|
|
||||||
newdlg.innerHTML = '<div id="player"></div>';
|
playerDlg.innerHTML = '<div id="player"></div>';
|
||||||
const videoElement = newdlg.querySelector('#player');
|
const videoElement = playerDlg.querySelector('#player');
|
||||||
|
|
||||||
document.body.insertBefore(newdlg, document.body.firstChild);
|
document.body.insertBefore(playerDlg, document.body.firstChild);
|
||||||
instance.videoDialog = newdlg;
|
instance.videoDialog = playerDlg;
|
||||||
|
|
||||||
if (options.fullscreen) {
|
if (options.fullscreen) {
|
||||||
document.body.classList.add('hide-scroll');
|
document.body.classList.add('hide-scroll');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.fullscreen && newdlg.animate && !browser.slow) {
|
if (options.fullscreen && playerDlg.animate && !browser.slow) {
|
||||||
zoomIn(newdlg, 1).onfinish = function () {
|
zoomIn(playerDlg, 1).onfinish = function () {
|
||||||
resolve(videoElement);
|
resolve(videoElement);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue