diff --git a/src/components/cardbuilder/card.css b/src/components/cardbuilder/card.css index b6fdf7cb2..69a0e4e90 100644 --- a/src/components/cardbuilder/card.css +++ b/src/components/cardbuilder/card.css @@ -174,6 +174,7 @@ button::-moz-focus-inner { .cardScalable .cardImageContainer { height: 100%; + width: 100%; contain: strict; } @@ -225,8 +226,8 @@ button::-moz-focus-inner { } .visualCardBox .cardContent { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; + border-top-left-radius: 0.2em; + border-top-right-radius: 0.2em; } .cardContent-shadow, @@ -368,11 +369,6 @@ button::-moz-focus-inner { color: inherit; } -.cardImageIcon-small { - font-size: 3em !important; - margin-bottom: 0.1em; -} - .cardIndicators { right: 0.225em; top: 0.225em; diff --git a/src/controllers/dashboard/devices/devices.js b/src/controllers/dashboard/devices/devices.js index d2cb0ad8c..7dd597f80 100644 --- a/src/controllers/dashboard/devices/devices.js +++ b/src/controllers/dashboard/devices/devices.js @@ -96,7 +96,7 @@ import confirm from '../../../components/confirm/confirm'; deviceHtml += '
'; deviceHtml += '
'; deviceHtml += '
'; - deviceHtml += ''; + deviceHtml += ``; const iconUrl = imageHelper.getDeviceIcon(device); if (iconUrl) { diff --git a/src/controllers/dashboard/library.js b/src/controllers/dashboard/library.js index 7faf92211..a0acb36ad 100644 --- a/src/controllers/dashboard/library.js +++ b/src/controllers/dashboard/library.js @@ -9,6 +9,7 @@ import '../../components/cardbuilder/card.css'; import '../../elements/emby-itemrefreshindicator/emby-itemrefreshindicator'; import Dashboard, { pageClassOn, pageIdOn } from '../../scripts/clientUtils'; import confirm from '../../components/confirm/confirm'; +import cardBuilder from '../../components/cardbuilder/cardBuilder'; /* eslint-disable indent */ @@ -276,11 +277,12 @@ import confirm from '../../components/confirm/confirm'; let hasCardImageContainer; if (imgUrl) { - html += '
"; + html += `
`; + html += ``; hasCardImageContainer = true; } else if (!virtualFolder.showNameWithIcon) { - html += '
'; - html += ''; + html += `
`; + html += ''; hasCardImageContainer = true; } @@ -293,7 +295,7 @@ import confirm from '../../components/confirm/confirm'; if (!imgUrl && virtualFolder.showNameWithIcon) { html += '

'; - html += ''; + html += ''; if (virtualFolder.showNameWithIcon) { html += '
'; diff --git a/src/controllers/dashboard/plugins/available/index.js b/src/controllers/dashboard/plugins/available/index.js index ecbc4dac9..da25b7c0a 100644 --- a/src/controllers/dashboard/plugins/available/index.js +++ b/src/controllers/dashboard/plugins/available/index.js @@ -1,6 +1,7 @@ import loading from '../../../../components/loading/loading'; import libraryMenu from '../../../../scripts/libraryMenu'; import globalize from '../../../../scripts/globalize'; +import * as cardBuilder from '../../../../components/cardbuilder/cardBuilder.js'; import '../../../../components/cardbuilder/card.css'; import '../../../../elements/emby-button/emby-button'; import '../../../../elements/emby-checkbox/emby-checkbox'; @@ -102,10 +103,20 @@ function getPluginHtml(plugin, options, installedPlugins) { html += '
'; html += ''; html += '
'; html += "
"; html += plugin.name; diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index 76249abf6..654ae4c29 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -2,6 +2,7 @@ import loading from '../../../../components/loading/loading'; import libraryMenu from '../../../../scripts/libraryMenu'; import dom from '../../../../scripts/dom'; import globalize from '../../../../scripts/globalize'; +import * as cardBuilder from '../../../../components/cardbuilder/cardBuilder.js'; import '../../../../components/cardbuilder/card.css'; import '../../../../elements/emby-button/emby-button'; import Dashboard, { pageIdOn } from '../../../../scripts/clientUtils'; @@ -53,22 +54,31 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { const configPage = pluginConfigurationPages.filter(function (pluginConfigurationPage) { return pluginConfigurationPage.PluginId == plugin.Id; })[0]; + const configPageUrl = configPage ? Dashboard.getPluginUrl(configPage.Name) : null; let html = ''; + html += `
`; html += '
'; html += '
'; html += '
'; - html += configPageUrl ? `
` : ''; html += '
'; if (configPage || plugin.CanUninstall) { @@ -133,7 +143,7 @@ function showPluginMenu(page, elem) { const id = card.getAttribute('data-id'); const name = card.getAttribute('data-name'); const removable = card.getAttribute('data-removable'); - const configHref = card.querySelector('.cardContent').getAttribute('href'); + const configHref = card.querySelector('.cardImageContainer').getAttribute('href'); const status = card.getAttribute('data-status'); const version = card.getAttribute('data-version'); const menuItems = []; diff --git a/src/controllers/dashboard/users/userprofilespage.js b/src/controllers/dashboard/users/userprofilespage.js index 33d445639..203a63015 100644 --- a/src/controllers/dashboard/users/userprofilespage.js +++ b/src/controllers/dashboard/users/userprofilespage.js @@ -10,6 +10,7 @@ import '../../../components/indicators/indicators.css'; import '../../../assets/css/flexstyles.scss'; import Dashboard, { pageIdOn } from '../../../scripts/clientUtils'; import confirm from '../../../components/confirm/confirm'; +import cardBuilder from '../../../components/cardbuilder/cardBuilder'; /* eslint-disable indent */ @@ -93,7 +94,7 @@ import confirm from '../../../components/confirm/confirm'; html += '
'; html += '
'; html += '
'; - html += ''; + html += ``; let imgUrl; if (user.PrimaryImageTag) { @@ -113,7 +114,7 @@ import confirm from '../../../components/confirm/confirm'; if (imgUrl) { html += '
"; } else { - html += '
'; + html += `
`; html += ''; } diff --git a/src/controllers/session/login/index.js b/src/controllers/session/login/index.js index 24b3a983e..84596ce4c 100644 --- a/src/controllers/session/login/index.js +++ b/src/controllers/session/login/index.js @@ -13,6 +13,7 @@ import ServerConnections from '../../../components/ServerConnections'; import toast from '../../../components/toast/toast'; import dialogHelper from '../../../components/dialogHelper/dialogHelper'; import baseAlert from '../../../components/alert'; +import cardBuilder from '../../../components/cardbuilder/cardBuilder'; /* eslint-disable indent */ @@ -131,29 +132,6 @@ import baseAlert from '../../../components/alert'; } } - const metroColors = ['#6FBD45', '#4BB3DD', '#4164A5', '#E12026', '#800080', '#E1B222', '#008040', '#0094FF', '#FF00C7', '#FF870F', '#7F0037']; - - function getRandomMetroColor() { - const index = Math.floor(Math.random() * (metroColors.length - 1)); - return metroColors[index]; - } - - function getMetroColor(str) { - if (str) { - const character = String(str.substr(0, 1).charCodeAt()); - let sum = 0; - - for (let i = 0; i < character.length; i++) { - sum += parseInt(character.charAt(i)); - } - - const index = String(sum).substr(-1); - return metroColors[index]; - } - - return getRandomMetroColor(); - } - function loadUserList(context, apiClient, users) { let html = ''; @@ -176,7 +154,7 @@ import baseAlert from '../../../components/alert'; html += '
'; html += '
'; html += '
'; - html += '
'; + html += `
`; let imgUrl; if (user.PrimaryImageTag) { @@ -185,11 +163,12 @@ import baseAlert from '../../../components/alert'; tag: user.PrimaryImageTag, type: 'Primary' }); + html += '
"; } else { - const background = getMetroColor(user.Id); - imgUrl = 'assets/img/avatar.png'; - html += '
'; + html += `
`; + html += ''; + html += '
'; } html += '
'; diff --git a/src/controllers/session/selectServer/index.js b/src/controllers/session/selectServer/index.js index 32674a806..6c6e4189a 100644 --- a/src/controllers/session/selectServer/index.js +++ b/src/controllers/session/selectServer/index.js @@ -17,6 +17,7 @@ import '../../../elements/emby-button/emby-button'; import Dashboard from '../../../scripts/clientUtils'; import ServerConnections from '../../../components/ServerConnections'; import alert from '../../../components/alert'; +import cardBuilder from '../../../components/cardbuilder/cardBuilder'; /* eslint-disable indent */ @@ -64,7 +65,7 @@ import alert from '../../../components/alert'; cardContainer += '
'; cardContainer += '
'; cardContainer += '
'; - cardContainer += '
'; + cardContainer += `
`; cardContainer += cardImageContainer; cardContainer += '
'; cardContainer += '
'; diff --git a/src/strings/en-us.json b/src/strings/en-us.json index faae336e4..394162249 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -179,6 +179,8 @@ "DirectStreamHelp1": "The video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.", "DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.", "DirectStreaming": "Direct streaming", + "EnablePlugin": "Enable Plugin", + "DisablePlugin": "Disable Plugin", "Disc": "Disc", "Disconnect": "Disconnect", "Display": "Display",