mirror of
https://github.com/Starlio-app/StarlioX
synced 2025-02-22 23:13:12 +03:00
add auto change wallpaper
This commit is contained in:
parent
41507c8fc5
commit
b9d775eec9
4 changed files with 111 additions and 10 deletions
|
@ -10,6 +10,10 @@ $.ajax({
|
|||
$("#autorunSwitch").attr("checked", "true");
|
||||
$("#autorunText").text("On");
|
||||
}
|
||||
if(data["autochangewallpaper"] === 1) {
|
||||
$("#autosetWallpaperSwitch").attr("checked", "true");
|
||||
$("#autosetWallpaperText").text("On");
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -81,4 +85,38 @@ $("#autorunSwitch").click(function(){
|
|||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$("#autosetWallpaperSwitch").click(function(){
|
||||
$.ajax({
|
||||
url: "http://localhost:8080/api/get/settings",
|
||||
type: "GET",
|
||||
success: function(data){
|
||||
if(data["autochangewallpaper"] === 1){
|
||||
$.ajax({
|
||||
url: "http://localhost:8080/api/update/settings",
|
||||
type: "POST",
|
||||
data: {
|
||||
autochangewallpaper: 0
|
||||
},
|
||||
success: function(){
|
||||
$("#autosetWallpaperSwitch").removeAttr("checked");
|
||||
$("#autosetWallpaperText").text("Off");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$.ajax({
|
||||
url: "http://localhost:8080/api/update/settings",
|
||||
type: "POST",
|
||||
data: {
|
||||
autochangewallpaper: 1
|
||||
},
|
||||
success: function(){
|
||||
$("#autosetWallpaperSwitch").attr("checked", "true");
|
||||
$("#autosetWallpaperText").text("On");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
Loading…
Add table
Reference in a new issue