Release Vulpes OS 2.7-preview.24
This commit is contained in:
parent
49572b6b45
commit
97ef99f827
135 changed files with 7717 additions and 2524 deletions
|
|
@ -475,20 +475,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Set the .icon property before saving for
|
||||
// backwards compatibility with verticalhome
|
||||
// Set the .icon property before saving for backwards compatibility with
|
||||
// verticalhome. A missing favicon must not prevent pinning the site.
|
||||
var saveSite = function(icon) {
|
||||
siteObject.icon = icon || '';
|
||||
BookmarksDatabase.put(siteObject, siteObject.id)
|
||||
.then(() => {
|
||||
this.app.debug('pinSite: ' + siteObject.id);
|
||||
this.systemBanner.show('site-pinned-to-home-screen');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('pinSite, Failed to pin site: ' + error);
|
||||
});
|
||||
}.bind(this);
|
||||
|
||||
IconsHelper.getIcon(siteObject.url, null,
|
||||
{icons: this.app.favicons}, siteObject).then(icon => {
|
||||
siteObject.icon = icon;
|
||||
BookmarksDatabase.put(siteObject, siteObject.id)
|
||||
.then(() => {
|
||||
this.app.debug('pinSite: ' + siteObject.id);
|
||||
this.systemBanner.show('site-pinned-to-home-screen');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('pinSite, Failed to pin site: ' + error);
|
||||
});
|
||||
});
|
||||
{icons: this.app.favicons}, siteObject).then(saveSite, function(error) {
|
||||
this.app.debug('pinSite: using no favicon: ' + error);
|
||||
saveSite('');
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -986,12 +991,14 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Enable/disable the bookmark option
|
||||
BookmarksDatabase.get(this._currentURL).then(function resolve(result) {
|
||||
// start_url is the bookmark key for installed web apps, while _currentURL
|
||||
// may be a later page in the app. Check the canonical key first.
|
||||
var siteUrl = this.getSiteUrl();
|
||||
BookmarksDatabase.get(siteUrl).then(function resolve(result) {
|
||||
this.addToHomeButton.hidden = !!result;
|
||||
}.bind(this),
|
||||
function reject() {
|
||||
this.addToHomeButton.hidden = true;
|
||||
this.addToHomeButton.hidden = false;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -242,76 +242,29 @@
|
|||
div.dataset.zIndexLevel = 'poweroff-splash';
|
||||
div.id = 'poweroff-splash';
|
||||
|
||||
this.poweroffLogoLoader = new LogoLoader(this._poweroff);
|
||||
// Vulpes uses Gaia's three-ring shutdown animation without a carrier
|
||||
// image or video layered over it.
|
||||
var inner;
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
var outer = document.createElement('span');
|
||||
outer.className = 'poweroff-ring';
|
||||
outer.id = 'poweroff-ring-' + i;
|
||||
div.appendChild(outer);
|
||||
inner = document.createElement('span');
|
||||
outer.appendChild(inner);
|
||||
}
|
||||
|
||||
this.poweroffLogoLoader.onload = function(elem) {
|
||||
// Perform customized animation.
|
||||
div.appendChild(elem);
|
||||
div.className = 'step1';
|
||||
|
||||
if (elem.tagName.toLowerCase() == 'video' && !elem.ended) {
|
||||
elem.onended = function() {
|
||||
elem.classList.add('hide');
|
||||
// XXX workaround of bug 831747
|
||||
// Unload the video. This releases the video decoding hardware
|
||||
// so other apps can use it.
|
||||
elem.removeAttribute('src');
|
||||
elem.load();
|
||||
};
|
||||
elem.play();
|
||||
} else {
|
||||
div.addEventListener('animationend', function() {
|
||||
elem.classList.add('hide');
|
||||
if (elem.tagName.toLowerCase() == 'video') {
|
||||
// XXX workaround of bug 831747
|
||||
// Unload the video. This releases the video decoding hardware
|
||||
// so other apps can use it.
|
||||
elem.removeAttribute('src');
|
||||
elem.load();
|
||||
}
|
||||
});
|
||||
div.className = 'step1';
|
||||
var nextAnimation = function nextAnimation(e) {
|
||||
if (e.target == div) {
|
||||
div.className = 'step2';
|
||||
}
|
||||
|
||||
elem.addEventListener('transitionend', function() {
|
||||
if (e.target == inner) {
|
||||
self._actualPowerOff(reboot);
|
||||
});
|
||||
document.getElementById('screen').appendChild(div);
|
||||
};
|
||||
|
||||
this.poweroffLogoLoader.onnotfound = function() {
|
||||
// - Perform OS default animation.
|
||||
|
||||
// The overall animation ends when the inner span of the bottom ring
|
||||
// is animated, so we store it for detecting.
|
||||
var inner;
|
||||
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
var outer = document.createElement('span');
|
||||
outer.className = 'poweroff-ring';
|
||||
outer.id = 'poweroff-ring-' + i;
|
||||
div.appendChild(outer);
|
||||
|
||||
inner = document.createElement('span');
|
||||
outer.appendChild(inner);
|
||||
}
|
||||
|
||||
div.className = 'step1';
|
||||
var nextAnimation = function nextAnimation(e) {
|
||||
// Switch to next class
|
||||
if (e.target == div) {
|
||||
div.className = 'step2';
|
||||
}
|
||||
|
||||
if (e.target != inner) {
|
||||
return;
|
||||
}
|
||||
|
||||
self._actualPowerOff(reboot);
|
||||
};
|
||||
div.addEventListener('animationend', nextAnimation);
|
||||
|
||||
document.getElementById('screen').appendChild(div);
|
||||
};
|
||||
div.addEventListener('animationend', nextAnimation);
|
||||
document.getElementById('screen').appendChild(div);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -265,7 +265,8 @@
|
|||
// until it works. It may fail at the moment the screenchange
|
||||
// event has been fired, so we may need to try it several times.
|
||||
var tryLockOrientation = () => {
|
||||
if (screen.mozLockOrientation('portrait-primary')) {
|
||||
// Allow the lock screen to follow the physical display orientation.
|
||||
if (screen.mozLockOrientation('any')) {
|
||||
if (!this.orientationLockID) {
|
||||
throw new Error('No orientation ID. This function should only' +
|
||||
'be invoked as a interval callback');
|
||||
|
|
|
|||
|
|
@ -346,13 +346,26 @@
|
|||
|
||||
case this.fullApp:
|
||||
// XXX: This should be replaced probably by Web Activities
|
||||
var host = document.location.host;
|
||||
var domain = host.replace(/(^[\w\d]+\.)?([\w\d]+\.[a-z]+)/, '$2');
|
||||
var protocol = document.location.protocol + '//';
|
||||
applications.getByManifestURL(protocol + 'settings.' +
|
||||
domain + '/manifest.webapp').launch();
|
||||
|
||||
UtilityTray.hide();
|
||||
var settingsURL = new URL(document.location.href);
|
||||
if (settingsURL.hostname.indexOf('system.') !== 0) {
|
||||
console.error('Quick settings: cannot resolve Settings app host');
|
||||
return;
|
||||
}
|
||||
settingsURL.hostname = 'settings.' +
|
||||
settingsURL.hostname.slice('system.'.length);
|
||||
settingsURL.pathname = '/manifest.webapp';
|
||||
settingsURL.search = '';
|
||||
settingsURL.hash = '';
|
||||
applications.waitForReady().then(function() {
|
||||
var settingsApp = applications.getByManifestURL(
|
||||
settingsURL.href);
|
||||
if (!settingsApp) {
|
||||
console.error('Quick settings: Settings app is not installed');
|
||||
return;
|
||||
}
|
||||
settingsApp.launch();
|
||||
UtilityTray.hide();
|
||||
});
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -187,6 +187,15 @@
|
|||
},
|
||||
|
||||
hasPermission: function wf_hasPermission(app, permission) {
|
||||
// The embedded Gaia browser is the trusted system web client. Newer
|
||||
// Gecko builds no longer expose mozPermissionSettings to this code, so
|
||||
// honour its declared window permission and keep popup navigation in
|
||||
// Gaia instead of letting Gecko open a desktop browser window.
|
||||
if (app && app.manifest && app.manifest.role === 'search' &&
|
||||
permission === 'open-remote-window' && app.manifest.permissions &&
|
||||
app.manifest.permissions['open-remote-window']) {
|
||||
return true;
|
||||
}
|
||||
var mozPerms = navigator.mozPermissionSettings;
|
||||
if (!mozPerms) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue