jekyll-theme-chirpy-customized-upe 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/sidebar.html +16 -13
- data/_layouts/login.html +31 -29
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 787b5394b48c9baab9a02e63fa01f654b136bdc83affaa0cce2cde1b8afac066
|
4
|
+
data.tar.gz: 938f098f58865bf1486f8ef055b596fb11421011c104fa937bfea959a3f46c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b78e7fd89e5b63b4fc7471fd71079c0367b7c47a5fad48706577f066911ef39b58b4b3704586e718e97e1fc8602753d6d2d91d7020105a70227c54cdeda9579e
|
7
|
+
data.tar.gz: 144fce3a5395dee9847ff2e04b5ddf3ce01ed1d68c856f5f3555fc6c7601ad8ca04872a773ce4378522bf7bdc7e185f868d0b4da8371ec69ba976d2db9c5d8d3
|
data/_includes/sidebar.html
CHANGED
@@ -4,7 +4,8 @@
|
|
4
4
|
display: none;
|
5
5
|
justify-content: center;
|
6
6
|
align-items: center;
|
7
|
-
position:
|
7
|
+
position: fixed;
|
8
|
+
max-width: 400px;
|
8
9
|
top: 50%;
|
9
10
|
left: 50%;
|
10
11
|
transform: translate(-50%, -50%);
|
@@ -23,7 +24,7 @@
|
|
23
24
|
transform: translate(-50%, -50%);
|
24
25
|
}
|
25
26
|
}
|
26
|
-
|
27
|
+
|
27
28
|
.form-changeInfo input[type="text"],
|
28
29
|
input[type="url"]
|
29
30
|
{
|
@@ -45,7 +46,8 @@
|
|
45
46
|
}
|
46
47
|
.form-buttons {
|
47
48
|
display: flex;
|
48
|
-
justify-content:
|
49
|
+
justify-content: center;
|
50
|
+
gap: 100px;
|
49
51
|
}
|
50
52
|
.form-submit {
|
51
53
|
margin: 0 20px;
|
@@ -69,25 +71,26 @@
|
|
69
71
|
}
|
70
72
|
</style>
|
71
73
|
|
74
|
+
{% include lang.html %}
|
72
75
|
<div id = "InfoForm">
|
73
76
|
<div class = "info">
|
74
77
|
<form target="_self" class="form-changeInfo">
|
75
78
|
<div class="form-avatar">
|
76
|
-
<label for="avatar"
|
77
|
-
<input type="url" name="avatar" placeholder="
|
79
|
+
<label for="avatar">{{ site.data.locales[lang].sidebar.new_avatar }}</label>
|
80
|
+
<input type="url" name="avatar" placeholder="{{ site.data.locales[lang].sidebar.optional }}" id="newAvatar" onblur="formValidate.checkAvatar()"/>
|
78
81
|
<span class="validatemsg" id="isAvatarValid"></span>
|
79
82
|
</div>
|
80
83
|
<div class="form-nickname">
|
81
|
-
<label for="nickname"
|
82
|
-
<input type="text" name="nickname" maxlength="15" placeholder="
|
84
|
+
<label for="nickname">{{ site.data.locales[lang].sidebar.new_nickname }}</label>
|
85
|
+
<input type="text" name="nickname" maxlength="15" placeholder="{{ site.data.locales[lang].sidebar.optional }}" id="newNickname" onblur="formValidate.checkNickname()"/>
|
83
86
|
<span class="validatemsg" id="isNicknameValid"></span>
|
84
87
|
</div>
|
85
88
|
<div class="form-buttons">
|
86
89
|
<div class="form-submit">
|
87
|
-
<input type="button" class="submitChange" value="
|
90
|
+
<input type="button" class="submitChange" value="{{ site.data.locales[lang].sidebar.submit }}" onclick="updateUserInfo()"/>
|
88
91
|
</div>
|
89
92
|
<div class="form-cancel">
|
90
|
-
<input type="button" class="cancelChange" value="
|
93
|
+
<input type="button" class="cancelChange" value="{{ site.data.locales[lang].sidebar.cancel }}"/>
|
91
94
|
</div>
|
92
95
|
</div>
|
93
96
|
</form>
|
@@ -120,7 +123,7 @@
|
|
120
123
|
<!-- home -->
|
121
124
|
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
122
125
|
<a href="{{ '/' | relative_url }}" class="nav-link">
|
123
|
-
<i class="fa-fw fas fa-
|
126
|
+
<i class="fa-fw fas fa-eye-slash"></i>
|
124
127
|
<span>{{ site.data.locales[include.lang].tabs.home | upcase }}</span>
|
125
128
|
</a>
|
126
129
|
</li>
|
@@ -190,7 +193,7 @@
|
|
190
193
|
</a>
|
191
194
|
{% endif %}
|
192
195
|
{% endfor %}
|
193
|
-
<a href="javascript:void(0);" onclick="AV.User.logOut();setTimeout(function() { window.location.reload(); }, 1000)">
|
196
|
+
<a href="javascript:void(0);" onclick="AV.User.logOut();setTimeout(function() { window.location.reload(); }, 1000)" title="{{ site.data.locales[lang].login.logout }}">
|
194
197
|
<i class="fas fa-right-from-bracket" style="color: rgb(181, 27, 27);"></i>
|
195
198
|
</a>
|
196
199
|
</div>
|
@@ -221,7 +224,7 @@
|
|
221
224
|
document.getElementById('isAvatarValid').style.color = 'green';
|
222
225
|
return true;
|
223
226
|
} else if (document.getElementById('newAvatar').value.trim() !='') {
|
224
|
-
document.getElementById('isAvatarValid').innerHTML = '<i class="fa-fw fas fa-xmark"></i>
|
227
|
+
document.getElementById('isAvatarValid').innerHTML = '<i class="fa-fw fas fa-xmark"></i>{{ site.data.locales[lang].sidebar.invalid_url }}';
|
225
228
|
document.getElementById('isAvatarValid').style.color = 'red';
|
226
229
|
} else {
|
227
230
|
document.getElementById('isAvatarValid').innerHTML = '';
|
@@ -245,7 +248,7 @@
|
|
245
248
|
currentUser.save().then((user) => {
|
246
249
|
console.log('保存成功!');
|
247
250
|
if (newAvatar != '' || newNickname != '') {
|
248
|
-
alert("
|
251
|
+
alert("{{ site.data.locales[lang].sidebar.save_success }}");
|
249
252
|
window.location.reload();
|
250
253
|
}
|
251
254
|
}).catch((error) => {
|
data/_layouts/login.html
CHANGED
@@ -133,17 +133,18 @@ layout: compress
|
|
133
133
|
</head>
|
134
134
|
|
135
135
|
<body>
|
136
|
+
{% include lang.html %}
|
136
137
|
<div class="shell">
|
137
|
-
<h2 class="title">
|
138
|
-
<input type="text" id="username" placeholder="
|
139
|
-
<input type="password" id="password" placeholder="
|
140
|
-
<input type="email" id="email" placeholder="
|
141
|
-
<input type="submit" value="
|
138
|
+
<h2 class="title">{{ site.data.locales[lang].login.login }}</h2>
|
139
|
+
<input type="text" id="username" placeholder="{{ site.data.locales[lang].login.username }}">
|
140
|
+
<input type="password" id="password" placeholder="{{ site.data.locales[lang].login.password }}">
|
141
|
+
<input type="email" id="email" placeholder="{{ site.data.locales[lang].login.email }}">
|
142
|
+
<input type="submit" value="{{ site.data.locales[lang].login.login }}" id="loginBtn">
|
142
143
|
<div class="footer">
|
143
144
|
{% if site.Leancloud.allowRegister %}
|
144
|
-
|
145
|
+
<button id="signUp">{{ site.data.locales[lang].login.go_to_register }}</button>
|
145
146
|
{% endif %}
|
146
|
-
<button id="forgotPassword">
|
147
|
+
<button id="forgotPassword">{{ site.data.locales[lang].login.forgot_password }}</button>
|
147
148
|
</div>
|
148
149
|
</div>
|
149
150
|
|
@@ -153,22 +154,22 @@ layout: compress
|
|
153
154
|
var title = document.querySelector('.title');
|
154
155
|
var loginBtn = document.getElementById('loginBtn');
|
155
156
|
var signUpBtn = document.getElementById('signUp');
|
156
|
-
if (title.innerText == '
|
157
|
-
title.innerText = '
|
158
|
-
loginBtn.value = '
|
159
|
-
signUpBtn.innerText = '
|
157
|
+
if (title.innerText == '{{ site.data.locales[lang].login.login }}') {
|
158
|
+
title.innerText = '{{ site.data.locales[lang].login.register }}';
|
159
|
+
loginBtn.value = '{{ site.data.locales[lang].login.register }}';
|
160
|
+
signUpBtn.innerText = '{{ site.data.locales[lang].login.go_to_login }}';
|
160
161
|
document.getElementById('username').value = '';
|
161
162
|
document.getElementById('password').value = '';
|
162
|
-
document.getElementById('username').placeholder = '
|
163
|
-
document.getElementById('password').placeholder = '
|
163
|
+
document.getElementById('username').placeholder = '{{ site.data.locales[lang].login.new_username }}';
|
164
|
+
document.getElementById('password').placeholder = '{{ site.data.locales[lang].login.new_password }}';
|
164
165
|
document.getElementById('password').type = 'password';
|
165
166
|
document.getElementById('email').style.display = 'block';
|
166
167
|
} else {
|
167
|
-
title.innerText = '
|
168
|
-
loginBtn.value = '
|
169
|
-
signUpBtn.innerText = '
|
170
|
-
document.getElementById('username').placeholder = '
|
171
|
-
document.getElementById('password').placeholder = '
|
168
|
+
title.innerText = '{{ site.data.locales[lang].login.login }}';
|
169
|
+
loginBtn.value = '{{ site.data.locales[lang].login.login }}';
|
170
|
+
signUpBtn.innerText = '{{ site.data.locales[lang].login.go_to_register }}';
|
171
|
+
document.getElementById('username').placeholder = '{{ site.data.locales[lang].login.username }}';
|
172
|
+
document.getElementById('password').placeholder = '{{ site.data.locales[lang].login.password }}';
|
172
173
|
document.getElementById('password').type = 'password';
|
173
174
|
document.getElementById('email').style.display = 'none';
|
174
175
|
}
|
@@ -202,11 +203,11 @@ layout: compress
|
|
202
203
|
document.getElementById('loginBtn').addEventListener("click", function () {
|
203
204
|
var username = document.getElementById('username').value.trim();
|
204
205
|
var password = document.getElementById('password').value.trim();
|
205
|
-
if (document.querySelector('.title').innerText == '
|
206
|
+
if (document.querySelector('.title').innerText == '{{ site.data.locales[lang].login.login }}') {
|
206
207
|
AV.User.logIn(username, password).then(function (user) {
|
207
208
|
if (user.get("emailVerified")) {
|
208
209
|
/* 登录成功 */
|
209
|
-
console.log('
|
210
|
+
console.log('Successfully logged in');
|
210
211
|
console.log(AV.User.emailVerified);
|
211
212
|
/* document.getElementById('username').value = '';
|
212
213
|
document.getElementById('password').value = ''; */
|
@@ -217,26 +218,27 @@ layout: compress
|
|
217
218
|
window.location.href = redirectUrl;
|
218
219
|
}
|
219
220
|
else {
|
220
|
-
window.location.href = '{{ site.
|
221
|
+
window.location.href = '{{ site.baseurl }}';
|
221
222
|
}
|
223
|
+
|
222
224
|
} else {
|
223
|
-
alert('
|
225
|
+
alert('{{ site.data.locales[lang].login.email_not_verified }}');
|
224
226
|
}
|
225
227
|
}).catch(function (error) {
|
226
228
|
/* 登录失败,处理错误信息 */
|
227
|
-
console.log('
|
228
|
-
alert('
|
229
|
+
console.log('Login failed:', error);
|
230
|
+
alert('{{ site.data.locales[lang].login.login_fail }}');
|
229
231
|
});
|
230
232
|
} else {
|
231
233
|
var email = document.getElementById('email').value;
|
232
234
|
if (!validateEmail(email)) {
|
233
|
-
alert('
|
235
|
+
alert('{{ site.data.locales[lang].login.enter_vaild_email }}');
|
234
236
|
return;
|
235
237
|
} else if (username == '') {
|
236
|
-
alert('
|
238
|
+
alert('{{ site.data.locales[lang].login.enter_username }}');
|
237
239
|
return;
|
238
240
|
} else if (password == '') {
|
239
|
-
alert('
|
241
|
+
alert('{{ site.data.locales[lang].login.enter_password }}');
|
240
242
|
return;
|
241
243
|
} else {
|
242
244
|
const user = new AV.User();
|
@@ -247,13 +249,13 @@ layout: compress
|
|
247
249
|
|
248
250
|
user.signUp().then(function (user) {
|
249
251
|
/* 注册成功 */
|
250
|
-
alert('
|
252
|
+
alert('{{ site.data.locales[lang].login.waiting_for_verification }}');
|
251
253
|
console.log('注册成功,等待验证邮箱');
|
252
254
|
window.location.reload();
|
253
255
|
}).catch(function (error) {
|
254
256
|
/* 注册失败,处理错误信息 */
|
255
257
|
console.log('注册失败:', error);
|
256
|
-
alert('
|
258
|
+
alert('{{ site.data.locales[lang].login.register_fail }}');
|
257
259
|
});
|
258
260
|
}
|
259
261
|
};
|