aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/showNameClick.ts
blob: 005bfd576af6442c03b31f3a6224d33d1ec2f49f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import setCookie from "../utils/setCookie";

/**
 * Triggered when the showname checkboc is clicked
 * @param {MouseEvent} event
 */
export function showname_click(_event: Event | null) {
  setCookie(
    "showname",
    String((<HTMLInputElement>document.getElementById("showname")).checked),
  );
  setCookie(
    "ic_chat_name",
    (<HTMLInputElement>document.getElementById("ic_chat_name")).value,
  );

  const css_s = <HTMLAnchorElement>document.getElementById("nameplate_setting");

  if ((<HTMLInputElement>document.getElementById("showname")).checked) {
    css_s.href = "styles/shownames.css";
  } else {
    css_s.href = "styles/nameplates.css";
  }
}
window.showname_click = showname_click;