-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
47 lines (39 loc) · 1.32 KB
/
main.js
File metadata and controls
47 lines (39 loc) · 1.32 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
import {registerConfigs} from "./config.js";
export default class GoblinStyle{
static ID = 'fox-goblins-in-the-code';
static NAME = 'GoblinStyle';
static SETTINGS = {
JOURNAL_STYLES: 'style-journal',
CHAT_STYLES: 'style-chat',
GLOBAL_STYLES: 'style-global'
}
static loadCSS() {
// Get HTML head element
var head = document.getElementsByTagName('HEAD')[0];
if (game.settings.get(GoblinStyle.ID,GoblinStyle.SETTINGS.JOURNAL_STYLES)){
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = './modules/fox-goblins-in-the-code/styles/journal.css';
head.appendChild(link);
}
if (game.settings.get(GoblinStyle.ID,GoblinStyle.SETTINGS.CHAT_STYLES)){
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = './modules/fox-goblins-in-the-code/styles/chat.css';
head.appendChild(link);
}
if (game.settings.get(GoblinStyle.ID,GoblinStyle.SETTINGS.GLOBAL_STYLES)){
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = './modules/fox-goblins-in-the-code/styles/global.css';
head.appendChild(link);
}
}
}
Hooks.once('init', () => {
registerConfigs();
GoblinStyle.loadCSS();
});