This repository was archived by the owner on Sep 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathabout.js
More file actions
47 lines (43 loc) · 1.17 KB
/
about.js
File metadata and controls
47 lines (43 loc) · 1.17 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* About this module FormApp
* @extends FormApplication
*/
export default class PinCushionAboutApp extends FormApplication {
constructor(options={}) {
super(options);
}
/**
* Call app default options
* @override
*/
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
id: "pin-cushion-about",
title: `About ${PinCushion.MODULE_TITLE}`,
template: `${PinCushion.PATH}/templates/about.hbs`,
popOut: true,
width: 500,
height: 480
});
}
/**
* Supplies data to the template
*/
async getData() {
return {
moduleName: PinCushion.MODULE_TITLE,
version: game.modules.get(PinCushion.MODULE_NAME).data.version,
patrons: await this.fetchPatrons()
}
}
/**
* Fetches a list of Patrons to display on the About page
*/
async fetchPatrons() {
const jsonPath = `${PinCushion.PATH}/patrons.json`;
const response = await fetch(jsonPath);
if (!response.ok) return null;
const json = await response.json();
return json;
}
}