From fecc09eee23017c8412004a3550cd0d9e8a025c2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 21 Nov 2018 15:43:32 +0900 Subject: [PATCH] Improved accessibility --- mixins/SoundTrack.pixy | 2 +- pages/anime/anime.pixy | 12 ++++++------ pages/company/company.pixy | 2 +- pages/soundtrack/soundtrack.pixy | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/mixins/SoundTrack.pixy b/mixins/SoundTrack.pixy index 1737340c..c5b95448 100644 --- a/mixins/SoundTrack.pixy +++ b/mixins/SoundTrack.pixy @@ -50,4 +50,4 @@ component SoundTrackMiniFooter(track *arn.SoundTrack, user *arn.User) a(href=track.Link())= track.Title.ByUser(user) component ExternalMedia(media *arn.ExternalMedia) - iframe.lazy(data-src=media.EmbedLink(), allowfullscreen) \ No newline at end of file + iframe.lazy(data-src=media.EmbedLink(), title=media.Service + " media", allowfullscreen) \ No newline at end of file diff --git a/pages/anime/anime.pixy b/pages/anime/anime.pixy index d8cb560f..f6253b6c 100644 --- a/pages/anime/anime.pixy +++ b/pages/anime/anime.pixy @@ -7,7 +7,7 @@ component Anime(anime *arn.Anime, listItem *arn.AnimeListItem, tracks []*arn.Sou component AnimeMainColumn(anime *arn.Anime, listItem *arn.AnimeListItem, tracks []*arn.SoundTrack, amvs []*arn.AMV, amvAppearances []*arn.AMV, episodes []*arn.AnimeEpisode, episodeToFriends map[int][]*arn.User, user *arn.User) .anime-header(data-id=anime.ID) - a.anime-image-container.mountable(href=anime.ImageLink("original"), target="_blank", data-mountable-type="header") + a.anime-image-container.mountable(href=anime.ImageLink("original"), target="_blank", rel="noopener", data-mountable-type="header") img.anime-cover-image.lazy(data-src=anime.ImageLink("large"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user)) .space @@ -33,7 +33,7 @@ component AnimeMainColumn(anime *arn.Anime, listItem *arn.AnimeListItem, tracks AnimeComments(anime, user, false) component AnimeSideColumn(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User) - AnimeTrailer(anime) + AnimeTrailer(anime, user) AnimeInformation(anime) AnimeRatings(anime, user) AnimePopularity(anime) @@ -150,15 +150,15 @@ component AnimeGenres(anime *arn.Anime) a.anime-genre.mountable(href="/genre/" + strings.ToLower(genre), data-mountable-type="header") span= genre -component AnimeTrailer(anime *arn.Anime) +component AnimeTrailer(anime *arn.Anime, user *arn.User) if len(anime.Trailers) > 0 && anime.Trailers[len(anime.Trailers) - 1].Service == "Youtube" && anime.Trailers[len(anime.Trailers) - 1].ServiceID != "" - AnimeTrailerByIndex(anime, len(anime.Trailers)-1) + AnimeTrailerByIndex(anime, len(anime.Trailers)-1, user) -component AnimeTrailerByIndex(anime *arn.Anime, index int) +component AnimeTrailerByIndex(anime *arn.Anime, index int, user *arn.User) section.anime-section.mountable(data-mountable-type="sidebar") h3.anime-section-name Trailer .anime-trailer.video-container - iframe.video(src="https://www.youtube.com/embed/" + anime.Trailers[index].ServiceID + "?showinfo=0", importance="low", allowfullscreen) + iframe.video(src="https://www.youtube.com/embed/" + anime.Trailers[index].ServiceID + "?showinfo=0", importance="low", title=anime.Title.ByUser(user) + " trailer", allowfullscreen) component AnimeFriends(friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem) if len(friends) > 0 diff --git a/pages/company/company.pixy b/pages/company/company.pixy index c82d616e..b6f8e129 100644 --- a/pages/company/company.pixy +++ b/pages/company/company.pixy @@ -15,7 +15,7 @@ component CompanyPage(company *arn.Company, studioAnime, producedAnime, licensed .company-sidebar if company.Location.Latitude != 0 && company.Location.Longitude != 0 h3.mountable Location - iframe.company-location.mountable(src="https://www.google.com/maps/embed/v1/place?q=" + fmt.Sprint(company.Location.Latitude) + "," + fmt.Sprint(company.Location.Longitude) + "&key=AIzaSyAsx6fhqRGaMLTixIJMIZBU4Mg6HJmvQf0", importance="low") + iframe.company-location.mountable(src="https://www.google.com/maps/embed/v1/place?q=" + fmt.Sprint(company.Location.Latitude) + "," + fmt.Sprint(company.Location.Longitude) + "&key=AIzaSyAsx6fhqRGaMLTixIJMIZBU4Mg6HJmvQf0", importance="low", title=company.Name.English + " location map") if len(closeCompanies) > 0 h3.mountable Within 1 km radius diff --git a/pages/soundtrack/soundtrack.pixy b/pages/soundtrack/soundtrack.pixy index 8fd5dc09..60ae5ceb 100644 --- a/pages/soundtrack/soundtrack.pixy +++ b/pages/soundtrack/soundtrack.pixy @@ -11,8 +11,9 @@ component SoundTrackPage(track *arn.SoundTrack, user *arn.User) each media in track.Media .widget.mountable h3.widget-title= media.Service + .soundtrack-media.video-container - iframe.lazy.video(data-src=media.EmbedLink(), allowfullscreen) + iframe.lazy.video(data-src=media.EmbedLink(), title=media.Service + " media source", allowfullscreen) if user != nil && media.Service == "Youtube" && track.File != "" .buttons