1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-11-10 04:10:10 +00:00

Compare commits

..

No commits in common. "fc7ae0ec4e2a98caaffcbc04b0c8aec0e0b6074c" and "f1b7ef303d2bb1cfadf81aa6dc8b900483439ea9" have entirely different histories.

3 changed files with 8 additions and 18 deletions

View File

@ -3,7 +3,7 @@ import shutil
import os import os
import argparse import argparse
from pathlib import Path from pathlib import Path
from multiprocessing import Process from threading import Thread
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", help="output directory for .html and .txt files") parser.add_argument("-o", "--output", help="output directory for .html and .txt files")
@ -27,10 +27,10 @@ local_path = Path("mail")
threads = [] threads = []
for mjml in [f for f in local_path.iterdir() if f.is_file() and "mjml" in f.suffix]: for mjml in [f for f in local_path.iterdir() if f.is_file() and "mjml" in f.suffix]:
p = Process(target=compile, args=(mjml,)) threads.append(Thread(target=compile, args=(mjml,)))
p.start()
threads.append(p)
for thread in threads:
thread.start()
for thread in threads: for thread in threads:
thread.join() thread.join()

View File

@ -47,12 +47,11 @@ export class lang implements Lang {
} }
} }
export var TimeFmtChange = new CustomEvent("timefmt-change");
export const loadLangSelector = (page: string) => { export const loadLangSelector = (page: string) => {
if (page == "admin" || "user") { if (page == "admin") {
const ev = new CustomEvent("timefmt-change");
const setTimefmt = (fmt: string) => { const setTimefmt = (fmt: string) => {
document.dispatchEvent(TimeFmtChange); document.dispatchEvent(ev);
localStorage.setItem("timefmt", fmt); localStorage.setItem("timefmt", fmt);
}; };
const t12 = document.getElementById("lang-12h") as HTMLInputElement; const t12 = document.getElementById("lang-12h") as HTMLInputElement;

View File

@ -243,16 +243,11 @@ class ExpiryCard {
private _aside: HTMLElement; private _aside: HTMLElement;
private _countdown: HTMLElement; private _countdown: HTMLElement;
private _interval: number = null; private _interval: number = null;
private _expiryUnix: number = 0;
constructor(card: HTMLElement) { constructor(card: HTMLElement) {
this._card = card; this._card = card;
this._aside = this._card.querySelector(".user-expiry") as HTMLElement; this._aside = this._card.querySelector(".user-expiry") as HTMLElement;
this._countdown = this._card.querySelector(".user-expiry-countdown") as HTMLElement; this._countdown = this._card.querySelector(".user-expiry-countdown") as HTMLElement;
document.addEventListener("timefmt-change", () => {
this.expiry = this._expiryUnix;
});
} }
private _drawCountdown = () => { private _drawCountdown = () => {
@ -302,11 +297,7 @@ class ExpiryCard {
window.clearInterval(this._interval); window.clearInterval(this._interval);
this._interval = null; this._interval = null;
} }
this._expiryUnix = expiryUnix; if (expiryUnix == 0) return;
if (expiryUnix == 0) {
this._card.classList.add("unfocused");
return;
}
this._expiry = new Date(expiryUnix * 1000); this._expiry = new Date(expiryUnix * 1000);
this._aside.textContent = window.lang.strings("yourAccountIsValidUntil").replace("{date}", toDateString(this._expiry)); this._aside.textContent = window.lang.strings("yourAccountIsValidUntil").replace("{date}", toDateString(this._expiry));
this._card.classList.remove("unfocused"); this._card.classList.remove("unfocused");