2024-03-07 20:35:50 +08:00
|
|
|
$(document).ready(function () {
|
|
|
|
$('#deleteConfirm').change(function () {
|
|
|
|
if (this.checked) {
|
2024-03-04 16:51:19 +08:00
|
|
|
$('#deleteButton').prop('disabled', false);
|
|
|
|
} else {
|
|
|
|
$('#deleteButton').prop('disabled', true);
|
|
|
|
}
|
|
|
|
});
|
2024-03-07 20:35:50 +08:00
|
|
|
$('#totp-enabled').change(function () {
|
|
|
|
if (this.checked) {
|
|
|
|
$('#totpSetupModal').modal('show');
|
2024-03-09 13:32:35 +08:00
|
|
|
} else {
|
2024-03-07 20:35:50 +08:00
|
|
|
$.post('index.php?r=user%2Fremove-two-factor', function () {
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('#totpSetupModal').on('hidden.bs.modal', function () {
|
|
|
|
$('#totp-enabled').prop('checked', false);
|
|
|
|
});
|
2024-03-09 13:32:35 +08:00
|
|
|
$('#useDarkTheme').change(function () {
|
2024-03-08 16:20:22 +08:00
|
|
|
var darkMode = this.checked ? 1 : 0;
|
2024-03-09 13:32:35 +08:00
|
|
|
$.post('index.php?r=user%2Fset-theme', {dark_mode: darkMode}, function () {
|
2024-03-08 16:20:22 +08:00
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
2024-03-07 20:35:50 +08:00
|
|
|
|
2024-03-09 13:32:35 +08:00
|
|
|
$('#followSystemTheme').change(function () {
|
2024-03-08 16:20:22 +08:00
|
|
|
$('#useDarkTheme').prop('checked', false);
|
|
|
|
var darkMode = this.checked ? 2 : 0;
|
2024-03-09 13:32:35 +08:00
|
|
|
$.post('index.php?r=user%2Fset-theme', {dark_mode: darkMode}, function () {
|
2024-03-08 16:20:22 +08:00
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
2024-03-09 13:32:35 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelector('.avatar-container').addEventListener('click', function () {
|
|
|
|
$('#avatarModal').modal('show');
|
2024-03-09 14:38:42 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelector('.editable-username').addEventListener('click', function () {
|
|
|
|
// 在这里添加你的代码来显示一个模态框或其他你想要的东西
|
|
|
|
$('#changeAccountName').modal('show');
|
2024-03-04 16:51:19 +08:00
|
|
|
});
|