Fix appHost.supports
This commit is contained in:
parent
9675bd57b8
commit
a7df7ad720
20 changed files with 48 additions and 66 deletions
|
@ -78,12 +78,6 @@ _define('webcomponents', function() {
|
||||||
return webcomponents;
|
return webcomponents;
|
||||||
});
|
});
|
||||||
|
|
||||||
// shaka
|
|
||||||
const shaka = require('shaka-player');
|
|
||||||
_define('shaka', function() {
|
|
||||||
return shaka;
|
|
||||||
});
|
|
||||||
|
|
||||||
// libass-wasm
|
// libass-wasm
|
||||||
const libassWasm = require('libass-wasm');
|
const libassWasm = require('libass-wasm');
|
||||||
_define('JavascriptSubtitlesOctopus', function() {
|
_define('JavascriptSubtitlesOctopus', function() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import actionsheet from 'actionsheet';
|
||||||
const canPlay = playbackManager.canPlay(item);
|
const canPlay = playbackManager.canPlay(item);
|
||||||
const restrictOptions = (browser.operaTv || browser.web0s) && !user.Policy.IsAdministrator;
|
const restrictOptions = (browser.operaTv || browser.web0s) && !user.Policy.IsAdministrator;
|
||||||
|
|
||||||
let commands = [];
|
const commands = [];
|
||||||
|
|
||||||
if (canPlay && item.MediaType !== 'Photo') {
|
if (canPlay && item.MediaType !== 'Photo') {
|
||||||
if (options.play !== false) {
|
if (options.play !== false) {
|
||||||
|
@ -367,7 +367,7 @@ import actionsheet from 'actionsheet';
|
||||||
case 'copy-stream': {
|
case 'copy-stream': {
|
||||||
const downloadHref = apiClient.getItemDownloadUrl(itemId);
|
const downloadHref = apiClient.getItemDownloadUrl(itemId);
|
||||||
const textAreaCopy = function () {
|
const textAreaCopy = function () {
|
||||||
let textArea = document.createElement('textarea');
|
const textArea = document.createElement('textarea');
|
||||||
textArea.value = downloadHref;
|
textArea.value = downloadHref;
|
||||||
document.body.appendChild(textArea);
|
document.body.appendChild(textArea);
|
||||||
textArea.focus();
|
textArea.focus();
|
||||||
|
|
|
@ -907,7 +907,7 @@ import 'flexStyles';
|
||||||
}
|
}
|
||||||
|
|
||||||
function populatePeople(context, people) {
|
function populatePeople(context, people) {
|
||||||
let lastType = '';
|
const lastType = '';
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
const elem = context.querySelector('#peopleList');
|
const elem = context.querySelector('#peopleList');
|
||||||
|
|
|
@ -500,20 +500,20 @@ import 'emby-ratingbutton';
|
||||||
const textLines = nowPlayingItem ? nowPlayingHelper.getNowPlayingNames(nowPlayingItem) : [];
|
const textLines = nowPlayingItem ? nowPlayingHelper.getNowPlayingNames(nowPlayingItem) : [];
|
||||||
nowPlayingTextElement.innerHTML = '';
|
nowPlayingTextElement.innerHTML = '';
|
||||||
if (textLines) {
|
if (textLines) {
|
||||||
let itemText = document.createElement('div');
|
const itemText = document.createElement('div');
|
||||||
let secondaryText = document.createElement('div');
|
const secondaryText = document.createElement('div');
|
||||||
secondaryText.classList.add('nowPlayingBarSecondaryText');
|
secondaryText.classList.add('nowPlayingBarSecondaryText');
|
||||||
if (textLines.length > 1) {
|
if (textLines.length > 1) {
|
||||||
textLines[1].secondary = true;
|
textLines[1].secondary = true;
|
||||||
if (textLines[1].text) {
|
if (textLines[1].text) {
|
||||||
let text = document.createElement('a');
|
const text = document.createElement('a');
|
||||||
text.innerHTML = textLines[1].text;
|
text.innerHTML = textLines[1].text;
|
||||||
secondaryText.appendChild(text);
|
secondaryText.appendChild(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textLines[0].text) {
|
if (textLines[0].text) {
|
||||||
let text = document.createElement('a');
|
const text = document.createElement('a');
|
||||||
text.innerHTML = textLines[0].text;
|
text.innerHTML = textLines[0].text;
|
||||||
itemText.appendChild(text);
|
itemText.appendChild(text);
|
||||||
}
|
}
|
||||||
|
@ -555,10 +555,10 @@ import 'emby-ratingbutton';
|
||||||
if (!layoutManager.mobile) {
|
if (!layoutManager.mobile) {
|
||||||
let contextButton = nowPlayingBarElement.querySelector('.btnToggleContextMenu');
|
let contextButton = nowPlayingBarElement.querySelector('.btnToggleContextMenu');
|
||||||
// We remove the previous event listener by replacing the item in each update event
|
// We remove the previous event listener by replacing the item in each update event
|
||||||
let contextButtonClone = contextButton.cloneNode(true);
|
const contextButtonClone = contextButton.cloneNode(true);
|
||||||
contextButton.parentNode.replaceChild(contextButtonClone, contextButton);
|
contextButton.parentNode.replaceChild(contextButtonClone, contextButton);
|
||||||
contextButton = nowPlayingBarElement.querySelector('.btnToggleContextMenu');
|
contextButton = nowPlayingBarElement.querySelector('.btnToggleContextMenu');
|
||||||
let options = {
|
const options = {
|
||||||
play: false,
|
play: false,
|
||||||
queue: false,
|
queue: false,
|
||||||
clearQueue: true,
|
clearQueue: true,
|
||||||
|
@ -600,10 +600,10 @@ import 'emby-ratingbutton';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let shuffleMode = playbackManager.getQueueShuffleMode();
|
const shuffleMode = playbackManager.getQueueShuffleMode();
|
||||||
let context = nowPlayingBarElement;
|
const context = nowPlayingBarElement;
|
||||||
const cssClass = 'buttonActive';
|
const cssClass = 'buttonActive';
|
||||||
let toggleShuffleButton = context.querySelector('.btnShuffleQueue');
|
const toggleShuffleButton = context.querySelector('.btnShuffleQueue');
|
||||||
switch (shuffleMode) {
|
switch (shuffleMode) {
|
||||||
case 'Shuffle':
|
case 'Shuffle':
|
||||||
toggleShuffleButton.classList.add(cssClass);
|
toggleShuffleButton.classList.add(cssClass);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import globalize from 'globalize';
|
import globalize from 'globalize';
|
||||||
|
|
||||||
export function getVideoQualityOptions(options) {
|
export function getVideoQualityOptions(options) {
|
||||||
|
|
||||||
var maxStreamingBitrate = options.currentMaxBitrate;
|
var maxStreamingBitrate = options.currentMaxBitrate;
|
||||||
var videoWidth = options.videoWidth;
|
var videoWidth = options.videoWidth;
|
||||||
var videoHeight = options.videoHeight;
|
var videoHeight = options.videoHeight;
|
||||||
|
@ -25,7 +24,6 @@ export function getVideoQualityOptions(options) {
|
||||||
|
|
||||||
// Some 1080- videos are reported as 1912?
|
// Some 1080- videos are reported as 1912?
|
||||||
if (maxAllowedWidth >= 1900) {
|
if (maxAllowedWidth >= 1900) {
|
||||||
|
|
||||||
qualityOptions.push({ name: '1080p - 60 Mbps', maxHeight: 1080, bitrate: 60000000 });
|
qualityOptions.push({ name: '1080p - 60 Mbps', maxHeight: 1080, bitrate: 60000000 });
|
||||||
qualityOptions.push({ name: '1080p - 50 Mbps', maxHeight: 1080, bitrate: 50000000 });
|
qualityOptions.push({ name: '1080p - 50 Mbps', maxHeight: 1080, bitrate: 50000000 });
|
||||||
qualityOptions.push({ name: '1080p - 40 Mbps', maxHeight: 1080, bitrate: 40000000 });
|
qualityOptions.push({ name: '1080p - 40 Mbps', maxHeight: 1080, bitrate: 40000000 });
|
||||||
|
@ -38,13 +36,11 @@ export function getVideoQualityOptions(options) {
|
||||||
qualityOptions.push({ name: '1080p - 6 Mbps', maxHeight: 1080, bitrate: 6000001 });
|
qualityOptions.push({ name: '1080p - 6 Mbps', maxHeight: 1080, bitrate: 6000001 });
|
||||||
qualityOptions.push({ name: '1080p - 5 Mbps', maxHeight: 1080, bitrate: 5000001 });
|
qualityOptions.push({ name: '1080p - 5 Mbps', maxHeight: 1080, bitrate: 5000001 });
|
||||||
qualityOptions.push({ name: '1080p - 4 Mbps', maxHeight: 1080, bitrate: 4000002 });
|
qualityOptions.push({ name: '1080p - 4 Mbps', maxHeight: 1080, bitrate: 4000002 });
|
||||||
|
|
||||||
} else if (maxAllowedWidth >= 1260) {
|
} else if (maxAllowedWidth >= 1260) {
|
||||||
qualityOptions.push({ name: '720p - 10 Mbps', maxHeight: 720, bitrate: 10000000 });
|
qualityOptions.push({ name: '720p - 10 Mbps', maxHeight: 720, bitrate: 10000000 });
|
||||||
qualityOptions.push({ name: '720p - 8 Mbps', maxHeight: 720, bitrate: 8000000 });
|
qualityOptions.push({ name: '720p - 8 Mbps', maxHeight: 720, bitrate: 8000000 });
|
||||||
qualityOptions.push({ name: '720p - 6 Mbps', maxHeight: 720, bitrate: 6000000 });
|
qualityOptions.push({ name: '720p - 6 Mbps', maxHeight: 720, bitrate: 6000000 });
|
||||||
qualityOptions.push({ name: '720p - 5 Mbps', maxHeight: 720, bitrate: 5000000 });
|
qualityOptions.push({ name: '720p - 5 Mbps', maxHeight: 720, bitrate: 5000000 });
|
||||||
|
|
||||||
} else if (maxAllowedWidth >= 620) {
|
} else if (maxAllowedWidth >= 620) {
|
||||||
qualityOptions.push({ name: '480p - 4 Mbps', maxHeight: 480, bitrate: 4000001 });
|
qualityOptions.push({ name: '480p - 4 Mbps', maxHeight: 480, bitrate: 4000001 });
|
||||||
qualityOptions.push({ name: '480p - 3 Mbps', maxHeight: 480, bitrate: 3000001 });
|
qualityOptions.push({ name: '480p - 3 Mbps', maxHeight: 480, bitrate: 3000001 });
|
||||||
|
@ -83,7 +79,6 @@ export function getVideoQualityOptions(options) {
|
||||||
if (maxStreamingBitrate) {
|
if (maxStreamingBitrate) {
|
||||||
var selectedIndex = -1;
|
var selectedIndex = -1;
|
||||||
for (var i = 0, length = qualityOptions.length; i < length; i++) {
|
for (var i = 0, length = qualityOptions.length; i < length; i++) {
|
||||||
|
|
||||||
var option = qualityOptions[i];
|
var option = qualityOptions[i];
|
||||||
|
|
||||||
if (selectedIndex === -1 && option.bitrate <= maxStreamingBitrate) {
|
if (selectedIndex === -1 && option.bitrate <= maxStreamingBitrate) {
|
||||||
|
@ -143,7 +138,6 @@ export function getAudioQualityOptions(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedIndex === -1) {
|
if (selectedIndex === -1) {
|
||||||
|
|
||||||
selectedIndex = qualityOptions.length - 1;
|
selectedIndex = qualityOptions.length - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,8 +127,8 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
if (item.Artists != null) {
|
if (item.Artists != null) {
|
||||||
if (item.ArtistItems != null) {
|
if (item.ArtistItems != null) {
|
||||||
for (const artist of item.ArtistItems) {
|
for (const artist of item.ArtistItems) {
|
||||||
let artistName = artist.Name;
|
const artistName = artist.Name;
|
||||||
let artistId = artist.Id;
|
const artistId = artist.Id;
|
||||||
artistsSeries += `<a class="button-link emby-button" is="emby-linkbutton" href="details?id=${artistId}&serverId=${nowPlayingServerId}">${artistName}</a>`;
|
artistsSeries += `<a class="button-link emby-button" is="emby-linkbutton" href="details?id=${artistId}&serverId=${nowPlayingServerId}">${artistName}</a>`;
|
||||||
if (artist !== item.ArtistItems.slice(-1)[0]) {
|
if (artist !== item.ArtistItems.slice(-1)[0]) {
|
||||||
artistsSeries += ', ';
|
artistsSeries += ', ';
|
||||||
|
@ -185,7 +185,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
let contextButton = context.querySelector('.btnToggleContextMenu');
|
let contextButton = context.querySelector('.btnToggleContextMenu');
|
||||||
// We remove the previous event listener by replacing the item in each update event
|
// We remove the previous event listener by replacing the item in each update event
|
||||||
const autoFocusContextButton = document.activeElement === contextButton;
|
const autoFocusContextButton = document.activeElement === contextButton;
|
||||||
let contextButtonClone = contextButton.cloneNode(true);
|
const contextButtonClone = contextButton.cloneNode(true);
|
||||||
contextButton.parentNode.replaceChild(contextButtonClone, contextButton);
|
contextButton.parentNode.replaceChild(contextButtonClone, contextButton);
|
||||||
contextButton = context.querySelector('.btnToggleContextMenu');
|
contextButton = context.querySelector('.btnToggleContextMenu');
|
||||||
if (autoFocusContextButton) {
|
if (autoFocusContextButton) {
|
||||||
|
@ -362,7 +362,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
|
|
||||||
function updateRepeatModeDisplay(repeatMode) {
|
function updateRepeatModeDisplay(repeatMode) {
|
||||||
var context = dlg;
|
var context = dlg;
|
||||||
let toggleRepeatButtons = context.querySelectorAll('.repeatToggleButton');
|
const toggleRepeatButtons = context.querySelectorAll('.repeatToggleButton');
|
||||||
const cssClass = 'buttonActive';
|
const cssClass = 'buttonActive';
|
||||||
let innHtml = '<span class="material-icons repeat"></span>';
|
let innHtml = '<span class="material-icons repeat"></span>';
|
||||||
let repeatOn = true;
|
let repeatOn = true;
|
||||||
|
@ -529,12 +529,12 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
}
|
}
|
||||||
|
|
||||||
function onShuffleQueueModeChange(updateView = true) {
|
function onShuffleQueueModeChange(updateView = true) {
|
||||||
let shuffleMode = playbackManager.getQueueShuffleMode(this);
|
const shuffleMode = playbackManager.getQueueShuffleMode(this);
|
||||||
let context = dlg;
|
const context = dlg;
|
||||||
const cssClass = 'buttonActive';
|
const cssClass = 'buttonActive';
|
||||||
let shuffleButtons = context.querySelectorAll('.btnShuffleQueue');
|
const shuffleButtons = context.querySelectorAll('.btnShuffleQueue');
|
||||||
|
|
||||||
for (let shuffleButton of shuffleButtons) {
|
for (const shuffleButton of shuffleButtons) {
|
||||||
switch (shuffleMode) {
|
switch (shuffleMode) {
|
||||||
case 'Shuffle':
|
case 'Shuffle':
|
||||||
shuffleButton.classList.add(cssClass);
|
shuffleButton.classList.add(cssClass);
|
||||||
|
@ -873,15 +873,11 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
}
|
}
|
||||||
|
|
||||||
function init(ownerView, context) {
|
function init(ownerView, context) {
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
const contextmenuHtml = `<button id="toggleContextMenu" is="paper-icon-button-light" class="btnToggleContextMenu" title=${globalize.translate('ButtonToggleContextMenu')}><span class="material-icons more_vert"></span></button>`;
|
|
||||||
>>>>>>> 4f0443b2d... Fix linting errors
|
|
||||||
let volumecontrolHtml = '<div class="volumecontrol flex align-items-center flex-wrap-wrap justify-content-center">';
|
let volumecontrolHtml = '<div class="volumecontrol flex align-items-center flex-wrap-wrap justify-content-center">';
|
||||||
volumecontrolHtml += `<button is="paper-icon-button-light" class="buttonMute autoSize" title=${globalize.translate('Mute')}><span class="xlargePaperIconButton material-icons volume_up"></span></button>`;
|
volumecontrolHtml += `<button is="paper-icon-button-light" class="buttonMute autoSize" title=${globalize.translate('Mute')}><span class="xlargePaperIconButton material-icons volume_up"></span></button>`;
|
||||||
volumecontrolHtml += '<div class="sliderContainer nowPlayingVolumeSliderContainer"><input is="emby-slider" type="range" step="1" min="0" max="100" value="0" class="nowPlayingVolumeSlider"/></div>';
|
volumecontrolHtml += '<div class="sliderContainer nowPlayingVolumeSliderContainer"><input is="emby-slider" type="range" step="1" min="0" max="100" value="0" class="nowPlayingVolumeSlider"/></div>';
|
||||||
volumecontrolHtml += '</div>';
|
volumecontrolHtml += '</div>';
|
||||||
let optionsSection = context.querySelector('.playlistSectionButton');
|
const optionsSection = context.querySelector('.playlistSectionButton');
|
||||||
if (!layoutManager.mobile) {
|
if (!layoutManager.mobile) {
|
||||||
context.querySelector('.nowPlayingSecondaryButtons').insertAdjacentHTML('beforeend', volumecontrolHtml);
|
context.querySelector('.nowPlayingSecondaryButtons').insertAdjacentHTML('beforeend', volumecontrolHtml);
|
||||||
optionsSection.classList.remove('align-items-center', 'justify-content-center');
|
optionsSection.classList.remove('align-items-center', 'justify-content-center');
|
||||||
|
|
|
@ -136,7 +136,7 @@ function embed(options, self) {
|
||||||
options.element.querySelector('.btnSave').classList.remove('hide');
|
options.element.querySelector('.btnSave').classList.remove('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appHost.supports('subtitleappearancesettings')) {
|
if (appHost.default.supports('subtitleappearancesettings')) {
|
||||||
options.element.querySelector('.subtitleAppearanceSection').classList.remove('hide');
|
options.element.querySelector('.subtitleAppearanceSection').classList.remove('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import 'emby-itemscontainer';
|
||||||
function showPlaybackInfo(btn, session) {
|
function showPlaybackInfo(btn, session) {
|
||||||
import('alert').then(({default: alert}) => {
|
import('alert').then(({default: alert}) => {
|
||||||
let title;
|
let title;
|
||||||
let text = [];
|
const text = [];
|
||||||
const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session);
|
const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session);
|
||||||
|
|
||||||
if (displayPlayMethod === 'DirectStream') {
|
if (displayPlayMethod === 'DirectStream') {
|
||||||
|
|
|
@ -38,7 +38,7 @@ import 'cardStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDeviceMenu(view, btn, deviceId) {
|
function showDeviceMenu(view, btn, deviceId) {
|
||||||
let menuItems = [];
|
const menuItems = [];
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
|
|
|
@ -315,7 +315,7 @@ import 'listViewStyle';
|
||||||
let currentType;
|
let currentType;
|
||||||
|
|
||||||
for (let i = 0, length = profiles.length; i < length; i++) {
|
for (let i = 0, length = profiles.length; i < length; i++) {
|
||||||
let profile = profiles[i];
|
const profile = profiles[i];
|
||||||
|
|
||||||
if (profile.Type !== currentType) {
|
if (profile.Type !== currentType) {
|
||||||
html += '<li data-role="list-divider">' + profile.Type + '</li>';
|
html += '<li data-role="list-divider">' + profile.Type + '</li>';
|
||||||
|
@ -401,7 +401,7 @@ import 'listViewStyle';
|
||||||
let currentType;
|
let currentType;
|
||||||
|
|
||||||
for (let i = 0, length = profiles.length; i < length; i++) {
|
for (let i = 0, length = profiles.length; i < length; i++) {
|
||||||
let profile = profiles[i];
|
const profile = profiles[i];
|
||||||
|
|
||||||
if (profile.Type !== currentType) {
|
if (profile.Type !== currentType) {
|
||||||
html += '<li data-role="list-divider">' + profile.Type + '</li>';
|
html += '<li data-role="list-divider">' + profile.Type + '</li>';
|
||||||
|
@ -472,7 +472,7 @@ import 'listViewStyle';
|
||||||
let currentType;
|
let currentType;
|
||||||
|
|
||||||
for (let i = 0, length = profiles.length; i < length; i++) {
|
for (let i = 0, length = profiles.length; i < length; i++) {
|
||||||
let profile = profiles[i];
|
const profile = profiles[i];
|
||||||
const type = profile.Type.replace('VideoAudio', 'Video Audio');
|
const type = profile.Type.replace('VideoAudio', 'Video Audio');
|
||||||
|
|
||||||
if (type !== currentType) {
|
if (type !== currentType) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ import 'emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0, length = profiles.length; i < length; i++) {
|
for (let i = 0, length = profiles.length; i < length; i++) {
|
||||||
let profile = profiles[i];
|
const profile = profiles[i];
|
||||||
html += '<div class="listItem listItem-border">';
|
html += '<div class="listItem listItem-border">';
|
||||||
html += '<span class="listItemIcon material-icons live_tv"></span>';
|
html += '<span class="listItemIcon material-icons live_tv"></span>';
|
||||||
html += '<div class="listItemBody two-line">';
|
html += '<div class="listItemBody two-line">';
|
||||||
|
|
|
@ -33,7 +33,7 @@ import 'emby-select';
|
||||||
const ScheduledTaskPage = {
|
const ScheduledTaskPage = {
|
||||||
refreshScheduledTask: function (view) {
|
refreshScheduledTask: function (view) {
|
||||||
loading.show();
|
loading.show();
|
||||||
let id = getParameterByName('id');
|
const id = getParameterByName('id');
|
||||||
ApiClient.getScheduledTask(id).then(function (task) {
|
ApiClient.getScheduledTask(id).then(function (task) {
|
||||||
ScheduledTaskPage.loadScheduledTask(view, task);
|
ScheduledTaskPage.loadScheduledTask(view, task);
|
||||||
});
|
});
|
||||||
|
@ -143,7 +143,7 @@ import 'emby-select';
|
||||||
},
|
},
|
||||||
deleteTrigger: function (view, index) {
|
deleteTrigger: function (view, index) {
|
||||||
loading.show();
|
loading.show();
|
||||||
let id = getParameterByName('id');
|
const id = getParameterByName('id');
|
||||||
ApiClient.getScheduledTask(id).then(function (task) {
|
ApiClient.getScheduledTask(id).then(function (task) {
|
||||||
task.Triggers.remove(index);
|
task.Triggers.remove(index);
|
||||||
ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).then(function () {
|
ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).then(function () {
|
||||||
|
@ -211,7 +211,7 @@ import 'emby-select';
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
function onSubmit(e) {
|
function onSubmit(e) {
|
||||||
loading.show();
|
loading.show();
|
||||||
let id = getParameterByName('id');
|
const id = getParameterByName('id');
|
||||||
ApiClient.getScheduledTask(id).then(function (task) {
|
ApiClient.getScheduledTask(id).then(function (task) {
|
||||||
task.Triggers.push(ScheduledTaskPage.getTriggerToAdd(view));
|
task.Triggers.push(ScheduledTaskPage.getTriggerToAdd(view));
|
||||||
ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).then(function () {
|
ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).then(function () {
|
||||||
|
|
|
@ -103,7 +103,7 @@ import 'emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTaskButtonIcon(button, icon) {
|
function setTaskButtonIcon(button, icon) {
|
||||||
let inner = button.querySelector('.material-icons');
|
const inner = button.querySelector('.material-icons');
|
||||||
inner.classList.remove('stop', 'play_arrow');
|
inner.classList.remove('stop', 'play_arrow');
|
||||||
inner.classList.add(icon);
|
inner.classList.add(icon);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ import 'emby-button';
|
||||||
|
|
||||||
$('.divScheduledTasks', view).on('click', '.btnStartTask', function() {
|
$('.divScheduledTasks', view).on('click', '.btnStartTask', function() {
|
||||||
const button = this;
|
const button = this;
|
||||||
let id = button.getAttribute('data-taskid');
|
const id = button.getAttribute('data-taskid');
|
||||||
ApiClient.startScheduledTask(id).then(function() {
|
ApiClient.startScheduledTask(id).then(function() {
|
||||||
updateTaskButton(button, 'Running');
|
updateTaskButton(button, 'Running');
|
||||||
reloadList(view);
|
reloadList(view);
|
||||||
|
@ -169,7 +169,7 @@ import 'emby-button';
|
||||||
|
|
||||||
$('.divScheduledTasks', view).on('click', '.btnStopTask', function() {
|
$('.divScheduledTasks', view).on('click', '.btnStopTask', function() {
|
||||||
const button = this;
|
const button = this;
|
||||||
let id = button.getAttribute('data-taskid');
|
const id = button.getAttribute('data-taskid');
|
||||||
ApiClient.stopScheduledTask(id).then(function() {
|
ApiClient.stopScheduledTask(id).then(function() {
|
||||||
updateTaskButton(button, '');
|
updateTaskButton(button, '');
|
||||||
reloadList(view);
|
reloadList(view);
|
||||||
|
|
|
@ -373,7 +373,7 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArtistLinksHtml(artists, serverId, context) {
|
function getArtistLinksHtml(artists, serverId, context) {
|
||||||
let html = [];
|
const html = [];
|
||||||
|
|
||||||
for (const artist of artists) {
|
for (const artist of artists) {
|
||||||
const href = appRouter.getRouteUrl(artist, {
|
const href = appRouter.getRouteUrl(artist, {
|
||||||
|
|
|
@ -172,9 +172,7 @@ import 'css!assets/css/videoosd';
|
||||||
}
|
}
|
||||||
|
|
||||||
setTitle(displayItem, parentName);
|
setTitle(displayItem, parentName);
|
||||||
let titleElement;
|
const titleElement = view.querySelector('.osdTitle');
|
||||||
const osdTitle = view.querySelector('.osdTitle');
|
|
||||||
titleElement = osdTitle;
|
|
||||||
let displayName = itemHelper.getDisplayName(displayItem, {
|
let displayName = itemHelper.getDisplayName(displayItem, {
|
||||||
includeParentInfo: displayItem.Type !== 'Program',
|
includeParentInfo: displayItem.Type !== 'Program',
|
||||||
includeIndexNumber: displayItem.Type !== 'Program'
|
includeIndexNumber: displayItem.Type !== 'Program'
|
||||||
|
@ -1619,7 +1617,7 @@ import 'css!assets/css/videoosd';
|
||||||
const item = currentItem;
|
const item = currentItem;
|
||||||
|
|
||||||
if (item && item.Chapters && item.Chapters.length && item.Chapters[0].ImageTag) {
|
if (item && item.Chapters && item.Chapters.length && item.Chapters[0].ImageTag) {
|
||||||
let html = getChapterBubbleHtml(connectionManager.getApiClient(item.ServerId), item, item.Chapters, ticks);
|
const html = getChapterBubbleHtml(connectionManager.getApiClient(item.ServerId), item, item.Chapters, ticks);
|
||||||
|
|
||||||
if (html) {
|
if (html) {
|
||||||
return html;
|
return html;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import 'webcomponents';
|
||||||
|
|
||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
const itemsContainer = this;
|
const itemsContainer = this;
|
||||||
let multiSelect = itemsContainer.multiSelect;
|
const multiSelect = itemsContainer.multiSelect;
|
||||||
|
|
||||||
if (multiSelect) {
|
if (multiSelect) {
|
||||||
if (multiSelect.onContainerClick.call(itemsContainer, e) === false) {
|
if (multiSelect.onContainerClick.call(itemsContainer, e) === false) {
|
||||||
|
@ -164,7 +164,7 @@ import 'webcomponents';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEventsToMonitor(itemsContainer) {
|
function getEventsToMonitor(itemsContainer) {
|
||||||
let monitor = itemsContainer.getAttribute('data-monitor');
|
const monitor = itemsContainer.getAttribute('data-monitor');
|
||||||
if (monitor) {
|
if (monitor) {
|
||||||
return monitor.split(',');
|
return monitor.split(',');
|
||||||
}
|
}
|
||||||
|
@ -356,7 +356,7 @@ import 'webcomponents';
|
||||||
ItemsContainerPrototype.resume = function (options) {
|
ItemsContainerPrototype.resume = function (options) {
|
||||||
this.paused = false;
|
this.paused = false;
|
||||||
|
|
||||||
let refreshIntervalEndTime = this.refreshIntervalEndTime;
|
const refreshIntervalEndTime = this.refreshIntervalEndTime;
|
||||||
if (refreshIntervalEndTime) {
|
if (refreshIntervalEndTime) {
|
||||||
const remainingMs = refreshIntervalEndTime - new Date().getTime();
|
const remainingMs = refreshIntervalEndTime - new Date().getTime();
|
||||||
if (remainingMs > 0 && !this.needsRefresh) {
|
if (remainingMs > 0 && !this.needsRefresh) {
|
||||||
|
@ -395,7 +395,7 @@ import 'webcomponents';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let timeout = this.refreshTimeout;
|
const timeout = this.refreshTimeout;
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ import 'webcomponents';
|
||||||
function onDataFetched(result) {
|
function onDataFetched(result) {
|
||||||
const items = result.Items || result;
|
const items = result.Items || result;
|
||||||
|
|
||||||
let parentContainer = this.parentContainer;
|
const parentContainer = this.parentContainer;
|
||||||
if (parentContainer) {
|
if (parentContainer) {
|
||||||
if (items.length) {
|
if (items.length) {
|
||||||
parentContainer.classList.remove('hide');
|
parentContainer.classList.remove('hide');
|
||||||
|
|
|
@ -75,7 +75,7 @@ import EmbyButtonPrototype from 'emby-button';
|
||||||
button.title = globalize.translate('Played');
|
button.title = globalize.translate('Played');
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = button.querySelector('.button-text');
|
const text = button.querySelector('.button-text');
|
||||||
if (text) {
|
if (text) {
|
||||||
text.innerHTML = button.title;
|
text.innerHTML = button.title;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ const EmbyScrollButtonsPrototype = Object.create(HTMLDivElement.prototype);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onScrollButtonClick(e) {
|
function onScrollButtonClick(e) {
|
||||||
let scroller = this.parentNode.nextSibling;
|
const scroller = this.parentNode.nextSibling;
|
||||||
|
|
||||||
const direction = this.getAttribute('data-direction');
|
const direction = this.getAttribute('data-direction');
|
||||||
const scrollSize = getScrollSize(scroller);
|
const scrollSize = getScrollSize(scroller);
|
||||||
|
@ -161,7 +161,7 @@ const EmbyScrollButtonsPrototype = Object.create(HTMLDivElement.prototype);
|
||||||
const parent = this.scroller;
|
const parent = this.scroller;
|
||||||
this.scroller = null;
|
this.scroller = null;
|
||||||
|
|
||||||
let scrollHandler = this.scrollHandler;
|
const scrollHandler = this.scrollHandler;
|
||||||
if (parent && scrollHandler) {
|
if (parent && scrollHandler) {
|
||||||
parent.removeScrollEventListener(scrollHandler, {
|
parent.removeScrollEventListener(scrollHandler, {
|
||||||
capture: false,
|
capture: false,
|
||||||
|
|
|
@ -24,7 +24,7 @@ import globalize from 'globalize';
|
||||||
|
|
||||||
// parse strings, leading zeros into proper ints
|
// parse strings, leading zeros into proper ints
|
||||||
const a = [1, 2, 3, 4, 5, 6, 10, 11];
|
const a = [1, 2, 3, 4, 5, 6, 10, 11];
|
||||||
for (let i in a) {
|
for (const i in a) {
|
||||||
d[a[i]] = parseInt(d[a[i]], 10);
|
d[a[i]] = parseInt(d[a[i]], 10);
|
||||||
}
|
}
|
||||||
d[7] = parseFloat(d[7]);
|
d[7] = parseFloat(d[7]);
|
||||||
|
|
|
@ -63,11 +63,11 @@ import events from 'events';
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensureTranslations(culture) {
|
function ensureTranslations(culture) {
|
||||||
for (let i in allTranslations) {
|
for (const i in allTranslations) {
|
||||||
ensureTranslation(allTranslations[i], culture);
|
ensureTranslation(allTranslations[i], culture);
|
||||||
}
|
}
|
||||||
if (culture !== fallbackCulture) {
|
if (culture !== fallbackCulture) {
|
||||||
for (let i in allTranslations) {
|
for (const i in allTranslations) {
|
||||||
ensureTranslation(allTranslations[i], fallbackCulture);
|
ensureTranslation(allTranslations[i], fallbackCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue