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:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,98 @@
/* global NotificationHelper,
Notify,
Promise,
Utils
*/
'use strict';
(function(exports) {
var form;
function init() {
form = document.querySelector('form');
form.addEventListener('submit', onFormSubmit);
navigator.mozL10n.once(function () {
sendNotification().catch((err) => {
console.error('Error while sending a notification', err);
});
});
document.addEventListener('visibilitychange', onVisibilityChange);
}
function sendNotification() {
var params = Utils.parseParams();
var fromNotification = params.notification;
if (fromNotification) {
return Promise.resolve();
}
return new Promise(function(resolve, reject) {
var titleL10n = params.title;
var body = params.body;
var req = navigator.mozApps.getSelf();
req.onsuccess = function onsuccess(event) {
var app = event.target.result;
NotificationHelper.send(titleL10n, {
body: body,
tag: '' + Date.now(), // needs to be unique
icon: NotificationHelper.getIconURI(app),
data: { title: titleL10n },
closeOnClick: false
}).then(function(notification){
notification.onerror = function onerror() {
reject(new Error('CMAS: notification API error'));
};
notification.onshow = resolve;
});
};
req.onerror = function onerror() {
reject(new Error('CMAS: App getSelf request error'));
};
});
}
function closeApp() {
// make sure we close both parent and child window
window.opener ? window.opener.close() : window.close();
}
function onFormSubmit(e) {
e.preventDefault();
// Close parent(if exist) and child attention window after user click ok
closeApp();
}
function onVisibilityChange() {
// Close app when app resized as top banner and moved to background
if (document.hidden && !document.querySelector('h1').clientHeight) {
closeApp();
}
}
function render() {
var params = Utils.parseParams();
renderForm(params);
var fromNotification = params.notification;
if (!fromNotification) {
Notify.notify();
}
}
function renderForm(params) {
var title = params.title;
var body = params.body;
form.querySelector('h1').setAttribute('data-l10n-id', title);
form.querySelector('p').textContent = body;
}
exports.Attention = { init, render };
})(window);