Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
req.onsuccess = function onsuccess() {
let blob = req.result['wallpaper.image'];
let url = URL.createObjectURL(blob);
console.log("wallpaper", url);
document.body.style.backgroundImage = "url(" + url + ")";
};
}
utils.joinPath('build', 'config', 'wallpaper_' +
config.GAIA_DEVICE_TYPE + '.jpg'), config.GAIA_DIR);
}
if (!wallpaper.exists()) {
wallpaper = utils.resolve(
utils.joinPath('build', 'config', 'wallpaper' + devpixels + '.jpg'),
config.GAIA_DIR);
}
if (!wallpaper.exists()) {
wallpaper = utils.resolve(
utils.joinPath('build', 'config', 'wallpaper.jpg'),
config.GAIA_DIR);
}
settings['wallpaper.image'] = utils.getFileAsDataURI(wallpaper);
}
if (wallpaper) {
var uri;
if (wallpaper.startsWith(this.appPrefix)) {
uri = wallpaper;
} else {
var file = this.getFile(wallpaper);
if (!file) {
return;
}
uri = '/resources/' + file.leafName;
this.addEntry(file, file.leafName);
}
var content = { uri: uri,
default: this.settings['wallpaper.image'] };
var jsonName = 'wallpaper-' + utils.getHash(wallpaper) + '.json';
return this.createJSON(jsonName, content);
}
};
req.onsuccess = function image_onsuccess() {
var image = req.result['wallpaper.image'];
if (image instanceof Blob) {
image = URL.createObjectURL(image);
}
resolve(image);
};
req.onerror = reject;
reqWallpaper.onsuccess = function wallpaper_getWallpaperSuccess() {
self.preview.src = reqWallpaper.result['wallpaper.image'];
};
},
wallpaper = utils.resolve(
utils.joinPath(config.GAIA_DISTRIBUTION_DIR, 'wallpapers', 'default.jpg'),
config.GAIA_DIR);
}
if (!wallpaper.exists()) {
wallpaper = utils.resolve(
utils.joinPath('build', 'config', 'wallpaper' + devpixels + '.jpg'),
config.GAIA_DIR);
}
if (!wallpaper.exists()) {
wallpaper = utils.resolve(utils.joinPath('build', 'config', 'wallpaper.jpg'),
config.GAIA_DIR);
}
settings['wallpaper.image'] = utils.getFileAsDataURI(wallpaper);
}