CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
ProdigyPNP

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: ProdigyPNP/ProdigyMathGameHacking
Path: blob/master/cheatGUI/src/utils/swal.ts
Views: 723
1
import swal from "sweetalert2";
2
export const Swal = swal;
3
4
// Text Input
5
export const Input = Swal.mixin({
6
input: "text",
7
showCancelButton: true,
8
showConfirmButton: true,
9
toast: false,
10
});
11
// Text Input
12
13
14
15
// Number Input
16
export const NumberInput = Input.mixin({
17
toast: false,
18
input: "number"
19
});
20
// Number Input
21
22
23
// Toast
24
export const Toast = Swal.mixin({
25
toast: true,
26
position: "bottom"
27
});
28
// Toast
29
30
31
// Confirm
32
export const Confirm = Swal.mixin({
33
icon: "warning",
34
showCancelButton: true,
35
toast: false,
36
confirmButtonText: "Confirm",
37
cancelButtonText: "Cancel"
38
});
39
// Confirm
40
41
42
// Info popup
43
export const Info = Swal.mixin({
44
icon: "info",
45
showCancelButton: false,
46
toast: false
47
});
48
// Info popup
49
50
51
// License popup
52
export const License = Swal.mixin({
53
icon: "info",
54
showCancelButton: true,
55
toast: false,
56
confirmButtonText: "Agree",
57
cancelButtonText: "Disagree"
58
});
59
60
61
// Disagreed to license popup
62
export const NoLicense = Swal.mixin({
63
icon: "error",
64
showCancelButton: true,
65
toast: false,
66
confirmButtonText: "Reload",
67
cancelButtonText: "Play without hacks"
68
});
69
// Disagreed to license popup
70
71
// @ts-expect-error allow accessing swal from devtools
72
window.Swal = Swal;
73