diff --git a/mixins/Input.pixy b/mixins/Input.pixy index 352bd112..01553a40 100644 --- a/mixins/Input.pixy +++ b/mixins/Input.pixy @@ -13,7 +13,7 @@ component InputNumber(id string, value float64, label string, placeholder string label(for=id)= label + ":" input.widget-element.action(id=id, type="number", value=value, min=min, max=max, step=step, placeholder=placeholder, title=placeholder, data-action="save", data-trigger="change") -component InputSelection(id string, value string, label string, placeholder string) +component InputSelection(id string, value string, label string, placeholder string, values []string) .widget-input label(for=id)= label + ":" select.widget-element.action(id=id, value=value, title=placeholder, data-action="save", data-trigger="change") diff --git a/pages/animelist/animelist.scarlet b/pages/animelist/animelist.scarlet index 85c2a68f..4a32d6b2 100644 --- a/pages/animelist/animelist.scarlet +++ b/pages/animelist/animelist.scarlet @@ -1,7 +1,7 @@ .anime-list vertical width 100% - max-width 1100px + max-width 1200px margin 0 auto tr diff --git a/pages/animelistitem/animelistitem.pixy b/pages/animelistitem/animelistitem.pixy index 4c1276c4..7194f5f6 100644 --- a/pages/animelistitem/animelistitem.pixy +++ b/pages/animelistitem/animelistitem.pixy @@ -5,6 +5,14 @@ component AnimeListItem(viewUser *arn.User, item *arn.AnimeListItem, anime *arn. InputNumber("Episodes", float64(item.Episodes), "Episodes", "Number of episodes you watched", "0", arn.EpisodeCountMax(anime.EpisodeCount), "1") + label(for="Status") Status: + select.widget-element.action(id="Status", value=item.Status, data-action="save", data-trigger="change") + option(value=arn.AnimeListStatusWatching) Watching + option(value=arn.AnimeListStatusCompleted) Completed + option(value=arn.AnimeListStatusPlanned) Plan to watch + option(value=arn.AnimeListStatusHold) On hold + option(value=arn.AnimeListStatusDropped) Dropped + .anime-list-item-rating-edit InputNumber("Rating.Overall", item.Rating.Overall, "Overall", "Overall rating on a scale of 0 to 10", "0", "10", "0.1") InputNumber("Rating.Story", item.Rating.Story, "Story", "Story rating on a scale of 0 to 10", "0", "10", "0.1") diff --git a/pages/newthread/newthread.pixy b/pages/newthread/newthread.pixy index bd83d888..08bfb5ef 100644 --- a/pages/newthread/newthread.pixy +++ b/pages/newthread/newthread.pixy @@ -5,7 +5,7 @@ component NewThread(user *arn.User) textarea#text.widget-element(placeholder="Content") - select#tag.widget-element + select#tag.widget-element(value="general") option(value="general") General option(value="news") News option(value="anime") Anime diff --git a/scripts/AnimeNotifier.ts b/scripts/AnimeNotifier.ts index e4147d86..836c1f07 100644 --- a/scripts/AnimeNotifier.ts +++ b/scripts/AnimeNotifier.ts @@ -71,9 +71,16 @@ export class AnimeNotifier { // Update each of these asynchronously Promise.resolve().then(() => this.mountMountables()) - Promise.resolve().then(() => this.assignActions()) Promise.resolve().then(() => this.lazyLoadImages()) Promise.resolve().then(() => this.displayLocalDates()) + Promise.resolve().then(() => this.setSelectBoxValue()) + Promise.resolve().then(() => this.assignActions()) + } + + setSelectBoxValue() { + for(let element of document.getElementsByTagName("select")) { + element.value = element.getAttribute("value") + } } displayLocalDates() { @@ -229,7 +236,7 @@ export class AnimeNotifier { this.unmountMountables() this.loading(true) - return delay(300).then(() => { + return delay(330).then(() => { request .then(html => this.app.setContent(html, true)) .then(() => this.app.markActiveLinks()) diff --git a/scripts/Diff.ts b/scripts/Diff.ts index ea3c2620..342e8186 100644 --- a/scripts/Diff.ts +++ b/scripts/Diff.ts @@ -57,6 +57,11 @@ export class Diff { let attrib = elemB.attributes[x] if(attrib.specified) { + // Skip mountables + if(attrib.name == "class" && elemA.classList.contains("mounted")) { + continue + } + elemA.setAttribute(attrib.name, elemB.getAttribute(attrib.name)) } } diff --git a/styles/include/config.scarlet b/styles/include/config.scarlet index 1ca8a328..f6ecc921 100644 --- a/styles/include/config.scarlet +++ b/styles/include/config.scarlet @@ -61,4 +61,4 @@ nav-height = 3.11rem // Timings fade-speed = 200ms -transition-speed = 290ms \ No newline at end of file +transition-speed = 250ms \ No newline at end of file diff --git a/styles/input.scarlet b/styles/input.scarlet index 54afac5e..4270571b 100644 --- a/styles/input.scarlet +++ b/styles/input.scarlet @@ -62,10 +62,13 @@ button, .button // // box-shadow 0 0 6px alpha(mainColor, 20%) // border 1px solid main-color -// select -// ui-element -// font-size 1rem -// padding 0.5em 1em +select + ui-element + appearance none + -webkit-appearance none + -moz-appearance none + font-size 1rem + // padding 0.5em 1em label width 100%