-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral.js
More file actions
49 lines (40 loc) · 1.4 KB
/
general.js
File metadata and controls
49 lines (40 loc) · 1.4 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
48
49
class HintTextShower {
static _enable = false;
static get enable() {
return HintTextShower._enable;
}
static set enable(value) {
if (value) {
document.getElementById('hintText').style.display = "block";
document.getElementById('hintIcon').classList.add('activeHintIcon');
HintTextShower._enable = true;
} else {
document.getElementById('hintText').style.display = "none";
document.getElementById('hintIcon').classList.remove('activeHintIcon');
HintTextShower._enable = false;
}
}
static showModelInfo() {
if (!HintTextShower.enable) {
document.getElementById('hintText').style.display = "block";
document.getElementById('hintIcon').classList.add('activeHintIcon');
}
}
static hideModelInfo() {
if (!HintTextShower.enable) {
document.getElementById('hintText').style.display = "none";
document.getElementById('hintIcon').classList.remove('activeHintIcon');
}
}
}
function downloadData(filename, data) {
const blob = new Blob([data], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}