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.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
45
gaia/apps/operatorvariant/js/customizers/power_customizer.js
Executable file
45
gaia/apps/operatorvariant/js/customizers/power_customizer.js
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
/* global Customizer */
|
||||
|
||||
'use strict';
|
||||
|
||||
var PowerCustomizer = (function() {
|
||||
Customizer.call(this, 'power', 'json');
|
||||
|
||||
this.set = function(aDatas) {
|
||||
if (!aDatas) {
|
||||
return;
|
||||
}
|
||||
var settings = navigator.mozSettings;
|
||||
if (!settings) {
|
||||
console.error('PowerCustomizer. Settings is not available');
|
||||
return;
|
||||
}
|
||||
|
||||
var settingsValue = {};
|
||||
|
||||
if (aDatas.poweron) {
|
||||
if (aDatas.poweron.video) {
|
||||
settingsValue['poweron.video'] = aDatas.poweron.video;
|
||||
}
|
||||
if (aDatas.poweron.image) {
|
||||
settingsValue['poweron.image'] = aDatas.poweron.image;
|
||||
}
|
||||
}
|
||||
if (aDatas.poweroff) {
|
||||
if (aDatas.poweroff.video) {
|
||||
settingsValue['poweroff.video'] = aDatas.poweroff.video;
|
||||
}
|
||||
if (aDatas.poweroff.image) {
|
||||
settingsValue['poweroff.image'] = aDatas.poweroff.image;
|
||||
}
|
||||
}
|
||||
if (Object.keys(settingsValue).length) {
|
||||
settings.createLock().set({
|
||||
'operatorResources.power': settingsValue
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
var powerCustomizer = new PowerCustomizer();
|
||||
powerCustomizer.init();
|
||||
Loading…
Reference in a new issue