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,36 @@
/* global BaseModule */
'use strict';
(function(exports) {
var App = function() {
};
App.SUB_MODULES = [
'WallpaperManager',
'remote/RemoteAppWindowManager',
'remote/MessageController'
];
App.STATES = [
'displayId'
];
BaseModule.create(App, {
DEBUG: false,
name: 'App',
displayId: function() {
return this._displayId;
},
_start: function() {
// The displayId is assigned by shell_remote.js. It should be unique and
// indicates the display which the current instance is associated with in
// Gecko.
this._displayId = window.location.hash ?
parseInt(window.location.hash.substring(1), 10) :
-1;
this.debug('displayId: ' + this._displayId);
}
});
}(window));

9
gaia/apps/system/js/remote/bootstrap.js vendored Executable file
View file

@ -0,0 +1,9 @@
/* global BaseModule */
'use strict';
(function(exports) {
window.addEventListener('load', () => {
exports.app = BaseModule.instantiate('App');
exports.app && exports.app.start();
});
}(window));

View file

@ -0,0 +1,66 @@
/* global BaseModule, BroadcastChannel, Service */
'use strict';
(function(exports) {
function MessageController() {
}
// An empty EVENTS is necessary for triggering EventMixin in BaseModule.
MessageController.EVENTS = [
];
BaseModule.create(MessageController, {
DEBUG: false,
name: 'MessageController',
postMessage: function(type, detail) {
this.debug('[#' + this.displayId + '] ' +
'broadcast message to local system: ' + type +
', ' + JSON.stringify(detail));
this.broadcastChannel.postMessage({
source: this.displayId,
type: type,
detail: detail
});
},
_start: function() {
this.displayId = Service.query('displayId');
this.broadcastChannel = new BroadcastChannel('multiscreen');
this.broadcastChannel.addEventListener('message', this);
},
_stop: function() {
this.broadcastChannel.close();
this.broadcastChannel = null;
},
_handle_message: function(evt) {
var data = evt.data;
if (data.target !== this.displayId) {
return;
}
this.debug('[#' + this.displayId + '] ' +
'got message from local system: ' + data.type +
', ' + JSON.stringify(data.detail));
switch(data.type) {
case 'launch-app':
Service.request('launchApp', data.detail).then(() => {
this.postMessage('launch-app-success', {
config: data.detail
});
}).catch((reason) => {
this.postMessage('launch-app-error', {
config: data.detail,
reason: reason
});
});
break;
}
}
});
}(window));

View file

@ -0,0 +1,98 @@
/* global BaseModule, BrowserFrame */
'use strict';
(function(exports) {
function RemoteAppWindowManager() {
}
RemoteAppWindowManager.SERVICES = [
'launchApp',
'killCurrentApp'
];
// An empty EVENTS is necessary for triggering EventMixin in BaseModule.
RemoteAppWindowManager.EVENTS = [
];
BaseModule.create(RemoteAppWindowManager, {
DEBUG: false,
name: 'RemoteAppWindowManager',
REGISTERED_EVENTS: ['mozbrowserclose', 'mozbrowsererror'],
launchApp: function(config, immediate) {
return new Promise((resolve, reject) => {
if (this.currentApp &&
this.currentApp.container.classList.contains('opening')) {
this.debug('error: previous app is opening.');
reject('Previous app is opening.');
return;
}
this.debug('launching app: ' + JSON.stringify(config));
this.killCurrentApp();
var app = new BrowserFrame(config);
this.REGISTERED_EVENTS.forEach((type) => {
app.element.addEventListener(type, this);
});
this.currentApp = app;
var appWindow = document.createElement('div');
appWindow.appendChild(app.element);
appWindow.classList.add('appWindow');
app.container = appWindow;
this.container.appendChild(appWindow);
if (!immediate) {
appWindow.addEventListener('animationend', function(evt) {
evt.target.classList.remove(evt.animationName);
resolve(config);
});
appWindow.classList.add('opening');
} else {
resolve(config);
}
});
},
killCurrentApp: function() {
if (!this.currentApp) {
return;
}
this.container.removeChild(this.currentApp.container);
this.currentApp = null;
this.debug('current app is killed');
},
_start: function() {
this.container = document.getElementById('windows');
this.currentApp = null;
// XXX: A workaround to force external display to refresh the screen
// at the beginning.
this.launchApp({
oop: true,
url: 'about:blank'
}, true).then(this.killCurrentApp.bind(this));
},
_stop: function() {
this.killCurrentApp();
this.container = null;
},
_handle_mozbrowsererror: function() {
this.killCurrentApp();
},
_handle_mozbrowserclose: function() {
this.killCurrentApp();
}
});
}(window));