|
@@ -6,8 +6,9 @@ var items = {
|
6
|
6
|
};
|
7
|
7
|
|
8
|
8
|
var server = getServer();
|
9
|
|
-var token = "";
|
10
|
|
-var lang = {};
|
|
9
|
+var token = "";
|
|
10
|
+var labels = true;
|
|
11
|
+var lang = {};
|
11
|
12
|
|
12
|
13
|
var xhr = {
|
13
|
14
|
lang: new XMLHttpRequest(),
|
|
@@ -25,7 +26,9 @@ xhr.token.onreadystatechange = function() {
|
25
|
26
|
|
26
|
27
|
xhr.lang.onreadystatechange = function() {
|
27
|
28
|
if(xhr.lang.readyState == XMLHttpRequest.DONE) {
|
28
|
|
- lang = JSON.parse(xhr.lang.responseText);
|
|
29
|
+ let response = JSON.parse(xhr.lang.responseText);
|
|
30
|
+ lang = response.translations;
|
|
31
|
+ labels = response.labels;
|
29
|
32
|
}
|
30
|
33
|
};
|
31
|
34
|
|
|
@@ -115,7 +118,9 @@ function getField(id, placeholder, email, type) {
|
115
|
118
|
var field = document.createElement('div');
|
116
|
119
|
|
117
|
120
|
field.setAttribute('id', id); // TODO: configurable prefix
|
118
|
|
- field.appendChild(getLabel(id, placeholder, type));
|
|
121
|
+ if(labels) {
|
|
122
|
+ field.appendChild(getLabel(id, placeholder, type));
|
|
123
|
+ }
|
119
|
124
|
field.appendChild(getInputField(id, placeholder, email, type));
|
120
|
125
|
|
121
|
126
|
return field;
|