diff --git a/images/elements/paypal.svg b/images/elements/paypal.svg new file mode 100644 index 00000000..559c8fbf --- /dev/null +++ b/images/elements/paypal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/charge/charge.pixy b/pages/charge/charge.pixy index 86b6734e..302db311 100644 --- a/pages/charge/charge.pixy +++ b/pages/charge/charge.pixy @@ -1,7 +1,10 @@ component Charge(user *arn.User) ShopTabs(user) - h1.mountable Charge up + h1.page-title Charge up + + p + img.paypal-logo.mountable(src="/images/elements/paypal.svg", alt="Payment method: PayPal") p.text-center.mountable You can add balance via PayPal. 1 Japanese Yen equals 1 Gem. diff --git a/pages/charge/charge.scarlet b/pages/charge/charge.scarlet index 03cd2771..4ee57cf7 100644 --- a/pages/charge/charge.scarlet +++ b/pages/charge/charge.scarlet @@ -1,3 +1,7 @@ .shop-video max-width 100% - margin calc(content-padding / 2) auto \ No newline at end of file + margin calc(content-padding / 2) auto + +.paypal-logo + width 100% + max-width 300px \ No newline at end of file diff --git a/pages/settings/settings.pixy b/pages/settings/settings.pixy index b799417f..444af53f 100644 --- a/pages/settings/settings.pixy +++ b/pages/settings/settings.pixy @@ -215,7 +215,7 @@ component SettingsPro(user *arn.User) span Extend PRO account duration else .widget-section - label Would you like to support the site development? + label Would you like to make this website more awesome? a.button(href="/support") Icon("star") span Go PRO diff --git a/scripts/Actions/Serialization.ts b/scripts/Actions/Serialization.ts index 91769d67..4f100348 100644 --- a/scripts/Actions/Serialization.ts +++ b/scripts/Actions/Serialization.ts @@ -1,7 +1,7 @@ import AnimeNotifier from "../AnimeNotifier" // Save new data from an input field -export function save(arn: AnimeNotifier, input: HTMLElement) { +export async function save(arn: AnimeNotifier, input: HTMLElement) { let obj = {} let isContentEditable = input.isContentEditable let value = isContentEditable ? input.innerText : (input as HTMLInputElement).value @@ -31,21 +31,28 @@ export function save(arn: AnimeNotifier, input: HTMLElement) { let apiEndpoint = arn.findAPIEndpoint(input) - arn.post(apiEndpoint, obj) - .catch(err => arn.statusMessage.showError(err)) - .then(() => { + try { + await arn.post(apiEndpoint, obj) + + if(apiEndpoint.startsWith("/api/user/") && input.dataset.field === "Nick") { + // Update nickname based links on the page + return arn.reloadPage() + } else if(apiEndpoint.startsWith("/api/settings/") && input.dataset.field === "Theme") { + // Reload for the theme to take effect + location.reload() + } else { + return arn.reloadContent() + } + } catch(err) { + arn.reloadContent() + arn.statusMessage.showError(err) + } finally { if(isContentEditable) { input.contentEditable = "true" } else { (input as HTMLInputElement).disabled = false } - - if(apiEndpoint.startsWith("/api/user/") && input.dataset.field === "Nick") { - return arn.reloadPage() - } else { - return arn.reloadContent() - } - }) + } } // Enable (bool field)