Improved page titles
This commit is contained in:
parent
7efeddab55
commit
fb7d2fa24c
@ -1,7 +1,7 @@
|
||||
component AnimeListItem(viewUser *arn.User, item *arn.AnimeListItem, anime *arn.Anime)
|
||||
.widgets.mountable
|
||||
.widget.anime-list-item-view(data-api="/api/animelist/" + viewUser.ID + "/update/" + anime.ID)
|
||||
h2= anime.Title.Canonical
|
||||
h1= anime.Title.Canonical
|
||||
|
||||
InputNumber("Episodes", float64(item.Episodes), "Episodes", "Number of episodes you watched", "0", arn.EpisodeCountMax(anime.EpisodeCount), "1")
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
component EditAnime(anime *arn.Anime)
|
||||
h2= anime.Title.Canonical
|
||||
h1= anime.Title.Canonical
|
||||
|
||||
.widgets
|
||||
.widget(data-api="/api/anime/" + anime.ID)
|
||||
|
@ -1,5 +1,5 @@
|
||||
component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
|
||||
h2.page-title Forum
|
||||
h1.page-title Forum
|
||||
ForumTags
|
||||
.forum
|
||||
ThreadList(threads)
|
||||
|
@ -1,3 +0,0 @@
|
||||
component Forums
|
||||
h2.forum-header Forum
|
||||
ForumTags
|
@ -1,5 +1,5 @@
|
||||
component ImportAnilist(user *arn.User, matches []*arn.AniListMatch)
|
||||
h2= "anilist.co Import (" + user.Accounts.AniList.Nick + ", " + toString(len(matches)) + " anime)"
|
||||
h1= "anilist.co Import (" + user.Accounts.AniList.Nick + ", " + toString(len(matches)) + " anime)"
|
||||
|
||||
table.import-list
|
||||
thead
|
||||
|
@ -1,5 +1,5 @@
|
||||
component Music(tracks []*arn.SoundTrack)
|
||||
h2 Soundtracks
|
||||
h1 Soundtracks
|
||||
|
||||
.music-buttons
|
||||
a.button.ajax(href="/new/soundtrack")
|
||||
|
@ -1,5 +1,5 @@
|
||||
component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
|
||||
h2.thread-title= thread.Title
|
||||
h1.thread-title= thread.Title
|
||||
|
||||
#thread.thread(data-id=thread.ID)
|
||||
.posts
|
||||
|
@ -1,5 +1,5 @@
|
||||
component Track(track *arn.SoundTrack)
|
||||
h2= track.Media[0].Title
|
||||
h1= track.Media[0].Title
|
||||
|
||||
.sound-tracks
|
||||
SoundTrackAllMedia(track)
|
@ -8,6 +8,7 @@ import * as actions from "./Actions"
|
||||
export class AnimeNotifier {
|
||||
app: Application
|
||||
user: HTMLElement
|
||||
title: string
|
||||
visibilityObserver: IntersectionObserver
|
||||
|
||||
imageFound: MutationQueue
|
||||
@ -17,6 +18,7 @@ export class AnimeNotifier {
|
||||
constructor(app: Application) {
|
||||
this.app = app
|
||||
this.user = null
|
||||
this.title = "Anime Notifier"
|
||||
|
||||
this.imageFound = new MutationQueue(elem => elem.classList.add("image-found"))
|
||||
this.imageNotFound = new MutationQueue(elem => elem.classList.add("image-not-found"))
|
||||
@ -96,6 +98,16 @@ export class AnimeNotifier {
|
||||
Promise.resolve().then(() => this.displayLocalDates()),
|
||||
Promise.resolve().then(() => this.setSelectBoxValue()),
|
||||
Promise.resolve().then(() => this.assignActions())
|
||||
|
||||
let headers = document.getElementsByTagName("h1")
|
||||
|
||||
if(this.app.currentPath === "/" || headers.length === 0) {
|
||||
if(document.title !== this.title) {
|
||||
document.title = this.title
|
||||
}
|
||||
} else {
|
||||
document.title = headers[0].innerText
|
||||
}
|
||||
}
|
||||
|
||||
onIdle() {
|
||||
|
@ -23,24 +23,20 @@ post-content-padding-y = 0.75rem
|
||||
padding 0.75rem 1rem
|
||||
position relative
|
||||
|
||||
h1, h2, h3
|
||||
font-weight normal
|
||||
text-align left
|
||||
line-height 1.5em
|
||||
margin typography-margin 0
|
||||
|
||||
h1
|
||||
font-size 1.5rem
|
||||
line-height 1.5em
|
||||
text-align left
|
||||
margin typography-margin 0
|
||||
|
||||
h2
|
||||
font-size 1.3rem
|
||||
line-height 1.5em
|
||||
font-weight normal
|
||||
text-align left
|
||||
margin typography-margin 0
|
||||
|
||||
h3
|
||||
font-size 1.1rem
|
||||
line-height 1.5em
|
||||
font-weight normal
|
||||
text-align left
|
||||
|
||||
:hover
|
||||
.post-toolbar
|
||||
|
Loading…
Reference in New Issue
Block a user