diff --git a/.eslintrc.js b/.eslintrc.js index dc8729fb2a..e5ee2dfe86 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -49,6 +49,7 @@ module.exports = { 'prefer-const': ['error', {'destructuring': 'all'}], 'quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }], '@babel/semi': ['error'], + 'no-var': ['error'], 'space-before-blocks': ['error'], 'space-infix-ops': 'error', 'yoda': 'error' diff --git a/.gitignore b/.gitignore index 36b843f022..98aa2d974b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ dist web node_modules +# config +config.json + # ide .idea .vscode diff --git a/package.json b/package.json index d2072a85a9..490d8a5314 100644 --- a/package.json +++ b/package.json @@ -5,28 +5,28 @@ "repository": "https://github.com/jellyfin/jellyfin-web", "license": "GPL-2.0-or-later", "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/eslint-parser": "^7.11.5", - "@babel/eslint-plugin": "^7.11.5", + "@babel/core": "^7.12.3", + "@babel/eslint-parser": "^7.12.1", + "@babel/eslint-plugin": "^7.12.1", "@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.11.5", - "@babel/preset-env": "^7.11.5", + "@babel/plugin-proposal-private-methods": "^7.12.1", + "@babel/plugin-transform-modules-amd": "^7.12.1", + "@babel/polyfill": "^7.12.1", + "@babel/preset-env": "^7.12.1", "autoprefixer": "^9.8.6", "babel-loader": "^8.0.6", - "browser-sync": "^2.26.12", - "confusing-browser-globals": "^1.0.9", + "browser-sync": "^2.26.13", + "confusing-browser-globals": "^1.0.10", "copy-webpack-plugin": "^5.1.1", - "css-loader": "^4.3.0", + "css-loader": "^5.0.0", "cssnano": "^4.1.10", - "del": "^5.1.0", - "eslint": "^7.9.0", + "del": "^6.0.0", + "eslint": "^7.12.0", "eslint-plugin-compat": "^3.5.1", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-import": "^2.21.2", + "eslint-plugin-import": "^2.22.1", "eslint-plugin-promise": "^4.2.1", - "file-loader": "^6.1.0", + "file-loader": "^6.1.1", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", "gulp-cli": "^2.3.0", @@ -45,12 +45,12 @@ "node-sass": "^4.13.1", "postcss-loader": "^3.0.0", "postcss-preset-env": "^6.7.0", - "style-loader": "^1.1.3", - "stylelint": "^13.7.1", + "style-loader": "^2.0.0", + "stylelint": "^13.7.2", "stylelint-config-rational-order": "^0.1.2", "stylelint-no-browser-hacks": "^1.2.1", "stylelint-order": "^4.1.0", - "webpack": "^4.44.2", + "webpack": "^5.2.0", "webpack-merge": "^4.2.2", "webpack-stream": "^6.1.0", "worker-plugin": "^5.0.0" @@ -62,14 +62,14 @@ "core-js": "^3.6.5", "date-fns": "^2.16.1", "epubjs": "^0.3.85", + "pdfjs-dist": "2.4.456", "fast-text-encoding": "^1.0.3", "flv.js": "^1.5.0", - "headroom.js": "^0.11.0", - "hls.js": "^0.14.12", - "howler": "^2.2.0", + "headroom.js": "^0.12.0", + "hls.js": "^0.14.16", + "howler": "^2.2.1", "intersection-observer": "^0.11.0", - "jellyfin-apiclient": "^1.4.1", - "jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto", + "jellyfin-apiclient": "^1.4.2", "jquery": "^3.5.1", "jstree": "^3.3.10", "libarchive.js": "^1.3.0", @@ -77,11 +77,11 @@ "material-design-icons-iconfont": "^6.1.0", "native-promise-only": "^0.8.0-a", "page": "^1.11.6", - "query-string": "^6.13.2", + "query-string": "^6.13.6", "resize-observer-polyfill": "^1.5.1", "screenfull": "^5.0.2", "sortablejs": "^1.12.0", - "swiper": "^6.2.0", + "swiper": "^6.3.4", "webcomponents.js": "^0.7.24", "whatwg-fetch": "^3.4.1" }, @@ -245,7 +245,7 @@ "src/controllers/dashboard/plugins/installed/index.js", "src/controllers/dashboard/plugins/available/index.js", "src/controllers/dashboard/plugins/repositories/index.js", - "src/controllers/dashboard/quickconnect.js", + "src/controllers/dashboard/quickConnect.js", "src/controllers/dashboard/scheduledtasks/scheduledtask.js", "src/controllers/dashboard/scheduledtasks/scheduledtasks.js", "src/controllers/dashboard/serveractivity.js", @@ -326,6 +326,7 @@ "src/libraries/scroller.js", "src/plugins/backdropScreensaver/plugin.js", "src/plugins/bookPlayer/plugin.js", + "src/plugins/pdfPlayer/plugin.js", "src/plugins/bookPlayer/tableOfContents.js", "src/plugins/chromecastPlayer/chromecastHelper.js", "src/plugins/photoPlayer/plugin.js", diff --git a/src/assets/css/videoosd.css b/src/assets/css/videoosd.css index 808915e58b..b2446d5d48 100644 --- a/src/assets/css/videoosd.css +++ b/src/assets/css/videoosd.css @@ -6,29 +6,42 @@ -ms-user-select: none; } -.osdPoster img, .videoOsdBottom { bottom: 0; left: 0; right: 0; + position: fixed; + background: linear-gradient(0deg, rgba(16, 16, 16, 0.75) 0%, rgba(16, 16, 16, 0) 100%); + padding-top: 7.5em; + padding-bottom: 1.75em; + display: flex; + flex-direction: row; + justify-content: center; + will-change: opacity; + transition: opacity 0.3s ease-out; + color: #fff; + user-select: none; + -webkit-touch-callout: none; } -.osdHeader { - -webkit-transition: opacity 0.3s ease-out; - -o-transition: opacity 0.3s ease-out; +.skinHeader-withBackground.osdHeader { transition: opacity 0.3s ease-out; position: relative; z-index: 1; - background: rgba(0, 0, 0, 0.7) !important; - -webkit-backdrop-filter: none !important; - backdrop-filter: none !important; - color: #eee !important; + background: linear-gradient(180deg, rgba(16, 16, 16, 0.75) 0%, rgba(16, 16, 16, 0) 100%); + backdrop-filter: none; + color: #eee; + height: 7.5em; } .osdHeader-hidden { opacity: 0; } +.osdHeader .headerTop { + max-height: 3.5em; +} + .osdHeader .headerButton:not(.headerBackButton):not(.headerCastButton):not(.headerSyncButton) { display: none; } @@ -86,34 +99,17 @@ opacity: 0.6; } -.videoOsdBottom { - position: fixed; - background-color: rgba(0, 0, 0, 0.7); - padding: 1%; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-box-orient: horizontal; - -webkit-box-direction: normal; - -webkit-flex-direction: row; - flex-direction: row; - will-change: opacity; - -webkit-transition: opacity 0.3s ease-out; - -o-transition: opacity 0.3s ease-out; - transition: opacity 0.3s ease-out; - color: #fff; - user-select: none; - -webkit-touch-callout: none; -} - .videoOsdBottom-hidden { opacity: 0; } .osdControls { - -webkit-box-flex: 1; - -webkit-flex-grow: 1; flex-grow: 1; + padding: 0 0.8em; +} + +.layout-desktop .osdControls { + max-width: calc(100vh * 1.77 - 2vh); } .videoOsdBottom .buttons { @@ -145,7 +141,7 @@ } .volumeButtons { - margin: 0 0.5em 0 auto; + margin: 0 1em 0 0.29em; display: flex; -webkit-align-items: center; align-items: center; @@ -153,33 +149,13 @@ .osdTimeText { margin-left: 1em; + margin-right: auto; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } -.osdPoster { - width: 10%; - position: relative; - margin-right: 0.5em; -} - -.osdPoster img { - position: absolute; - height: auto; - width: 100%; - -webkit-box-shadow: 0 0 1.9vh #000; - box-shadow: 0 0 1.9vh #000; - border: 0.08em solid #222; - user-drag: none; - user-select: none; - -moz-user-select: none; - -webkit-user-drag: none; - -webkit-user-select: none; - -ms-user-select: none; -} - .osdTitle, .osdTitleSmall { margin: 0 1em 0 0; diff --git a/src/bundle.js b/src/bundle.js index 25810f58ee..2693ede52b 100644 --- a/src/bundle.js +++ b/src/bundle.js @@ -90,17 +90,16 @@ _define('material-icons', function() { return materialIcons; }); -// noto font -const noto = require('jellyfin-noto'); -_define('jellyfin-noto', function () { - return noto; -}); - const epubjs = require('epubjs'); _define('epubjs', function () { return epubjs; }); +const pdfjs = require('pdfjs-dist/build/pdf'); +_define('pdfjs', function () { + return pdfjs; +}); + // page.js const page = require('page'); _define('page', function() { @@ -177,7 +176,7 @@ _define('appStorage', function () { }); // libarchive.js -var libarchive = require('libarchive.js'); +const libarchive = require('libarchive.js'); _define('libarchive', function () { return libarchive; }); diff --git a/src/components/appFooter/appFooter.js b/src/components/appFooter/appFooter.js index c60aa1a27c..260aea8280 100644 --- a/src/components/appFooter/appFooter.js +++ b/src/components/appFooter/appFooter.js @@ -27,7 +27,7 @@ class appFooter { }; } destroy() { - var self = this; + const self = this; self.element = null; } diff --git a/src/components/apphost.js b/src/components/apphost.js index 33ca5a0b79..df2f7c2d2c 100644 --- a/src/components/apphost.js +++ b/src/components/apphost.js @@ -78,7 +78,7 @@ function getDeviceId() { } function getDeviceName() { - var deviceName; + let deviceName; if (browser.tizen) { deviceName = 'Samsung Smart TV'; } else if (browser.web0s) { @@ -172,7 +172,6 @@ function supportsCue() { function onAppVisible() { if (isHidden) { isHidden = false; - console.debug('triggering app resume event'); events.trigger(appHost, 'resume'); } } @@ -180,7 +179,6 @@ function onAppVisible() { function onAppHidden() { if (!isHidden) { isHidden = true; - console.debug('app is hidden'); } } diff --git a/src/components/displaySettings/displaySettings.js b/src/components/displaySettings/displaySettings.js index 9def27dc8a..efaab16b3f 100644 --- a/src/components/displaySettings/displaySettings.js +++ b/src/components/displaySettings/displaySettings.js @@ -23,7 +23,7 @@ import 'emby-button'; }).join(''); // get default theme - var defaultTheme = themes.find(theme => { + const defaultTheme = themes.find(theme => { return theme.default; }); diff --git a/src/components/filtermenu/filtermenu.js b/src/components/filtermenu/filtermenu.js index be12b04edd..7cef08303d 100644 --- a/src/components/filtermenu/filtermenu.js +++ b/src/components/filtermenu/filtermenu.js @@ -19,7 +19,7 @@ function onSubmit(e) { return false; } function renderOptions(context, selector, cssClass, items, isCheckedFn) { - var elem = context.querySelector(selector); + const elem = context.querySelector(selector); if (items.length) { elem.classList.remove('hide'); @@ -27,12 +27,12 @@ function renderOptions(context, selector, cssClass, items, isCheckedFn) { elem.classList.add('hide'); } - var html = ''; + let html = ''; html += items.map(function (filter) { - var itemHtml = ''; + let itemHtml = ''; - var checkedHtml = isCheckedFn(filter) ? ' checked' : ''; + const checkedHtml = isCheckedFn(filter) ? ' checked' : ''; itemHtml += '