mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
not save to server
This commit is contained in:
@@ -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
@@ -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();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -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',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user