Skip to content

Commit 050e6ba

Browse files
committed
Updates
1 parent 22cb510 commit 050e6ba

14 files changed

Lines changed: 145 additions & 57 deletions

src/chat/elementjson/accountnotice.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",
@@ -111,7 +112,7 @@ module.exports = {
111112
window.location.href =
112113
"/signin?href=" +
113114
encodeURIComponent(
114-
window.location.pathname + window.location.hash,
115+
window.location.pathname + window.location.hash
115116
);
116117
},
117118
},
@@ -129,7 +130,7 @@ module.exports = {
129130
window.location.href =
130131
"/signup?href=" +
131132
encodeURIComponent(
132-
window.location.pathname + window.location.hash,
133+
window.location.pathname + window.location.hash
133134
);
134135
},
135136
},

src/chat/elementjson/banned.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",

src/chat/elementjson/chat-styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,14 @@ a {
16731673
}
16741674
}
16751675

1676+
.normalLevelDialog {
1677+
position: fixed;
1678+
top: 0;
1679+
left: 0;
1680+
width: 100%;
1681+
height: 100%;
1682+
}
1683+
16761684
.veryImportantDialog {
16771685
/* Important dialogs go to the front so that they can be visible */
16781686
position: fixed;

src/chat/elementjson/installappdialog.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
style: {
99
zIndex: 10,
1010
},
11+
className: "normalLevelDialog",
1112
children: [
1213
{
1314
element: "div",

src/chat/elementjson/noguests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",
@@ -52,7 +53,7 @@ module.exports = {
5253
window.location.href =
5354
"/signin?href=" +
5455
encodeURIComponent(
55-
window.location.pathname + window.location.hash,
56+
window.location.pathname + window.location.hash
5657
);
5758
},
5859
},
@@ -69,7 +70,7 @@ module.exports = {
6970
window.location.href =
7071
"/signup?href=" +
7172
encodeURIComponent(
72-
window.location.pathname + window.location.hash,
73+
window.location.pathname + window.location.hash
7374
);
7475
},
7576
},

src/chat/elementjson/notallowed.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",

src/chat/elementjson/roomerror.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",

src/chat/elementjson/toomanyconnections.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",

src/chat/elementjson/usernameerror.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
style: {
66
zIndex: 10,
77
},
8+
className: "normalLevelDialog",
89
children: [
910
{
1011
element: "div",

src/chat/interface/mini-loader.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
var elements = require("../../gp2/elements.js");
2+
3+
class LoadingScreen {
4+
constructor(text = "Loading...") {
5+
var _this = this;
6+
this.loadingElement = document.createElement("div");
7+
this.textSpan = null;
8+
var dom = elements.createElementsFromJSON([
9+
//Background
10+
{
11+
element: "div",
12+
className: "dialogBackground",
13+
style: {
14+
zIndex: "9999999999",
15+
},
16+
},
17+
//Dialog box
18+
{
19+
element: "div",
20+
className: "centerMiddle",
21+
style: {
22+
zIndex: "9999999999",
23+
padding: "5px 5px",
24+
display: "flex",
25+
flexDirection: "column",
26+
justifyContent: "center",
27+
alignItems: "center",
28+
},
29+
children: [
30+
{
31+
element: "div",
32+
className: "loader2Container",
33+
children: [
34+
{
35+
element: "div",
36+
className: "loader2",
37+
},
38+
],
39+
},
40+
{
41+
element: "span",
42+
textContent: "",
43+
style: {
44+
fontWeight: "bold",
45+
fontSize: "17px",
46+
textAlign: "center",
47+
padding: "7px 7px",
48+
background: "rgba(255, 255, 255, 50%)",
49+
color: "black",
50+
borderRadius: "5px",
51+
},
52+
GPWhenCreated: (elm) => (_this.textSpan = elm),
53+
},
54+
],
55+
},
56+
]);
57+
elements.appendElements(this.loadingElement, dom);
58+
document.body.append(this.loadingElement);
59+
60+
this.setText(text);
61+
}
62+
63+
setText(text) {
64+
this.textSpan.textContent = text;
65+
}
66+
67+
dispose() {
68+
this.loadingElement.remove();
69+
this.loadingElement = null;
70+
this.textSpan.remove();
71+
this.textSpan = null;
72+
}
73+
remove() {
74+
this.dispose();
75+
}
76+
}
77+
module.exports = LoadingScreen;

0 commit comments

Comments
 (0)