1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2025-12-14 18:45:06 +00:00

Create initial language support

Create support for languages, then reformat user, home, and post pages
to use it, and create en and en-us language files.
This commit is contained in:
Cadence Ember
2020-07-20 01:40:27 +12:00
parent 1f76e43446
commit 496d53f47e
22 changed files with 319 additions and 54 deletions

View File

@@ -57,7 +57,7 @@ class ElemJS {
event(name, callback) {
this.element.addEventListener(name, event => callback(event))
}
child(toAdd, position) {
child(toAdd, position = undefined) {
if (typeof(toAdd) == "object") {
toAdd.parent = this;
if (typeof(position) == "number" && position >= 0) {

View File

@@ -75,7 +75,7 @@ class NextPage extends FreezeWidth {
fetch() {
if (this.fetching) return
this.fetching = true
this.freeze("Loading...")
this.freeze(this.element.getAttribute("data-loading-text"))
const type = this.element.getAttribute("data-type")
return fetch(`/fragment/user/${this.element.getAttribute("data-username")}/${this.nextPageNumber}?type=${type}`).then(res => res.text()).then(text => {