mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'master' into migrate-to-ES6-41
This commit is contained in:
commit
ea852b6cdb
166 changed files with 4026 additions and 4908 deletions
10
.eslintrc.js
10
.eslintrc.js
|
@ -1,6 +1,7 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
plugins: [
|
||||
'@babel',
|
||||
'promise',
|
||||
'import',
|
||||
'eslint-comments'
|
||||
|
@ -28,7 +29,7 @@ module.exports = {
|
|||
],
|
||||
rules: {
|
||||
'block-spacing': ['error'],
|
||||
'brace-style': ['error', "1tbs", { "allowSingleLine": true }],
|
||||
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
|
||||
'comma-dangle': ['error', 'never'],
|
||||
'comma-spacing': ['error'],
|
||||
'eol-last': ['error'],
|
||||
|
@ -40,20 +41,21 @@ module.exports = {
|
|||
'no-multiple-empty-lines': ['error', { 'max': 1 }],
|
||||
'no-trailing-spaces': ['error'],
|
||||
'no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }],
|
||||
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
|
||||
'no-unused-vars': ['error', { 'vars': 'all', 'args': 'none', 'ignoreRestSiblings': true }],
|
||||
'one-var': ['error', 'never'],
|
||||
'padded-blocks': ['error', 'never'],
|
||||
'quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }],
|
||||
'semi': ['error'],
|
||||
'space-before-blocks': ['error'],
|
||||
'space-infix-ops': 'error'
|
||||
'space-infix-ops': 'error',
|
||||
'yoda': 'error'
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
'./src/**/*.js'
|
||||
],
|
||||
parser: 'babel-eslint',
|
||||
parser: '@babel/eslint-parser',
|
||||
env: {
|
||||
node: false,
|
||||
amd: true,
|
||||
|
|
22
package.json
22
package.json
|
@ -6,20 +6,21 @@
|
|||
"license": "GPL-2.0-or-later",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.0",
|
||||
"@babel/eslint-parser": "^7.11.0",
|
||||
"@babel/eslint-plugin": "^7.11.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.10.1",
|
||||
"@babel/plugin-proposal-private-methods": "^7.10.1",
|
||||
"@babel/plugin-transform-modules-amd": "^7.10.5",
|
||||
"@babel/polyfill": "^7.8.7",
|
||||
"@babel/preset-env": "^7.11.0",
|
||||
"autoprefixer": "^9.8.6",
|
||||
"babel-eslint": "^11.0.0-beta.2",
|
||||
"babel-loader": "^8.0.6",
|
||||
"browser-sync": "^2.26.12",
|
||||
"copy-webpack-plugin": "^5.1.1",
|
||||
"css-loader": "^4.1.1",
|
||||
"css-loader": "^4.2.0",
|
||||
"cssnano": "^4.1.10",
|
||||
"del": "^5.1.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-plugin-compat": "^3.5.1",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.21.2",
|
||||
|
@ -37,7 +38,7 @@
|
|||
"gulp-postcss": "^8.0.0",
|
||||
"gulp-sass": "^4.0.2",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-terser": "^1.2.1",
|
||||
"gulp-terser": "^1.3.0",
|
||||
"html-webpack-plugin": "^4.3.0",
|
||||
"lazypipe": "^1.0.2",
|
||||
"node-sass": "^4.13.1",
|
||||
|
@ -106,6 +107,7 @@
|
|||
"src/components/dialogHelper/dialogHelper.js",
|
||||
"src/components/directorybrowser/directorybrowser.js",
|
||||
"src/components/displaySettings/displaySettings.js",
|
||||
"src/components/favoriteitems.js",
|
||||
"src/components/fetchhelper.js",
|
||||
"src/components/filterdialog/filterdialog.js",
|
||||
"src/components/groupedcards.js",
|
||||
|
@ -119,11 +121,13 @@
|
|||
"src/components/imageUploader/imageUploader.js",
|
||||
"src/components/indicators/indicators.js",
|
||||
"src/components/itemContextMenu.js",
|
||||
"src/components/itemHelper.js",
|
||||
"src/components/itemidentifier/itemidentifier.js",
|
||||
"src/components/itemMediaInfo/itemMediaInfo.js",
|
||||
"src/components/lazyLoader/lazyLoaderIntersectionObserver.js",
|
||||
"src/components/libraryoptionseditor/libraryoptionseditor.js",
|
||||
"src/components/listview/listview.js",
|
||||
"src/components/loading/loading.js",
|
||||
"src/components/maintabsmanager.js",
|
||||
"src/components/mediainfo/mediainfo.js",
|
||||
"src/components/mediaLibraryCreator/mediaLibraryCreator.js",
|
||||
|
@ -136,6 +140,7 @@
|
|||
"src/components/playback/mediasession.js",
|
||||
"src/components/playback/nowplayinghelper.js",
|
||||
"src/components/playback/playbackorientation.js",
|
||||
"src/components/playback/playbackmanager.js",
|
||||
"src/components/playback/playerSelectionMenu.js",
|
||||
"src/components/playback/playersettingsmenu.js",
|
||||
"src/components/playback/playmethodhelper.js",
|
||||
|
@ -161,6 +166,7 @@
|
|||
"src/components/syncPlay/playbackPermissionManager.js",
|
||||
"src/components/syncPlay/syncPlayManager.js",
|
||||
"src/components/syncPlay/timeSyncManager.js",
|
||||
"src/components/viewContainer.js",
|
||||
"src/controllers/session/addServer/index.js",
|
||||
"src/controllers/session/forgotPassword/index.js",
|
||||
"src/controllers/session/redeemPassword/index.js",
|
||||
|
@ -204,10 +210,13 @@
|
|||
"src/controllers/hometab.js",
|
||||
"src/controllers/playback/nowplaying.js",
|
||||
"src/controllers/playback/videoosd.js",
|
||||
"src/controllers/itemDetails/index.js",
|
||||
"src/controllers/playback/queue/index.js",
|
||||
"src/controllers/playback/video/index.js",
|
||||
"src/controllers/searchpage.js",
|
||||
"src/controllers/livetvtuner.js",
|
||||
"src/controllers/livetvstatus.js",
|
||||
"src/controllers/livetvsettings.js",
|
||||
"src/controllers/shows/episodes.js",
|
||||
"src/controllers/shows/tvgenres.js",
|
||||
"src/controllers/shows/tvlatest.js",
|
||||
|
@ -253,6 +262,7 @@
|
|||
"src/plugins/youtubePlayer/plugin.js",
|
||||
"src/scripts/alphanumericshortcuts.js",
|
||||
"src/scripts/autoBackdrops.js",
|
||||
"src/scripts/browser.js",
|
||||
"src/scripts/datetime.js",
|
||||
"src/scripts/deleteHelper.js",
|
||||
"src/scripts/dfnshelper.js",
|
||||
|
@ -263,10 +273,14 @@
|
|||
"src/scripts/globalize.js",
|
||||
"src/scripts/imagehelper.js",
|
||||
"src/scripts/inputManager.js",
|
||||
"src/scripts/autoThemes.js",
|
||||
"src/scripts/themeManager.js",
|
||||
"src/scripts/keyboardNavigation.js",
|
||||
"src/scripts/libraryBrowser.js",
|
||||
"src/scripts/mouseManager.js",
|
||||
"src/scripts/multiDownload.js",
|
||||
"src/scripts/playlists.js",
|
||||
"src/scripts/routes.js",
|
||||
"src/scripts/settings/appSettings.js",
|
||||
"src/scripts/settings/userSettings.js",
|
||||
"src/scripts/settings/webSettings.js",
|
||||
|
|
|
@ -49,7 +49,7 @@ import 'formDialogStyle';
|
|||
};
|
||||
|
||||
if (parseFloat(updatedSchedule.StartHour) >= parseFloat(updatedSchedule.EndHour)) {
|
||||
return void alert(globalize.translate('ErrorMessageStartHourGreaterThanEnd'));
|
||||
return void alert(globalize.translate('ErrorStartHourGreaterThanEnd'));
|
||||
}
|
||||
|
||||
context.submitted = true;
|
||||
|
|
|
@ -16,7 +16,7 @@ import 'listViewStyle';
|
|||
let color = '#00a4dc';
|
||||
let icon = 'notifications';
|
||||
|
||||
if ('Error' == entry.Severity || 'Fatal' == entry.Severity || 'Warn' == entry.Severity) {
|
||||
if (entry.Severity == 'Error' || entry.Severity == 'Fatal' || entry.Severity == 'Warn') {
|
||||
color = '#cc0000';
|
||||
icon = 'notification_important';
|
||||
}
|
||||
|
@ -60,13 +60,13 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function reloadData(instance, elem, apiClient, startIndex, limit) {
|
||||
if (null == startIndex) {
|
||||
if (startIndex == null) {
|
||||
startIndex = parseInt(elem.getAttribute('data-activitystartindex') || '0');
|
||||
}
|
||||
|
||||
limit = limit || parseInt(elem.getAttribute('data-activitylimit') || '7');
|
||||
const minDate = new Date();
|
||||
const hasUserId = 'false' !== elem.getAttribute('data-useractivity');
|
||||
const hasUserId = elem.getAttribute('data-useractivity') !== 'false';
|
||||
|
||||
// TODO: Use date-fns
|
||||
if (hasUserId) {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdrop', 'browser', 'page', 'appSettings', 'apphost', 'connectionManager'], function (loading, globalize, events, viewManager, skinManager, backdrop, browser, page, appSettings, appHost, connectionManager) {
|
||||
'use strict';
|
||||
|
||||
browser = browser.default || browser;
|
||||
loading = loading.default || loading;
|
||||
|
||||
var appRouter = {
|
||||
showLocalLogin: function (serverId, manualLogin) {
|
||||
var pageName = manualLogin ? 'manuallogin' : 'login';
|
||||
|
@ -34,7 +37,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
|||
switch (result.State) {
|
||||
case 'SignedIn':
|
||||
loading.hide();
|
||||
skinManager.loadUserSkin();
|
||||
Emby.Page.goHome();
|
||||
break;
|
||||
case 'ServerSignIn':
|
||||
result.ApiClient.getPublicUsers().then(function (users) {
|
||||
|
@ -147,7 +150,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
|||
if (typeof route.path === 'string') {
|
||||
loadContentUrl(ctx, next, route, currentRequest);
|
||||
} else {
|
||||
// ? TODO
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
@ -285,12 +287,9 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
|||
|
||||
connectionManager.connect({
|
||||
enableAutoLogin: appSettings.enableAutoLogin()
|
||||
|
||||
}).then(function (result) {
|
||||
firstConnectionResult = result;
|
||||
|
||||
options = options || {};
|
||||
|
||||
page({
|
||||
click: options.click !== false,
|
||||
hashbang: options.hashbang !== false
|
||||
|
@ -342,7 +341,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
|||
|
||||
if (route.isDefaultRoute) {
|
||||
console.debug('appRouter - loading skin home page');
|
||||
loadUserSkinWithOptions(ctx);
|
||||
Emby.Page.goHome();
|
||||
return;
|
||||
} else if (route.roles) {
|
||||
validateRoles(apiClient, route.roles).then(function () {
|
||||
|
@ -356,15 +355,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
|||
callback();
|
||||
}
|
||||
|
||||
function loadUserSkinWithOptions(ctx) {
|
||||
require(['queryString'], function (queryString) {
|
||||
var params = queryString.parse(ctx.querystring);
|
||||
skinManager.loadUserSkin({
|
||||
start: params.start
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function validateRoles(apiClient, roles) {
|
||||
return Promise.all(roles.split(',').map(function (role) {
|
||||
return validateRole(apiClient, role);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'globalize'], function (appSettings, browser, events, htmlMediaHelper, webSettings, globalize) {
|
||||
'use strict';
|
||||
|
||||
browser = browser.default || browser;
|
||||
|
||||
function getBaseProfileOptions(item) {
|
||||
var disableHlsVideoAudioCodecs = [];
|
||||
|
||||
|
@ -47,7 +49,7 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
|||
profile = window.NativeShell.AppHost.getDeviceProfile(profileBuilder);
|
||||
} else {
|
||||
var builderOpts = getBaseProfileOptions(item);
|
||||
builderOpts.enableSsaRender = (item && !options.isRetry && 'allcomplexformats' !== appSettings.get('subtitleburnin'));
|
||||
builderOpts.enableSsaRender = (item && !options.isRetry && appSettings.get('subtitleburnin') !== 'allcomplexformats');
|
||||
profile = profileBuilder(builderOpts);
|
||||
}
|
||||
|
||||
|
@ -277,7 +279,7 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
|||
features.push('targetblank');
|
||||
features.push('screensaver');
|
||||
|
||||
webSettings.enableMultiServer().then(enabled => {
|
||||
webSettings.getMultiServer().then(enabled => {
|
||||
if (enabled) features.push('multiserver');
|
||||
});
|
||||
|
||||
|
@ -370,7 +372,7 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
|||
return window.NativeShell.AppHost.supports(command);
|
||||
}
|
||||
|
||||
return -1 !== supportedFeatures.indexOf(command.toLowerCase());
|
||||
return supportedFeatures.indexOf(command.toLowerCase()) !== -1;
|
||||
},
|
||||
preferVisualCards: browser.android || browser.chrome,
|
||||
getSyncProfile: getSyncProfile,
|
||||
|
@ -407,13 +409,6 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
|||
getPushTokenInfo: function () {
|
||||
return {};
|
||||
},
|
||||
setThemeColor: function (color) {
|
||||
var metaThemeColor = document.querySelector('meta[name=theme-color]');
|
||||
|
||||
if (metaThemeColor) {
|
||||
metaThemeColor.setAttribute('content', color);
|
||||
}
|
||||
},
|
||||
setUserScalable: function (scalable) {
|
||||
if (!browser.tv) {
|
||||
var att = scalable ? 'width=device-width, initial-scale=1, minimum-scale=1, user-scalable=yes' : 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no';
|
||||
|
|
|
@ -277,7 +277,7 @@ import 'programStyles';
|
|||
*/
|
||||
function getImageWidth(shape, screenWidth, isOrientationLandscape) {
|
||||
const imagesPerRow = getPostersPerRow(shape, screenWidth, isOrientationLandscape);
|
||||
return Math.round(screenWidth / imagesPerRow) * 2;
|
||||
return Math.round(screenWidth / imagesPerRow);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,7 +73,7 @@ import browser from 'browser';
|
|||
if (ImageTag) {
|
||||
return apiClient.getScaledImageUrl(Id, {
|
||||
|
||||
maxWidth: maxWidth * 2,
|
||||
maxWidth: maxWidth,
|
||||
tag: ImageTag,
|
||||
type: 'Chapter',
|
||||
index
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import browser from 'browser';
|
||||
import layoutManager from 'layoutManager';
|
||||
import appSettings from 'appSettings';
|
||||
import pluginManager from 'pluginManager';
|
||||
import appHost from 'apphost';
|
||||
import focusManager from 'focusManager';
|
||||
|
@ -16,17 +15,22 @@ import 'emby-button';
|
|||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function fillThemes(select, isDashboard) {
|
||||
select.innerHTML = skinManager.getThemes().map(t => {
|
||||
let value = t.id;
|
||||
if (t.isDefault && !isDashboard) {
|
||||
value = '';
|
||||
} else if (t.isDefaultServerDashboard && isDashboard) {
|
||||
value = '';
|
||||
}
|
||||
function fillThemes(context, userSettings) {
|
||||
const select = context.querySelector('#selectTheme');
|
||||
|
||||
return `<option value="${value}">${t.name}</option>`;
|
||||
skinManager.getThemes().then(themes => {
|
||||
select.innerHTML = themes.map(t => {
|
||||
return `<option value="${t.id}">${t.name}</option>`;
|
||||
}).join('');
|
||||
|
||||
// get default theme
|
||||
var defaultTheme = themes.find(theme => {
|
||||
return theme.default;
|
||||
});
|
||||
|
||||
// set the current theme
|
||||
select.value = userSettings.theme() || defaultTheme.id;
|
||||
});
|
||||
}
|
||||
|
||||
function loadScreensavers(context, userSettings) {
|
||||
|
@ -46,6 +50,7 @@ import 'emby-button';
|
|||
selectScreensaver.innerHTML = options.map(o => {
|
||||
return `<option value="${o.value}">${o.name}</option>`;
|
||||
}).join('');
|
||||
|
||||
selectScreensaver.value = userSettings.screensaver();
|
||||
|
||||
if (!selectScreensaver.value) {
|
||||
|
@ -54,57 +59,6 @@ import 'emby-button';
|
|||
}
|
||||
}
|
||||
|
||||
function loadSoundEffects(context, userSettings) {
|
||||
const selectSoundEffects = context.querySelector('.selectSoundEffects');
|
||||
const options = pluginManager.ofType('soundeffects').map(plugin => {
|
||||
return {
|
||||
name: plugin.name,
|
||||
value: plugin.id
|
||||
};
|
||||
});
|
||||
|
||||
options.unshift({
|
||||
name: globalize.translate('None'),
|
||||
value: 'none'
|
||||
});
|
||||
|
||||
selectSoundEffects.innerHTML = options.map(o => {
|
||||
return `<option value="${o.value}">${o.name}</option>`;
|
||||
}).join('');
|
||||
selectSoundEffects.value = userSettings.soundEffects();
|
||||
|
||||
if (!selectSoundEffects.value) {
|
||||
// TODO: set the default instead of none
|
||||
selectSoundEffects.value = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function loadSkins(context, userSettings) {
|
||||
const selectSkin = context.querySelector('.selectSkin');
|
||||
|
||||
const options = pluginManager.ofType('skin').map(plugin => {
|
||||
return {
|
||||
name: plugin.name,
|
||||
value: plugin.id
|
||||
};
|
||||
});
|
||||
|
||||
selectSkin.innerHTML = options.map(o => {
|
||||
return `<option value="${o.value}">${o.name}</option>`;
|
||||
}).join('');
|
||||
selectSkin.value = userSettings.skin();
|
||||
|
||||
if (!selectSkin.value && options.length) {
|
||||
selectSkin.value = options[0].value;
|
||||
}
|
||||
|
||||
if (options.length > 1 && appHost.supports('skins')) {
|
||||
context.querySelector('.selectSkinContainer').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.selectSkinContainer').classList.add('hide');
|
||||
}
|
||||
}
|
||||
|
||||
function showOrHideMissingEpisodesField(context) {
|
||||
if (browser.tizen || browser.web0s) {
|
||||
context.querySelector('.fldDisplayMissingEpisodes').classList.add('hide');
|
||||
|
@ -115,12 +69,6 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
function loadForm(context, user, userSettings) {
|
||||
if (user.Policy.IsAdministrator) {
|
||||
context.querySelector('.selectDashboardThemeContainer').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.selectDashboardThemeContainer').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.supports('displaylanguage')) {
|
||||
context.querySelector('.languageSection').classList.remove('hide');
|
||||
} else {
|
||||
|
@ -139,18 +87,6 @@ import 'emby-button';
|
|||
context.querySelector('.learnHowToContributeContainer').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.supports('runatstartup')) {
|
||||
context.querySelector('.fldAutorun').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.fldAutorun').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.supports('soundeffects')) {
|
||||
context.querySelector('.fldSoundEffects').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.fldSoundEffects').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.supports('screensaver')) {
|
||||
context.querySelector('.selectScreensaverContainer').classList.remove('hide');
|
||||
} else {
|
||||
|
@ -173,16 +109,8 @@ import 'emby-button';
|
|||
context.querySelector('.fldThemeVideo').classList.add('hide');
|
||||
}
|
||||
|
||||
context.querySelector('.chkRunAtStartup').checked = appSettings.runAtStartup();
|
||||
|
||||
const selectTheme = context.querySelector('#selectTheme');
|
||||
const selectDashboardTheme = context.querySelector('#selectDashboardTheme');
|
||||
|
||||
fillThemes(selectTheme);
|
||||
fillThemes(selectDashboardTheme, true);
|
||||
fillThemes(context, userSettings);
|
||||
loadScreensavers(context, userSettings);
|
||||
loadSoundEffects(context, userSettings);
|
||||
loadSkins(context, userSettings);
|
||||
|
||||
context.querySelector('.chkDisplayMissingEpisodes').checked = user.Configuration.DisplayMissingEpisodes || false;
|
||||
|
||||
|
@ -198,9 +126,6 @@ import 'emby-button';
|
|||
|
||||
context.querySelector('#txtLibraryPageSize').value = userSettings.libraryPageSize();
|
||||
|
||||
selectDashboardTheme.value = userSettings.dashboardTheme() || '';
|
||||
selectTheme.value = userSettings.theme() || '';
|
||||
|
||||
context.querySelector('.selectLayout').value = layoutManager.getSavedLayout() || '';
|
||||
|
||||
showOrHideMissingEpisodesField(context);
|
||||
|
@ -209,8 +134,6 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
function saveUser(context, user, userSettingsInstance, apiClient) {
|
||||
appSettings.runAtStartup(context.querySelector('.chkRunAtStartup').checked);
|
||||
|
||||
user.Configuration.DisplayMissingEpisodes = context.querySelector('.chkDisplayMissingEpisodes').checked;
|
||||
|
||||
if (appHost.supports('displaylanguage')) {
|
||||
|
@ -221,15 +144,11 @@ import 'emby-button';
|
|||
|
||||
userSettingsInstance.enableThemeSongs(context.querySelector('#chkThemeSong').checked);
|
||||
userSettingsInstance.enableThemeVideos(context.querySelector('#chkThemeVideo').checked);
|
||||
userSettingsInstance.dashboardTheme(context.querySelector('#selectDashboardTheme').value);
|
||||
userSettingsInstance.theme(context.querySelector('#selectTheme').value);
|
||||
userSettingsInstance.soundEffects(context.querySelector('.selectSoundEffects').value);
|
||||
userSettingsInstance.screensaver(context.querySelector('.selectScreensaver').value);
|
||||
|
||||
userSettingsInstance.libraryPageSize(context.querySelector('#txtLibraryPageSize').value);
|
||||
|
||||
userSettingsInstance.skin(context.querySelector('.selectSkin').value);
|
||||
|
||||
userSettingsInstance.enableFastFadein(context.querySelector('#chkFadein').checked);
|
||||
userSettingsInstance.enableBlurhash(context.querySelector('#chkBlurhash').checked);
|
||||
userSettingsInstance.enableBackdrops(context.querySelector('#chkBackdrops').checked);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<form style="margin: 0 auto;">
|
||||
|
||||
<h2 class="sectionTitle">
|
||||
${Display}
|
||||
</h2>
|
||||
|
@ -123,26 +122,14 @@
|
|||
<div class="fieldDescription">${LabelPleaseRestart}</div>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer hide selectSkinContainer">
|
||||
<select is="emby-select" class="selectSkin" label="${LabelSkin}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select id="selectTheme" is="emby-select" label="${LabelTheme}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer selectDashboardThemeContainer hide">
|
||||
<select id="selectDashboardTheme" is="emby-select" label="${LabelDashboardTheme}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer hide selectScreensaverContainer">
|
||||
<select is="emby-select" class="selectScreensaver" label="${LabelScreensaver}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer fldSoundEffects hide">
|
||||
<select is="emby-select" class="selectSoundEffects" label="${LabelSoundEffects}"></select>
|
||||
</div>
|
||||
|
||||
<div class="inputContainer inputContainer-withDescription">
|
||||
<input is="emby-input" type="number" id="txtLibraryPageSize" pattern="[0-9]*" required="required" min="0" max="1000" step="1" label="${LabelLibraryPageSize}" />
|
||||
<div class="fieldDescription">${LabelLibraryPageSizeHelp}</div>
|
||||
|
@ -159,9 +146,9 @@
|
|||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" id="chkBlurhash" />
|
||||
<span>${EnableBlurhash}</span>
|
||||
<span>${EnableBlurHash}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${EnableBlurhashHelp}</div>
|
||||
<div class="fieldDescription checkboxFieldDescription">${EnableBlurHashHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
|
@ -196,13 +183,6 @@
|
|||
<div class="fieldDescription checkboxFieldDescription">${EnableThemeVideosHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer hide fldAutorun">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkRunAtStartup" />
|
||||
<span>${RunAtStartup}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldDisplayMissingEpisodes hide">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkDisplayMissingEpisodes" />
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoader', 'globalize', 'layoutManager', 'scrollStyles', 'emby-itemscontainer'], function (loading, libraryBrowser, cardBuilder, dom, appHost, imageLoader, globalize, layoutManager) {
|
||||
'use strict';
|
||||
import loading from 'loading';
|
||||
import cardBuilder from 'cardBuilder';
|
||||
import dom from 'dom';
|
||||
import appHost from 'apphost';
|
||||
import imageLoader from 'imageLoader';
|
||||
import globalize from 'globalize';
|
||||
import layoutManager from 'layoutManager';
|
||||
import 'scrollStyles';
|
||||
import 'emby-itemscontainer';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
|
@ -94,8 +103,8 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
}
|
||||
|
||||
function loadSection(elem, userId, topParentId, section, isSingleSection) {
|
||||
var screenWidth = dom.getWindowSize().innerWidth;
|
||||
var options = {
|
||||
const screenWidth = dom.getWindowSize().innerWidth;
|
||||
const options = {
|
||||
SortBy: 'SortName',
|
||||
SortOrder: 'Ascending',
|
||||
Filters: 'IsFavorite',
|
||||
|
@ -118,9 +127,9 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
}
|
||||
}
|
||||
|
||||
var promise;
|
||||
let promise;
|
||||
|
||||
if ('MusicArtist' === section.types) {
|
||||
if (section.types === 'MusicArtist') {
|
||||
promise = ApiClient.getArtists(userId, options);
|
||||
} else {
|
||||
options.IncludeItemTypes = section.types;
|
||||
|
@ -128,7 +137,7 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
}
|
||||
|
||||
return promise.then(function (result) {
|
||||
var html = '';
|
||||
let html = '';
|
||||
|
||||
if (result.Items.length) {
|
||||
if (html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">', !layoutManager.tv && options.Limit && result.Items.length >= options.Limit) {
|
||||
|
@ -144,7 +153,7 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
|
||||
html += '</div>';
|
||||
if (enableScrollX()) {
|
||||
var scrollXClass = 'scrollX hiddenScrollX';
|
||||
let scrollXClass = 'scrollX hiddenScrollX';
|
||||
if (layoutManager.tv) {
|
||||
scrollXClass += ' smoothScrollX';
|
||||
}
|
||||
|
@ -154,13 +163,13 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap padded-left padded-right">';
|
||||
}
|
||||
|
||||
var cardLayout = appHost.preferVisualCards && section.autoCardLayout && section.showTitle;
|
||||
let cardLayout = appHost.preferVisualCards && section.autoCardLayout && section.showTitle;
|
||||
cardLayout = false;
|
||||
html += cardBuilder.getCardsHtml(result.Items, {
|
||||
preferThumb: section.preferThumb,
|
||||
shape: section.shape,
|
||||
centerText: section.centerText && !cardLayout,
|
||||
overlayText: false !== section.overlayText,
|
||||
overlayText: section.overlayText !== false,
|
||||
showTitle: section.showTitle,
|
||||
showParentTitle: section.showParentTitle,
|
||||
scalable: true,
|
||||
|
@ -179,10 +188,10 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
});
|
||||
}
|
||||
|
||||
function loadSections(page, userId, topParentId, types) {
|
||||
export function loadSections(page, userId, topParentId, types) {
|
||||
loading.show();
|
||||
var sections = getSections();
|
||||
var sectionid = getParameterByName('sectionid');
|
||||
let sections = getSections();
|
||||
const sectionid = getParameterByName('sectionid');
|
||||
|
||||
if (sectionid) {
|
||||
sections = sections.filter(function (s) {
|
||||
|
@ -192,30 +201,28 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
|
||||
if (types) {
|
||||
sections = sections.filter(function (s) {
|
||||
return -1 !== types.indexOf(s.id);
|
||||
return types.indexOf(s.id) !== -1;
|
||||
});
|
||||
}
|
||||
|
||||
var i;
|
||||
var length;
|
||||
var elem = page.querySelector('.favoriteSections');
|
||||
let elem = page.querySelector('.favoriteSections');
|
||||
|
||||
if (!elem.innerHTML) {
|
||||
var html = '';
|
||||
let html = '';
|
||||
|
||||
for (i = 0, length = sections.length; i < length; i++) {
|
||||
for (let i = 0, length = sections.length; i < length; i++) {
|
||||
html += '<div class="verticalSection section' + sections[i].id + '"></div>';
|
||||
}
|
||||
|
||||
elem.innerHTML = html;
|
||||
}
|
||||
|
||||
var promises = [];
|
||||
const promises = [];
|
||||
|
||||
for (i = 0, length = sections.length; i < length; i++) {
|
||||
var section = sections[i];
|
||||
for (let i = 0, length = sections.length; i < length; i++) {
|
||||
const section = sections[i];
|
||||
elem = page.querySelector('.section' + section.id);
|
||||
promises.push(loadSection(elem, userId, topParentId, section, 1 === sections.length));
|
||||
promises.push(loadSection(elem, userId, topParentId, section, sections.length === 1));
|
||||
}
|
||||
|
||||
Promise.all(promises).then(function () {
|
||||
|
@ -223,7 +230,8 @@ define(['loading', 'libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoad
|
|||
});
|
||||
}
|
||||
|
||||
return {
|
||||
export default {
|
||||
render: loadSections
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
|
@ -21,7 +21,7 @@ import connectionManager from 'connectionManager';
|
|||
|
||||
if (!actionableParent || actionableParent.classList.contains('cardContent')) {
|
||||
apiClient.getJSON(apiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||
if (1 === items.length) {
|
||||
if (items.length === 1) {
|
||||
return void appRouter.showItem(items[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager', 'scrollHelper', 'serverNotifications', 'loading', 'datetime', 'focusManager', 'playbackManager', 'userSettings', 'imageLoader', 'events', 'layoutManager', 'itemShortcuts', 'dom', 'css!./guide.css', 'programStyles', 'material-icons', 'scrollStyles', 'emby-programcell', 'emby-button', 'paper-icon-button-light', 'emby-tabs', 'emby-scroller', 'flexStyles', 'webcomponents'], function (require, inputManager, browser, globalize, connectionManager, scrollHelper, serverNotifications, loading, datetime, focusManager, playbackManager, userSettings, imageLoader, events, layoutManager, itemShortcuts, dom) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
browser = browser.default || browser;
|
||||
loading = loading.default || loading;
|
||||
|
||||
function showViewSettings(instance) {
|
||||
require(['guide-settings-dialog'], function (guideSettingsDialog) {
|
||||
guideSettingsDialog.show(instance.categoryOptions).then(function () {
|
||||
|
|
|
@ -16,7 +16,7 @@ import 'emby-input';
|
|||
return {
|
||||
Type: type,
|
||||
MinWidth: 0,
|
||||
Limit: 'Primary' === type ? 1 : 0
|
||||
Limit: type === 'Primary' ? 1 : 0
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ import 'css!./imageeditor';
|
|||
reload(context, null, focusContext);
|
||||
}, function () {
|
||||
import('alert').then(({default: alert}) => {
|
||||
alert(globalize.translate('DefaultErrorMessage'));
|
||||
alert(globalize.translate('ErrorDefault'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ import 'css!./style';
|
|||
|
||||
/* eslint-enable indent */
|
||||
export default {
|
||||
serLazyImage: setLazyImage,
|
||||
setLazyImage: setLazyImage,
|
||||
fillImages: fillImages,
|
||||
fillImage: fillImage,
|
||||
lazyImage: lazyImage,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
define(['apphost', 'globalize'], function (appHost, globalize) {
|
||||
'use strict';
|
||||
import appHost from 'apphost';
|
||||
import globalize from 'globalize';
|
||||
|
||||
function getDisplayName(item, options = {}) {
|
||||
export function getDisplayName(item, options = {}) {
|
||||
if (!item) {
|
||||
throw new Error('null item passed into getDisplayName');
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
item = item.ProgramInfo || item;
|
||||
}
|
||||
|
||||
var name = ((item.Type === 'Program' || item.Type === 'Recording') && (item.IsSeries || item.EpisodeTitle) ? item.EpisodeTitle : item.Name) || '';
|
||||
let name = ((item.Type === 'Program' || item.Type === 'Recording') && (item.IsSeries || item.EpisodeTitle) ? item.EpisodeTitle : item.Name) || '';
|
||||
|
||||
if (item.Type === 'TvChannel') {
|
||||
if (item.ChannelNumber) {
|
||||
|
@ -21,10 +21,10 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
if (item.Type === 'Episode' && item.ParentIndexNumber === 0) {
|
||||
name = globalize.translate('ValueSpecialEpisodeName', name);
|
||||
} else if ((item.Type === 'Episode' || item.Type === 'Program') && item.IndexNumber != null && item.ParentIndexNumber != null && options.includeIndexNumber !== false) {
|
||||
var displayIndexNumber = item.IndexNumber;
|
||||
let displayIndexNumber = item.IndexNumber;
|
||||
|
||||
var number = displayIndexNumber;
|
||||
var nameSeparator = ' - ';
|
||||
let number = displayIndexNumber;
|
||||
let nameSeparator = ' - ';
|
||||
|
||||
if (options.includeParentInfo !== false) {
|
||||
number = 'S' + item.ParentIndexNumber + ':E' + number;
|
||||
|
@ -43,10 +43,10 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
function supportsAddingToCollection(item) {
|
||||
var invalidTypes = ['Genre', 'MusicGenre', 'Studio', 'UserView', 'CollectionFolder', 'Audio', 'Program', 'Timer', 'SeriesTimer'];
|
||||
export function supportsAddingToCollection(item) {
|
||||
const invalidTypes = ['Genre', 'MusicGenre', 'Studio', 'UserView', 'CollectionFolder', 'Audio', 'Program', 'Timer', 'SeriesTimer'];
|
||||
|
||||
if (item.Type === 'Recording') {
|
||||
if (item.Status !== 'Completed') {
|
||||
|
@ -55,9 +55,9 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return !item.CollectionType && invalidTypes.indexOf(item.Type) === -1 && item.MediaType !== 'Photo' && !isLocalItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
function supportsAddingToPlaylist(item) {
|
||||
export function supportsAddingToPlaylist(item) {
|
||||
if (item.Type === 'Program') {
|
||||
return false;
|
||||
}
|
||||
|
@ -88,10 +88,10 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return item.MediaType || item.IsFolder || item.Type === 'Genre' || item.Type === 'MusicGenre' || item.Type === 'MusicArtist';
|
||||
}
|
||||
}
|
||||
|
||||
function canEdit(user, item) {
|
||||
var itemType = item.Type;
|
||||
export function canEdit(user, item) {
|
||||
const itemType = item.Type;
|
||||
|
||||
if (itemType === 'UserRootFolder' || itemType === 'UserView') {
|
||||
return false;
|
||||
|
@ -120,24 +120,18 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return user.Policy.IsAdministrator;
|
||||
}
|
||||
}
|
||||
|
||||
function isLocalItem(item) {
|
||||
export function isLocalItem(item) {
|
||||
if (item && item.Id && item.Id.indexOf('local') === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
getDisplayName: getDisplayName,
|
||||
supportsAddingToCollection: supportsAddingToCollection,
|
||||
supportsAddingToPlaylist: supportsAddingToPlaylist,
|
||||
isLocalItem: isLocalItem,
|
||||
|
||||
canIdentify: function (user, item) {
|
||||
var itemType = item.Type;
|
||||
export function canIdentify (user, item) {
|
||||
const itemType = item.Type;
|
||||
|
||||
if (itemType === 'Movie' ||
|
||||
itemType === 'Trailer' ||
|
||||
|
@ -156,12 +150,10 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
canEdit: canEdit,
|
||||
|
||||
canEditImages: function (user, item) {
|
||||
var itemType = item.Type;
|
||||
export function canEditImages (user, item) {
|
||||
const itemType = item.Type;
|
||||
|
||||
if (item.MediaType === 'Photo') {
|
||||
return false;
|
||||
|
@ -182,9 +174,9 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return itemType !== 'Timer' && itemType !== 'SeriesTimer' && canEdit(user, item) && !isLocalItem(item);
|
||||
},
|
||||
}
|
||||
|
||||
canSync: function (user, item) {
|
||||
export function canSync (user, item) {
|
||||
if (user && !user.Policy.EnableContentDownloading) {
|
||||
return false;
|
||||
}
|
||||
|
@ -194,9 +186,9 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return item.SupportsSync;
|
||||
},
|
||||
}
|
||||
|
||||
canShare: function (item, user) {
|
||||
export function canShare (item, user) {
|
||||
if (item.Type === 'Program') {
|
||||
return false;
|
||||
}
|
||||
|
@ -218,13 +210,13 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
return false;
|
||||
}
|
||||
return user.Policy.EnablePublicSharing && appHost.supports('sharing');
|
||||
},
|
||||
}
|
||||
|
||||
enableDateAddedDisplay: function (item) {
|
||||
export function enableDateAddedDisplay (item) {
|
||||
return !item.IsFolder && item.MediaType && item.Type !== 'Program' && item.Type !== 'TvChannel' && item.Type !== 'Trailer';
|
||||
},
|
||||
}
|
||||
|
||||
canMarkPlayed: function (item) {
|
||||
export function canMarkPlayed (item) {
|
||||
if (item.Type === 'Program') {
|
||||
return false;
|
||||
}
|
||||
|
@ -251,9 +243,9 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
canRate: function (item) {
|
||||
export function canRate (item) {
|
||||
if (item.Type === 'Program'
|
||||
|| item.Type === 'Timer'
|
||||
|| item.Type === 'SeriesTimer'
|
||||
|
@ -265,9 +257,9 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
}
|
||||
|
||||
canConvert: function (item, user) {
|
||||
export function canConvert (item, user) {
|
||||
if (!user.Policy.EnableMediaConversion) {
|
||||
return false;
|
||||
}
|
||||
|
@ -276,17 +268,17 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
return false;
|
||||
}
|
||||
|
||||
var mediaType = item.MediaType;
|
||||
const mediaType = item.MediaType;
|
||||
if (mediaType === 'Book' || mediaType === 'Photo' || mediaType === 'Audio') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var collectionType = item.CollectionType;
|
||||
const collectionType = item.CollectionType;
|
||||
if (collectionType === 'livetv') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var type = item.Type;
|
||||
const type = item.Type;
|
||||
if (type === 'Channel' || type === 'Person' || type === 'Year' || type === 'Program' || type === 'Timer' || type === 'SeriesTimer') {
|
||||
return false;
|
||||
}
|
||||
|
@ -300,11 +292,11 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
}
|
||||
|
||||
canRefreshMetadata: function (item, user) {
|
||||
export function canRefreshMetadata (item, user) {
|
||||
if (user.Policy.IsAdministrator) {
|
||||
var collectionType = item.CollectionType;
|
||||
const collectionType = item.CollectionType;
|
||||
if (collectionType === 'livetv') {
|
||||
return false;
|
||||
}
|
||||
|
@ -317,9 +309,9 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
supportsMediaSourceSelection: function (item) {
|
||||
export function supportsMediaSourceSelection (item) {
|
||||
if (item.MediaType !== 'Video') {
|
||||
return false;
|
||||
}
|
||||
|
@ -337,6 +329,22 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
|
|||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
getDisplayName: getDisplayName,
|
||||
supportsAddingToCollection: supportsAddingToCollection,
|
||||
supportsAddingToPlaylist: supportsAddingToPlaylist,
|
||||
isLocalItem: isLocalItem,
|
||||
canIdentify: canIdentify,
|
||||
canEdit: canEdit,
|
||||
canEditImages: canEditImages,
|
||||
canSync: canSync,
|
||||
canShare: canShare,
|
||||
enableDateAddedDisplay: enableDateAddedDisplay,
|
||||
canMarkPlayed: canMarkPlayed,
|
||||
canRate: canRate,
|
||||
canConvert: canConvert,
|
||||
canRefreshMetadata: canRefreshMetadata,
|
||||
supportsMediaSourceSelection: supportsMediaSourceSelection
|
||||
};
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['playbackManager', 'serverNotifications', 'events'], function (playbackManager, serverNotifications, events) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
function onUserDataChanged(e, apiClient, userData) {
|
||||
var instance = this;
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['browser', 'appSettings', 'events'], function (browser, appSettings, events) {
|
||||
'use strict';
|
||||
|
||||
browser = browser.default || browser;
|
||||
|
||||
function setLayout(instance, layout, selectedLayout) {
|
||||
if (layout === selectedLayout) {
|
||||
instance[layout] = true;
|
||||
|
|
|
@ -219,7 +219,7 @@ import 'emby-input';
|
|||
html += '<div class="flex align-items-center" style="margin:1.5em 0 .5em;">';
|
||||
html += '<h3 class="checkboxListLabel" style="margin:0;">' + globalize.translate('HeaderTypeImageFetchers', availableTypeOptions.Type) + '</h3>';
|
||||
const supportedImageTypes = availableTypeOptions.SupportedImageTypes || [];
|
||||
if (supportedImageTypes.length > 1 || 1 === supportedImageTypes.length && 'Primary' !== supportedImageTypes[0]) {
|
||||
if (supportedImageTypes.length > 1 || supportedImageTypes.length === 1 && supportedImageTypes[0] !== 'Primary') {
|
||||
html += '<button is="emby-button" class="raised btnImageOptionsForType" type="button" style="margin-left:1.5em;font-size:90%;"><span>' + globalize.translate('HeaderFetcherSettings') + '</span></button>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
@ -362,7 +362,7 @@ import 'emby-input';
|
|||
TypeOptions: []
|
||||
};
|
||||
currentAvailableOptions = null;
|
||||
const isNewLibrary = null === libraryOptions;
|
||||
const isNewLibrary = libraryOptions === null;
|
||||
isNewLibrary && parent.classList.add('newlibrary');
|
||||
const response = await fetch('components/libraryoptionseditor/libraryoptionseditor.template.html');
|
||||
const template = await response.text();
|
||||
|
@ -578,7 +578,7 @@ import 'emby-input';
|
|||
parent.querySelector('#chkSkipIfAudioTrackPresent').checked = options.SkipSubtitlesIfAudioTrackMatches;
|
||||
parent.querySelector('#chkRequirePerfectMatch').checked = options.RequirePerfectSubtitleMatch;
|
||||
Array.prototype.forEach.call(parent.querySelectorAll('.chkMetadataSaver'), elem => {
|
||||
elem.checked = options.MetadataSavers ? options.MetadataSavers.includes(elem.getAttribute('data-pluginname')) : 'true' === elem.getAttribute('data-defaultenabled');
|
||||
elem.checked = options.MetadataSavers ? options.MetadataSavers.includes(elem.getAttribute('data-pluginname')) : elem.getAttribute('data-defaultenabled') === 'true';
|
||||
});
|
||||
Array.prototype.forEach.call(parent.querySelectorAll('.chkSubtitleLanguage'), elem => {
|
||||
elem.checked = !!options.SubtitleDownloadLanguages && options.SubtitleDownloadLanguages.includes(elem.getAttribute('data-lang'));
|
||||
|
|
|
@ -81,7 +81,7 @@ import 'emby-playstatebutton';
|
|||
let itemId;
|
||||
|
||||
const options = {
|
||||
maxWidth: width * 2,
|
||||
maxWidth: width,
|
||||
type: 'Primary'
|
||||
};
|
||||
|
||||
|
@ -108,7 +108,7 @@ import 'emby-playstatebutton';
|
|||
function getChannelImageUrl(item, width) {
|
||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
const options = {
|
||||
maxWidth: width * 2,
|
||||
maxWidth: width,
|
||||
type: 'Primary'
|
||||
};
|
||||
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
define(['css!./loading'], function () {
|
||||
'use strict';
|
||||
import 'css!./loading';
|
||||
|
||||
var loadingElem;
|
||||
var layer1;
|
||||
var layer2;
|
||||
var layer3;
|
||||
var layer4;
|
||||
var circleLefts;
|
||||
var circleRights;
|
||||
let loadingElem;
|
||||
let layer1;
|
||||
let layer2;
|
||||
let layer3;
|
||||
let layer4;
|
||||
let circleLefts;
|
||||
let circleRights;
|
||||
|
||||
return {
|
||||
show: function () {
|
||||
var elem = loadingElem;
|
||||
export function show() {
|
||||
let elem = loadingElem;
|
||||
|
||||
if (!elem) {
|
||||
elem = document.createElement('div');
|
||||
|
@ -40,19 +38,17 @@ define(['css!./loading'], function () {
|
|||
layer3.classList.add('mdl-spinner__layer-3-active');
|
||||
layer4.classList.add('mdl-spinner__layer-4-active');
|
||||
|
||||
var i;
|
||||
var length;
|
||||
|
||||
for (i = 0, length = circleLefts.length; i < length; i++) {
|
||||
for (let i = 0, length = circleLefts.length; i < length; i++) {
|
||||
circleLefts[i].classList.add('mdl-spinner__circleLeft-active');
|
||||
}
|
||||
|
||||
for (i = 0, length = circleRights.length; i < length; i++) {
|
||||
for (let i = 0, length = circleRights.length; i < length; i++) {
|
||||
circleRights[i].classList.add('mdl-spinner__circleRight-active');
|
||||
}
|
||||
},
|
||||
hide: function () {
|
||||
var elem = loadingElem;
|
||||
}
|
||||
|
||||
export function hide() {
|
||||
const elem = loadingElem;
|
||||
|
||||
if (elem) {
|
||||
elem.classList.remove('mdlSpinnerActive');
|
||||
|
@ -62,17 +58,17 @@ define(['css!./loading'], function () {
|
|||
elem.classList.remove('mdl-spinner__layer-3-active');
|
||||
elem.classList.remove('mdl-spinner__layer-4-active');
|
||||
|
||||
var i;
|
||||
var length;
|
||||
|
||||
for (i = 0, length = circleLefts.length; i < length; i++) {
|
||||
for (let i = 0, length = circleLefts.length; i < length; i++) {
|
||||
circleLefts[i].classList.remove('mdl-spinner__circleLeft-active');
|
||||
}
|
||||
|
||||
for (i = 0, length = circleRights.length; i < length; i++) {
|
||||
for (let i = 0, length = circleRights.length; i < length; i++) {
|
||||
circleRights[i].classList.remove('mdl-spinner__circleRight-active');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
show: show,
|
||||
hide: hide
|
||||
};
|
||||
|
|
|
@ -85,7 +85,7 @@ import 'flexStyles';
|
|||
refreshLibraryFromServer(dom.parentWithClass(button, 'dlg-libraryeditor'));
|
||||
}, () => {
|
||||
import('toast').then(({default: toast}) => {
|
||||
toast(globalize.translate('DefaultErrorMessage'));
|
||||
toast(globalize.translate('ErrorDefault'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -98,8 +98,8 @@ import 'flexStyles';
|
|||
if (listItem) {
|
||||
const index = parseInt(listItem.getAttribute('data-index'));
|
||||
const pathInfos = (currentOptions.library.LibraryOptions || {}).PathInfos || [];
|
||||
const pathInfo = null == index ? {} : pathInfos[index] || {};
|
||||
const originalPath = pathInfo.Path || (null == index ? null : currentOptions.library.Locations[index]);
|
||||
const pathInfo = index == null ? {} : pathInfos[index] || {};
|
||||
const originalPath = pathInfo.Path || (index == null ? null : currentOptions.library.Locations[index]);
|
||||
const btnRemovePath = dom.parentWithClass(e.target, 'btnRemovePath');
|
||||
|
||||
if (btnRemovePath) {
|
||||
|
@ -171,7 +171,7 @@ import 'flexStyles';
|
|||
const picker = new directoryBrowser();
|
||||
picker.show({
|
||||
enableNetworkSharePath: true,
|
||||
pathReadOnly: null != originalPath,
|
||||
pathReadOnly: originalPath != null,
|
||||
path: originalPath,
|
||||
networkSharePath: networkPath,
|
||||
callback: function (path, networkSharePath) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['serverNotifications', 'playbackManager', 'events', 'globalize', 'require'], function (serverNotifications, playbackManager, events, globalize, require) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
function onOneDocumentClick() {
|
||||
document.removeEventListener('click', onOneDocumentClick);
|
||||
document.removeEventListener('keydown', onOneDocumentClick);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -85,7 +85,7 @@
|
|||
<div class="selectContainer">
|
||||
<select is="emby-select" class="selectChromecastVersion" label="${LabelChromecastVersion}">
|
||||
<option value="stable">${LabelStable}</option>
|
||||
<option value="nightly">${LabelNightly}</option>
|
||||
<option value="unstable">${LabelUnstable}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'c
|
|||
var apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
apiClient.getLiveTvProgram(programId, apiClient.getCurrentUserId()).then(function (item) {
|
||||
playbackManager.play({
|
||||
playbackManager.default.play({
|
||||
ids: [item.ChannelId],
|
||||
serverId: serverId
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'imageLoader', 'scrollStyles', 'emby-button', 'emby-collapse', 'emby-input', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'material-icons', 'flexStyles'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper, imageLoader) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
var currentDialog;
|
||||
var recordingDeleted = false;
|
||||
var currentItemId;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['globalize', 'connectionManager', 'serverNotifications', 'require', 'loading', 'apphost', 'dom', 'recordingHelper', 'events', 'paper-icon-button-light', 'emby-button', 'css!./recordingfields', 'flexStyles'], function (globalize, connectionManager, serverNotifications, require, loading, appHost, dom, recordingHelper, events) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function loadData(parent, program, apiClient) {
|
||||
if (program.IsSeries) {
|
||||
parent.querySelector('.recordSeriesContainer').classList.remove('hide');
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['globalize', 'loading', 'connectionManager'], function (globalize, loading, connectionManager) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function changeRecordingToSeries(apiClient, timerId, programId, confirmTimerCancellation) {
|
||||
loading.show();
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'imageLoader', 'datetime', 'scrollStyles', 'emby-button', 'emby-checkbox', 'emby-input', 'emby-select', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'material-icons', 'flexStyles'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper, imageLoader, datetime) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
var currentDialog;
|
||||
var recordingUpdated = false;
|
||||
var recordingDeleted = false;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageLoader', 'playbackManager', 'nowPlayingHelper', 'events', 'connectionManager', 'apphost', 'globalize', 'layoutManager', 'userSettings', 'cardBuilder', 'itemContextMenu', 'cardStyle', 'emby-itemscontainer', 'css!./remotecontrol.css', 'emby-ratingbutton'], function (browser, datetime, backdrop, libraryBrowser, listView, imageLoader, playbackManager, nowPlayingHelper, events, connectionManager, appHost, globalize, layoutManager, userSettings, cardBuilder, itemContextMenu) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
var showMuteButton = true;
|
||||
var showVolumeSlider = true;
|
||||
|
||||
|
@ -48,7 +51,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
menuItems.unshift({
|
||||
id: -1,
|
||||
name: globalize.translate('ButtonOff'),
|
||||
selected: null == currentIndex
|
||||
selected: currentIndex == null
|
||||
});
|
||||
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
|
@ -69,18 +72,18 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
}
|
||||
|
||||
function seriesImageUrl(item, options) {
|
||||
if ('Episode' !== item.Type) {
|
||||
if (item.Type !== 'Episode') {
|
||||
return null;
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
options.type = options.type || 'Primary';
|
||||
if ('Primary' === options.type && item.SeriesPrimaryImageTag) {
|
||||
if (options.type === 'Primary' && item.SeriesPrimaryImageTag) {
|
||||
options.tag = item.SeriesPrimaryImageTag;
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||
}
|
||||
|
||||
if ('Thumb' === options.type) {
|
||||
if (options.type === 'Thumb') {
|
||||
if (item.SeriesThumbImageTag) {
|
||||
options.tag = item.SeriesThumbImageTag;
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||
|
@ -119,9 +122,9 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
var nowPlayingServerId = (item.ServerId || serverId);
|
||||
if (item.Type == 'Audio' || item.MediaStreams[0].Type == 'Audio') {
|
||||
var songName = item.Name;
|
||||
if (item.Album != null && item.Artists != null) {
|
||||
var artistsSeries = '';
|
||||
var albumName = item.Album;
|
||||
var albumName = '';
|
||||
if (item.Artists != null) {
|
||||
if (item.ArtistItems != null) {
|
||||
for (const artist of item.ArtistItems) {
|
||||
let artistName = artist.Name;
|
||||
|
@ -142,9 +145,12 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
}
|
||||
}
|
||||
}
|
||||
context.querySelector('.nowPlayingArtist').innerHTML = artistsSeries;
|
||||
context.querySelector('.nowPlayingAlbum').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.AlbumId + `&serverId=${nowPlayingServerId}">${albumName}</a>`;
|
||||
}
|
||||
if (item.Album != null) {
|
||||
albumName = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.AlbumId + `&serverId=${nowPlayingServerId}">` + item.Album + '</a>';
|
||||
}
|
||||
context.querySelector('.nowPlayingAlbum').innerHTML = albumName;
|
||||
context.querySelector('.nowPlayingArtist').innerHTML = artistsSeries;
|
||||
context.querySelector('.nowPlayingSongName').innerHTML = songName;
|
||||
} else if (item.Type == 'Episode') {
|
||||
if (item.SeasonName != null) {
|
||||
|
@ -171,9 +177,9 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
}
|
||||
|
||||
var url = item ? seriesImageUrl(item, {
|
||||
maxHeight: 300 * 2
|
||||
maxHeight: 300
|
||||
}) || imageUrl(item, {
|
||||
maxHeight: 300 * 2
|
||||
maxHeight: 300
|
||||
}) : null;
|
||||
|
||||
let contextButton = context.querySelector('.btnToggleContextMenu');
|
||||
|
@ -210,7 +216,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
backdrop.setBackdrops([item]);
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), item.Id).then(function (fullItem) {
|
||||
var userData = fullItem.UserData || {};
|
||||
var likes = null == userData.Likes ? '' : userData.Likes;
|
||||
var likes = userData.Likes == null ? '' : userData.Likes;
|
||||
context.querySelector('.nowPlayingPageUserDataButtonsTitle').innerHTML = '<button is="emby-ratingbutton" type="button" class="listItemButton paper-icon-button-light" data-id="' + fullItem.Id + '" data-serverid="' + fullItem.ServerId + '" data-itemtype="' + fullItem.Type + '" data-likes="' + likes + '" data-isfavorite="' + userData.IsFavorite + '"><span class="material-icons favorite"></span></button>';
|
||||
context.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '<button is="emby-ratingbutton" type="button" class="listItemButton paper-icon-button-light" data-id="' + fullItem.Id + '" data-serverid="' + fullItem.ServerId + '" data-itemtype="' + fullItem.Type + '" data-likes="' + likes + '" data-isfavorite="' + userData.IsFavorite + '"><span class="material-icons favorite"></span></button>';
|
||||
});
|
||||
|
@ -251,7 +257,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
var all = context.querySelectorAll('.btnCommand');
|
||||
|
||||
for (var i = 0, length = all.length; i < length; i++) {
|
||||
var enableButton = -1 !== commands.indexOf(all[i].getAttribute('data-command'));
|
||||
var enableButton = commands.indexOf(all[i].getAttribute('data-command')) !== -1;
|
||||
all[i].disabled = !enableButton;
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +284,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
currentPlayerSupportedCommands = supportedCommands;
|
||||
var playState = state.PlayState || {};
|
||||
var isSupportedCommands = supportedCommands.includes('DisplayMessage') || supportedCommands.includes('SendString') || supportedCommands.includes('Select');
|
||||
buttonVisible(context.querySelector('.btnToggleFullscreen'), item && 'Video' == item.MediaType && supportedCommands.includes('ToggleFullscreen'));
|
||||
buttonVisible(context.querySelector('.btnToggleFullscreen'), item && item.MediaType == 'Video' && supportedCommands.includes('ToggleFullscreen'));
|
||||
updateAudioTracksDisplay(player, context);
|
||||
updateSubtitleTracksDisplay(player, context);
|
||||
|
||||
|
@ -306,15 +312,15 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
context.querySelector('.remoteControlSection').classList.add('hide');
|
||||
}
|
||||
|
||||
buttonVisible(context.querySelector('.btnStop'), null != item);
|
||||
buttonVisible(context.querySelector('.btnNextTrack'), null != item);
|
||||
buttonVisible(context.querySelector('.btnPreviousTrack'), null != item);
|
||||
buttonVisible(context.querySelector('.btnStop'), item != null);
|
||||
buttonVisible(context.querySelector('.btnNextTrack'), item != null);
|
||||
buttonVisible(context.querySelector('.btnPreviousTrack'), item != null);
|
||||
if (layoutManager.mobile) {
|
||||
buttonVisible(context.querySelector('.btnRewind'), false);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), false);
|
||||
} else {
|
||||
buttonVisible(context.querySelector('.btnRewind'), null != item);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), null != item);
|
||||
buttonVisible(context.querySelector('.btnRewind'), item != null);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), item != null);
|
||||
}
|
||||
var positionSlider = context.querySelector('.nowPlayingPositionSlider');
|
||||
|
||||
|
@ -325,15 +331,15 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
|
||||
if (positionSlider && !positionSlider.dragging) {
|
||||
positionSlider.disabled = !playState.CanSeek;
|
||||
var isProgressClear = state.MediaSource && null == state.MediaSource.RunTimeTicks;
|
||||
var isProgressClear = state.MediaSource && state.MediaSource.RunTimeTicks == null;
|
||||
positionSlider.setIsClear(isProgressClear);
|
||||
}
|
||||
|
||||
updatePlayPauseState(playState.IsPaused, null != item);
|
||||
updatePlayPauseState(playState.IsPaused, item != null);
|
||||
updateTimeDisplay(playState.PositionTicks, item ? item.RunTimeTicks : null);
|
||||
updatePlayerVolumeState(context, playState.IsMuted, playState.VolumeLevel);
|
||||
|
||||
if (item && 'Video' == item.MediaType) {
|
||||
if (item && item.MediaType == 'Video') {
|
||||
context.classList.remove('hideVideoButtons');
|
||||
} else {
|
||||
context.classList.add('hideVideoButtons');
|
||||
|
@ -346,12 +352,12 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
|
||||
function updateAudioTracksDisplay(player, context) {
|
||||
var supportedCommands = currentPlayerSupportedCommands;
|
||||
buttonVisible(context.querySelector('.btnAudioTracks'), playbackManager.audioTracks(player).length > 1 && -1 != supportedCommands.indexOf('SetAudioStreamIndex'));
|
||||
buttonVisible(context.querySelector('.btnAudioTracks'), playbackManager.audioTracks(player).length > 1 && supportedCommands.indexOf('SetAudioStreamIndex') != -1);
|
||||
}
|
||||
|
||||
function updateSubtitleTracksDisplay(player, context) {
|
||||
var supportedCommands = currentPlayerSupportedCommands;
|
||||
buttonVisible(context.querySelector('.btnSubtitles'), playbackManager.subtitleTracks(player).length && -1 != supportedCommands.indexOf('SetSubtitleStreamIndex'));
|
||||
buttonVisible(context.querySelector('.btnSubtitles'), playbackManager.subtitleTracks(player).length && supportedCommands.indexOf('SetSubtitleStreamIndex') != -1);
|
||||
}
|
||||
|
||||
function updateRepeatModeDisplay(repeatMode) {
|
||||
|
@ -383,11 +389,11 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
var view = context;
|
||||
var supportedCommands = currentPlayerSupportedCommands;
|
||||
|
||||
if (-1 === supportedCommands.indexOf('Mute')) {
|
||||
if (supportedCommands.indexOf('Mute') === -1) {
|
||||
showMuteButton = false;
|
||||
}
|
||||
|
||||
if (-1 === supportedCommands.indexOf('SetVolume')) {
|
||||
if (supportedCommands.indexOf('SetVolume') === -1) {
|
||||
showVolumeSlider = false;
|
||||
}
|
||||
|
||||
|
@ -452,8 +458,8 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
}
|
||||
}
|
||||
|
||||
context.querySelector('.positionTime').innerHTML = null == positionTicks ? '--:--' : datetime.getDisplayRunningTime(positionTicks);
|
||||
context.querySelector('.runtime').innerHTML = null != runtimeTicks ? datetime.getDisplayRunningTime(runtimeTicks) : '--:--';
|
||||
context.querySelector('.positionTime').innerHTML = positionTicks == null ? '--:--' : datetime.getDisplayRunningTime(positionTicks);
|
||||
context.querySelector('.runtime').innerHTML = runtimeTicks != null ? datetime.getDisplayRunningTime(runtimeTicks) : '--:--';
|
||||
}
|
||||
|
||||
function getPlaylistItems(player) {
|
||||
|
|
|
@ -1,184 +0,0 @@
|
|||
define(['apphost', 'userSettings', 'browser', 'events', 'backdrop', 'globalize', 'require', 'appSettings'], function (appHost, userSettings, browser, events, backdrop, globalize, require, appSettings) {
|
||||
'use strict';
|
||||
|
||||
var themeStyleElement;
|
||||
var currentThemeId;
|
||||
|
||||
function unloadTheme() {
|
||||
var elem = themeStyleElement;
|
||||
if (elem) {
|
||||
elem.parentNode.removeChild(elem);
|
||||
themeStyleElement = null;
|
||||
currentThemeId = null;
|
||||
}
|
||||
}
|
||||
|
||||
function loadUserSkin(options) {
|
||||
options = options || {};
|
||||
if (options.start) {
|
||||
Emby.Page.invokeShortcut(options.start);
|
||||
} else {
|
||||
Emby.Page.goHome();
|
||||
}
|
||||
}
|
||||
|
||||
function getThemes() {
|
||||
return [{
|
||||
name: 'Apple TV',
|
||||
id: 'appletv'
|
||||
}, {
|
||||
name: 'Blue Radiance',
|
||||
id: 'blueradiance'
|
||||
}, {
|
||||
name: 'Dark',
|
||||
id: 'dark',
|
||||
isDefault: true,
|
||||
isDefaultServerDashboard: true
|
||||
}, {
|
||||
name: 'Light',
|
||||
id: 'light'
|
||||
}, {
|
||||
name: 'Purple Haze',
|
||||
id: 'purplehaze'
|
||||
}, {
|
||||
name: 'Windows Media Center',
|
||||
id: 'wmc'
|
||||
}];
|
||||
}
|
||||
|
||||
var skinManager = {
|
||||
getThemes: getThemes,
|
||||
loadUserSkin: loadUserSkin
|
||||
};
|
||||
|
||||
function getThemeStylesheetInfo(id, isDefaultProperty) {
|
||||
var themes = skinManager.getThemes();
|
||||
var defaultTheme;
|
||||
var selectedTheme;
|
||||
|
||||
for (var i = 0, length = themes.length; i < length; i++) {
|
||||
var theme = themes[i];
|
||||
if (theme[isDefaultProperty]) {
|
||||
defaultTheme = theme;
|
||||
}
|
||||
if (id === theme.id) {
|
||||
selectedTheme = theme;
|
||||
}
|
||||
}
|
||||
|
||||
selectedTheme = selectedTheme || defaultTheme;
|
||||
return {
|
||||
stylesheetPath: require.toUrl('themes/' + selectedTheme.id + '/theme.css'),
|
||||
themeId: selectedTheme.id
|
||||
};
|
||||
}
|
||||
|
||||
var themeResources = {};
|
||||
var lastSound = 0;
|
||||
var currentSound;
|
||||
|
||||
function loadThemeResources(id) {
|
||||
lastSound = 0;
|
||||
if (currentSound) {
|
||||
currentSound.stop();
|
||||
currentSound = null;
|
||||
}
|
||||
|
||||
backdrop.clearBackdrop();
|
||||
}
|
||||
|
||||
function onThemeLoaded() {
|
||||
document.documentElement.classList.remove('preload');
|
||||
try {
|
||||
var color = getComputedStyle(document.querySelector('.skinHeader')).getPropertyValue('background-color');
|
||||
if (color) {
|
||||
appHost.setThemeColor(color);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('error setting theme color: ' + err);
|
||||
}
|
||||
}
|
||||
|
||||
skinManager.setTheme = function (id, context) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (currentThemeId && currentThemeId === id) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
var isDefaultProperty = context === 'serverdashboard' ? 'isDefaultServerDashboard' : 'isDefault';
|
||||
var info = getThemeStylesheetInfo(id, isDefaultProperty);
|
||||
if (currentThemeId && currentThemeId === info.themeId) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
var linkUrl = info.stylesheetPath;
|
||||
unloadTheme();
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.setAttribute('rel', 'stylesheet');
|
||||
link.setAttribute('type', 'text/css');
|
||||
link.onload = function () {
|
||||
onThemeLoaded();
|
||||
resolve();
|
||||
};
|
||||
|
||||
link.setAttribute('href', linkUrl);
|
||||
document.head.appendChild(link);
|
||||
themeStyleElement = link;
|
||||
currentThemeId = info.themeId;
|
||||
loadThemeResources(info.themeId);
|
||||
|
||||
onViewBeforeShow({});
|
||||
});
|
||||
};
|
||||
|
||||
function onViewBeforeShow(e) {
|
||||
if (e.detail && e.detail.type === 'video-osd') {
|
||||
// This removes the space that the scrollbar takes while playing a video
|
||||
document.body.classList.remove('force-scroll');
|
||||
return;
|
||||
}
|
||||
|
||||
if (themeResources.backdrop) {
|
||||
backdrop.setBackdrop(themeResources.backdrop);
|
||||
}
|
||||
|
||||
if (!browser.mobile && userSettings.enableThemeSongs()) {
|
||||
if (lastSound === 0) {
|
||||
if (themeResources.themeSong) {
|
||||
playSound(themeResources.themeSong);
|
||||
}
|
||||
} else if ((new Date().getTime() - lastSound) > 30000) {
|
||||
if (themeResources.effect) {
|
||||
playSound(themeResources.effect);
|
||||
}
|
||||
}
|
||||
}
|
||||
// This keeps the scrollbar always present in all pages, so we avoid clipping while switching between pages
|
||||
// that need the scrollbar and pages that don't.
|
||||
document.body.classList.add('force-scroll');
|
||||
}
|
||||
|
||||
document.addEventListener('viewshow', onViewBeforeShow);
|
||||
|
||||
function playSound(path, volume) {
|
||||
lastSound = new Date().getTime();
|
||||
require(['howler'], function (howler) {
|
||||
/* globals Howl */
|
||||
try {
|
||||
var sound = new Howl({
|
||||
src: [path],
|
||||
volume: volume || 0.1
|
||||
});
|
||||
sound.play();
|
||||
currentSound = sound;
|
||||
} catch (err) {
|
||||
console.error('error playing sound: ' + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return skinManager;
|
||||
});
|
|
@ -5,6 +5,8 @@
|
|||
define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'focusManager', 'browser', 'apphost', 'dom', 'css!./style', 'material-icons', 'paper-icon-button-light'], function (dialogHelper, inputManager, connectionManager, layoutManager, focusManager, browser, appHost, dom) {
|
||||
'use strict';
|
||||
|
||||
browser = browser.default || browser;
|
||||
|
||||
/**
|
||||
* Name of transition event.
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['dialogHelper', 'require', 'layoutManager', 'globalize', 'userSettings', 'connectionManager', 'loading', 'focusManager', 'dom', 'apphost', 'emby-select', 'listViewStyle', 'paper-icon-button-light', 'css!./../formdialog', 'material-icons', 'css!./subtitleeditor', 'emby-button', 'flexStyles'], function (dialogHelper, require, layoutManager, globalize, userSettings, connectionManager, loading, focusManager, dom, appHost) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
var currentItem;
|
||||
var hasChanges;
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['playbackManager', 'layoutManager', 'text!./subtitlesync.template.html', 'css!./subtitlesync'], function (playbackManager, layoutManager, template, css) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
var player;
|
||||
var subtitleSyncSlider;
|
||||
var subtitleSyncTextField;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['playbackManager', 'userSettings', 'connectionManager'], function (playbackManager, userSettings, connectionManager) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
var currentOwnerId;
|
||||
var currentThemeIds = [];
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
define(['dialogHelper', 'dom', 'layoutManager', 'connectionManager', 'globalize', 'loading', 'browser', 'focusManager', 'scrollHelper', 'material-icons', 'formDialogStyle', 'emby-button', 'emby-itemscontainer', 'cardStyle'], function (dialogHelper, dom, layoutManager, connectionManager, globalize, loading, browser, focusManager, scrollHelper) {
|
||||
'use strict';
|
||||
|
||||
browser = browser.default || browser;
|
||||
loading = loading.default || loading;
|
||||
|
||||
var enableFocusTransform = !browser.slow && !browser.edge;
|
||||
|
||||
function getEditorHtml() {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'listViewStyle', 'emby-input', 'emby-select', 'emby-button', 'flexStyles'], function ($, loading, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
return function (page, providerId, options) {
|
||||
function reload() {
|
||||
loading.show();
|
||||
|
@ -42,7 +44,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'listViewStyle', 'emb
|
|||
for (var region in result) {
|
||||
var countries = result[region];
|
||||
|
||||
if (countries.length && 'ZZZ' !== region) {
|
||||
if (countries.length && region !== 'ZZZ') {
|
||||
for (i = 0, length = countries.length; i < length; i++) {
|
||||
countryList.push({
|
||||
name: countries[i].fullName,
|
||||
|
@ -237,7 +239,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'listViewStyle', 'emb
|
|||
var device = devices[i];
|
||||
html += '<div class="listItem">';
|
||||
var enabledTuners = providerInfo.EnabledTuners || [];
|
||||
var isChecked = providerInfo.EnableAllTuners || -1 !== enabledTuners.indexOf(device.Id);
|
||||
var isChecked = providerInfo.EnableAllTuners || enabledTuners.indexOf(device.Id) !== -1;
|
||||
var checkedAttribute = isChecked ? ' checked' : '';
|
||||
html += '<label class="checkboxContainer listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" data-id="' + device.Id + '" class="chkTuner" ' + checkedAttribute + '/><span></span></label>';
|
||||
html += '<div class="listItemBody two-line">';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-input', 'listViewStyle', 'paper-icon-button-light'], function ($, loading, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
return function (page, providerId, options) {
|
||||
function getListingProvider(config, id) {
|
||||
if (config && id) {
|
||||
|
@ -84,7 +86,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-input', 'listVi
|
|||
}).then(function (result) {
|
||||
loading.hide();
|
||||
|
||||
if (false !== options.showConfirmation) {
|
||||
if (options.showConfirmation !== false) {
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
}
|
||||
|
||||
|
@ -118,7 +120,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-input', 'listVi
|
|||
var device = devices[i];
|
||||
html += '<div class="listItem">';
|
||||
var enabledTuners = providerInfo.EnabledTuners || [];
|
||||
var isChecked = providerInfo.EnableAllTuners || -1 !== enabledTuners.indexOf(device.Id);
|
||||
var isChecked = providerInfo.EnableAllTuners || enabledTuners.indexOf(device.Id) !== -1;
|
||||
var checkedAttribute = isChecked ? ' checked' : '';
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkTuner" data-id="' + device.Id + '" ' + checkedAttribute + '><span></span></label>';
|
||||
html += '<div class="listItemBody two-line">';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['dom', 'playbackManager', 'connectionManager', 'events', 'mediaInfo', 'layoutManager', 'focusManager', 'globalize', 'itemHelper', 'css!./upnextdialog', 'emby-button', 'flexStyles'], function (dom, playbackManager, connectionManager, events, mediaInfo, layoutManager, focusManager, globalize, itemHelper) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
var transitionEndEventName = dom.whichTransitionEvent();
|
||||
|
||||
function seriesImageUrl(item, options) {
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewContainer'], function (browser, dom, layoutManager) {
|
||||
'use strict';
|
||||
import 'css!components/viewManager/viewContainer';
|
||||
/* eslint-disable indent */
|
||||
|
||||
function setControllerClass(view, options) {
|
||||
if (options.controllerFactory) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
var controllerUrl = view.getAttribute('data-controller');
|
||||
let controllerUrl = view.getAttribute('data-controller');
|
||||
|
||||
if (controllerUrl) {
|
||||
if (0 === controllerUrl.indexOf('__plugin/')) {
|
||||
if (controllerUrl.indexOf('__plugin/') === 0) {
|
||||
controllerUrl = controllerUrl.substring('__plugin/'.length);
|
||||
}
|
||||
|
||||
controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl);
|
||||
return getRequirePromise([controllerUrl]).then(function (ControllerFactory) {
|
||||
return import(controllerUrl).then((ControllerFactory) => {
|
||||
options.controllerFactory = ControllerFactory;
|
||||
});
|
||||
}
|
||||
|
@ -22,38 +22,30 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function getRequirePromise(deps) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
require(deps, resolve);
|
||||
});
|
||||
}
|
||||
|
||||
function loadView(options) {
|
||||
export function loadView(options) {
|
||||
if (!options.cancel) {
|
||||
var selected = selectedPageIndex;
|
||||
var previousAnimatable = -1 === selected ? null : allPages[selected];
|
||||
var pageIndex = selected + 1;
|
||||
const selected = selectedPageIndex;
|
||||
const previousAnimatable = selected === -1 ? null : allPages[selected];
|
||||
let pageIndex = selected + 1;
|
||||
|
||||
if (pageIndex >= pageContainerCount) {
|
||||
pageIndex = 0;
|
||||
}
|
||||
|
||||
var isPluginpage = -1 !== options.url.toLowerCase().indexOf('/configurationpage');
|
||||
var newViewInfo = normalizeNewView(options, isPluginpage);
|
||||
var newView = newViewInfo.elem;
|
||||
var modulesToLoad = [];
|
||||
const isPluginpage = options.url.toLowerCase().indexOf('/configurationpage') !== -1;
|
||||
const newViewInfo = normalizeNewView(options, isPluginpage);
|
||||
const newView = newViewInfo.elem;
|
||||
|
||||
return new Promise(function (resolve) {
|
||||
require(modulesToLoad, function () {
|
||||
var currentPage = allPages[pageIndex];
|
||||
return new Promise((resolve) => {
|
||||
const currentPage = allPages[pageIndex];
|
||||
|
||||
if (currentPage) {
|
||||
triggerDestroy(currentPage);
|
||||
}
|
||||
|
||||
var view = newView;
|
||||
let view = newView;
|
||||
|
||||
if ('string' == typeof view) {
|
||||
if (typeof view == 'string') {
|
||||
view = document.createElement('div');
|
||||
view.innerHTML = newView;
|
||||
}
|
||||
|
@ -62,8 +54,8 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
|
||||
if (currentPage) {
|
||||
if (newViewInfo.hasScript && window.$) {
|
||||
view = $(view).appendTo(mainAnimatedPages)[0];
|
||||
mainAnimatedPages.removeChild(currentPage);
|
||||
view = $(view).appendTo(mainAnimatedPages)[0];
|
||||
} else {
|
||||
mainAnimatedPages.replaceChild(view, currentPage);
|
||||
}
|
||||
|
@ -79,7 +71,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
view.setAttribute('data-type', options.type);
|
||||
}
|
||||
|
||||
var properties = [];
|
||||
const properties = [];
|
||||
|
||||
if (options.fullscreen) {
|
||||
properties.push('fullscreen');
|
||||
|
@ -90,7 +82,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
}
|
||||
|
||||
allPages[pageIndex] = view;
|
||||
setControllerClass(view, options).then(function () {
|
||||
setControllerClass(view, options).then(() => {
|
||||
if (onBeforeChange) {
|
||||
onBeforeChange(view, false, options);
|
||||
}
|
||||
|
@ -111,7 +103,6 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
resolve(view);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,33 +116,33 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
html = replaceAll(html, '<\/script>--\x3e', '<\/script>');
|
||||
}
|
||||
|
||||
var wrapper = document.createElement('div');
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.innerHTML = html;
|
||||
return wrapper.querySelector('div[data-role="page"]');
|
||||
}
|
||||
|
||||
function normalizeNewView(options, isPluginpage) {
|
||||
var viewHtml = options.view;
|
||||
const viewHtml = options.view;
|
||||
|
||||
if (-1 === viewHtml.indexOf('data-role="page"')) {
|
||||
if (viewHtml.indexOf('data-role="page"') === -1) {
|
||||
return viewHtml;
|
||||
}
|
||||
|
||||
var hasScript = -1 !== viewHtml.indexOf('<script');
|
||||
var elem = parseHtml(viewHtml, hasScript);
|
||||
let hasScript = viewHtml.indexOf('<script') !== -1;
|
||||
const elem = parseHtml(viewHtml, hasScript);
|
||||
|
||||
if (hasScript) {
|
||||
hasScript = null != elem.querySelector('script');
|
||||
hasScript = elem.querySelector('script') != null;
|
||||
}
|
||||
|
||||
var hasjQuery = false;
|
||||
var hasjQuerySelect = false;
|
||||
var hasjQueryChecked = false;
|
||||
let hasjQuery = false;
|
||||
let hasjQuerySelect = false;
|
||||
let hasjQueryChecked = false;
|
||||
|
||||
if (isPluginpage) {
|
||||
hasjQuery = -1 != viewHtml.indexOf('jQuery') || -1 != viewHtml.indexOf('$(') || -1 != viewHtml.indexOf('$.');
|
||||
hasjQueryChecked = -1 != viewHtml.indexOf('.checked(');
|
||||
hasjQuerySelect = -1 != viewHtml.indexOf('.selectmenu(');
|
||||
hasjQuery = viewHtml.indexOf('jQuery') != -1 || viewHtml.indexOf('$(') != -1 || viewHtml.indexOf('$.') != -1;
|
||||
hasjQueryChecked = viewHtml.indexOf('.checked(') != -1;
|
||||
hasjQuerySelect = viewHtml.indexOf('.selectmenu(') != -1;
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -164,7 +155,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
}
|
||||
|
||||
function beforeAnimate(allPages, newPageIndex, oldPageIndex) {
|
||||
for (var index = 0, length = allPages.length; index < length; index++) {
|
||||
for (let index = 0, length = allPages.length; index < length; index++) {
|
||||
if (newPageIndex !== index && oldPageIndex !== index) {
|
||||
allPages[index].classList.add('hide');
|
||||
}
|
||||
|
@ -172,33 +163,33 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
}
|
||||
|
||||
function afterAnimate(allPages, newPageIndex) {
|
||||
for (var index = 0, length = allPages.length; index < length; index++) {
|
||||
for (let index = 0, length = allPages.length; index < length; index++) {
|
||||
if (newPageIndex !== index) {
|
||||
allPages[index].classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setOnBeforeChange(fn) {
|
||||
export function setOnBeforeChange(fn) {
|
||||
onBeforeChange = fn;
|
||||
}
|
||||
|
||||
function tryRestoreView(options) {
|
||||
var url = options.url;
|
||||
var index = currentUrls.indexOf(url);
|
||||
export function tryRestoreView(options) {
|
||||
const url = options.url;
|
||||
const index = currentUrls.indexOf(url);
|
||||
|
||||
if (-1 !== index) {
|
||||
var animatable = allPages[index];
|
||||
var view = animatable;
|
||||
if (index !== -1) {
|
||||
const animatable = allPages[index];
|
||||
const view = animatable;
|
||||
|
||||
if (view) {
|
||||
if (options.cancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
var selected = selectedPageIndex;
|
||||
var previousAnimatable = -1 === selected ? null : allPages[selected];
|
||||
return setControllerClass(view, options).then(function () {
|
||||
const selected = selectedPageIndex;
|
||||
const previousAnimatable = selected === -1 ? null : allPages[selected];
|
||||
return setControllerClass(view, options).then(() => {
|
||||
if (onBeforeChange) {
|
||||
onBeforeChange(view, true, options);
|
||||
}
|
||||
|
@ -228,25 +219,28 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
|
|||
view.dispatchEvent(new CustomEvent('viewdestroy', {}));
|
||||
}
|
||||
|
||||
function reset() {
|
||||
export function reset() {
|
||||
allPages = [];
|
||||
currentUrls = [];
|
||||
mainAnimatedPages.innerHTML = '';
|
||||
selectedPageIndex = -1;
|
||||
}
|
||||
|
||||
var onBeforeChange;
|
||||
var mainAnimatedPages = document.querySelector('.mainAnimatedPages');
|
||||
var allPages = [];
|
||||
var currentUrls = [];
|
||||
var pageContainerCount = 3;
|
||||
var selectedPageIndex = -1;
|
||||
let onBeforeChange;
|
||||
const mainAnimatedPages = document.querySelector('.mainAnimatedPages');
|
||||
let allPages = [];
|
||||
let currentUrls = [];
|
||||
const pageContainerCount = 3;
|
||||
let selectedPageIndex = -1;
|
||||
reset();
|
||||
mainAnimatedPages.classList.remove('hide');
|
||||
return {
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
||||
export default {
|
||||
loadView: loadView,
|
||||
tryRestoreView: tryRestoreView,
|
||||
reset: reset,
|
||||
setOnBeforeChange: setOnBeforeChange
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,37 @@
|
|||
{
|
||||
"multiserver": false
|
||||
"multiserver": false,
|
||||
"themes": [
|
||||
{
|
||||
"name": "Apple TV",
|
||||
"id": "appletv"
|
||||
}, {
|
||||
"name": "Blue Radiance",
|
||||
"id": "blueradiance"
|
||||
}, {
|
||||
"name": "Dark",
|
||||
"id": "dark",
|
||||
"default": true
|
||||
}, {
|
||||
"name": "Light",
|
||||
"id": "light"
|
||||
}, {
|
||||
"name": "Purple Haze",
|
||||
"id": "purplehaze"
|
||||
}, {
|
||||
"name": "WMC",
|
||||
"id": "wmc"
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
"plugins/playAccessValidation/plugin",
|
||||
"plugins/experimentalWarnings/plugin",
|
||||
"plugins/htmlAudioPlayer/plugin",
|
||||
"plugins/photoPlayer/plugin",
|
||||
"plugins/bookPlayer/plugin",
|
||||
"plugins/youtubePlayer/plugin",
|
||||
"plugins/backdropScreensaver/plugin",
|
||||
"plugins/logoScreensaver/plugin",
|
||||
"plugins/sessionPlayer/plugin",
|
||||
"plugins/chromecastPlayer/plugin"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ import 'emby-itemscontainer';
|
|||
btnCssClass = session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length ? '' : ' hide';
|
||||
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionInfo paper-icon-button-light ' + btnCssClass + '" title="' + globalize.translate('ViewPlaybackInfo') + '"><span class="material-icons info"></span></button>';
|
||||
|
||||
btnCssClass = session.ServerId && -1 !== session.SupportedCommands.indexOf('DisplayMessage') && session.DeviceId !== connectionManager.deviceId() ? '' : ' hide';
|
||||
btnCssClass = session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1 && session.DeviceId !== connectionManager.deviceId() ? '' : ' hide';
|
||||
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionSendMessage paper-icon-button-light ' + btnCssClass + '" title="' + globalize.translate('SendMessage') + '"><span class="material-icons message"></span></button>';
|
||||
html += '</div>';
|
||||
|
||||
|
@ -346,7 +346,7 @@ import 'emby-itemscontainer';
|
|||
function renderRunningTasks(view, tasks) {
|
||||
let html = '';
|
||||
tasks = tasks.filter(function (task) {
|
||||
if ('Idle' != task.State) {
|
||||
if (task.State != 'Idle') {
|
||||
return !task.IsHidden;
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ import 'emby-itemscontainer';
|
|||
row.classList.remove('playingSession');
|
||||
}
|
||||
|
||||
if (session.ServerId && -1 !== session.SupportedCommands.indexOf('DisplayMessage') && session.DeviceId !== connectionManager.deviceId()) {
|
||||
if (session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1 && session.DeviceId !== connectionManager.deviceId()) {
|
||||
row.querySelector('.btnSessionSendMessage').classList.remove('hide');
|
||||
} else {
|
||||
row.querySelector('.btnSessionSendMessage').classList.add('hide');
|
||||
|
|
|
@ -29,7 +29,7 @@ import 'listViewStyle';
|
|||
function renderProfile(page, profile, users) {
|
||||
$('#txtName', page).val(profile.Name);
|
||||
$('.chkMediaType', page).each(function () {
|
||||
this.checked = -1 != (profile.SupportedMediaTypes || '').split(',').indexOf(this.getAttribute('data-value'));
|
||||
this.checked = (profile.SupportedMediaTypes || '').split(',').indexOf(this.getAttribute('data-value')) != -1;
|
||||
});
|
||||
$('#chkEnableAlbumArtInDidl', page).prop('checked', profile.EnableAlbumArtInDidl);
|
||||
$('#chkEnableSingleImageLimit', page).prop('checked', profile.EnableSingleAlbumArtLimit);
|
||||
|
@ -111,7 +111,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editIdentificationHeader(page, header) {
|
||||
isSubProfileNew = null == header;
|
||||
isSubProfileNew = header == null;
|
||||
header = header || {};
|
||||
currentSubProfile = header;
|
||||
const popup = $('#identificationHeaderPopup', page);
|
||||
|
@ -156,7 +156,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editXmlDocumentAttribute(page, attribute) {
|
||||
isSubProfileNew = null == attribute;
|
||||
isSubProfileNew = attribute == null;
|
||||
attribute = attribute || {};
|
||||
currentSubProfile = attribute;
|
||||
const popup = $('#xmlAttributePopup', page);
|
||||
|
@ -204,7 +204,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editSubtitleProfile(page, profile) {
|
||||
isSubProfileNew = null == profile;
|
||||
isSubProfileNew = profile == null;
|
||||
profile = profile || {};
|
||||
currentSubProfile = profile;
|
||||
const popup = $('#subtitleProfilePopup', page);
|
||||
|
@ -266,11 +266,11 @@ import 'listViewStyle';
|
|||
html += '<a is="emby-linkbutton" href="#" class="lnkEditSubProfile" data-profileindex="' + index + '">';
|
||||
html += '<p>' + globalize.translate('ValueContainer', profile.Container || allText) + '</p>';
|
||||
|
||||
if ('Video' == profile.Type) {
|
||||
if (profile.Type == 'Video') {
|
||||
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
||||
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
||||
} else {
|
||||
if ('Audio' == profile.Type) {
|
||||
if (profile.Type == 'Audio') {
|
||||
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
||||
}
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editDirectPlayProfile(page, directPlayProfile) {
|
||||
isSubProfileNew = null == directPlayProfile;
|
||||
isSubProfileNew = directPlayProfile == null;
|
||||
directPlayProfile = directPlayProfile || {};
|
||||
currentSubProfile = directPlayProfile;
|
||||
const popup = $('#popupEditDirectPlayProfile', page);
|
||||
|
@ -327,11 +327,11 @@ import 'listViewStyle';
|
|||
html += '<p>Protocol: ' + (profile.Protocol || 'Http') + '</p>';
|
||||
html += '<p>' + globalize.translate('ValueContainer', profile.Container || allText) + '</p>';
|
||||
|
||||
if ('Video' == profile.Type) {
|
||||
if (profile.Type == 'Video') {
|
||||
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
||||
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
||||
} else {
|
||||
if ('Audio' == profile.Type) {
|
||||
if (profile.Type == 'Audio') {
|
||||
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
||||
}
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editTranscodingProfile(page, transcodingProfile) {
|
||||
isSubProfileNew = null == transcodingProfile;
|
||||
isSubProfileNew = transcodingProfile == null;
|
||||
transcodingProfile = transcodingProfile || {};
|
||||
currentSubProfile = transcodingProfile;
|
||||
const popup = $('#transcodingProfilePopup', page);
|
||||
|
@ -365,7 +365,7 @@ import 'listViewStyle';
|
|||
$('#selectTranscodingProtocol', popup).val(transcodingProfile.Protocol || 'Http');
|
||||
$('#chkEnableMpegtsM2TsMode', popup).prop('checked', transcodingProfile.EnableMpegtsM2TsMode || false);
|
||||
$('#chkEstimateContentLength', popup).prop('checked', transcodingProfile.EstimateContentLength || false);
|
||||
$('#chkReportByteRangeRequests', popup).prop('checked', 'Bytes' == transcodingProfile.TranscodeSeekInfo);
|
||||
$('#chkReportByteRangeRequests', popup).prop('checked', transcodingProfile.TranscodeSeekInfo == 'Bytes');
|
||||
$('.radioTabButton:first', popup).trigger('click');
|
||||
openPopup(popup[0]);
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editContainerProfile(page, containerProfile) {
|
||||
isSubProfileNew = null == containerProfile;
|
||||
isSubProfileNew = containerProfile == null;
|
||||
containerProfile = containerProfile || {};
|
||||
currentSubProfile = containerProfile;
|
||||
const popup = $('#containerProfilePopup', page);
|
||||
|
@ -515,7 +515,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editCodecProfile(page, codecProfile) {
|
||||
isSubProfileNew = null == codecProfile;
|
||||
isSubProfileNew = codecProfile == null;
|
||||
codecProfile = codecProfile || {};
|
||||
currentSubProfile = codecProfile;
|
||||
const popup = $('#codecProfilePopup', page);
|
||||
|
@ -555,11 +555,11 @@ import 'listViewStyle';
|
|||
html += '<a is="emby-linkbutton" href="#" class="lnkEditSubProfile" data-profileindex="' + i + '">';
|
||||
html += '<p>' + globalize.translate('ValueContainer', profile.Container || allText) + '</p>';
|
||||
|
||||
if ('Video' == profile.Type) {
|
||||
if (profile.Type == 'Video') {
|
||||
html += '<p>' + globalize.translate('ValueVideoCodec', profile.VideoCodec || allText) + '</p>';
|
||||
html += '<p>' + globalize.translate('ValueAudioCodec', profile.AudioCodec || allText) + '</p>';
|
||||
} else {
|
||||
if ('Audio' == profile.Type) {
|
||||
if (profile.Type == 'Audio') {
|
||||
html += '<p>' + globalize.translate('ValueCodec', profile.AudioCodec || allText) + '</p>';
|
||||
}
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function editResponseProfile(page, responseProfile) {
|
||||
isSubProfileNew = null == responseProfile;
|
||||
isSubProfileNew = responseProfile == null;
|
||||
responseProfile = responseProfile || {};
|
||||
currentSubProfile = responseProfile;
|
||||
const popup = $('#responseProfilePopup', page);
|
||||
|
@ -703,26 +703,26 @@ import 'listViewStyle';
|
|||
$('.radioTabButton', page).on('click', function () {
|
||||
$(this).siblings().removeClass('ui-btn-active');
|
||||
$(this).addClass('ui-btn-active');
|
||||
const value = 'A' == this.tagName ? this.getAttribute('data-value') : this.value;
|
||||
const value = this.tagName == 'A' ? this.getAttribute('data-value') : this.value;
|
||||
const elem = $('.' + value, page);
|
||||
elem.siblings('.tabContent').hide();
|
||||
elem.show();
|
||||
});
|
||||
$('#selectDirectPlayProfileType', page).on('change', function () {
|
||||
if ('Video' == this.value) {
|
||||
if (this.value == 'Video') {
|
||||
$('#fldDirectPlayVideoCodec', page).show();
|
||||
} else {
|
||||
$('#fldDirectPlayVideoCodec', page).hide();
|
||||
}
|
||||
|
||||
if ('Photo' == this.value) {
|
||||
if (this.value == 'Photo') {
|
||||
$('#fldDirectPlayAudioCodec', page).hide();
|
||||
} else {
|
||||
$('#fldDirectPlayAudioCodec', page).show();
|
||||
}
|
||||
});
|
||||
$('#selectTranscodingProfileType', page).on('change', function () {
|
||||
if ('Video' == this.value) {
|
||||
if (this.value == 'Video') {
|
||||
$('#fldTranscodingVideoCodec', page).show();
|
||||
$('#fldTranscodingProtocol', page).show();
|
||||
$('#fldEnableMpegtsM2TsMode', page).show();
|
||||
|
@ -732,7 +732,7 @@ import 'listViewStyle';
|
|||
$('#fldEnableMpegtsM2TsMode', page).hide();
|
||||
}
|
||||
|
||||
if ('Photo' == this.value) {
|
||||
if (this.value == 'Photo') {
|
||||
$('#fldTranscodingAudioCodec', page).hide();
|
||||
$('#fldEstimateContentLength', page).hide();
|
||||
$('#fldReportByteRangeRequests', page).hide();
|
||||
|
@ -743,13 +743,13 @@ import 'listViewStyle';
|
|||
}
|
||||
});
|
||||
$('#selectResponseProfileType', page).on('change', function () {
|
||||
if ('Video' == this.value) {
|
||||
if (this.value == 'Video') {
|
||||
$('#fldResponseProfileVideoCodec', page).show();
|
||||
} else {
|
||||
$('#fldResponseProfileVideoCodec', page).hide();
|
||||
}
|
||||
|
||||
if ('Photo' == this.value) {
|
||||
if (this.value == 'Photo') {
|
||||
$('#fldResponseProfileAudioCodec', page).hide();
|
||||
} else {
|
||||
$('#fldResponseProfileAudioCodec', page).show();
|
||||
|
|
|
@ -18,13 +18,13 @@ import 'emby-button';
|
|||
|
||||
function renderUserProfiles(page, profiles) {
|
||||
renderProfiles(page, page.querySelector('.customProfiles'), profiles.filter(function (p) {
|
||||
return 'User' == p.Type;
|
||||
return p.Type == 'User';
|
||||
}));
|
||||
}
|
||||
|
||||
function renderSystemProfiles(page, profiles) {
|
||||
renderProfiles(page, page.querySelector('.systemProfiles'), profiles.filter(function (p) {
|
||||
return 'System' == p.Type;
|
||||
return p.Type == 'System';
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ import 'emby-button';
|
|||
html += '</a>';
|
||||
html += '</div>';
|
||||
|
||||
if ('User' == profile.Type) {
|
||||
if (profile.Type == 'User') {
|
||||
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile" data-profileid="' + profile.Id + '" title="' + globalize.translate('ButtonDelete') + '"><span class="material-icons delete"></span></button>';
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import libraryMenu from 'libraryMenu';
|
|||
|
||||
function loadPage(page, config, systemInfo) {
|
||||
Array.prototype.forEach.call(page.querySelectorAll('.chkDecodeCodec'), function (c) {
|
||||
c.checked = -1 !== (config.HardwareDecodingCodecs || []).indexOf(c.getAttribute('data-codec'));
|
||||
c.checked = (config.HardwareDecodingCodecs || []).indexOf(c.getAttribute('data-codec')) !== -1;
|
||||
});
|
||||
page.querySelector('#chkDecodingColorDepth10Hevc').checked = config.EnableDecodingColorDepth10Hevc;
|
||||
page.querySelector('#chkDecodingColorDepth10Vp9').checked = config.EnableDecodingColorDepth10Vp9;
|
||||
|
@ -81,7 +81,7 @@ import libraryMenu from 'libraryMenu';
|
|||
updateEncoder(form);
|
||||
}, function () {
|
||||
import('alert').then(({default: alert}) => {
|
||||
alert(globalize.translate('DefaultErrorMessage'));
|
||||
alert(globalize.translate('ErrorDefault'));
|
||||
});
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
@ -107,7 +107,7 @@ import libraryMenu from 'libraryMenu';
|
|||
value = value || '';
|
||||
let any;
|
||||
Array.prototype.forEach.call(context.querySelectorAll('.chkDecodeCodec'), function (c) {
|
||||
if (-1 === c.getAttribute('data-types').split(',').indexOf(value)) {
|
||||
if (c.getAttribute('data-types').split(',').indexOf(value) === -1) {
|
||||
dom.parentWithTag(c, 'LABEL').classList.add('hide');
|
||||
} else {
|
||||
dom.parentWithTag(c, 'LABEL').classList.remove('hide');
|
||||
|
@ -138,7 +138,7 @@ import libraryMenu from 'libraryMenu';
|
|||
$(document).on('pageinit', '#encodingSettingsPage', function () {
|
||||
const page = this;
|
||||
page.querySelector('#selectVideoDecoder').addEventListener('change', function () {
|
||||
if ('vaapi' == this.value) {
|
||||
if (this.value == 'vaapi') {
|
||||
page.querySelector('.fldVaapiDevice').classList.remove('hide');
|
||||
page.querySelector('#txtVaapiDevice').setAttribute('required', 'required');
|
||||
} else {
|
||||
|
|
|
@ -52,7 +52,7 @@ import 'emby-button';
|
|||
});
|
||||
}, function () {
|
||||
import('alert').then(({default: alert}) => {
|
||||
alert(globalize.translate('DefaultErrorMessage'));
|
||||
alert(globalize.translate('ErrorDefault'));
|
||||
});
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
|
|
@ -48,7 +48,7 @@ import 'emby-button';
|
|||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
ApiClient.getNamedConfiguration('metadata').then(function(config) {
|
||||
config.UseFileCreationTimeForDateAdded = '1' === $('#selectDateAdded', form).val();
|
||||
config.UseFileCreationTimeForDateAdded = $('#selectDateAdded', form).val() === '1';
|
||||
ApiClient.updateNamedConfiguration('metadata', config);
|
||||
});
|
||||
|
||||
|
@ -61,7 +61,7 @@ import 'emby-button';
|
|||
libraryMenu.setTabs('librarysetup', 1, getTabs);
|
||||
loadData();
|
||||
ApiClient.getSystemInfo().then(function(info) {
|
||||
if ('Windows' === info.OperatingSystem) {
|
||||
if (info.OperatingSystem === 'Windows') {
|
||||
view.querySelector('.fldSaveMetadataHidden').classList.remove('hide');
|
||||
} else {
|
||||
view.querySelector('.fldSaveMetadataHidden').classList.add('hide');
|
||||
|
|
|
@ -156,7 +156,7 @@ import 'emby-itemrefreshindicator';
|
|||
}
|
||||
|
||||
function shouldRefreshLibraryAfterChanges(page) {
|
||||
return 'mediaLibraryPage' === page.id;
|
||||
return page.id === 'mediaLibraryPage';
|
||||
}
|
||||
|
||||
function reloadVirtualFolders(page, virtualFolders) {
|
||||
|
@ -286,7 +286,7 @@ import 'emby-itemrefreshindicator';
|
|||
|
||||
if (hasCardImageContainer) {
|
||||
html += '<div class="cardIndicators backdropCardIndicators">';
|
||||
html += '<div is="emby-itemrefreshindicator"' + (virtualFolder.RefreshProgress || virtualFolder.RefreshStatus && 'Idle' !== virtualFolder.RefreshStatus ? '' : ' class="hide"') + ' data-progress="' + (virtualFolder.RefreshProgress || 0) + '" data-status="' + virtualFolder.RefreshStatus + '"></div>';
|
||||
html += '<div is="emby-itemrefreshindicator"' + (virtualFolder.RefreshProgress || virtualFolder.RefreshStatus && virtualFolder.RefreshStatus !== 'Idle' ? '' : ' class="hide"') + ' data-progress="' + (virtualFolder.RefreshProgress || 0) + '" data-status="' + virtualFolder.RefreshStatus + '"></div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import 'emby-select';
|
|||
}).filter(function (s) {
|
||||
return s.length > 0;
|
||||
});
|
||||
config.IsRemoteIPFilterBlacklist = 'blacklist' === form.querySelector('#selectExternalAddressFilterMode').value;
|
||||
config.IsRemoteIPFilterBlacklist = form.querySelector('#selectExternalAddressFilterMode').value === 'blacklist';
|
||||
config.PublicPort = form.querySelector('#txtPublicPort').value;
|
||||
config.PublicHttpsPort = form.querySelector('#txtPublicHttpsPort').value;
|
||||
config.HttpServerPortNumber = form.querySelector('#txtPortNumber').value;
|
||||
|
@ -110,7 +110,7 @@ import 'emby-select';
|
|||
page.querySelector('#txtLanNetworks').value = (config.LocalNetworkSubnets || []).join(', ');
|
||||
page.querySelector('#txtExternalAddressFilter').value = (config.RemoteIPFilter || []).join(', ');
|
||||
page.querySelector('#selectExternalAddressFilterMode').value = config.IsRemoteIPFilterBlacklist ? 'blacklist' : 'whitelist';
|
||||
page.querySelector('#chkRemoteAccess').checked = null == config.EnableRemoteAccess || config.EnableRemoteAccess;
|
||||
page.querySelector('#chkRemoteAccess').checked = config.EnableRemoteAccess == null || config.EnableRemoteAccess;
|
||||
page.querySelector('#txtHttpsPort').value = config.HttpsPortNumber;
|
||||
page.querySelector('#chkEnableHttps').checked = config.EnableHttps;
|
||||
page.querySelector('#chkRequireHttps').checked = config.RequireHttps;
|
||||
|
|
|
@ -106,7 +106,7 @@ define(['jQuery', 'emby-checkbox'], function ($) {
|
|||
$(document).on('pageinit', '#notificationSettingPage', function () {
|
||||
var page = this;
|
||||
$('#selectUsers', page).on('change', function () {
|
||||
if ('Custom' == this.value) {
|
||||
if (this.value == 'Custom') {
|
||||
$('.selectCustomUsers', page).show();
|
||||
} else {
|
||||
$('.selectCustomUsers', page).hide();
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['loading', 'libraryMenu', 'globalize', 'listViewStyle', 'emby-button'], function(loading, libraryMenu, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function reload(page) {
|
||||
loading.show();
|
||||
ApiClient.getJSON(ApiClient.getUrl('Notifications/Types')).then(function(list) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['jQuery', 'loading', 'libraryMenu', 'globalize', 'connectionManager', 'emby-button'], function ($, loading, libraryMenu, globalize, connectionManager) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function populateHistory(packageInfo, page) {
|
||||
var html = '';
|
||||
var length = Math.min(packageInfo.versions.length, 10);
|
||||
|
@ -79,7 +81,7 @@ define(['jQuery', 'loading', 'libraryMenu', 'globalize', 'connectionManager', 'e
|
|||
page.querySelector('#btnInstall').disabled = true;
|
||||
ApiClient.installPlugin(name, guid, version).then(function () {
|
||||
loading.hide();
|
||||
alertText(globalize.translate('PluginInstalledMessage'));
|
||||
alertText(globalize.translate('MessagePluginInstalled'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['loading', 'libraryMenu', 'globalize', 'cardStyle', 'emby-button', 'emby-checkbox', 'emby-select'], function (loading, libraryMenu, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function reloadList(page) {
|
||||
loading.show();
|
||||
var promise1 = ApiClient.getAvailablePlugins();
|
||||
|
@ -17,13 +19,13 @@ define(['loading', 'libraryMenu', 'globalize', 'cardStyle', 'emby-button', 'emby
|
|||
|
||||
function getHeaderText(category) {
|
||||
category = category.replace(' ', '');
|
||||
if ('Channel' === category) {
|
||||
if (category === 'Channel') {
|
||||
category = 'Channels';
|
||||
} else if ('Theme' === category) {
|
||||
} else if (category === 'Theme') {
|
||||
category = 'Themes';
|
||||
} else if ('LiveTV' === category) {
|
||||
} else if (category === 'LiveTV') {
|
||||
category = 'HeaderLiveTV';
|
||||
} else if ('ScreenSaver' === category) {
|
||||
} else if (category === 'ScreenSaver') {
|
||||
category = 'HeaderScreenSavers';
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
define(['loading', 'libraryMenu', 'dom', 'globalize', 'cardStyle', 'emby-button'], function (loading, libraryMenu, dom, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function deletePlugin(page, uniqueid, name) {
|
||||
var msg = globalize.translate('UninstallPluginConfirmation', name);
|
||||
|
||||
require(['confirm'], function (confirm) {
|
||||
confirm.default({
|
||||
title: globalize.translate('UninstallPluginHeader'),
|
||||
title: globalize.translate('HeaderUninstallPlugin'),
|
||||
text: msg,
|
||||
primary: 'delete',
|
||||
confirmText: globalize.translate('UninstallPluginHeader')
|
||||
confirmText: globalize.translate('HeaderUninstallPlugin')
|
||||
}).then(function () {
|
||||
loading.show();
|
||||
ApiClient.uninstallPlugin(uniqueid).then(function () {
|
||||
|
@ -21,7 +23,7 @@ define(['loading', 'libraryMenu', 'dom', 'globalize', 'cardStyle', 'emby-button'
|
|||
|
||||
function showNoConfigurationMessage() {
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('NoPluginConfigurationMessage')
|
||||
message: globalize.translate('MessageNoPluginConfiguration')
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -95,7 +97,7 @@ define(['loading', 'libraryMenu', 'dom', 'globalize', 'cardStyle', 'emby-button'
|
|||
html += '<div class="centerMessage">';
|
||||
html += '<h1>' + globalize.translate('MessageNoPluginsInstalled') + '</h1>';
|
||||
html += '<p><a is="emby-linkbutton" class="button-link" href="availableplugins.html">';
|
||||
html += globalize.translate('BrowsePluginCatalogMessage');
|
||||
html += globalize.translate('MessageBrowsePluginCatalog');
|
||||
html += '</a></p>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
|
|
@ -84,16 +84,16 @@ import 'emby-select';
|
|||
},
|
||||
// TODO: Replace this mess with date-fns and remove datetime completely
|
||||
getTriggerFriendlyName: function (trigger) {
|
||||
if ('DailyTrigger' == trigger.Type) {
|
||||
if (trigger.Type == 'DailyTrigger') {
|
||||
return globalize.translate('DailyAt', ScheduledTaskPage.getDisplayTime(trigger.TimeOfDayTicks));
|
||||
}
|
||||
|
||||
if ('WeeklyTrigger' == trigger.Type) {
|
||||
if (trigger.Type == 'WeeklyTrigger') {
|
||||
// TODO: The day of week isn't localised as well
|
||||
return globalize.translate('WeeklyAt', trigger.DayOfWeek, ScheduledTaskPage.getDisplayTime(trigger.TimeOfDayTicks));
|
||||
}
|
||||
|
||||
if ('SystemEventTrigger' == trigger.Type && 'WakeFromSleep' == trigger.SystemEvent) {
|
||||
if (trigger.Type == 'SystemEventTrigger' && trigger.SystemEvent == 'WakeFromSleep') {
|
||||
return globalize.translate('OnWakeFromSleep');
|
||||
}
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ import globalize from 'globalize';
|
|||
let html = '';
|
||||
|
||||
for (const folder of mediaFolders) {
|
||||
isChecked = user.Policy.EnableContentDeletion || -1 != user.Policy.EnableContentDeletionFromFolders.indexOf(folder.Id);
|
||||
isChecked = user.Policy.EnableContentDeletion || user.Policy.EnableContentDeletionFromFolders.indexOf(folder.Id) != -1;
|
||||
checkedAttribute = isChecked ? ' checked="checked"' : '';
|
||||
html += '<label><input type="checkbox" is="emby-checkbox" class="chkFolder" data-id="' + folder.Id + '" ' + checkedAttribute + '><span>' + folder.Name + '</span></label>';
|
||||
}
|
||||
|
||||
for (const folder of channelsResult.Items) {
|
||||
isChecked = user.Policy.EnableContentDeletion || -1 != user.Policy.EnableContentDeletionFromFolders.indexOf(folder.Id);
|
||||
isChecked = user.Policy.EnableContentDeletion || user.Policy.EnableContentDeletionFromFolders.indexOf(folder.Id) != -1;
|
||||
checkedAttribute = isChecked ? ' checked="checked"' : '';
|
||||
html += '<label><input type="checkbox" is="emby-checkbox" class="chkFolder" data-id="' + folder.Id + '" ' + checkedAttribute + '><span>' + folder.Name + '</span></label>';
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ import globalize from 'globalize';
|
|||
$('#chkEnableVideoPlaybackTranscoding', page).prop('checked', user.Policy.EnableVideoPlaybackTranscoding);
|
||||
$('#chkEnableVideoPlaybackRemuxing', page).prop('checked', user.Policy.EnablePlaybackRemuxing);
|
||||
$('#chkForceRemoteSourceTranscoding', page).prop('checked', user.Policy.ForceRemoteSourceTranscoding);
|
||||
$('#chkRemoteAccess', page).prop('checked', null == user.Policy.EnableRemoteAccess || user.Policy.EnableRemoteAccess);
|
||||
$('#chkRemoteAccess', page).prop('checked', user.Policy.EnableRemoteAccess == null || user.Policy.EnableRemoteAccess);
|
||||
$('#chkEnableSyncTranscoding', page).prop('checked', user.Policy.EnableSyncTranscoding);
|
||||
$('#chkEnableConversion', page).prop('checked', user.Policy.EnableMediaConversion || false);
|
||||
$('#chkEnableSharing', page).prop('checked', user.Policy.EnablePublicSharing);
|
||||
|
|
|
@ -18,7 +18,7 @@ import globalize from 'globalize';
|
|||
|
||||
for (let i = 0, length = mediaFolders.length; i < length; i++) {
|
||||
const folder = mediaFolders[i];
|
||||
const isChecked = user.Policy.EnableAllFolders || -1 != user.Policy.EnabledFolders.indexOf(folder.Id);
|
||||
const isChecked = user.Policy.EnableAllFolders || user.Policy.EnabledFolders.indexOf(folder.Id) != -1;
|
||||
const checkedAttribute = isChecked ? ' checked="checked"' : '';
|
||||
html += '<label><input type="checkbox" is="emby-checkbox" class="chkFolder" data-id="' + folder.Id + '" ' + checkedAttribute + '><span>' + folder.Name + '</span></label>';
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import globalize from 'globalize';
|
|||
|
||||
for (let i = 0, length = channels.length; i < length; i++) {
|
||||
const folder = channels[i];
|
||||
const isChecked = user.Policy.EnableAllChannels || -1 != user.Policy.EnabledChannels.indexOf(folder.Id);
|
||||
const isChecked = user.Policy.EnableAllChannels || user.Policy.EnabledChannels.indexOf(folder.Id) != -1;
|
||||
const checkedAttribute = isChecked ? ' checked="checked"' : '';
|
||||
html += '<label><input type="checkbox" is="emby-checkbox" class="chkChannel" data-id="' + folder.Id + '" ' + checkedAttribute + '><span>' + folder.Name + '</span></label>';
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ import globalize from 'globalize';
|
|||
|
||||
for (let i = 0, length = devices.length; i < length; i++) {
|
||||
const device = devices[i];
|
||||
const checkedAttribute = user.Policy.EnableAllDevices || -1 != user.Policy.EnabledDevices.indexOf(device.Id) ? ' checked="checked"' : '';
|
||||
const checkedAttribute = user.Policy.EnableAllDevices || user.Policy.EnabledDevices.indexOf(device.Id) != -1 ? ' checked="checked"' : '';
|
||||
html += '<label><input type="checkbox" is="emby-checkbox" class="chkDevice" data-id="' + device.Id + '" ' + checkedAttribute + '><span>' + device.Name + ' - ' + device.AppName + '</span></label>';
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ import 'emby-checkbox';
|
|||
});
|
||||
}, function (response) {
|
||||
import('toast').then(({default: toast}) => {
|
||||
toast(globalize.translate('DefaultErrorMessage'));
|
||||
toast(globalize.translate('ErrorDefault'));
|
||||
});
|
||||
|
||||
loading.hide();
|
||||
|
|
|
@ -67,7 +67,7 @@ import 'paper-icon-button-light';
|
|||
|
||||
for (let i = 0, length = items.length; i < length; i++) {
|
||||
const item = items[i];
|
||||
const checkedAttribute = -1 != user.Policy.BlockUnratedItems.indexOf(item.value) ? ' checked="checked"' : '';
|
||||
const checkedAttribute = user.Policy.BlockUnratedItems.indexOf(item.value) != -1 ? ' checked="checked"' : '';
|
||||
html += '<label><input type="checkbox" is="emby-checkbox" class="chkUnratedItem" data-itemtype="' + item.value + '" type="checkbox"' + checkedAttribute + '><span>' + item.name + '</span></label>';
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ import 'paper-icon-button-light';
|
|||
}).then(function (updatedSchedule) {
|
||||
const schedules = getSchedulesFromPage(page);
|
||||
|
||||
if (-1 == index) {
|
||||
if (index == -1) {
|
||||
index = schedules.length;
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ import 'paper-icon-button-light';
|
|||
}).then(function (value) {
|
||||
const tags = getBlockedTagsFromPage(page);
|
||||
|
||||
if (-1 == tags.indexOf(value)) {
|
||||
if (tags.indexOf(value) == -1) {
|
||||
tags.push(value);
|
||||
loadBlockedTags(page, tags);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import 'emby-button';
|
|||
let showPasswordSection = true;
|
||||
let showLocalAccessSection = false;
|
||||
|
||||
if ('Guest' == user.ConnectLinkType) {
|
||||
if (user.ConnectLinkType == 'Guest') {
|
||||
page.querySelector('.localAccessSection').classList.add('hide');
|
||||
showPasswordSection = false;
|
||||
} else if (user.HasConfiguredPassword) {
|
||||
|
@ -145,14 +145,14 @@ import 'emby-button';
|
|||
function resetPassword() {
|
||||
const msg = globalize.translate('PasswordResetConfirmation');
|
||||
import('confirm').then(({default: confirm}) => {
|
||||
confirm(msg, globalize.translate('PasswordResetHeader')).then(function () {
|
||||
confirm(msg, globalize.translate('HeaderResetPassword')).then(function () {
|
||||
const userId = params.userId;
|
||||
loading.show();
|
||||
ApiClient.resetUserPassword(userId).then(function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('PasswordResetComplete'),
|
||||
title: globalize.translate('PasswordResetHeader')
|
||||
title: globalize.translate('HeaderResetPassword')
|
||||
});
|
||||
loadUser(view, params);
|
||||
});
|
||||
|
|
|
@ -129,7 +129,7 @@ import 'flexStyles';
|
|||
html += '</div>';
|
||||
html += '<div class="cardText cardText-secondary">';
|
||||
const lastSeen = getLastSeenText(user.LastActivityDate);
|
||||
html += '' != lastSeen ? lastSeen : ' ';
|
||||
html += lastSeen != '' ? lastSeen : ' ';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
|
|
@ -157,11 +157,11 @@ import 'emby-scroller';
|
|||
options.Limit = 20;
|
||||
const userId = apiClient.getCurrentUserId();
|
||||
|
||||
if ('MusicArtist' === section.types) {
|
||||
if (section.types === 'MusicArtist') {
|
||||
return apiClient.getArtists(userId, options);
|
||||
}
|
||||
|
||||
if ('Person' === section.types) {
|
||||
if (section.types === 'Person') {
|
||||
return apiClient.getPeople(userId, options);
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ import 'emby-scroller';
|
|||
preferThumb: section.preferThumb,
|
||||
shape: section.shape,
|
||||
centerText: section.centerText && !cardLayout,
|
||||
overlayText: false !== section.overlayText,
|
||||
overlayText: section.overlayText !== false,
|
||||
showTitle: section.showTitle,
|
||||
showYear: section.showYear,
|
||||
showParentTitle: section.showParentTitle,
|
||||
|
|
|
@ -20,7 +20,7 @@ define(['tabbedView', 'globalize', 'require', 'emby-tabs', 'emby-button', 'emby-
|
|||
}
|
||||
|
||||
function getTabController(index) {
|
||||
if (null == index) {
|
||||
if (index == null) {
|
||||
throw new Error('index cannot be null');
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,9 @@
|
|||
define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager', 'cardBuilder', 'loading', 'connectionManager', 'alphaNumericShortcuts', 'scroller', 'playbackManager', 'alphaPicker', 'emby-itemscontainer', 'emby-scroller'], function (globalize, listView, layoutManager, userSettings, focusManager, cardBuilder, loading, connectionManager, AlphaNumericShortcuts, scroller, playbackManager, AlphaPicker) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
loading = loading.default || loading;
|
||||
|
||||
function getInitialLiveTvQuery(instance, params) {
|
||||
var query = {
|
||||
UserId: connectionManager.getApiClient(params.serverId).getCurrentUserId(),
|
||||
|
@ -9,7 +12,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
Limit: 300
|
||||
};
|
||||
|
||||
if ('Recordings' === params.type) {
|
||||
if (params.type === 'Recordings') {
|
||||
query.IsInProgress = false;
|
||||
} else {
|
||||
query.HasAired = false;
|
||||
|
@ -19,39 +22,39 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
query.GenreIds = params.genreId;
|
||||
}
|
||||
|
||||
if ('true' === params.IsMovie) {
|
||||
if (params.IsMovie === 'true') {
|
||||
query.IsMovie = true;
|
||||
} else if ('false' === params.IsMovie) {
|
||||
} else if (params.IsMovie === 'false') {
|
||||
query.IsMovie = false;
|
||||
}
|
||||
|
||||
if ('true' === params.IsSeries) {
|
||||
if (params.IsSeries === 'true') {
|
||||
query.IsSeries = true;
|
||||
} else if ('false' === params.IsSeries) {
|
||||
} else if (params.IsSeries === 'false') {
|
||||
query.IsSeries = false;
|
||||
}
|
||||
|
||||
if ('true' === params.IsNews) {
|
||||
if (params.IsNews === 'true') {
|
||||
query.IsNews = true;
|
||||
} else if ('false' === params.IsNews) {
|
||||
} else if (params.IsNews === 'false') {
|
||||
query.IsNews = false;
|
||||
}
|
||||
|
||||
if ('true' === params.IsSports) {
|
||||
if (params.IsSports === 'true') {
|
||||
query.IsSports = true;
|
||||
} else if ('false' === params.IsSports) {
|
||||
} else if (params.IsSports === 'false') {
|
||||
query.IsSports = false;
|
||||
}
|
||||
|
||||
if ('true' === params.IsKids) {
|
||||
if (params.IsKids === 'true') {
|
||||
query.IsKids = true;
|
||||
} else if ('false' === params.IsKids) {
|
||||
} else if (params.IsKids === 'false') {
|
||||
query.IsKids = false;
|
||||
}
|
||||
|
||||
if ('true' === params.IsAiring) {
|
||||
if (params.IsAiring === 'true') {
|
||||
query.IsAiring = true;
|
||||
} else if ('false' === params.IsAiring) {
|
||||
} else if (params.IsAiring === 'false') {
|
||||
query.IsAiring = false;
|
||||
}
|
||||
|
||||
|
@ -181,13 +184,13 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var btnSortIcon = instance.btnSortIcon;
|
||||
|
||||
if (btnSortIcon) {
|
||||
setSortButtonIcon(btnSortIcon, 'Descending' === values.sortOrder ? 'arrow_downward' : 'arrow_upward');
|
||||
setSortButtonIcon(btnSortIcon, values.sortOrder === 'Descending' ? 'arrow_downward' : 'arrow_upward');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateItemsContainerForViewType(instance) {
|
||||
if ('list' === instance.getViewSettings().imageType) {
|
||||
if (instance.getViewSettings().imageType === 'list') {
|
||||
instance.itemsContainer.classList.remove('vertical-wrap');
|
||||
instance.itemsContainer.classList.add('vertical-list');
|
||||
} else {
|
||||
|
@ -203,11 +206,11 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
if (alphaPicker) {
|
||||
var values = instance.getSortValues();
|
||||
|
||||
if (null == numItems) {
|
||||
if (numItems == null) {
|
||||
numItems = 100;
|
||||
}
|
||||
|
||||
if ('SortName' === values.sortBy && 'Ascending' === values.sortOrder && numItems > 40) {
|
||||
if (values.sortBy === 'SortName' && values.sortOrder === 'Ascending' && numItems > 40) {
|
||||
alphaPicker.classList.remove('hide');
|
||||
instance.itemsContainer.parentNode.classList.add('padded-right-withalphapicker');
|
||||
} else {
|
||||
|
@ -222,19 +225,19 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var apiClient = connectionManager.getApiClient(params.serverId);
|
||||
|
||||
instance.queryRecursive = false;
|
||||
if ('Recordings' === params.type) {
|
||||
if (params.type === 'Recordings') {
|
||||
return apiClient.getLiveTvRecordings(getInitialLiveTvQuery(instance, params));
|
||||
}
|
||||
|
||||
if ('Programs' === params.type) {
|
||||
if ('true' === params.IsAiring) {
|
||||
if (params.type === 'Programs') {
|
||||
if (params.IsAiring === 'true') {
|
||||
return apiClient.getLiveTvRecommendedPrograms(getInitialLiveTvQuery(instance, params));
|
||||
}
|
||||
|
||||
return apiClient.getLiveTvPrograms(getInitialLiveTvQuery(instance, params));
|
||||
}
|
||||
|
||||
if ('nextup' === params.type) {
|
||||
if (params.type === 'nextup') {
|
||||
return apiClient.getNextUpEpisodes(modifyQueryWithFilters(instance, {
|
||||
Limit: limit,
|
||||
Fields: 'PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo',
|
||||
|
@ -250,9 +253,9 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
instance.queryRecursive = true;
|
||||
var method = 'getItems';
|
||||
|
||||
if ('MusicArtist' === params.type) {
|
||||
if (params.type === 'MusicArtist') {
|
||||
method = 'getArtists';
|
||||
} else if ('Person' === params.type) {
|
||||
} else if (params.type === 'Person') {
|
||||
method = 'getPeople';
|
||||
}
|
||||
|
||||
|
@ -261,15 +264,15 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
Limit: limit,
|
||||
Fields: 'PrimaryImageAspectRatio,SortName',
|
||||
ImageTypeLimit: 1,
|
||||
IncludeItemTypes: 'MusicArtist' === params.type || 'Person' === params.type ? null : params.type,
|
||||
IncludeItemTypes: params.type === 'MusicArtist' || params.type === 'Person' ? null : params.type,
|
||||
Recursive: true,
|
||||
IsFavorite: 'true' === params.IsFavorite || null,
|
||||
IsFavorite: params.IsFavorite === 'true' || null,
|
||||
ArtistIds: params.artistId || null,
|
||||
SortBy: sortBy
|
||||
}));
|
||||
}
|
||||
|
||||
if ('Genre' === item.Type || 'MusicGenre' === item.Type || 'Studio' === item.Type || 'Person' === item.Type) {
|
||||
if (item.Type === 'Genre' || item.Type === 'MusicGenre' || item.Type === 'Studio' || item.Type === 'Person') {
|
||||
instance.queryRecursive = true;
|
||||
var query = {
|
||||
StartIndex: startIndex,
|
||||
|
@ -280,25 +283,25 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
SortBy: sortBy
|
||||
};
|
||||
|
||||
if ('Studio' === item.Type) {
|
||||
if (item.Type === 'Studio') {
|
||||
query.StudioIds = item.Id;
|
||||
} else if ('Genre' === item.Type || 'MusicGenre' === item.Type) {
|
||||
} else if (item.Type === 'Genre' || item.Type === 'MusicGenre') {
|
||||
query.GenreIds = item.Id;
|
||||
} else if ('Person' === item.Type) {
|
||||
} else if (item.Type === 'Person') {
|
||||
query.PersonIds = item.Id;
|
||||
}
|
||||
|
||||
if ('MusicGenre' === item.Type) {
|
||||
if (item.Type === 'MusicGenre') {
|
||||
query.IncludeItemTypes = 'MusicAlbum';
|
||||
} else if ('GameGenre' === item.Type) {
|
||||
} else if (item.Type === 'GameGenre') {
|
||||
query.IncludeItemTypes = 'Game';
|
||||
} else if ('movies' === item.CollectionType) {
|
||||
} else if (item.CollectionType === 'movies') {
|
||||
query.IncludeItemTypes = 'Movie';
|
||||
} else if ('tvshows' === item.CollectionType) {
|
||||
} else if (item.CollectionType === 'tvshows') {
|
||||
query.IncludeItemTypes = 'Series';
|
||||
} else if ('Genre' === item.Type) {
|
||||
} else if (item.Type === 'Genre') {
|
||||
query.IncludeItemTypes = 'Movie,Series,Video';
|
||||
} else if ('Person' === item.Type) {
|
||||
} else if (item.Type === 'Person') {
|
||||
query.IncludeItemTypes = params.type;
|
||||
}
|
||||
|
||||
|
@ -316,7 +319,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
}
|
||||
|
||||
function getItem(params) {
|
||||
if ('Recordings' === params.type || 'Programs' === params.type || 'nextup' === params.type) {
|
||||
if (params.type === 'Recordings' || params.type === 'Programs' || params.type === 'nextup') {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
|
@ -412,7 +415,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
function ItemsView(view, params) {
|
||||
function fetchData() {
|
||||
return getItems(self, params, self.currentItem).then(function (result) {
|
||||
if (null == self.totalItemCount) {
|
||||
if (self.totalItemCount == null) {
|
||||
self.totalItemCount = result.Items ? result.Items.length : result.length;
|
||||
}
|
||||
|
||||
|
@ -424,7 +427,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
function getItemsHtml(items) {
|
||||
var settings = self.getViewSettings();
|
||||
|
||||
if ('list' === settings.imageType) {
|
||||
if (settings.imageType === 'list') {
|
||||
return listView.getListViewHtml({
|
||||
items: items
|
||||
});
|
||||
|
@ -438,24 +441,24 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var item = self.currentItem;
|
||||
var lines = settings.showTitle ? 2 : 0;
|
||||
|
||||
if ('banner' === settings.imageType) {
|
||||
if (settings.imageType === 'banner') {
|
||||
shape = 'banner';
|
||||
} else if ('disc' === settings.imageType) {
|
||||
} else if (settings.imageType === 'disc') {
|
||||
shape = 'square';
|
||||
preferDisc = true;
|
||||
} else if ('logo' === settings.imageType) {
|
||||
} else if (settings.imageType === 'logo') {
|
||||
shape = 'backdrop';
|
||||
preferLogo = true;
|
||||
} else if ('thumb' === settings.imageType) {
|
||||
} else if (settings.imageType === 'thumb') {
|
||||
shape = 'backdrop';
|
||||
preferThumb = true;
|
||||
} else if ('nextup' === params.type) {
|
||||
} else if (params.type === 'nextup') {
|
||||
shape = 'backdrop';
|
||||
preferThumb = 'thumb' === settings.imageType;
|
||||
} else if ('Programs' === params.type || 'Recordings' === params.type) {
|
||||
shape = 'true' === params.IsMovie ? 'portrait' : 'autoVertical';
|
||||
preferThumb = 'true' !== params.IsMovie ? 'auto' : false;
|
||||
defaultShape = 'true' === params.IsMovie ? 'portrait' : 'backdrop';
|
||||
preferThumb = settings.imageType === 'thumb';
|
||||
} else if (params.type === 'Programs' || params.type === 'Recordings') {
|
||||
shape = params.IsMovie === 'true' ? 'portrait' : 'autoVertical';
|
||||
preferThumb = params.IsMovie !== 'true' ? 'auto' : false;
|
||||
defaultShape = params.IsMovie === 'true' ? 'portrait' : 'backdrop';
|
||||
} else {
|
||||
shape = 'autoVertical';
|
||||
}
|
||||
|
@ -473,46 +476,46 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
overlayMoreButton: true,
|
||||
overlayText: !settings.showTitle,
|
||||
defaultShape: defaultShape,
|
||||
action: 'Audio' === params.type ? 'playallfromhere' : null
|
||||
action: params.type === 'Audio' ? 'playallfromhere' : null
|
||||
};
|
||||
|
||||
if ('nextup' === params.type) {
|
||||
if (params.type === 'nextup') {
|
||||
posterOptions.showParentTitle = settings.showTitle;
|
||||
} else if ('Person' === params.type) {
|
||||
} else if (params.type === 'Person') {
|
||||
posterOptions.showYear = false;
|
||||
posterOptions.showParentTitle = false;
|
||||
lines = 1;
|
||||
} else if ('Audio' === params.type) {
|
||||
} else if (params.type === 'Audio') {
|
||||
posterOptions.showParentTitle = settings.showTitle;
|
||||
} else if ('MusicAlbum' === params.type) {
|
||||
} else if (params.type === 'MusicAlbum') {
|
||||
posterOptions.showParentTitle = settings.showTitle;
|
||||
} else if ('Episode' === params.type) {
|
||||
} else if (params.type === 'Episode') {
|
||||
posterOptions.showParentTitle = settings.showTitle;
|
||||
} else if ('MusicArtist' === params.type) {
|
||||
} else if (params.type === 'MusicArtist') {
|
||||
posterOptions.showYear = false;
|
||||
lines = 1;
|
||||
} else if ('Programs' === params.type) {
|
||||
} else if (params.type === 'Programs') {
|
||||
lines = settings.showTitle ? 1 : 0;
|
||||
var showParentTitle = settings.showTitle && 'true' !== params.IsMovie;
|
||||
var showParentTitle = settings.showTitle && params.IsMovie !== 'true';
|
||||
|
||||
if (showParentTitle) {
|
||||
lines++;
|
||||
}
|
||||
|
||||
var showAirTime = settings.showTitle && 'Recordings' !== params.type;
|
||||
var showAirTime = settings.showTitle && params.type !== 'Recordings';
|
||||
|
||||
if (showAirTime) {
|
||||
lines++;
|
||||
}
|
||||
|
||||
var showYear = settings.showTitle && 'true' === params.IsMovie && 'Recordings' === params.type;
|
||||
var showYear = settings.showTitle && params.IsMovie === 'true' && params.type === 'Recordings';
|
||||
|
||||
if (showYear) {
|
||||
lines++;
|
||||
}
|
||||
|
||||
posterOptions = Object.assign(posterOptions, {
|
||||
inheritThumb: 'Recordings' === params.type,
|
||||
inheritThumb: params.type === 'Recordings',
|
||||
context: 'livetv',
|
||||
showParentTitle: showParentTitle,
|
||||
showAirTime: showAirTime,
|
||||
|
@ -529,7 +532,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
posterOptions.lines = lines;
|
||||
posterOptions.items = items;
|
||||
|
||||
if (item && 'folders' === item.CollectionType) {
|
||||
if (item && item.CollectionType === 'folders') {
|
||||
posterOptions.context = 'folders';
|
||||
}
|
||||
|
||||
|
@ -561,7 +564,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
function setTitle(item) {
|
||||
Emby.Page.setTitle(getTitle(item) || '');
|
||||
|
||||
if (item && 'playlists' === item.CollectionType) {
|
||||
if (item && item.CollectionType === 'playlists') {
|
||||
hideOrShowAll(view.querySelectorAll('.btnNewItem'), false);
|
||||
} else {
|
||||
hideOrShowAll(view.querySelectorAll('.btnNewItem'), true);
|
||||
|
@ -569,43 +572,43 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
}
|
||||
|
||||
function getTitle(item) {
|
||||
if ('Recordings' === params.type) {
|
||||
if (params.type === 'Recordings') {
|
||||
return globalize.translate('Recordings');
|
||||
}
|
||||
|
||||
if ('Programs' === params.type) {
|
||||
if ('true' === params.IsMovie) {
|
||||
if (params.type === 'Programs') {
|
||||
if (params.IsMovie === 'true') {
|
||||
return globalize.translate('Movies');
|
||||
}
|
||||
|
||||
if ('true' === params.IsSports) {
|
||||
if (params.IsSports === 'true') {
|
||||
return globalize.translate('Sports');
|
||||
}
|
||||
|
||||
if ('true' === params.IsKids) {
|
||||
if (params.IsKids === 'true') {
|
||||
return globalize.translate('HeaderForKids');
|
||||
}
|
||||
|
||||
if ('true' === params.IsAiring) {
|
||||
if (params.IsAiring === 'true') {
|
||||
return globalize.translate('HeaderOnNow');
|
||||
}
|
||||
|
||||
if ('true' === params.IsSeries) {
|
||||
if (params.IsSeries === 'true') {
|
||||
return globalize.translate('Shows');
|
||||
}
|
||||
|
||||
if ('true' === params.IsNews) {
|
||||
if (params.IsNews === 'true') {
|
||||
return globalize.translate('News');
|
||||
}
|
||||
|
||||
return globalize.translate('Programs');
|
||||
}
|
||||
|
||||
if ('nextup' === params.type) {
|
||||
if (params.type === 'nextup') {
|
||||
return globalize.translate('NextUp');
|
||||
}
|
||||
|
||||
if ('favoritemovies' === params.type) {
|
||||
if (params.type === 'favoritemovies') {
|
||||
return globalize.translate('FavoriteMovies');
|
||||
}
|
||||
|
||||
|
@ -613,35 +616,35 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
return item.Name;
|
||||
}
|
||||
|
||||
if ('Movie' === params.type) {
|
||||
if (params.type === 'Movie') {
|
||||
return globalize.translate('Movies');
|
||||
}
|
||||
|
||||
if ('Series' === params.type) {
|
||||
if (params.type === 'Series') {
|
||||
return globalize.translate('Shows');
|
||||
}
|
||||
|
||||
if ('Season' === params.type) {
|
||||
if (params.type === 'Season') {
|
||||
return globalize.translate('Seasons');
|
||||
}
|
||||
|
||||
if ('Episode' === params.type) {
|
||||
if (params.type === 'Episode') {
|
||||
return globalize.translate('Episodes');
|
||||
}
|
||||
|
||||
if ('MusicArtist' === params.type) {
|
||||
if (params.type === 'MusicArtist') {
|
||||
return globalize.translate('Artists');
|
||||
}
|
||||
|
||||
if ('MusicAlbum' === params.type) {
|
||||
if (params.type === 'MusicAlbum') {
|
||||
return globalize.translate('Albums');
|
||||
}
|
||||
|
||||
if ('Audio' === params.type) {
|
||||
if (params.type === 'Audio') {
|
||||
return globalize.translate('Songs');
|
||||
}
|
||||
|
||||
if ('Video' === params.type) {
|
||||
if (params.type === 'Video') {
|
||||
return globalize.translate('Videos');
|
||||
}
|
||||
|
||||
|
@ -700,11 +703,11 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
|
||||
if (params.parentId) {
|
||||
this.itemsContainer.setAttribute('data-parentid', params.parentId);
|
||||
} else if ('nextup' === params.type) {
|
||||
} else if (params.type === 'nextup') {
|
||||
this.itemsContainer.setAttribute('data-monitor', 'videoplayback');
|
||||
} else if ('favoritemovies' === params.type) {
|
||||
} else if (params.type === 'favoritemovies') {
|
||||
this.itemsContainer.setAttribute('data-monitor', 'markfavorite');
|
||||
} else if ('Programs' === params.type) {
|
||||
} else if (params.type === 'Programs') {
|
||||
this.itemsContainer.setAttribute('data-refreshinterval', '300000');
|
||||
}
|
||||
|
||||
|
@ -737,7 +740,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var sortButton = sortButtons[i];
|
||||
sortButton.addEventListener('click', showSortMenu.bind(this));
|
||||
|
||||
if ('nextup' !== params.type) {
|
||||
if (params.type !== 'nextup') {
|
||||
sortButton.classList.remove('hide');
|
||||
}
|
||||
}
|
||||
|
@ -772,19 +775,19 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
}
|
||||
});
|
||||
|
||||
if (!isRestored && item && 'PhotoAlbum' !== item.Type) {
|
||||
if (!isRestored && item && item.Type !== 'PhotoAlbum') {
|
||||
initAlphaPicker();
|
||||
}
|
||||
|
||||
var itemType = item ? item.Type : null;
|
||||
|
||||
if ('MusicGenre' === itemType || 'Programs' !== params.type && 'Channel' !== itemType) {
|
||||
if (itemType === 'MusicGenre' || params.type !== 'Programs' && itemType !== 'Channel') {
|
||||
hideOrShowAll(view.querySelectorAll('.btnPlay'), false);
|
||||
} else {
|
||||
hideOrShowAll(view.querySelectorAll('.btnPlay'), true);
|
||||
}
|
||||
|
||||
if ('MusicGenre' === itemType || 'Programs' !== params.type && 'nextup' !== params.type && 'Channel' !== itemType) {
|
||||
if (itemType === 'MusicGenre' || params.type !== 'Programs' && params.type !== 'nextup' && itemType !== 'Channel') {
|
||||
hideOrShowAll(view.querySelectorAll('.btnShuffle'), false);
|
||||
} else {
|
||||
hideOrShowAll(view.querySelectorAll('.btnShuffle'), true);
|
||||
|
@ -845,14 +848,14 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
ItemsView.prototype.getFilters = function () {
|
||||
var basekey = this.getSettingsKey();
|
||||
return {
|
||||
IsPlayed: 'true' === userSettings.getFilter(basekey + '-filter-IsPlayed'),
|
||||
IsUnplayed: 'true' === userSettings.getFilter(basekey + '-filter-IsUnplayed'),
|
||||
IsFavorite: 'true' === userSettings.getFilter(basekey + '-filter-IsFavorite'),
|
||||
IsResumable: 'true' === userSettings.getFilter(basekey + '-filter-IsResumable'),
|
||||
Is4K: 'true' === userSettings.getFilter(basekey + '-filter-Is4K'),
|
||||
IsHD: 'true' === userSettings.getFilter(basekey + '-filter-IsHD'),
|
||||
IsSD: 'true' === userSettings.getFilter(basekey + '-filter-IsSD'),
|
||||
Is3D: 'true' === userSettings.getFilter(basekey + '-filter-Is3D'),
|
||||
IsPlayed: userSettings.getFilter(basekey + '-filter-IsPlayed') === 'true',
|
||||
IsUnplayed: userSettings.getFilter(basekey + '-filter-IsUnplayed') === 'true',
|
||||
IsFavorite: userSettings.getFilter(basekey + '-filter-IsFavorite') === 'true',
|
||||
IsResumable: userSettings.getFilter(basekey + '-filter-IsResumable') === 'true',
|
||||
Is4K: userSettings.getFilter(basekey + '-filter-Is4K') === 'true',
|
||||
IsHD: userSettings.getFilter(basekey + '-filter-IsHD') === 'true',
|
||||
IsSD: userSettings.getFilter(basekey + '-filter-IsSD') === 'true',
|
||||
Is3D: userSettings.getFilter(basekey + '-filter-Is3D') === 'true',
|
||||
VideoTypes: userSettings.getFilter(basekey + '-filter-VideoTypes'),
|
||||
SeriesStatus: userSettings.getFilter(basekey + '-filter-SeriesStatus'),
|
||||
HasSubtitles: userSettings.getFilter(basekey + '-filter-HasSubtitles'),
|
||||
|
@ -868,7 +871,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var basekey = this.getSettingsKey();
|
||||
return {
|
||||
sortBy: userSettings.getFilter(basekey + '-sortby') || this.getDefaultSortBy(),
|
||||
sortOrder: 'Descending' === userSettings.getFilter(basekey + '-sortorder') ? 'Descending' : 'Ascending'
|
||||
sortOrder: userSettings.getFilter(basekey + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending'
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -887,7 +890,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var sortBy = [];
|
||||
var params = this.params;
|
||||
|
||||
if ('Programs' === params.type) {
|
||||
if (params.type === 'Programs') {
|
||||
sortBy.push({
|
||||
name: globalize.translate('AirDate'),
|
||||
value: 'StartDate,SortName'
|
||||
|
@ -912,7 +915,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
sortBy.push(option);
|
||||
}
|
||||
|
||||
if ('Programs' !== params.type) {
|
||||
if (params.type !== 'Programs') {
|
||||
sortBy.push({
|
||||
name: globalize.translate('DateAdded'),
|
||||
value: 'DateCreated,SortName'
|
||||
|
@ -955,7 +958,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
};
|
||||
|
||||
ItemsView.prototype.getNameSortOption = function (params) {
|
||||
if ('Episode' === params.type) {
|
||||
if (params.type === 'Episode') {
|
||||
return {
|
||||
name: globalize.translate('Name'),
|
||||
value: 'SeriesName,SortName'
|
||||
|
@ -969,7 +972,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
};
|
||||
|
||||
ItemsView.prototype.getPlayCountSortOption = function () {
|
||||
if ('Programs' === this.params.type) {
|
||||
if (this.params.type === 'Programs') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -980,7 +983,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
};
|
||||
|
||||
ItemsView.prototype.getDatePlayedSortOption = function () {
|
||||
if ('Programs' === this.params.type) {
|
||||
if (this.params.type === 'Programs') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -991,7 +994,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
};
|
||||
|
||||
ItemsView.prototype.getCriticRatingSortOption = function () {
|
||||
if ('Programs' === this.params.type) {
|
||||
if (this.params.type === 'Programs') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1012,8 +1015,8 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var filters = [];
|
||||
var params = this.params;
|
||||
|
||||
if (!('nextup' === params.type)) {
|
||||
if ('Programs' === params.type) {
|
||||
if (!(params.type === 'nextup')) {
|
||||
if (params.type === 'Programs') {
|
||||
filters.push('Genres');
|
||||
} else {
|
||||
filters.push('IsUnplayed');
|
||||
|
@ -1081,7 +1084,7 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var item = (this.params, this.currentItem);
|
||||
var fields = ['showTitle'];
|
||||
|
||||
if (!item || 'PhotoAlbum' !== item.Type && 'ChannelFolderItem' !== item.Type) {
|
||||
if (!item || item.Type !== 'PhotoAlbum' && item.Type !== 'ChannelFolderItem') {
|
||||
fields.push('imageType');
|
||||
}
|
||||
|
||||
|
@ -1095,25 +1098,25 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
var item = this.currentItem;
|
||||
var showTitle = userSettings.get(basekey + '-showTitle');
|
||||
|
||||
if ('true' === showTitle) {
|
||||
if (showTitle === 'true') {
|
||||
showTitle = true;
|
||||
} else if ('false' === showTitle) {
|
||||
} else if (showTitle === 'false') {
|
||||
showTitle = false;
|
||||
} else if ('Programs' === params.type || 'Recordings' === params.type || 'Person' === params.type || 'nextup' === params.type || 'Audio' === params.type || 'MusicAlbum' === params.type || 'MusicArtist' === params.type) {
|
||||
} else if (params.type === 'Programs' || params.type === 'Recordings' || params.type === 'Person' || params.type === 'nextup' || params.type === 'Audio' || params.type === 'MusicAlbum' || params.type === 'MusicArtist') {
|
||||
showTitle = true;
|
||||
} else if (item && 'PhotoAlbum' !== item.Type) {
|
||||
} else if (item && item.Type !== 'PhotoAlbum') {
|
||||
showTitle = true;
|
||||
}
|
||||
|
||||
var imageType = userSettings.get(basekey + '-imageType');
|
||||
|
||||
if (!imageType && 'nextup' === params.type) {
|
||||
if (!imageType && params.type === 'nextup') {
|
||||
imageType = 'thumb';
|
||||
}
|
||||
|
||||
return {
|
||||
showTitle: showTitle,
|
||||
showYear: 'false' !== userSettings.get(basekey + '-showYear'),
|
||||
showYear: userSettings.get(basekey + '-showYear') !== 'false',
|
||||
imageType: imageType || 'primary',
|
||||
viewType: userSettings.get(basekey + '-viewType') || 'images'
|
||||
};
|
||||
|
@ -1122,11 +1125,11 @@ define(['globalize', 'listView', 'layoutManager', 'userSettings', 'focusManager'
|
|||
ItemsView.prototype.getItemTypes = function () {
|
||||
var params = this.params;
|
||||
|
||||
if ('nextup' === params.type) {
|
||||
if (params.type === 'nextup') {
|
||||
return ['Episode'];
|
||||
}
|
||||
|
||||
if ('Programs' === params.type) {
|
||||
if (params.type === 'Programs') {
|
||||
return ['Program'];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(['cardBuilder', 'imageLoader', 'libraryBrowser', 'loading', 'events', 'userSettings', 'emby-itemscontainer'], function (cardBuilder, imageLoader, libraryBrowser, loading, events, userSettings) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
libraryBrowser = libraryBrowser.default || libraryBrowser;
|
||||
|
||||
return function (view, params, tabContent) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['layoutManager', 'loading', 'cardBuilder', 'apphost', 'imageLoader', 'scripts/livetvcomponents', 'listViewStyle', 'emby-itemscontainer'], function (layoutManager, loading, cardBuilder, appHost, imageLoader) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function renderRecordings(elem, recordings, cardOptions, scrollX) {
|
||||
if (!elem) {
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['layoutManager', 'cardBuilder', 'apphost', 'imageLoader', 'loading', 'scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function (layoutManager, cardBuilder, appHost, imageLoader, loading) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['datetime', 'cardBuilder', 'imageLoader', 'apphost', 'loading', 'paper-icon-button-light', 'emby-button'], function (datetime, cardBuilder, imageLoader, appHost, loading) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function renderTimers(context, timers) {
|
||||
var html = '';
|
||||
html += cardBuilder.getCardsHtml({
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['layoutManager', 'userSettings', 'inputManager', 'loading', 'globalize', 'libraryBrowser', 'mainTabsManager', 'cardBuilder', 'apphost', 'imageLoader', 'scrollStyles', 'emby-itemscontainer', 'emby-tabs', 'emby-button'], function (layoutManager, userSettings, inputManager, loading, globalize, libraryBrowser, mainTabsManager, cardBuilder, appHost, imageLoader) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
}
|
||||
|
@ -142,9 +144,9 @@ define(['layoutManager', 'userSettings', 'inputManager', 'loading', 'globalize',
|
|||
coverImage: true,
|
||||
overlayText: false,
|
||||
lazy: true,
|
||||
overlayPlayButton: 'play' === overlayButton,
|
||||
overlayMoreButton: 'more' === overlayButton,
|
||||
overlayInfoButton: 'info' === overlayButton,
|
||||
overlayPlayButton: overlayButton === 'play',
|
||||
overlayMoreButton: overlayButton === 'more',
|
||||
overlayInfoButton: overlayButton === 'info',
|
||||
allowBottomPadding: !enableScrollX(),
|
||||
showAirTime: true,
|
||||
showAirDateTime: true
|
||||
|
@ -261,7 +263,7 @@ define(['layoutManager', 'userSettings', 'inputManager', 'loading', 'globalize',
|
|||
require(depends, function (controllerFactory) {
|
||||
var tabContent;
|
||||
|
||||
if (0 == index) {
|
||||
if (index == 0) {
|
||||
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
|
||||
self.tabContent = tabContent;
|
||||
}
|
||||
|
@ -271,9 +273,9 @@ define(['layoutManager', 'userSettings', 'inputManager', 'loading', 'globalize',
|
|||
if (!controller) {
|
||||
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
|
||||
|
||||
if (0 === index) {
|
||||
if (index === 0) {
|
||||
controller = self;
|
||||
} else if (6 === index) {
|
||||
} else if (index === 6) {
|
||||
controller = new controllerFactory(view, tabContent, {
|
||||
collectionType: 'livetv'
|
||||
});
|
||||
|
@ -305,8 +307,8 @@ define(['layoutManager', 'userSettings', 'inputManager', 'loading', 'globalize',
|
|||
getTabController(page, index, function (controller) {
|
||||
initialTabIndex = null;
|
||||
|
||||
if (-1 == renderedTabs.indexOf(index)) {
|
||||
if (1 === index) {
|
||||
if (renderedTabs.indexOf(index) == -1) {
|
||||
if (index === 1) {
|
||||
renderedTabs.push(index);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['events', 'loading', 'globalize'], function (events, loading, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
|
||||
function onListingsSubmitted() {
|
||||
Dashboard.navigate('livetvstatus.html');
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading, globalize) {
|
||||
'use strict';
|
||||
import $ from 'jQuery';
|
||||
import loading from 'loading';
|
||||
import globalize from 'globalize';
|
||||
import 'emby-button';
|
||||
|
||||
function loadPage(page, config) {
|
||||
function loadPage(page, config) {
|
||||
$('.liveTvSettingsForm', page).show();
|
||||
$('.noLiveTvServices', page).hide();
|
||||
$('#selectGuideDays', page).val(config.GuideDays || '');
|
||||
|
@ -13,17 +15,17 @@ define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading,
|
|||
page.querySelector('#txtPostProcessor').value = config.RecordingPostProcessor || '';
|
||||
page.querySelector('#txtPostProcessorArguments').value = config.RecordingPostProcessorArguments || '';
|
||||
loading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
function onSubmit() {
|
||||
loading.show();
|
||||
var form = this;
|
||||
const form = this;
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
config.GuideDays = $('#selectGuideDays', form).val() || null;
|
||||
var recordingPath = form.querySelector('#txtRecordingPath').value || null;
|
||||
var movieRecordingPath = form.querySelector('#txtMovieRecordingPath').value || null;
|
||||
var seriesRecordingPath = form.querySelector('#txtSeriesRecordingPath').value || null;
|
||||
var recordingPathChanged = recordingPath != config.RecordingPath || movieRecordingPath != config.MovieRecordingPath || seriesRecordingPath != config.SeriesRecordingPath;
|
||||
const recordingPath = form.querySelector('#txtRecordingPath').value || null;
|
||||
const movieRecordingPath = form.querySelector('#txtMovieRecordingPath').value || null;
|
||||
const seriesRecordingPath = form.querySelector('#txtSeriesRecordingPath').value || null;
|
||||
const recordingPathChanged = recordingPath != config.RecordingPath || movieRecordingPath != config.MovieRecordingPath || seriesRecordingPath != config.SeriesRecordingPath;
|
||||
config.RecordingPath = recordingPath;
|
||||
config.MovieRecordingPath = movieRecordingPath;
|
||||
config.SeriesRecordingPath = seriesRecordingPath;
|
||||
|
@ -38,28 +40,29 @@ define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading,
|
|||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function showSaveMessage(recordingPathChanged) {
|
||||
var msg = '';
|
||||
function showSaveMessage(recordingPathChanged) {
|
||||
let msg = '';
|
||||
|
||||
if (recordingPathChanged) {
|
||||
msg += globalize.translate('RecordingPathChangeMessage');
|
||||
msg += globalize.translate('MessageChangeRecordingPath');
|
||||
}
|
||||
|
||||
if (msg) {
|
||||
require(['alert'], function (alert) {
|
||||
import('alert').then(({default: alert}) => {
|
||||
alert(msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default function () {
|
||||
$(document).on('pageinit', '#liveTvSettingsPage', function () {
|
||||
var page = this;
|
||||
const page = this;
|
||||
$('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
$('#btnSelectRecordingPath', page).on('click.selectDirectory', function () {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser.default();
|
||||
import('directorybrowser').then(({default: directoryBrowser}) => {
|
||||
const picker = new directoryBrowser();
|
||||
picker.show({
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
|
@ -73,8 +76,8 @@ define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading,
|
|||
});
|
||||
});
|
||||
$('#btnSelectMovieRecordingPath', page).on('click.selectDirectory', function () {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser.default();
|
||||
import('directorybrowser').then(({default: directoryBrowser}) => {
|
||||
const picker = new directoryBrowser();
|
||||
picker.show({
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
|
@ -88,8 +91,8 @@ define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading,
|
|||
});
|
||||
});
|
||||
$('#btnSelectSeriesRecordingPath', page).on('click.selectDirectory', function () {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser.default();
|
||||
import('directorybrowser').then(({default: directoryBrowser}) => {
|
||||
const picker = new directoryBrowser();
|
||||
picker.show({
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
|
@ -103,8 +106,8 @@ define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading,
|
|||
});
|
||||
});
|
||||
$('#btnSelectPostProcessorPath', page).on('click.selectDirectory', function () {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser.default();
|
||||
import('directorybrowser').then(({default: directoryBrowser}) => {
|
||||
const picker = new directoryBrowser();
|
||||
picker.show({
|
||||
includeFiles: true,
|
||||
callback: function (path) {
|
||||
|
@ -119,9 +122,9 @@ define(['jQuery', 'loading', 'globalize', 'emby-button'], function ($, loading,
|
|||
});
|
||||
}).on('pageshow', '#liveTvSettingsPage', function () {
|
||||
loading.show();
|
||||
var page = this;
|
||||
const page = this;
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
loadPage(page, config);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,13 +1,24 @@
|
|||
define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layoutManager', 'loading', 'browser', 'listViewStyle', 'flexStyles', 'emby-itemscontainer', 'cardStyle', 'material-icons', 'emby-button'], function ($, globalize, taskButton, dom, libraryMenu, layoutManager, loading, browser) {
|
||||
'use strict';
|
||||
import $ from 'jQuery';
|
||||
import globalize from 'globalize';
|
||||
import taskButton from 'scripts/taskbutton';
|
||||
import dom from 'dom';
|
||||
import layoutManager from 'layoutManager';
|
||||
import loading from 'loading';
|
||||
import browser from 'browser';
|
||||
import 'listViewStyle';
|
||||
import 'flexStyles';
|
||||
import 'emby-itemscontainer';
|
||||
import 'cardStyle';
|
||||
import 'material-icons';
|
||||
import 'emby-button';
|
||||
|
||||
var enableFocusTransform = !browser.slow && !browser.edge;
|
||||
const enableFocusTransform = !browser.slow && !browser.edge;
|
||||
|
||||
function getDeviceHtml(device) {
|
||||
var padderClass;
|
||||
var html = '';
|
||||
var cssClass = 'card scalableCard';
|
||||
var cardBoxCssClass = 'cardBox visualCardBox';
|
||||
function getDeviceHtml(device) {
|
||||
let padderClass;
|
||||
let html = '';
|
||||
let cssClass = 'card scalableCard';
|
||||
let cardBoxCssClass = 'cardBox visualCardBox';
|
||||
cssClass += ' backdropCard backdropCard-scalable';
|
||||
padderClass = 'cardPadder-backdrop';
|
||||
|
||||
|
@ -38,18 +49,17 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
html += '</div>';
|
||||
html += '</div>';
|
||||
return html += '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
function renderDevices(page, devices) {
|
||||
var html = devices.map(getDeviceHtml).join('');
|
||||
page.querySelector('.devicesList').innerHTML = html;
|
||||
}
|
||||
function renderDevices(page, devices) {
|
||||
page.querySelector('.devicesList').innerHTML = devices.map(getDeviceHtml).join('');
|
||||
}
|
||||
|
||||
function deleteDevice(page, id) {
|
||||
var message = globalize.translate('MessageConfirmDeleteTunerDevice');
|
||||
function deleteDevice(page, id) {
|
||||
const message = globalize.translate('MessageConfirmDeleteTunerDevice');
|
||||
|
||||
require(['confirm'], function (confirm) {
|
||||
confirm.default(message, globalize.translate('HeaderDeleteDevice')).then(function () {
|
||||
import('confirm').then(({default: confirm}) => {
|
||||
confirm(message, globalize.translate('HeaderDeleteDevice')).then(function () {
|
||||
loading.show();
|
||||
ApiClient.ajax({
|
||||
type: 'DELETE',
|
||||
|
@ -61,18 +71,18 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
function reload(page) {
|
||||
loading.show();
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
renderDevices(page, config.TunerHosts);
|
||||
renderProviders(page, config.ListingProviders);
|
||||
});
|
||||
loading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function submitAddDeviceForm(page) {
|
||||
function submitAddDeviceForm(page) {
|
||||
page.querySelector('.dlgAddDevice').close();
|
||||
loading.show();
|
||||
ApiClient.ajax({
|
||||
|
@ -90,16 +100,16 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
message: globalize.translate('ErrorAddingTunerDevice')
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderProviders(page, providers) {
|
||||
var html = '';
|
||||
function renderProviders(page, providers) {
|
||||
let html = '';
|
||||
|
||||
if (providers.length) {
|
||||
html += '<div class="paperList">';
|
||||
|
||||
for (var i = 0, length = providers.length; i < length; i++) {
|
||||
var provider = providers[i];
|
||||
for (let i = 0, length = providers.length; i < length; i++) {
|
||||
const provider = providers[i];
|
||||
html += '<div class="listItem">';
|
||||
html += '<span class="listItemIcon material-icons dvr"></span>';
|
||||
html += '<div class="listItemBody two-line">';
|
||||
|
@ -119,15 +129,15 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
html += '</div>';
|
||||
}
|
||||
|
||||
var elem = $('.providerList', page).html(html);
|
||||
const elem = $('.providerList', page).html(html);
|
||||
$('.btnOptions', elem).on('click', function () {
|
||||
var id = this.getAttribute('data-id');
|
||||
const id = this.getAttribute('data-id');
|
||||
showProviderOptions(page, id, this);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function showProviderOptions(page, providerId, button) {
|
||||
var items = [];
|
||||
function showProviderOptions(page, providerId, button) {
|
||||
const items = [];
|
||||
items.push({
|
||||
name: globalize.translate('ButtonDelete'),
|
||||
id: 'delete'
|
||||
|
@ -137,7 +147,7 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
id: 'map'
|
||||
});
|
||||
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
import('actionsheet').then(({default: actionsheet}) => {
|
||||
actionsheet.show({
|
||||
items: items,
|
||||
positionTo: button
|
||||
|
@ -152,22 +162,22 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function mapChannels(page, providerId) {
|
||||
require(['components/channelMapper/channelMapper'], function (channelMapper) {
|
||||
new channelMapper.default({
|
||||
function mapChannels(page, providerId) {
|
||||
import('components/channelMapper/channelMapper').then(({default: channelMapper}) => {
|
||||
new channelMapper({
|
||||
serverId: ApiClient.serverInfo().Id,
|
||||
providerId: providerId
|
||||
}).show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteProvider(page, id) {
|
||||
var message = globalize.translate('MessageConfirmDeleteGuideProvider');
|
||||
function deleteProvider(page, id) {
|
||||
const message = globalize.translate('MessageConfirmDeleteGuideProvider');
|
||||
|
||||
require(['confirm'], function (confirm) {
|
||||
confirm.default(message, globalize.translate('HeaderDeleteProvider')).then(function () {
|
||||
import('confirm').then(({default: confirm}) => {
|
||||
confirm(message, globalize.translate('HeaderDeleteProvider')).then(function () {
|
||||
loading.show();
|
||||
ApiClient.ajax({
|
||||
type: 'DELETE',
|
||||
|
@ -181,9 +191,9 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getTunerName(providerId) {
|
||||
function getTunerName(providerId) {
|
||||
switch (providerId = providerId.toLowerCase()) {
|
||||
case 'm3u':
|
||||
return 'M3U';
|
||||
|
@ -196,9 +206,9 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getProviderName(providerId) {
|
||||
function getProviderName(providerId) {
|
||||
switch (providerId = providerId.toLowerCase()) {
|
||||
case 'schedulesdirect':
|
||||
return 'Schedules Direct';
|
||||
|
@ -207,19 +217,19 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getProviderConfigurationUrl(providerId) {
|
||||
function getProviderConfigurationUrl(providerId) {
|
||||
switch (providerId = providerId.toLowerCase()) {
|
||||
case 'xmltv':
|
||||
return 'livetvguideprovider.html?type=xmltv';
|
||||
case 'schedulesdirect':
|
||||
return 'livetvguideprovider.html?type=schedulesdirect';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addProvider(button) {
|
||||
var menuItems = [];
|
||||
function addProvider(button) {
|
||||
const menuItems = [];
|
||||
menuItems.push({
|
||||
name: 'Schedules Direct',
|
||||
id: 'SchedulesDirect'
|
||||
|
@ -229,7 +239,7 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
id: 'xmltv'
|
||||
});
|
||||
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
import('actionsheet').then(({default: actionsheet}) => {
|
||||
actionsheet.show({
|
||||
items: menuItems,
|
||||
positionTo: button,
|
||||
|
@ -238,14 +248,14 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function addDevice(button) {
|
||||
function addDevice(button) {
|
||||
Dashboard.navigate('livetvtuner.html');
|
||||
}
|
||||
}
|
||||
|
||||
function showDeviceMenu(button, tunerDeviceId) {
|
||||
var items = [];
|
||||
function showDeviceMenu(button, tunerDeviceId) {
|
||||
const items = [];
|
||||
items.push({
|
||||
name: globalize.translate('ButtonDelete'),
|
||||
id: 'delete'
|
||||
|
@ -255,7 +265,7 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
id: 'edit'
|
||||
});
|
||||
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
import('actionsheet').then(({default: actionsheet}) => {
|
||||
actionsheet.show({
|
||||
items: items,
|
||||
positionTo: button
|
||||
|
@ -270,14 +280,14 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onDevicesListClick(e) {
|
||||
var card = dom.parentWithClass(e.target, 'card');
|
||||
function onDevicesListClick(e) {
|
||||
const card = dom.parentWithClass(e.target, 'card');
|
||||
|
||||
if (card) {
|
||||
var id = card.getAttribute('data-id');
|
||||
var btnCardOptions = dom.parentWithClass(e.target, 'btnCardOptions');
|
||||
const id = card.getAttribute('data-id');
|
||||
const btnCardOptions = dom.parentWithClass(e.target, 'btnCardOptions');
|
||||
|
||||
if (btnCardOptions) {
|
||||
showDeviceMenu(btnCardOptions, id);
|
||||
|
@ -285,10 +295,11 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
Dashboard.navigate('livetvtuner.html?id=' + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default function () {
|
||||
$(document).on('pageinit', '#liveTvStatusPage', function () {
|
||||
var page = this;
|
||||
const page = this;
|
||||
$('.btnAddDevice', page).on('click', function () {
|
||||
addDevice(this);
|
||||
});
|
||||
|
@ -301,21 +312,21 @@ define(['jQuery', 'globalize', 'scripts/taskbutton', 'dom', 'libraryMenu', 'layo
|
|||
});
|
||||
page.querySelector('.devicesList').addEventListener('click', onDevicesListClick);
|
||||
}).on('pageshow', '#liveTvStatusPage', function () {
|
||||
var page = this;
|
||||
const page = this;
|
||||
reload(page);
|
||||
taskButton.default({
|
||||
taskButton({
|
||||
mode: 'on',
|
||||
progressElem: page.querySelector('.refreshGuideProgress'),
|
||||
taskKey: 'RefreshGuide',
|
||||
button: page.querySelector('.btnRefresh')
|
||||
});
|
||||
}).on('pagehide', '#liveTvStatusPage', function () {
|
||||
var page = this;
|
||||
taskButton.default({
|
||||
const page = this;
|
||||
taskButton({
|
||||
mode: 'off',
|
||||
progressElem: page.querySelector('.refreshGuideProgress'),
|
||||
taskKey: 'RefreshGuide',
|
||||
button: page.querySelector('.btnRefresh')
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ function fillTypes(view, currentId) {
|
|||
html += globalize.translate('TabOther');
|
||||
html += '</option>';
|
||||
selectType.innerHTML = html;
|
||||
selectType.disabled = null != currentId;
|
||||
selectType.disabled = currentId != null;
|
||||
selectType.value = '';
|
||||
onTypeChange.call(selectType);
|
||||
});
|
||||
|
@ -112,15 +112,15 @@ function getDetectedDevice() {
|
|||
function onTypeChange() {
|
||||
const value = this.value;
|
||||
const view = dom.parentWithClass(this, 'page');
|
||||
const mayIncludeUnsupportedDrmChannels = 'hdhomerun' === value;
|
||||
const supportsTranscoding = 'hdhomerun' === value;
|
||||
const supportsFavorites = 'hdhomerun' === value;
|
||||
const supportsTunerIpAddress = 'hdhomerun' === value;
|
||||
const supportsTunerFileOrUrl = 'm3u' === value;
|
||||
const supportsStreamLooping = 'm3u' === value;
|
||||
const supportsTunerCount = 'm3u' === value;
|
||||
const supportsUserAgent = 'm3u' === value;
|
||||
const suppportsSubmit = 'other' !== value;
|
||||
const mayIncludeUnsupportedDrmChannels = value === 'hdhomerun';
|
||||
const supportsTranscoding = value === 'hdhomerun';
|
||||
const supportsFavorites = value === 'hdhomerun';
|
||||
const supportsTunerIpAddress = value === 'hdhomerun';
|
||||
const supportsTunerFileOrUrl = value === 'm3u';
|
||||
const supportsStreamLooping = value === 'm3u';
|
||||
const supportsTunerCount = value === 'm3u';
|
||||
const supportsUserAgent = value === 'm3u';
|
||||
const suppportsSubmit = value !== 'other';
|
||||
const supportsSelectablePath = supportsTunerFileOrUrl;
|
||||
const txtDevicePath = view.querySelector('.txtDevicePath');
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardBuilder', 'userSettings', 'globalize', 'emby-itemscontainer'], function (loading, events, libraryBrowser, imageLoader, listView, cardBuilder, userSettings, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
libraryBrowser = libraryBrowser.default || libraryBrowser;
|
||||
|
||||
return function (view, params, tabContent) {
|
||||
|
@ -50,7 +51,7 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB
|
|||
var viewStyle = self.getCurrentViewStyle();
|
||||
var itemsContainer = tabContent.querySelector('.itemsContainer');
|
||||
|
||||
if ('List' == viewStyle) {
|
||||
if (viewStyle == 'List') {
|
||||
itemsContainer.classList.add('vertical-list');
|
||||
itemsContainer.classList.remove('vertical-wrap');
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(['layoutManager', 'loading', 'libraryBrowser', 'cardBuilder', 'lazyLoader', 'apphost', 'globalize', 'appRouter', 'dom', 'emby-button'], function (layoutManager, loading, libraryBrowser, cardBuilder, lazyLoader, appHost, globalize, appRouter, dom) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
libraryBrowser = libraryBrowser.default || libraryBrowser;
|
||||
|
||||
return function (view, params, tabContent) {
|
||||
|
@ -56,13 +57,13 @@ define(['layoutManager', 'loading', 'libraryBrowser', 'cardBuilder', 'lazyLoader
|
|||
var elem = entry.target;
|
||||
var id = elem.getAttribute('data-id');
|
||||
var viewStyle = self.getCurrentViewStyle();
|
||||
var limit = 'Thumb' == viewStyle || 'ThumbCard' == viewStyle ? 5 : 9;
|
||||
var limit = viewStyle == 'Thumb' || viewStyle == 'ThumbCard' ? 5 : 9;
|
||||
|
||||
if (enableScrollX()) {
|
||||
limit = 10;
|
||||
}
|
||||
|
||||
var enableImageTypes = 'Thumb' == viewStyle || 'ThumbCard' == viewStyle ? 'Primary,Backdrop,Thumb' : 'Primary';
|
||||
var enableImageTypes = viewStyle == 'Thumb' || viewStyle == 'ThumbCard' ? 'Primary,Backdrop,Thumb' : 'Primary';
|
||||
var query = {
|
||||
SortBy: 'SortName',
|
||||
SortOrder: 'Ascending',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(['loading', 'layoutManager', 'userSettings', 'events', 'libraryBrowser', 'alphaPicker', 'listView', 'cardBuilder', 'globalize', 'emby-itemscontainer'], function (loading, layoutManager, userSettings, events, libraryBrowser, AlphaPicker, listView, cardBuilder, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
libraryBrowser = libraryBrowser.default || libraryBrowser;
|
||||
|
||||
return function (view, params, tabContent, options) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['events', 'layoutManager', 'inputManager', 'userSettings', 'libraryMenu', 'mainTabsManager', 'cardBuilder', 'dom', 'imageLoader', 'playbackManager', 'globalize', 'emby-scroller', 'emby-itemscontainer', 'emby-tabs', 'emby-button'], function (events, layoutManager, inputManager, userSettings, libraryMenu, mainTabsManager, cardBuilder, dom, imageLoader, playbackManager, globalize) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', 'alphaPicker', 'listView', 'cardBuilder', 'userSettings', 'globalize', 'emby-itemscontainer'], function (layoutManager, loading, events, libraryBrowser, imageLoader, AlphaPicker, listView, cardBuilder, userSettings, globalize) {
|
||||
'use strict';
|
||||
|
||||
loading = loading.default || loading;
|
||||
libraryBrowser = libraryBrowser.default || libraryBrowser;
|
||||
|
||||
return function (view, params, tabContent) {
|
||||
|
|
|
@ -73,7 +73,7 @@ import 'emby-itemscontainer';
|
|||
const viewStyle = self.getCurrentViewStyle();
|
||||
const itemsContainer = tabContent.querySelector('.itemsContainer');
|
||||
|
||||
if ('List' == viewStyle) {
|
||||
if (viewStyle == 'List') {
|
||||
itemsContainer.classList.add('vertical-list');
|
||||
itemsContainer.classList.remove('vertical-wrap');
|
||||
} else {
|
||||
|
|
|
@ -57,7 +57,7 @@ import 'emby-itemscontainer';
|
|||
const viewStyle = self.getCurrentViewStyle();
|
||||
const itemsContainer = tabContent.querySelector('.itemsContainer');
|
||||
|
||||
if ('List' == viewStyle) {
|
||||
if (viewStyle == 'List') {
|
||||
itemsContainer.classList.add('vertical-list');
|
||||
itemsContainer.classList.remove('vertical-wrap');
|
||||
} else {
|
||||
|
|
|
@ -304,7 +304,7 @@ import 'flexStyles';
|
|||
import(depends).then(({default: controllerFactory}) => {
|
||||
let tabContent;
|
||||
|
||||
if (0 == index) {
|
||||
if (index == 0) {
|
||||
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
|
||||
self.tabContent = tabContent;
|
||||
}
|
||||
|
|
|
@ -22,18 +22,18 @@ import 'css!assets/css/videoosd';
|
|||
/* eslint-disable indent */
|
||||
|
||||
function seriesImageUrl(item, options) {
|
||||
if ('Episode' !== item.Type) {
|
||||
if (item.Type !== 'Episode') {
|
||||
return null;
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
options.type = options.type || 'Primary';
|
||||
if ('Primary' === options.type && item.SeriesPrimaryImageTag) {
|
||||
if (options.type === 'Primary' && item.SeriesPrimaryImageTag) {
|
||||
options.tag = item.SeriesPrimaryImageTag;
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||
}
|
||||
|
||||
if ('Thumb' === options.type) {
|
||||
if (options.type === 'Thumb') {
|
||||
if (item.SeriesThumbImageTag) {
|
||||
options.tag = item.SeriesThumbImageTag;
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||
|
@ -57,7 +57,7 @@ import 'css!assets/css/videoosd';
|
|||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.PrimaryImageItemId || item.Id, options);
|
||||
}
|
||||
|
||||
if ('Primary' === options.type && item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
if (options.type === 'Primary' && item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
options.tag = item.AlbumPrimaryImageTag;
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId, options);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ import 'css!assets/css/videoosd';
|
|||
function onDoubleClick(e) {
|
||||
const clientX = e.clientX;
|
||||
|
||||
if (null != clientX) {
|
||||
if (clientX != null) {
|
||||
if (clientX < dom.getWindowSize().innerWidth / 2) {
|
||||
playbackManager.rewind(currentPlayer);
|
||||
} else {
|
||||
|
@ -117,7 +117,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function getDisplayItem(item) {
|
||||
if ('TvChannel' === item.Type) {
|
||||
if (item.Type === 'TvChannel') {
|
||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
return apiClient.getItem(apiClient.getCurrentUserId(), item.Id).then(function (refreshedItem) {
|
||||
return {
|
||||
|
@ -133,7 +133,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function updateRecordingButton(item) {
|
||||
if (!item || 'Program' !== item.Type) {
|
||||
if (!item || item.Type !== 'Program') {
|
||||
if (recordingButtonManager) {
|
||||
recordingButtonManager.destroy();
|
||||
recordingButtonManager = null;
|
||||
|
@ -176,8 +176,8 @@ import 'css!assets/css/videoosd';
|
|||
const osdTitle = view.querySelector('.osdTitle');
|
||||
titleElement = osdTitle;
|
||||
let displayName = itemHelper.getDisplayName(displayItem, {
|
||||
includeParentInfo: 'Program' !== displayItem.Type,
|
||||
includeIndexNumber: 'Program' !== displayItem.Type
|
||||
includeParentInfo: displayItem.Type !== 'Program',
|
||||
includeIndexNumber: displayItem.Type !== 'Program'
|
||||
});
|
||||
|
||||
if (!displayName) {
|
||||
|
@ -198,8 +198,8 @@ import 'css!assets/css/videoosd';
|
|||
tomatoes: false,
|
||||
endsAt: false,
|
||||
episodeTitle: false,
|
||||
originalAirDate: 'Program' !== displayItem.Type,
|
||||
episodeTitleIndexNumber: 'Program' !== displayItem.Type,
|
||||
originalAirDate: displayItem.Type !== 'Program',
|
||||
episodeTitleIndexNumber: displayItem.Type !== 'Program',
|
||||
programIndicator: false
|
||||
});
|
||||
const osdMediaInfo = view.querySelector('.osdMediaInfo');
|
||||
|
@ -271,7 +271,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function shouldEnableProgressByTimeOfDay(item) {
|
||||
return !('TvChannel' !== item.Type || !item.CurrentProgram);
|
||||
return !(item.Type !== 'TvChannel' || !item.CurrentProgram);
|
||||
}
|
||||
|
||||
function updateNowPlayingInfo(player, state) {
|
||||
|
@ -330,24 +330,24 @@ import 'css!assets/css/videoosd';
|
|||
|
||||
if (item) {
|
||||
let imgUrl = seriesImageUrl(item, {
|
||||
maxWidth: osdPoster.clientWidth * 2,
|
||||
maxWidth: osdPoster.clientWidth,
|
||||
type: 'Primary'
|
||||
}) || seriesImageUrl(item, {
|
||||
maxWidth: osdPoster.clientWidth * 2,
|
||||
maxWidth: osdPoster.clientWidth,
|
||||
type: 'Thumb'
|
||||
}) || imageUrl(item, {
|
||||
maxWidth: osdPoster.clientWidth * 2,
|
||||
maxWidth: osdPoster.clientWidth,
|
||||
type: 'Primary'
|
||||
});
|
||||
|
||||
if (!imgUrl && secondaryItem && (imgUrl = seriesImageUrl(secondaryItem, {
|
||||
maxWidth: osdPoster.clientWidth * 2,
|
||||
maxWidth: osdPoster.clientWidth,
|
||||
type: 'Primary'
|
||||
}) || seriesImageUrl(secondaryItem, {
|
||||
maxWidth: osdPoster.clientWidth * 2,
|
||||
maxWidth: osdPoster.clientWidth,
|
||||
type: 'Thumb'
|
||||
}) || imageUrl(secondaryItem, {
|
||||
maxWidth: osdPoster.clientWidth * 2,
|
||||
maxWidth: osdPoster.clientWidth,
|
||||
type: 'Primary'
|
||||
})), imgUrl) {
|
||||
return void (osdPoster.innerHTML = '<img src="' + imgUrl + '" />');
|
||||
|
@ -372,7 +372,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function toggleOsd() {
|
||||
if ('osd' === currentVisibleMenu) {
|
||||
if (currentVisibleMenu === 'osd') {
|
||||
hideOsd();
|
||||
} else if (!currentVisibleMenu) {
|
||||
showOsd();
|
||||
|
@ -433,7 +433,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function hideMainOsdControls() {
|
||||
if ('osd' === currentVisibleMenu) {
|
||||
if (currentVisibleMenu === 'osd') {
|
||||
const elem = osdBottomElement;
|
||||
clearHideAnimationEventListeners(elem);
|
||||
elem.classList.add('videoOsdBottom-hidden');
|
||||
|
@ -463,7 +463,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function onPointerMove(e) {
|
||||
if ('mouse' === (e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse'))) {
|
||||
if ((e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse')) === 'mouse') {
|
||||
const eventX = e.screenX || 0;
|
||||
const eventY = e.screenY || 0;
|
||||
const obj = lastPointerMoveData;
|
||||
|
@ -491,7 +491,7 @@ import 'css!assets/css/videoosd';
|
|||
|
||||
switch (e.detail.command) {
|
||||
case 'left':
|
||||
if ('osd' === currentVisibleMenu) {
|
||||
if (currentVisibleMenu === 'osd') {
|
||||
showOsd();
|
||||
} else {
|
||||
if (!currentVisibleMenu) {
|
||||
|
@ -503,7 +503,7 @@ import 'css!assets/css/videoosd';
|
|||
break;
|
||||
|
||||
case 'right':
|
||||
if ('osd' === currentVisibleMenu) {
|
||||
if (currentVisibleMenu === 'osd') {
|
||||
showOsd();
|
||||
} else if (!currentVisibleMenu) {
|
||||
e.preventDefault();
|
||||
|
@ -618,7 +618,7 @@ import 'css!assets/css/videoosd';
|
|||
resetUpNextDialog();
|
||||
console.debug('nowplaying event: ' + e.type);
|
||||
|
||||
if ('Video' !== state.NextMediaType) {
|
||||
if (state.NextMediaType !== 'Video') {
|
||||
view.removeEventListener('viewbeforehide', onViewHideStopPlayback);
|
||||
Emby.Page.back();
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function showComingUpNextIfNeeded(player, currentItem, currentTimeTicks, runtimeTicks) {
|
||||
if (runtimeTicks && currentTimeTicks && !comingUpNextDisplayed && !currentVisibleMenu && 'Episode' === currentItem.Type && userSettings.enableNextVideoInfoOverlay()) {
|
||||
if (runtimeTicks && currentTimeTicks && !comingUpNextDisplayed && !currentVisibleMenu && currentItem.Type === 'Episode' && userSettings.enableNextVideoInfoOverlay()) {
|
||||
const showAtSecondsLeft = runtimeTicks >= 3e10 ? 40 : runtimeTicks >= 24e9 ? 35 : 30;
|
||||
const showAtTicks = runtimeTicks - 1e3 * showAtSecondsLeft * 1e4;
|
||||
const timeRemainingTicks = runtimeTicks - currentTimeTicks;
|
||||
|
@ -717,7 +717,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function onUpNextHidden() {
|
||||
if ('upnext' === currentVisibleMenu) {
|
||||
if (currentVisibleMenu === 'upnext') {
|
||||
currentVisibleMenu = null;
|
||||
}
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function refreshProgramInfoIfNeeded(player, item) {
|
||||
if ('TvChannel' === item.Type) {
|
||||
if (item.Type === 'TvChannel') {
|
||||
const program = item.CurrentProgram;
|
||||
|
||||
if (program && program.EndDate) {
|
||||
|
@ -781,7 +781,7 @@ import 'css!assets/css/videoosd';
|
|||
updatePlayPauseState(playState.IsPaused);
|
||||
const supportedCommands = playbackManager.getSupportedCommands(player);
|
||||
currentPlayerSupportedCommands = supportedCommands;
|
||||
supportsBrightnessChange = -1 !== supportedCommands.indexOf('SetBrightness');
|
||||
supportsBrightnessChange = supportedCommands.indexOf('SetBrightness') !== -1;
|
||||
updatePlayerVolumeState(player, playState.IsMuted, playState.VolumeLevel);
|
||||
|
||||
if (nowPlayingPositionSlider && !nowPlayingPositionSlider.dragging) {
|
||||
|
@ -795,13 +795,13 @@ import 'css!assets/css/videoosd';
|
|||
updateTimeDisplay(playState.PositionTicks, nowPlayingItem.RunTimeTicks, playState.PlaybackStartTimeTicks, playState.BufferedRanges || []);
|
||||
updateNowPlayingInfo(player, state);
|
||||
|
||||
if (state.MediaSource && state.MediaSource.SupportsTranscoding && -1 !== supportedCommands.indexOf('SetMaxStreamingBitrate')) {
|
||||
if (state.MediaSource && state.MediaSource.SupportsTranscoding && supportedCommands.indexOf('SetMaxStreamingBitrate') !== -1) {
|
||||
view.querySelector('.btnVideoOsdSettings').classList.remove('hide');
|
||||
} else {
|
||||
view.querySelector('.btnVideoOsdSettings').classList.add('hide');
|
||||
}
|
||||
|
||||
const isProgressClear = state.MediaSource && null == state.MediaSource.RunTimeTicks;
|
||||
const isProgressClear = state.MediaSource && state.MediaSource.RunTimeTicks == null;
|
||||
nowPlayingPositionSlider.setIsClear(isProgressClear);
|
||||
|
||||
if (nowPlayingItem.RunTimeTicks) {
|
||||
|
@ -809,19 +809,19 @@ import 'css!assets/css/videoosd';
|
|||
userSettings.skipForwardLength() * 1000000 / nowPlayingItem.RunTimeTicks);
|
||||
}
|
||||
|
||||
if (-1 === supportedCommands.indexOf('ToggleFullscreen') || player.isLocalPlayer && layoutManager.tv && playbackManager.isFullscreen(player)) {
|
||||
if (supportedCommands.indexOf('ToggleFullscreen') === -1 || player.isLocalPlayer && layoutManager.tv && playbackManager.isFullscreen(player)) {
|
||||
view.querySelector('.btnFullscreen').classList.add('hide');
|
||||
} else {
|
||||
view.querySelector('.btnFullscreen').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (-1 === supportedCommands.indexOf('PictureInPicture')) {
|
||||
if (supportedCommands.indexOf('PictureInPicture') === -1) {
|
||||
view.querySelector('.btnPip').classList.add('hide');
|
||||
} else {
|
||||
view.querySelector('.btnPip').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (-1 === supportedCommands.indexOf('AirPlay')) {
|
||||
if (supportedCommands.indexOf('AirPlay') === -1) {
|
||||
view.querySelector('.btnAirPlay').classList.add('hide');
|
||||
} else {
|
||||
view.querySelector('.btnAirPlay').classList.remove('hide');
|
||||
|
@ -869,7 +869,7 @@ import 'css!assets/css/videoosd';
|
|||
nowPlayingPositionSlider.value = 0;
|
||||
}
|
||||
|
||||
if (runtimeTicks && null != positionTicks && currentRuntimeTicks && !enableProgressByTimeOfDay && currentItem.RunTimeTicks && 'Recording' !== currentItem.Type) {
|
||||
if (runtimeTicks && positionTicks != null && currentRuntimeTicks && !enableProgressByTimeOfDay && currentItem.RunTimeTicks && currentItem.Type !== 'Recording') {
|
||||
endsAtText.innerHTML = ' - ' + mediaInfo.getEndsAtFromPosition(runtimeTicks, positionTicks, true);
|
||||
} else {
|
||||
endsAtText.innerHTML = '';
|
||||
|
@ -890,11 +890,11 @@ import 'css!assets/css/videoosd';
|
|||
let showMuteButton = true;
|
||||
let showVolumeSlider = true;
|
||||
|
||||
if (-1 === supportedCommands.indexOf('Mute')) {
|
||||
if (supportedCommands.indexOf('Mute') === -1) {
|
||||
showMuteButton = false;
|
||||
}
|
||||
|
||||
if (-1 === supportedCommands.indexOf('SetVolume')) {
|
||||
if (supportedCommands.indexOf('SetVolume') === -1) {
|
||||
showVolumeSlider = false;
|
||||
}
|
||||
|
||||
|
@ -945,7 +945,7 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function updateTimeText(elem, ticks, divider) {
|
||||
if (null == ticks) {
|
||||
if (ticks == null) {
|
||||
elem.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
@ -987,9 +987,9 @@ import 'css!assets/css/videoosd';
|
|||
}
|
||||
|
||||
function onSettingsOption(selectedOption) {
|
||||
if ('stats' === selectedOption) {
|
||||
if (selectedOption === 'stats') {
|
||||
toggleStats();
|
||||
} else if ('suboffset' === selectedOption) {
|
||||
} else if (selectedOption === 'suboffset') {
|
||||
const player = currentPlayer;
|
||||
if (player) {
|
||||
playbackManager.enableShowingSubtitleOffset(player);
|
||||
|
@ -1063,7 +1063,7 @@ import 'css!assets/css/videoosd';
|
|||
const streams = playbackManager.subtitleTracks(player);
|
||||
let currentIndex = playbackManager.getSubtitleStreamIndex(player);
|
||||
|
||||
if (null == currentIndex) {
|
||||
if (currentIndex == null) {
|
||||
currentIndex = -1;
|
||||
}
|
||||
|
||||
|
@ -1134,9 +1134,9 @@ import 'css!assets/css/videoosd';
|
|||
clickedElement = e.target;
|
||||
|
||||
const key = keyboardnavigation.getKeyName(e);
|
||||
const isKeyModified = e.ctrlKey || e.altKey;
|
||||
const isKeyModified = e.ctrlKey || e.altKey || e.metaKey;
|
||||
|
||||
if (!currentVisibleMenu && 32 === e.keyCode) {
|
||||
if (!currentVisibleMenu && e.keyCode === 32) {
|
||||
playbackManager.playPause(currentPlayer);
|
||||
showOsd();
|
||||
return;
|
||||
|
|
|
@ -3,21 +3,21 @@ import globalize from 'globalize';
|
|||
/* eslint-disable indent */
|
||||
|
||||
function processForgotPasswordResult(result) {
|
||||
if ('ContactAdmin' == result.Action) {
|
||||
if (result.Action == 'ContactAdmin') {
|
||||
return void Dashboard.alert({
|
||||
message: globalize.translate('MessageContactAdminToResetPassword'),
|
||||
title: globalize.translate('HeaderForgotPassword')
|
||||
});
|
||||
}
|
||||
|
||||
if ('InNetworkRequired' == result.Action) {
|
||||
if (result.Action == 'InNetworkRequired') {
|
||||
return void Dashboard.alert({
|
||||
message: globalize.translate('MessageForgotPasswordInNetworkRequired'),
|
||||
title: globalize.translate('HeaderForgotPassword')
|
||||
});
|
||||
}
|
||||
|
||||
if ('PinCode' == result.Action) {
|
||||
if (result.Action == 'PinCode') {
|
||||
let msg = globalize.translate('MessageForgotPasswordFileCreated');
|
||||
msg += '<br/>';
|
||||
msg += '<br/>';
|
||||
|
|
|
@ -58,7 +58,7 @@ import 'emby-itemscontainer';
|
|||
const viewStyle = self.getCurrentViewStyle();
|
||||
const itemsContainer = tabContent.querySelector('.itemsContainer');
|
||||
|
||||
if ('List' == viewStyle) {
|
||||
if (viewStyle == 'List') {
|
||||
itemsContainer.classList.add('vertical-list');
|
||||
itemsContainer.classList.remove('vertical-wrap');
|
||||
} else {
|
||||
|
|
|
@ -62,13 +62,13 @@ import 'emby-button';
|
|||
const elem = entry.target;
|
||||
const id = elem.getAttribute('data-id');
|
||||
const viewStyle = self.getCurrentViewStyle();
|
||||
let limit = 'Thumb' == viewStyle || 'ThumbCard' == viewStyle ? 5 : 9;
|
||||
let limit = viewStyle == 'Thumb' || viewStyle == 'ThumbCard' ? 5 : 9;
|
||||
|
||||
if (enableScrollX()) {
|
||||
limit = 10;
|
||||
}
|
||||
|
||||
const enableImageTypes = 'Thumb' == viewStyle || 'ThumbCard' == viewStyle ? 'Primary,Backdrop,Thumb' : 'Primary';
|
||||
const enableImageTypes = viewStyle == 'Thumb' || viewStyle == 'ThumbCard' ? 'Primary,Backdrop,Thumb' : 'Primary';
|
||||
const query = {
|
||||
SortBy: 'SortName',
|
||||
SortOrder: 'Ascending',
|
||||
|
|
|
@ -58,7 +58,7 @@ import 'emby-itemscontainer';
|
|||
const viewStyle = self.getCurrentViewStyle();
|
||||
const itemsContainer = tabContent.querySelector('.itemsContainer');
|
||||
|
||||
if ('List' == viewStyle) {
|
||||
if (viewStyle == 'List') {
|
||||
itemsContainer.classList.add('vertical-list');
|
||||
itemsContainer.classList.remove('vertical-wrap');
|
||||
} else {
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="preload">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
|
||||
<meta http-equiv="X-UA-Compatibility" content="IE=Edge">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
|
@ -15,10 +13,9 @@
|
|||
<meta name="robots" content="noindex, nofollow, noarchive">
|
||||
<meta property="og:title" content="Jellyfin">
|
||||
<meta property="og:site_name" content="Jellyfin">
|
||||
<meta property="og:url" content="http://jellyfin.media">
|
||||
<meta property="og:description" content="The Free Software Media System.">
|
||||
<meta property="og:url" content="http://jellyfin.org">
|
||||
<meta property="og:description" content="The Free Software Media System">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="fb:app_id" content="1618309211750238">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="touchicon.png">
|
||||
|
||||
<!-- iPhone 5 -->
|
||||
|
@ -64,7 +61,6 @@
|
|||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<meta name="msapplication-TileImage" content="touchicon144.png">
|
||||
<meta name="msapplication-TileColor" content="#333333">
|
||||
<meta name="theme-color" content="#101010">
|
||||
|
||||
<title>Jellyfin</title>
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(["browser", "dom", "css!./navdrawer", "scrollStyles"], function (browser, dom) {
|
||||
"use strict";
|
||||
|
||||
browser = browser.default || browser;
|
||||
|
||||
return function (options) {
|
||||
function getTouches(e) {
|
||||
return e.changedTouches || e.targetTouches || e.touches;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(["events", "playbackManager", "pluginManager", "inputManager", "connectionManager", "userSettings"], function (events, playbackManager, pluginManager, inputManager, connectionManager, userSettings) {
|
||||
"use strict";
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
function getMinIdleTime() {
|
||||
// Returns the minimum amount of idle time required before the screen saver can be displayed
|
||||
//time units used Millisecond
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['browser', 'layoutManager', 'dom', 'focusManager', 'ResizeObserver', 'scrollStyles'], function (browser, layoutManager, dom, focusManager, ResizeObserver) {
|
||||
'use strict';
|
||||
|
||||
browser = browser.default || browser;
|
||||
|
||||
/**
|
||||
* Return type of the value.
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Jellyfin",
|
||||
"description": "Jellyfin: the Free Software Media System.",
|
||||
"description": "The Free Software Media System",
|
||||
"lang": "en-US",
|
||||
"short_name": "Jellyfin",
|
||||
"start_url": "index.html#!/home.html",
|
||||
|
|
|
@ -2,6 +2,7 @@ import connectionManager from 'connectionManager';
|
|||
import loading from 'loading';
|
||||
import keyboardnavigation from 'keyboardnavigation';
|
||||
import dialogHelper from 'dialogHelper';
|
||||
import dom from 'dom';
|
||||
import events from 'events';
|
||||
import 'css!./style';
|
||||
import 'material-icons';
|
||||
|
@ -93,23 +94,22 @@ export class BookPlayer {
|
|||
|
||||
onWindowKeyUp(e) {
|
||||
let key = keyboardnavigation.getKeyName(e);
|
||||
let rendition = this._rendition;
|
||||
|
||||
// TODO: depending on the event this can be the document or the rendition itself
|
||||
let rendition = this._rendition || this;
|
||||
let book = rendition.book;
|
||||
|
||||
if (this._loaded === false) return;
|
||||
switch (key) {
|
||||
case 'l':
|
||||
case 'ArrowRight':
|
||||
case 'Right':
|
||||
if (this._loaded) {
|
||||
book.package.metadata.direction === 'rtl' ? rendition.prev() : rendition.next();
|
||||
}
|
||||
break;
|
||||
case 'j':
|
||||
case 'ArrowLeft':
|
||||
case 'Left':
|
||||
if (this._loaded) {
|
||||
book.package.metadata.direction === 'rtl' ? rendition.next() : rendition.prev();
|
||||
}
|
||||
break;
|
||||
case 'Escape':
|
||||
if (this._tocElement) {
|
||||
|
@ -123,6 +123,25 @@ export class BookPlayer {
|
|||
}
|
||||
}
|
||||
|
||||
onTouchStart(e) {
|
||||
// TODO: depending on the event this can be the document or the rendition itself
|
||||
let rendition = this._rendition || this;
|
||||
let book = rendition.book;
|
||||
|
||||
// check that the event is from the book or the document
|
||||
if (!book || this._loaded === false) return;
|
||||
|
||||
// epubjs stores pages off the screen or something for preloading
|
||||
// get the modulus of the touch event to account for the increased width
|
||||
if (!e.touches || e.touches.length === 0) return;
|
||||
let touch = e.touches[0].clientX % dom.getWindowSize().innerWidth;
|
||||
if (touch < dom.getWindowSize().innerWidth / 2) {
|
||||
book.package.metadata.direction === 'rtl' ? rendition.next() : rendition.prev();
|
||||
} else {
|
||||
book.package.metadata.direction === 'rtl' ? rendition.prev() : rendition.next();
|
||||
}
|
||||
}
|
||||
|
||||
onDialogClosed() {
|
||||
this.stop();
|
||||
}
|
||||
|
@ -139,8 +158,11 @@ export class BookPlayer {
|
|||
this.bindMediaElementEvents();
|
||||
|
||||
document.addEventListener('keyup', this.onWindowKeyUp);
|
||||
document.addEventListener('touchstart', this.onTouchStart);
|
||||
|
||||
// FIXME: I don't really get why document keyup event is not triggered when epub is in focus
|
||||
this._rendition.on('keyup', this.onWindowKeyUp);
|
||||
this._rendition.on('touchstart', this.onTouchStart);
|
||||
}
|
||||
|
||||
unbindMediaElementEvents() {
|
||||
|
@ -155,9 +177,13 @@ export class BookPlayer {
|
|||
if (this._mediaElement) {
|
||||
this.unbindMediaElementEvents();
|
||||
}
|
||||
|
||||
document.removeEventListener('keyup', this.onWindowKeyUp);
|
||||
document.removeEventListener('touchstart', this.onTouchStart);
|
||||
|
||||
if (this._rendition) {
|
||||
this._rendition.off('keyup', this.onWindowKeyUp);
|
||||
this._rendition.off('touchstart', this.onTouchStart);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,13 +195,11 @@ export class BookPlayer {
|
|||
|
||||
createMediaElement() {
|
||||
let elem = this._mediaElement;
|
||||
|
||||
if (elem) {
|
||||
return elem;
|
||||
}
|
||||
|
||||
elem = document.getElementById('bookPlayer');
|
||||
|
||||
if (!elem) {
|
||||
elem = dialogHelper.createDialog({
|
||||
exitAnimationDuration: 400,
|
||||
|
@ -185,6 +209,7 @@ export class BookPlayer {
|
|||
exitAnimation: 'fadeout',
|
||||
removeOnClose: true
|
||||
});
|
||||
|
||||
elem.id = 'bookPlayer';
|
||||
|
||||
let html = '';
|
||||
|
@ -222,7 +247,7 @@ export class BookPlayer {
|
|||
return new Promise((resolve, reject) => {
|
||||
import('epubjs').then(({default: epubjs}) => {
|
||||
let downloadHref = apiClient.getItemDownloadUrl(item.Id);
|
||||
let book = epubjs.default(downloadHref, {openAs: 'epub'});
|
||||
let book = epubjs(downloadHref, {openAs: 'epub'});
|
||||
let rendition = book.renderTo(elem, {width: '100%', height: '97%'});
|
||||
|
||||
this._currentSrc = downloadHref;
|
||||
|
@ -230,6 +255,7 @@ export class BookPlayer {
|
|||
let cancellationToken = {
|
||||
shouldCancel: false
|
||||
};
|
||||
|
||||
this._cancellationToken = cancellationToken;
|
||||
|
||||
return rendition.display().then(() => {
|
||||
|
@ -253,7 +279,6 @@ export class BookPlayer {
|
|||
epubElem.style.display = 'block';
|
||||
rendition.on('relocated', (locations) => {
|
||||
this._progress = book.locations.percentageFromCfi(locations.start.cfi);
|
||||
|
||||
events.trigger(this, 'timeupdate');
|
||||
});
|
||||
|
||||
|
@ -262,7 +287,7 @@ export class BookPlayer {
|
|||
return resolve();
|
||||
});
|
||||
}, () => {
|
||||
console.error('Failed to display epub');
|
||||
console.error('failed to display epub');
|
||||
return reject();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', 'globalize', 'events', 'require', 'castSenderApiLoader'], function (appSettings, userSettings, playbackManager, connectionManager, globalize, events, require, castSenderApiLoader) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
||||
var currentResolve;
|
||||
var currentReject;
|
||||
|
@ -54,7 +56,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
|||
// production version registered with google
|
||||
// replace this value if you want to test changes on another instance
|
||||
var applicationStable = 'F007D354';
|
||||
var applicationNightly = '6F511C87';
|
||||
var applicationUnstable = '6F511C87';
|
||||
|
||||
var messageNamespace = 'urn:x-cast:com.connectsdk';
|
||||
|
||||
|
@ -99,8 +101,8 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
|||
}
|
||||
|
||||
var applicationID = applicationStable;
|
||||
if (userSettings.chromecastVersion() === 'nightly') {
|
||||
applicationID = applicationNightly;
|
||||
if (userSettings.chromecastVersion() === 'unstable') {
|
||||
applicationID = applicationUnstable;
|
||||
}
|
||||
|
||||
// request session
|
||||
|
@ -363,7 +365,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
|||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
require(['chromecastHelper'], function (chromecastHelper) {
|
||||
require(['./chromecastHelper'], function (chromecastHelper) {
|
||||
chromecastHelper.getServerAddress(apiClient).then(function (serverAddress) {
|
||||
message.serverAddress = serverAddress;
|
||||
player.sendMessageInternal(message).then(resolve, reject);
|
||||
|
|
|
@ -1663,7 +1663,7 @@ function tryRemoveElement(elem) {
|
|||
setAspectRatio(val) {
|
||||
const mediaElement = this.#mediaElement;
|
||||
if (mediaElement) {
|
||||
if ('auto' === val) {
|
||||
if (val === 'auto') {
|
||||
mediaElement.style.removeProperty('object-fit');
|
||||
} else {
|
||||
mediaElement.style['object-fit'] = val;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define(['playbackManager', 'events', 'serverNotifications', 'connectionManager'], function (playbackManager, events, serverNotifications, connectionManager) {
|
||||
'use strict';
|
||||
|
||||
playbackManager = playbackManager.default || playbackManager;
|
||||
|
||||
function getActivePlayerId() {
|
||||
var info = playbackManager.getPlayerInfo();
|
||||
return info ? info.id : null;
|
||||
|
|
8
src/scripts/autoThemes.js
Normal file
8
src/scripts/autoThemes.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import * as userSettings from 'userSettings';
|
||||
import skinManager from 'skinManager';
|
||||
import connectionManager from 'connectionManager';
|
||||
import events from 'events';
|
||||
|
||||
events.on(connectionManager, 'localusersignedin', function (e, user) {
|
||||
skinManager.setTheme(userSettings.theme());
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue