diff --git a/src/components/actionSheet/actionSheet.js b/src/components/actionSheet/actionSheet.js index bf8b158458..0b040861b0 100644 --- a/src/components/actionSheet/actionSheet.js +++ b/src/components/actionSheet/actionSheet.js @@ -141,7 +141,7 @@ export function show(options) { } if (layoutManager.tv) { - html += ``; } diff --git a/src/components/alphaPicker/alphaPicker.js b/src/components/alphaPicker/alphaPicker.js index 1579ef71cc..ac484bbf1c 100644 --- a/src/components/alphaPicker/alphaPicker.js +++ b/src/components/alphaPicker/alphaPicker.js @@ -8,6 +8,7 @@ import focusManager from '../focusManager'; import layoutManager from '../layoutManager'; import dom from '../../scripts/dom'; +import globalize from '../../scripts/globalize'; import './style.scss'; import '../../elements/emby-button/paper-icon-button-light'; import 'material-design-icons-iconfont'; @@ -75,7 +76,7 @@ import 'material-design-icons-iconfont'; html += `
`; if (options.mode === 'keyboard') { - html += ``; + html += ``; } else { letters = ['#']; html += mapLetters(letters, vertical).join(''); @@ -85,7 +86,7 @@ import 'material-design-icons-iconfont'; html += mapLetters(letters, vertical).join(''); if (options.mode === 'keyboard') { - html += ``; + html += ``; html += '
'; letters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; diff --git a/src/components/cardbuilder/cardBuilder.js b/src/components/cardbuilder/cardBuilder.js index d46ee4cde1..c2300fb2d8 100644 --- a/src/components/cardbuilder/cardBuilder.js +++ b/src/components/cardbuilder/cardBuilder.js @@ -790,7 +790,7 @@ import ServerConnections from '../ServerConnections'; if (isOuterFooter && options.cardLayout && layoutManager.mobile) { if (options.cardFooterAside !== 'none') { - html += ''; + html += ``; } } @@ -1309,15 +1309,15 @@ import ServerConnections from '../ServerConnections'; const btnCssClass = 'cardOverlayButton cardOverlayButton-br itemAction'; if (options.centerPlayButton) { - overlayButtons += ''; + overlayButtons += ``; } if (overlayPlayButton && !item.IsPlaceHolder && (item.LocationType !== 'Virtual' || !item.MediaType || item.Type === 'Program') && item.Type !== 'Person') { - overlayButtons += ''; + overlayButtons += ``; } if (options.overlayMoreButton) { - overlayButtons += ''; + overlayButtons += ``; } } @@ -1344,8 +1344,10 @@ import ServerConnections from '../ServerConnections'; cardImageContainerClose = ''; } else { + const cardImageContainerAriaLabelAttribute = ` aria-label="${item.Name}"`; + // Don't use the IMG tag with safari because it puts a white border around it - cardImageContainerOpen = imgUrl ? (''; } @@ -1420,10 +1422,12 @@ import ServerConnections from '../ServerConnections'; } let actionAttribute; + let ariaLabelAttribute = ''; if (tagName === 'button') { className += ' itemAction'; actionAttribute = ' data-action="' + action + '"'; + ariaLabelAttribute = ` aria-label="${item.Name}"`; } else { actionAttribute = ''; } @@ -1450,7 +1454,7 @@ import ServerConnections from '../ServerConnections'; additionalCardContent += getHoverMenuHtml(item, action); } - return '<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId || options.serverId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + pathData + positionTicksData + collectionIdData + playlistIdData + contextData + parentIdData + startDate + endDate + ' data-prefix="' + prefix + '" class="' + className + '">' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + overlayButtons + additionalCardContent + cardScalableClose + outerCardFooter + cardBoxClose + ''; + return '<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId || options.serverId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + pathData + positionTicksData + collectionIdData + playlistIdData + contextData + parentIdData + startDate + endDate + ' data-prefix="' + prefix + '" class="' + className + '"' + ariaLabelAttribute + '>' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + overlayButtons + additionalCardContent + cardScalableClose + outerCardFooter + cardBoxClose + ''; } /** @@ -1488,7 +1492,7 @@ import ServerConnections from '../ServerConnections'; html += ''; } - html += ''; + html += ``; html += ''; html += ''; diff --git a/src/components/channelMapper/channelMapper.js b/src/components/channelMapper/channelMapper.js index 8f277fa943..d1338f182e 100644 --- a/src/components/channelMapper/channelMapper.js +++ b/src/components/channelMapper/channelMapper.js @@ -127,7 +127,7 @@ export default class channelMapper { let html = ''; const title = globalize.translate('MapChannels'); html += '
'; - html += ''; + html += ``; html += '

'; html += title; html += '

'; diff --git a/src/components/collectionEditor/collectionEditor.js b/src/components/collectionEditor/collectionEditor.js index e83467288d..f78573af3d 100644 --- a/src/components/collectionEditor/collectionEditor.js +++ b/src/components/collectionEditor/collectionEditor.js @@ -229,7 +229,7 @@ import toast from '../toast/toast'; const title = items.length ? globalize.translate('HeaderAddToCollection') : globalize.translate('NewCollection'); html += '
'; - html += ''; + html += ``; html += '

'; html += title; html += '

'; diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js index 5f5acc5c21..cc11736d99 100644 --- a/src/components/directorybrowser/directorybrowser.js +++ b/src/components/directorybrowser/directorybrowser.js @@ -264,7 +264,7 @@ class DirectoryBrowser { let html = ''; html += '
'; - html += ''; + html += ``; html += '

'; html += options.header || globalize.translate('HeaderSelectPath'); html += '

'; diff --git a/src/components/filtermenu/filtermenu.js b/src/components/filtermenu/filtermenu.js index 7436f04d11..8c71782968 100644 --- a/src/components/filtermenu/filtermenu.js +++ b/src/components/filtermenu/filtermenu.js @@ -228,7 +228,7 @@ class FilterMenu { let html = ''; html += '
'; - html += ''; + html += ``; html += '

${Filters}

'; html += '
'; diff --git a/src/components/imageDownloader/imageDownloader.template.html b/src/components/imageDownloader/imageDownloader.template.html index 6818b31530..ba760567d6 100644 --- a/src/components/imageDownloader/imageDownloader.template.html +++ b/src/components/imageDownloader/imageDownloader.template.html @@ -1,5 +1,5 @@
- +

${Search}

diff --git a/src/components/imageOptionsEditor/imageOptionsEditor.template.html b/src/components/imageOptionsEditor/imageOptionsEditor.template.html index e2d4df73c6..d3b1957e48 100644 --- a/src/components/imageOptionsEditor/imageOptionsEditor.template.html +++ b/src/components/imageOptionsEditor/imageOptionsEditor.template.html @@ -1,5 +1,5 @@
- +

${HeaderImageOptions}

diff --git a/src/components/imageUploader/imageUploader.template.html b/src/components/imageUploader/imageUploader.template.html index a59123e34d..4ae178fe77 100644 --- a/src/components/imageUploader/imageUploader.template.html +++ b/src/components/imageUploader/imageUploader.template.html @@ -1,5 +1,5 @@
- +

${HeaderUploadImage}

diff --git a/src/components/imageeditor/imageeditor.template.html b/src/components/imageeditor/imageeditor.template.html index 4d7b096f00..32e42bbef0 100644 --- a/src/components/imageeditor/imageeditor.template.html +++ b/src/components/imageeditor/imageeditor.template.html @@ -1,5 +1,5 @@
- +

${HeaderEditImages}

diff --git a/src/components/itemMediaInfo/itemMediaInfo.template.html b/src/components/itemMediaInfo/itemMediaInfo.template.html index ca34f5d0a4..161a35339f 100644 --- a/src/components/itemMediaInfo/itemMediaInfo.template.html +++ b/src/components/itemMediaInfo/itemMediaInfo.template.html @@ -1,5 +1,5 @@
-

${MoreMediaInfo}

diff --git a/src/components/itemidentifier/itemidentifier.template.html b/src/components/itemidentifier/itemidentifier.template.html index 96d3dd6431..edcb9d4c6a 100644 --- a/src/components/itemidentifier/itemidentifier.template.html +++ b/src/components/itemidentifier/itemidentifier.template.html @@ -1,5 +1,5 @@
-

${Identify}

diff --git a/src/components/mediaLibraryCreator/mediaLibraryCreator.template.html b/src/components/mediaLibraryCreator/mediaLibraryCreator.template.html index 27567590c9..d130c820eb 100644 --- a/src/components/mediaLibraryCreator/mediaLibraryCreator.template.html +++ b/src/components/mediaLibraryCreator/mediaLibraryCreator.template.html @@ -1,5 +1,5 @@
- +

${ButtonAddMediaLibrary}

diff --git a/src/components/mediaLibraryEditor/mediaLibraryEditor.template.html b/src/components/mediaLibraryEditor/mediaLibraryEditor.template.html index 22267e1c9c..8f1822520e 100644 --- a/src/components/mediaLibraryEditor/mediaLibraryEditor.template.html +++ b/src/components/mediaLibraryEditor/mediaLibraryEditor.template.html @@ -1,5 +1,5 @@
- +

diff --git a/src/components/metadataEditor/metadataEditor.template.html b/src/components/metadataEditor/metadataEditor.template.html index a4a2413a07..d301687a45 100644 --- a/src/components/metadataEditor/metadataEditor.template.html +++ b/src/components/metadataEditor/metadataEditor.template.html @@ -1,5 +1,5 @@
- +

${Edit}

@@ -8,10 +8,10 @@ ${Save} - -
diff --git a/src/components/metadataEditor/personEditor.template.html b/src/components/metadataEditor/personEditor.template.html index 2e84a00fc8..fd8982b9fe 100644 --- a/src/components/metadataEditor/personEditor.template.html +++ b/src/components/metadataEditor/personEditor.template.html @@ -1,5 +1,5 @@
- +

${Edit}

diff --git a/src/components/playlisteditor/playlisteditor.js b/src/components/playlisteditor/playlisteditor.js index d579d2fc15..8dfc26eb5f 100644 --- a/src/components/playlisteditor/playlisteditor.js +++ b/src/components/playlisteditor/playlisteditor.js @@ -242,7 +242,7 @@ import ServerConnections from '../ServerConnections'; const title = globalize.translate('HeaderAddToPlaylist'); html += '
'; - html += ''; + html += ``; html += '

'; html += title; html += '

'; diff --git a/src/components/prompt/prompt.template.html b/src/components/prompt/prompt.template.html index 80b76b48aa..bd8b22589a 100644 --- a/src/components/prompt/prompt.template.html +++ b/src/components/prompt/prompt.template.html @@ -1,5 +1,5 @@
- diff --git a/src/components/recordingcreator/recordingcreator.template.html b/src/components/recordingcreator/recordingcreator.template.html index 0708287a98..dd97113362 100644 --- a/src/components/recordingcreator/recordingcreator.template.html +++ b/src/components/recordingcreator/recordingcreator.template.html @@ -1,5 +1,5 @@
- +

diff --git a/src/components/recordingcreator/recordingeditor.template.html b/src/components/recordingcreator/recordingeditor.template.html index c0f3d6991d..033958b283 100644 --- a/src/components/recordingcreator/recordingeditor.template.html +++ b/src/components/recordingcreator/recordingeditor.template.html @@ -1,5 +1,5 @@
- +

${HeaderRecordingOptions}

diff --git a/src/components/recordingcreator/seriesrecordingeditor.template.html b/src/components/recordingcreator/seriesrecordingeditor.template.html index 86620a77d0..05f04c9cf1 100644 --- a/src/components/recordingcreator/seriesrecordingeditor.template.html +++ b/src/components/recordingcreator/seriesrecordingeditor.template.html @@ -1,5 +1,5 @@
- +

${HeaderSeriesOptions}

diff --git a/src/components/refreshdialog/refreshdialog.js b/src/components/refreshdialog/refreshdialog.js index 890a89f36e..27ce6b97cf 100644 --- a/src/components/refreshdialog/refreshdialog.js +++ b/src/components/refreshdialog/refreshdialog.js @@ -120,7 +120,7 @@ class RefreshDialog { const title = globalize.translate('RefreshMetadata'); html += '
'; - html += ''; + html += ``; html += '

'; html += title; html += '

'; diff --git a/src/components/sortmenu/sortmenu.js b/src/components/sortmenu/sortmenu.js index d9ea049370..5a61caaace 100644 --- a/src/components/sortmenu/sortmenu.js +++ b/src/components/sortmenu/sortmenu.js @@ -63,7 +63,7 @@ class SortMenu { let html = ''; html += '
'; - html += ''; + html += ``; html += '

${Sort}

'; html += '
'; diff --git a/src/components/subtitleeditor/subtitleeditor.template.html b/src/components/subtitleeditor/subtitleeditor.template.html index f70119db0f..7880896dc1 100644 --- a/src/components/subtitleeditor/subtitleeditor.template.html +++ b/src/components/subtitleeditor/subtitleeditor.template.html @@ -1,5 +1,5 @@
- +

${Subtitles}

${Help} diff --git a/src/components/subtitleuploader/subtitleuploader.template.html b/src/components/subtitleuploader/subtitleuploader.template.html index d3c89380bc..4b5bc6c7d0 100644 --- a/src/components/subtitleuploader/subtitleuploader.template.html +++ b/src/components/subtitleuploader/subtitleuploader.template.html @@ -1,5 +1,5 @@
- +

${HeaderUploadSubtitle}

diff --git a/src/components/syncPlay/ui/settings/editor.html b/src/components/syncPlay/ui/settings/editor.html index 1ffc2d4c04..0177c1e27e 100644 --- a/src/components/syncPlay/ui/settings/editor.html +++ b/src/components/syncPlay/ui/settings/editor.html @@ -1,5 +1,5 @@
-

${HeaderSyncPlaySettings}

diff --git a/src/components/tunerPicker.js b/src/components/tunerPicker.js index aba21acdfc..c41ad10840 100644 --- a/src/components/tunerPicker.js +++ b/src/components/tunerPicker.js @@ -135,7 +135,7 @@ function tunerPicker() { dlg.classList.add('formDialog'); let html = ''; html += '
'; - html += ''; + html += ``; html += '

'; html += globalize.translate('HeaderLiveTvTunerSetup'); html += '

'; diff --git a/src/components/viewSettings/viewSettings.js b/src/components/viewSettings/viewSettings.js index 246e08ee73..c872561307 100644 --- a/src/components/viewSettings/viewSettings.js +++ b/src/components/viewSettings/viewSettings.js @@ -76,7 +76,7 @@ class ViewSettings { let html = ''; html += '
'; - html += ''; + html += ``; html += '

${Settings}

'; html += '
'; diff --git a/src/controllers/dashboard/plugins/repositories/index.js b/src/controllers/dashboard/plugins/repositories/index.js index 3a1f0f5d2a..5eaa6210bf 100644 --- a/src/controllers/dashboard/plugins/repositories/index.js +++ b/src/controllers/dashboard/plugins/repositories/index.js @@ -117,7 +117,7 @@ export default function(view) { let html = ''; html += '
'; - html += ''; + html += ``; html += `

${globalize.translate('HeaderNewRepository')}

`; html += '
'; html += '
'; diff --git a/src/controllers/list.html b/src/controllers/list.html index de250bc5d2..a755ad1c9b 100644 --- a/src/controllers/list.html +++ b/src/controllers/list.html @@ -7,25 +7,25 @@ - - - - @@ -33,19 +33,19 @@ - - - -
diff --git a/src/controllers/movies/movies.html b/src/controllers/movies/movies.html index def6bbeb94..428b83de45 100644 --- a/src/controllers/movies/movies.html +++ b/src/controllers/movies/movies.html @@ -76,7 +76,7 @@
- +
diff --git a/src/controllers/playback/video/index.html b/src/controllers/playback/video/index.html index 54f8f87118..3eb3050d49 100644 --- a/src/controllers/playback/video/index.html +++ b/src/controllers/playback/video/index.html @@ -47,7 +47,7 @@ - @@ -70,7 +70,7 @@
-
@@ -86,7 +86,7 @@ -
diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index 8f1046855b..32abe27275 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -643,13 +643,19 @@ import { appRouter } from '../../../components/appRouter'; btnPlayPauseIcon.classList.remove('play_arrow', 'pause'); + let icon; + let title; + if (isPaused) { - btnPlayPauseIcon.classList.add('play_arrow'); - btnPlayPause.setAttribute('title', globalize.translate('Play') + ' (k)'); + icon = 'play_arrow'; + title = globalize.translate('Play'); } else { - btnPlayPauseIcon.classList.add('pause'); - btnPlayPause.setAttribute('title', globalize.translate('ButtonPause') + ' (k)'); + icon = 'pause'; + title = globalize.translate('ButtonPause'); } + + btnPlayPauseIcon.classList.add(icon); + dom.setElementTitle(btnPlayPause, title + ' (k)', title); } function updatePlayerStateInternal(event, player, state) { diff --git a/src/scripts/dom.js b/src/scripts/dom.js index c08230f06a..8cc3e7d036 100644 --- a/src/scripts/dom.js +++ b/src/scripts/dom.js @@ -262,6 +262,17 @@ /* eslint-enable indent */ +/** + * Sets title and ARIA-label of element. + * @param {HTMLElement} elem - Element to set the title and ARIA-label. + * @param {string} title - Title. + * @param {string?} [ariaLabel] - ARIA-label. + */ +export function setElementTitle(elem, title, ariaLabel) { + elem.setAttribute('title', title); + elem.setAttribute('aria-label', ariaLabel); +} + export default { parentWithAttribute: parentWithAttribute, parentWithClass: parentWithClass, @@ -270,6 +281,7 @@ export default { removeEventListener: removeEventListener, getWindowSize: getWindowSize, getScreenWidth: getScreenWidth, + setElementTitle, whichTransitionEvent: whichTransitionEvent, whichAnimationEvent: whichAnimationEvent, whichAnimationCancelEvent: whichAnimationCancelEvent diff --git a/src/scripts/libraryMenu.js b/src/scripts/libraryMenu.js index f1146e4e5d..0d40bb5220 100644 --- a/src/scripts/libraryMenu.js +++ b/src/scripts/libraryMenu.js @@ -80,6 +80,18 @@ import Headroom from 'headroom.js'; } function retranslateUi() { + if (headerBackButton) { + headerBackButton.title = globalize.translate('ButtonBack'); + } + + if (headerHomeButton) { + headerHomeButton.title = globalize.translate('Home'); + } + + if (mainDrawerButton) { + mainDrawerButton.title = globalize.translate('Menu'); + } + if (headerSyncButton) { headerSyncButton.title = globalize.translate('ButtonSyncPlay'); } @@ -95,6 +107,10 @@ import Headroom from 'headroom.js'; if (headerSearchButton) { headerSearchButton.title = globalize.translate('Search'); } + + if (headerUserButton) { + headerUserButton.title = globalize.translate('Settings'); + } } function updateUserInHeader(user) { diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 860278779e..d288e74cdf 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -75,9 +75,11 @@ "ButtonArrowRight": "Right", "ButtonAudioTracks": "Audio Tracks", "ButtonBack": "Back", + "ButtonBackspace": "Backspace", "ButtonCancel": "Cancel", "ButtonCast": "Cast to Device", "ButtonChangeServer": "Change Server", + "ButtonClose": "Close", "ButtonEditOtherUserPreferences": "Edit this user's profile, image and personal preferences.", "ButtonForgotPassword": "Forgot Password", "ButtonFullscreen": "Fullscreen", @@ -108,6 +110,7 @@ "ButtonSignIn": "Sign In", "ButtonSignOut": "Sign Out", "ButtonExitApp": "Exit Application", + "ButtonSpace": "Space", "ButtonSplit": "Split", "ButtonStart": "Start", "ButtonStop": "Stop",