VulpesOS/gaia/apps/operatorvariant/js/customizers/wallpaper_customizer.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

38 lines
951 B
JavaScript
Executable file

/* global Customizer, Resources */
'use strict';
var WallpaperCustomizer = (function() {
Customizer.call(this, 'wallpaper', 'json');
this.set = function(wallpaperParams) {
if (!this.simPresentOnFirstBoot) {
console.log('WallpaperCustomizer. No first RUN with configured SIM.');
return;
}
var settings = navigator.mozSettings;
if (!settings) {
console.error('WallpaperCustomizer. Settings is not available');
return;
}
function setWallpaper() {
Resources.load(wallpaperParams.uri, 'blob', function onsuccess(blob) {
settings.createLock().set({
'wallpaper.image': blob
});
}, function onerror(status) {
console.error('WallpaperCustomizer.js: Error retrieving the resource.' +
wallpaperParams.uri);
});
}
setWallpaper();
};
});
var wallpaperCustomizer = new WallpaperCustomizer();
wallpaperCustomizer.init();