1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

merge branch master into config

This commit is contained in:
dkanada 2020-08-03 04:46:07 +09:00
commit 6c375a52bc
35 changed files with 1467 additions and 1411 deletions

View file

@ -1,6 +1,8 @@
define(['browser'], function (browser) {
'use strict';
browser = browser.default || browser;
function canPlayH264(videoTestElement) {
return !!(videoTestElement.canPlayType && videoTestElement.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
}

View file

@ -1,6 +1,9 @@
define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', 'viewManager', 'libraryBrowser', 'appRouter', 'apphost', 'playbackManager', 'syncPlayManager', 'groupSelectionMenu', 'browser', 'globalize', 'scripts/imagehelper', 'paper-icon-button-light', 'material-icons', 'scrollStyles', 'flexStyles'], function (dom, layoutManager, inputManager, connectionManager, events, viewManager, libraryBrowser, appRouter, appHost, playbackManager, syncPlayManager, groupSelectionMenu, browser, globalize, imageHelper) {
'use strict';
playbackManager = playbackManager.default || playbackManager;
browser = browser.default || browser;
function renderHeader() {
var html = '';
html += '<div class="flex align-items-center flex-grow headerTop">';

View file

@ -1,10 +1,15 @@
define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'dom'], function (inputManager, focusManager, browser, layoutManager, events, dom) {
'use strict';
import inputManager from 'inputManager';
import focusManager from 'focusManager';
import browser from 'browser';
import layoutManager from 'layoutManager';
import events from 'events';
import dom from 'dom';
/* eslint-disable indent */
var self = {};
const self = {};
var lastMouseInputTime = new Date().getTime();
var isMouseIdle;
let lastMouseInputTime = new Date().getTime();
let isMouseIdle;
function mouseIdleTime() {
return new Date().getTime() - lastMouseInputTime;
@ -15,14 +20,14 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function removeIdleClasses() {
var classList = document.body.classList;
const classList = document.body.classList;
classList.remove('mouseIdle');
classList.remove('mouseIdle-tv');
}
function addIdleClasses() {
var classList = document.body.classList;
const classList = document.body.classList;
classList.add('mouseIdle');
@ -31,7 +36,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
}
function showCursor() {
export function showCursor() {
if (isMouseIdle) {
isMouseIdle = false;
removeIdleClasses();
@ -39,7 +44,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
}
function hideCursor() {
export function hideCursor() {
if (!isMouseIdle) {
isMouseIdle = true;
addIdleClasses();
@ -47,17 +52,17 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
}
var lastPointerMoveData;
let lastPointerMoveData;
function onPointerMove(e) {
var eventX = e.screenX;
var eventY = e.screenY;
const eventX = e.screenX;
const eventY = e.screenY;
// if coord don't exist how could it move
if (typeof eventX === 'undefined' && typeof eventY === 'undefined') {
return;
}
var obj = lastPointerMoveData;
const obj = lastPointerMoveData;
if (!obj) {
lastPointerMoveData = {
x: eventX,
@ -81,11 +86,11 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function onPointerEnter(e) {
var pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');
const pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');
if (pointerType === 'mouse') {
if (!isMouseIdle) {
var parent = focusManager.focusableParent(e.target);
const parent = focusManager.focusableParent(e.target);
if (parent) {
focusManager.focus(parent);
}
@ -115,7 +120,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
}
var mouseInterval;
let mouseInterval;
function startMouseInterval() {
if (!mouseInterval) {
mouseInterval = setInterval(onMouseInterval, 5000);
@ -123,7 +128,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function stopMouseInterval() {
var interval = mouseInterval;
const interval = mouseInterval;
if (interval) {
clearInterval(interval);
@ -167,8 +172,10 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
events.on(layoutManager, 'modechange', initMouse);
self.hideCursor = hideCursor;
self.showCursor = showCursor;
/* eslint-enable indent */
export default {
hideCursor,
showCursor
};
return self;
});

View file

@ -1,18 +1,21 @@
define([
'jQuery',
'emby-button',
'emby-input',
'scripts/livetvcomponents',
'paper-icon-button-light',
'emby-itemscontainer',
'emby-collapse',
'emby-select',
'livetvcss',
'emby-checkbox',
'emby-slider',
'listViewStyle',
'dashboardcss',
'detailtablecss'], function () {
import 'emby-button';
import 'emby-input';
import 'scripts/livetvcomponents';
import 'paper-icon-button-light';
import 'emby-itemscontainer';
import 'emby-collapse';
import 'emby-select';
import 'livetvcss';
import 'emby-checkbox';
import 'emby-slider';
import 'listViewStyle';
import 'dashboardcss';
import 'detailtablecss';
/* eslint-disable indent */
console.groupCollapsed('defining core routes');
function defineRoute(newRoute) {
var path = newRoute.alias ? newRoute.alias : newRoute.path;
console.debug('defining route: ' + path);
@ -20,8 +23,6 @@ define([
Emby.Page.addRoute(path, newRoute);
}
console.debug('defining core routes');
defineRoute({
alias: '/addserver.html',
path: '/controllers/session/addServer/index.html',
@ -30,6 +31,7 @@ define([
startup: true,
controller: 'session/addServer/index'
});
defineRoute({
alias: '/selectserver.html',
path: '/controllers/session/selectServer/index.html',
@ -39,6 +41,7 @@ define([
controller: 'session/selectServer/index',
type: 'selectserver'
});
defineRoute({
alias: '/login.html',
path: '/controllers/session/login/index.html',
@ -48,6 +51,7 @@ define([
controller: 'session/login/index',
type: 'login'
});
defineRoute({
alias: '/forgotpassword.html',
path: '/controllers/session/forgotPassword/index.html',
@ -55,6 +59,7 @@ define([
startup: true,
controller: 'session/forgotPassword/index'
});
defineRoute({
alias: '/forgotpasswordpin.html',
path: '/controllers/session/redeemPassword/index.html',
@ -68,42 +73,41 @@ define([
alias: '/mypreferencesmenu.html',
path: '/controllers/user/menu/index.html',
autoFocus: false,
transition: 'fade',
controller: 'user/menu/index'
});
defineRoute({
alias: '/myprofile.html',
path: '/controllers/user/profile/index.html',
autoFocus: false,
transition: 'fade',
controller: 'user/profile/index'
});
defineRoute({
alias: '/mypreferencesdisplay.html',
path: '/controllers/user/display/index.html',
autoFocus: false,
transition: 'fade',
controller: 'user/display/index'
});
defineRoute({
alias: '/mypreferenceshome.html',
path: '/controllers/user/home/index.html',
autoFocus: false,
transition: 'fade',
controller: 'user/home/index'
});
defineRoute({
alias: '/mypreferencesplayback.html',
path: '/controllers/user/playback/index.html',
autoFocus: false,
transition: 'fade',
controller: 'user/playback/index'
});
defineRoute({
alias: '/mypreferencessubtitles.html',
path: '/controllers/user/subtitles/index.html',
autoFocus: false,
transition: 'fade',
controller: 'user/subtitles/index'
});
@ -113,42 +117,49 @@ define([
roles: 'admin',
controller: 'dashboard/dashboard'
});
defineRoute({
path: '/dashboardgeneral.html',
controller: 'dashboard/general',
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/networking.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/networking'
});
defineRoute({
path: '/devices.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/devices/devices'
});
defineRoute({
path: '/device.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/devices/device'
});
defineRoute({
path: '/dlnaprofile.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/dlna/profile'
});
defineRoute({
path: '/dlnaprofiles.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/dlna/profiles'
});
defineRoute({
alias: '/addplugin.html',
path: '/controllers/dashboard/plugins/add/index.html',
@ -156,52 +167,61 @@ define([
roles: 'admin',
controller: 'dashboard/plugins/add/index'
});
defineRoute({
path: '/library.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/mediaLibrary'
});
defineRoute({
path: '/librarydisplay.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/librarydisplay'
});
defineRoute({
path: '/dlnasettings.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/dlna/settings'
});
defineRoute({
path: '/edititemmetadata.html',
controller: 'edititemmetadata',
autoFocus: false
});
defineRoute({
path: '/encodingsettings.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/encodingsettings'
});
defineRoute({
path: '/log.html',
roles: 'admin',
controller: 'dashboard/logs'
});
defineRoute({
path: '/metadataimages.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/metadataImages'
});
defineRoute({
path: '/metadatanfo.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/metadatanfo'
});
defineRoute({
alias: '/notificationsetting.html',
path: '/controllers/dashboard/notifications/notification/index.html',
@ -209,6 +229,7 @@ define([
roles: 'admin',
controller: 'dashboard/notifications/notification/index'
});
defineRoute({
alias: '/notificationsettings.html',
path: '/controllers/dashboard/notifications/notifications/index.html',
@ -216,12 +237,14 @@ define([
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/playbackconfiguration.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/playback'
});
defineRoute({
alias: '/availableplugins.html',
path: '/controllers/dashboard/plugins/available/index.html',
@ -229,6 +252,7 @@ define([
roles: 'admin',
controller: 'dashboard/plugins/available/index'
});
defineRoute({
alias: '/repositories.html',
path: '/controllers/dashboard/plugins/repositories/index.html',
@ -241,67 +265,72 @@ define([
path: '/home.html',
autoFocus: false,
controller: 'home',
transition: 'fade',
type: 'home'
});
defineRoute({
path: '/search.html',
controller: 'searchpage'
});
defineRoute({
path: '/list.html',
autoFocus: false,
controller: 'list',
transition: 'fade'
controller: 'list'
});
defineRoute({
alias: '/details',
path: '/controllers/itemDetails/index.html',
controller: 'itemDetails/index',
autoFocus: false,
transition: 'fade'
autoFocus: false
});
defineRoute({
path: '/livetv.html',
controller: 'livetv/livetvsuggested',
autoFocus: false,
transition: 'fade'
autoFocus: false
});
defineRoute({
path: '/livetvguideprovider.html',
autoFocus: false,
roles: 'admin',
controller: 'livetvguideprovider'
});
defineRoute({
path: '/livetvsettings.html',
autoFocus: false,
controller: 'livetvsettings'
});
defineRoute({
path: '/livetvstatus.html',
autoFocus: false,
roles: 'admin',
controller: 'livetvstatus'
});
defineRoute({
path: '/livetvtuner.html',
autoFocus: false,
roles: 'admin',
controller: 'livetvtuner'
});
defineRoute({
path: '/movies.html',
autoFocus: false,
controller: 'movies/moviesrecommended',
transition: 'fade'
controller: 'movies/moviesrecommended'
});
defineRoute({
path: '/music.html',
controller: 'music/musicrecommended',
autoFocus: false,
transition: 'fade'
autoFocus: false
});
defineRoute({
alias: '/installedplugins.html',
path: '/controllers/dashboard/plugins/installed/index.html',
@ -309,41 +338,46 @@ define([
roles: 'admin',
controller: 'dashboard/plugins/installed/index'
});
defineRoute({
path: '/scheduledtask.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/scheduledtasks/scheduledtask'
});
defineRoute({
path: '/scheduledtasks.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/scheduledtasks/scheduledtasks'
});
defineRoute({
path: '/serveractivity.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/serveractivity'
});
defineRoute({
path: '/apikeys.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/apikeys'
});
defineRoute({
path: '/streamingsettings.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/streaming'
});
defineRoute({
path: '/tv.html',
autoFocus: false,
controller: 'shows/tvrecommended',
transition: 'fade'
controller: 'shows/tvrecommended'
});
defineRoute({
@ -352,29 +386,34 @@ define([
roles: 'admin',
controller: 'dashboard/users/useredit'
});
defineRoute({
path: '/userlibraryaccess.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/users/userlibraryaccess'
});
defineRoute({
path: '/usernew.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/users/usernew'
});
defineRoute({
path: '/userparentalcontrol.html',
autoFocus: false,
roles: 'admin',
controller: 'dashboard/users/userparentalcontrol'
});
defineRoute({
path: '/userpassword.html',
autoFocus: false,
controller: 'dashboard/users/userpasswordpage'
});
defineRoute({
path: '/userprofiles.html',
autoFocus: false,
@ -389,6 +428,7 @@ define([
anonymous: true,
controller: 'wizard/remote/index'
});
defineRoute({
alias: '/wizardfinish.html',
path: '/controllers/wizard/finish/index.html',
@ -396,12 +436,14 @@ define([
anonymous: true,
controller: 'wizard/finish/index'
});
defineRoute({
path: '/wizardlibrary.html',
autoFocus: false,
anonymous: true,
controller: 'dashboard/mediaLibrary'
});
defineRoute({
alias: '/wizardsettings.html',
path: '/controllers/wizard/settings/index.html',
@ -409,6 +451,7 @@ define([
anonymous: true,
controller: 'wizard/settings/index'
});
defineRoute({
alias: '/wizardstart.html',
path: '/controllers/wizard/start/index.html',
@ -416,6 +459,7 @@ define([
anonymous: true,
controller: 'wizard/start/index'
});
defineRoute({
alias: '/wizarduser.html',
path: '/controllers/wizard/user/index.html',
@ -427,7 +471,6 @@ define([
defineRoute({
alias: '/video',
path: '/controllers/playback/video/index.html',
transition: 'fade',
controller: 'playback/video/index',
autoFocus: false,
type: 'video-osd',
@ -435,16 +478,17 @@ define([
fullscreen: true,
enableMediaControl: false
});
defineRoute({
alias: '/queue',
path: '/controllers/playback/queue/index.html',
controller: 'playback/queue/index',
autoFocus: false,
transition: 'fade',
fullscreen: true,
supportsThemeMedia: true,
enableMediaControl: false
});
defineRoute({
path: '/configurationpage',
autoFocus: false,
@ -458,9 +502,13 @@ define([
isDefaultRoute: true,
autoFocus: false
});
defineRoute({
path: '/index.html',
autoFocus: false,
isDefaultRoute: true
});
});
console.groupEnd('defining core routes');
/* eslint-enable indent */

View file

@ -1,6 +1,8 @@
define(['connectionManager', 'playbackManager', 'syncPlayManager', 'events', 'inputManager', 'focusManager', 'appRouter'], function (connectionManager, playbackManager, syncPlayManager, events, inputManager, focusManager, appRouter) {
'use strict';
playbackManager = playbackManager.default || playbackManager;
var serverNotifications = {};
function notifyApp() {