not save to server

This commit is contained in:
meetqy
2024-03-28 11:09:47 +08:00
parent 0271950b78
commit 69beb1ff7d
3 changed files with 12 additions and 26 deletions
+7 -24
View File
@@ -360,30 +360,13 @@ async function UIWindowSettings(options){
$(el_window).on('change', 'select.change-clock-visable', function(e){
const $this = $(this);
const value = $this.val();
console.log(value);
// $.ajax({
// url: api_origin + "/clock",
// type: 'POST',
// async: true,
// headers: {
// "Authorization": "Bearer "+auth_token
// },
// contentType: "application/json",
// data: value,
// // data: JSON.stringify({
// // old_pass: current_password,
// // new_pass: new_password,
// // }),
// success: function (data){
// // $(el_window).find('.form-success-msg').html(i18n('password_changed'));
// // $(el_window).find('.form-success-msg').fadeIn();
// // $(el_window).find('input').val('');
// },
// error: function (err){
// // $(el_window).find('.form-error-msg').html(err.responseText);
// // $(el_window).find('.form-error-msg').fadeIn();
// }
// });
value === 'show' && $('#clock').show();
value === 'hide' && $('#clock').hide();
window.mutate_user_preferences({
clock_visable: value
});
})
resolve(el_window);
+4 -2
View File
@@ -505,6 +505,7 @@ async function UIDesktop(options){
const user_preferences = {
show_hidden_files: JSON.parse(await puter.kv.get('user_preferences.show_hidden_files')),
language: await puter.kv.get('user_preferences.language'),
clock_visable: await puter.kv.get('user_preferences.clock_visable'),
};
// update default apps
@@ -1379,14 +1380,15 @@ document.addEventListener('fullscreenchange', (event) => {
// document.fullscreenElement will point to the element that
// is in fullscreen mode if there is one. If there isn't one,
// the value of the property is null.
if (document.fullscreenElement) {
$('.fullscreen-btn').css('background-image', `url(${window.icons['shrink.svg']})`);
$('.fullscreen-btn').attr('title', 'Exit Full Screen');
$('#clock').show();
window.user_preferences.clock_visable === 'auto' && $('#clock').show();
} else {
$('.fullscreen-btn').css('background-image', `url(${window.icons['fullscreen.svg']})`);
$('.fullscreen-btn').attr('title', 'Enter Full Screen');
$('#clock').hide();
window.user_preferences.clock_visable === 'auto' && $('#clock').hide();
}
})
+1
View File
@@ -97,6 +97,7 @@ if (window.user_preferences === null) {
window.user_preferences = {
show_hidden_files: false,
language: navigator.language.split("-")[0] || navigator.userLanguage || 'en',
clock_visable: 'auto',
}
}