diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 9c231e1391..95bb416d2a 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -2,8 +2,7 @@ trigger: batch: true branches: include: - - master - - release-* + - '*' tags: include: - '*' @@ -13,12 +12,9 @@ pr: - '*' jobs: - - job: build + - job: Build displayName: 'Build' - pool: - vmImage: 'ubuntu-latest' - strategy: matrix: Development: @@ -27,7 +23,9 @@ jobs: BuildConfiguration: production Standalone: BuildConfiguration: standalone - maxParallel: 3 + + pool: + vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 @@ -63,16 +61,14 @@ jobs: - script: 'mv dist jellyfin-web' displayName: 'Rename Directory' - condition: succeeded() - task: PublishPipelineArtifact@1 displayName: 'Publish Release' - condition: succeeded() inputs: targetPath: '$(Build.SourcesDirectory)/jellyfin-web' artifactName: 'jellyfin-web-$(BuildConfiguration)' - - job: lint + - job: Lint displayName: 'Lint' pool: diff --git a/.eslintrc.yml b/.eslintrc.yml index 64ee42cc0f..0b92c0c9b0 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -75,7 +75,7 @@ rules: no-multiple-empty-lines: ["error", { "max": 1 }] no-trailing-spaces: ["error"] one-var: ["error", "never"] - semi: ["warn"] + semi: ["error"] space-before-blocks: ["error"] # TODO: Fix warnings and remove these rules no-redeclare: ["warn"] diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000000..1320b9a327 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-env"] +} diff --git a/package.json b/package.json index 5360c1b98f..1e13158827 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ }, "dependencies": { "alameda": "^1.4.0", + "classlist.js": "https://github.com/eligrey/classList.js/archive/1.2.20180112.tar.gz", "core-js": "^3.6.4", "date-fns": "^2.11.1", "document-register-element": "^1.14.3", @@ -66,7 +67,7 @@ "jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto", "jquery": "^3.4.1", "jstree": "^3.3.7", - "libass-wasm": "https://github.com/jellyfin/JavascriptSubtitlesOctopus#4.0.0-jf", + "libass-wasm": "https://github.com/jellyfin/JavascriptSubtitlesOctopus#4.0.0-jf-cordova", "material-design-icons-iconfont": "^5.0.1", "native-promise-only": "^0.8.0-a", "page": "^1.11.5", @@ -91,9 +92,12 @@ "src/components/filedownloader.js", "src/components/filesystem.js", "src/components/input/keyboardnavigation.js", + "src/components/scrollManager.js", "src/components/sanatizefilename.js", "src/scripts/settings/webSettings.js", - "src/components/scrollManager.js", + "src/scripts/settings/appSettings.js", + "src/scripts/settings/userSettings.js", + "src/scripts/imagehelper.js", "src/scripts/dfnshelper.js" ], "plugins": [ diff --git a/src/assets/css/librarybrowser.css b/src/assets/css/librarybrowser.css index e4b5bcf8d6..f0865815f2 100644 --- a/src/assets/css/librarybrowser.css +++ b/src/assets/css/librarybrowser.css @@ -242,7 +242,7 @@ } .mainDrawer-scrollContainer { - padding-bottom: 10vh; + margin-bottom: 10vh; } @media all and (min-width: 40em) { diff --git a/src/bundle.js b/src/bundle.js index ed6518447f..a5c0adc6de 100644 --- a/src/bundle.js +++ b/src/bundle.js @@ -13,7 +13,7 @@ _define("document-register-element", function() { // fetch var fetch = require("whatwg-fetch"); _define("fetch", function() { - return fetch + return fetch; }); // query-string @@ -113,6 +113,12 @@ _define("polyfill", function () { return polyfill; }); +// domtokenlist-shim +var classlist = require("classlist.js"); +_define("classlist-polyfill", function () { + return classlist; +}); + // Date-FNS var date_fns = require("date-fns"); _define("date-fns", function () { diff --git a/src/components/activitylog.js b/src/components/activitylog.js index 934a610ad0..62eda74d5f 100644 --- a/src/components/activitylog.js +++ b/src/components/activitylog.js @@ -16,7 +16,7 @@ define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings", html += 'dvr" + }) + "');background-repeat:no-repeat;background-position:center center;background-size: cover;\">dvr"; } else { html += '' + icon + ''; } diff --git a/src/components/appRouter.js b/src/components/appRouter.js index c4ecede60f..d348ce3247 100644 --- a/src/components/appRouter.js +++ b/src/components/appRouter.js @@ -579,8 +579,8 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM function showDirect(path) { return new Promise(function(resolve, reject) { - resolveOnNextShow = resolve, page.show(baseUrl()+path) - }) + resolveOnNextShow = resolve, page.show(baseUrl()+path); + }); } function show(path, options) { diff --git a/src/components/apphost.js b/src/components/apphost.js index ff113b7a9f..65e82614fe 100644 --- a/src/components/apphost.js +++ b/src/components/apphost.js @@ -279,8 +279,8 @@ define(["appSettings", "browser", "events", "htmlMediaHelper", "webSettings"], f features.push("screensaver"); webSettings.enableMultiServer().then(enabled => { - if (enabled) features.push("multiserver") - }) + if (enabled) features.push("multiserver"); + }); if (!browser.orsay && !browser.msie && (browser.firefox || browser.ps4 || browser.edge || supportsCue())) { features.push("subtitleappearancesettings"); @@ -383,7 +383,7 @@ define(["appSettings", "browser", "events", "htmlMediaHelper", "webSettings"], f return window.NativeShell.AppHost.getDefaultLayout(); } - return getDefaultLayout() + return getDefaultLayout(); }, getDeviceProfile: getDeviceProfile, init: function () { diff --git a/src/components/backdropscreensaver/plugin.js b/src/components/backdropscreensaver/plugin.js index c0bd31fb86..55de27a138 100644 --- a/src/components/backdropscreensaver/plugin.js +++ b/src/components/backdropscreensaver/plugin.js @@ -52,5 +52,5 @@ define(["connectionManager"], function (connectionManager) { currentSlideshow = null; } }; - } + }; }); diff --git a/src/components/chromecast/chromecasthelpers.js b/src/components/chromecast/chromecasthelpers.js index 2fef0c68b3..9967a4d96c 100644 --- a/src/components/chromecast/chromecasthelpers.js +++ b/src/components/chromecast/chromecasthelpers.js @@ -188,9 +188,9 @@ define(['events'], function (events) { return apiClient.getEndpointInfo().then(function (endpoint) { if (endpoint.IsInNetwork) { return apiClient.getPublicSystemInfo().then(function (info) { - var localAddress = info.LocalAddress + var localAddress = info.LocalAddress; if (!localAddress) { - console.debug("No valid local address returned, defaulting to external one") + console.debug("No valid local address returned, defaulting to external one"); localAddress = serverAddress; } addToCache(serverAddress, localAddress); diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js index 1d5c23eb1f..fc976068e7 100644 --- a/src/components/directorybrowser/directorybrowser.js +++ b/src/components/directorybrowser/directorybrowser.js @@ -7,11 +7,11 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- systemInfo = info; return info; } - ) + ); } function onDialogClosed() { - loading.hide() + loading.hide(); } function refreshDirectoryBrowser(page, path, fileOptions, updatePathOnError) { @@ -24,7 +24,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- var promises = []; if ("Network" === path) { - promises.push(ApiClient.getNetworkDevices()) + promises.push(ApiClient.getNetworkDevices()); } else { if (path) { promises.push(ApiClient.getDirectoryContents(path, fileOptions)); @@ -101,7 +101,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- html += Globalize.translate("MessageDirectoryPickerLinuxInstruction"); html += "
"; } - html += "" + html += ""; } html += '
'; html += '
'; @@ -144,13 +144,13 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- function alertText(text) { alertTextWithOptions({ text: text - }) + }); } function alertTextWithOptions(options) { require(["alert"], function(alert) { - alert(options) - }) + alert(options); + }); } function validatePath(path, validateWriteable, apiClient) { @@ -171,12 +171,12 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- if (validateWriteable) { alertText(Globalize.translate("WriteAccessRequired")); } else { - alertText(Globalize.translate("PathNotFound")) + alertText(Globalize.translate("PathNotFound")); } - return Promise.reject() + return Promise.reject(); } } - return Promise.resolve() + return Promise.resolve(); }); } @@ -188,7 +188,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- if (lnkPath.classList.contains("lnkFile")) { content.querySelector("#txtDirectoryPickerPath").value = path; } else { - refreshDirectoryBrowser(content, path, fileOptions, true) + refreshDirectoryBrowser(content, path, fileOptions, true); } } }); @@ -275,7 +275,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- dlg.addEventListener("close", onDialogClosed); dialogHelper.open(dlg); dlg.querySelector(".btnCloseDialog").addEventListener("click", function() { - dialogHelper.close(dlg) + dialogHelper.close(dlg); }); currentDialog = dlg; dlg.querySelector("#txtDirectoryPickerPath").value = initialPath; @@ -293,9 +293,9 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- if (currentDialog) { dialogHelper.close(currentDialog); } - } + }; } var systemInfo; - return directoryBrowser + return directoryBrowser; }); diff --git a/src/components/displaysettings/displaysettings.js b/src/components/displaysettings/displaysettings.js index da407c11f1..682e60f604 100644 --- a/src/components/displaysettings/displaysettings.js +++ b/src/components/displaysettings/displaysettings.js @@ -186,6 +186,8 @@ define(['require', 'browser', 'layoutManager', 'appSettings', 'pluginManager', ' context.querySelector('#selectLanguage').value = userSettings.language() || ''; context.querySelector('.selectDateTimeLocale').value = userSettings.dateTimeLocale() || ''; + context.querySelector('#txtLibraryPageSize').value = userSettings.libraryPageSize(); + selectDashboardTheme.value = userSettings.dashboardTheme() || ''; selectTheme.value = userSettings.theme() || ''; @@ -215,6 +217,8 @@ define(['require', 'browser', 'layoutManager', 'appSettings', 'pluginManager', ' 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); diff --git a/src/components/displaysettings/displaysettings.template.html b/src/components/displaysettings/displaysettings.template.html index 4ef8c8b1ca..62cb493e82 100644 --- a/src/components/displaysettings/displaysettings.template.html +++ b/src/components/displaysettings/displaysettings.template.html @@ -143,6 +143,11 @@
+
+ +
${LabelLibraryPageSizeHelp}
+
+