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,65 @@
(function(exports) {
'use strict';
const store = new Map();
function isParentAsyncStorageAvailable() {
return !!(window.parent &&
window.parent !== window &&
window.parent.asyncStorage);
}
function callCallback(value, callback) {
if (typeof callback === 'function') {
setTimeout(callback.bind(null, value));
}
}
Object.defineProperty(exports, 'asyncStorage', {
value: {
getItem: function asm_getItem(key, callback) {
if (isParentAsyncStorageAvailable()) {
window.parent.asyncStorage.getItem(key, callback);
return;
}
callCallback(store.get(key) || null, callback);
},
setItem: function asm_setItem(key, value, callback) {
if (isParentAsyncStorageAvailable()) {
window.parent.asyncStorage.setItem(key, value, callback);
return;
}
callCallback(store.set(key, value), callback);
},
removeItem: function asm_removeItem(key, callback) {
if (isParentAsyncStorageAvailable()) {
window.parent.asyncStorage.removeItem(key, callback);
return;
}
callCallback(store.delete(key), callback);
},
clear: function asm_clear(callback) {
if (isParentAsyncStorageAvailable()) {
window.parent.asyncStorage.clear(callback);
return;
}
callCallback(store.clear(), callback);
},
length: function(callback) {
if (isParentAsyncStorageAvailable()) {
window.parent.asyncStorage.length(callback);
return;
}
callCallback(store.size, callback);
},
key: function() {
throw new Error('Not Implemented');
}
}
});
})(window);

View file

@ -0,0 +1,24 @@
(function() {
'use strict';
if (navigator.mozAlarms) {
return;
}
navigator.mozAlarms = {
add: function() {
var returnResult = {};
setTimeout(() => {
returnResult.result = {};
if (typeof returnResult.onsuccess === 'function') {
returnResult.onsuccess.call(returnResult);
}
});
return returnResult;
},
remove: function() {}
};
})();

View file

@ -0,0 +1,33 @@
(function() {
'use strict';
if (navigator.mozApps.mgmt) {
return;
}
const Apps = [{
manifestURL: 'app://system.gaiamobile.org/manifest.webapp',
origin: 'app://system.gaiamobile.org',
manifest: {
name: 'Service'
}
}];
navigator.mozApps.mgmt = {
getAll: function() {
var returnResult = {};
setTimeout(() => {
returnResult.result = Apps;
if (typeof returnResult.onsuccess === 'function') {
returnResult.onsuccess.call(returnResult, {
target: returnResult
});
}
});
return returnResult;
}
};
})();

View file

@ -0,0 +1,21 @@
(function() {
'use strict';
if (navigator.mozIccManager) {
return;
}
navigator.mozIccManager = {
iccIds: ['1234575100210522938'],
getIccById: function(id) {
return {
cardState: 'ready',
iccInfo: {
mcc: id,
mnc: id
}
};
}
};
})();

View file

@ -0,0 +1,11 @@
(function() {
'use strict';
if (navigator.mozMobileConnections) {
return;
}
navigator.mozMobileConnections = navigator.mozIccManager.iccIds.map((id) => {
return { iccId: id};
});
})();

View file

@ -0,0 +1,145 @@
(function() {
'use strict';
if (navigator.mozNetworkStats) {
return;
}
const Today = new Date();
const NetworkInterfaceType = {
WIFI: 0,
MOBILE: 1
};
const Networks = new Map([
['0', {
type: NetworkInterfaceType.WIFI,
id: '0'
}]
].concat(navigator.mozIccManager.iccIds.map((id) => [id, {
type: NetworkInterfaceType.MOBILE,
id: id
}])));
// If we run app in Mulet with the direct URL, then we won't have API for
// navigator.mozApps.mgmt available, but if we run entire gaia in Mulet (aka
// from HomeScreen) then this API will be provided, so it's better to not have
// dependency on the mock navigator.mozApps.mgmt here and just hard code known
// app manifest URLs.
const appManifestURLs = ['app://system.gaiamobile.org/manifest.webapp'];
function generateSample(interfaceId, manifestURL, startValueInMb) {
return {
appManifestURL: manifestURL,
network: Networks.get(interfaceId),
start: new Date('2014-08-14T05:00:00.000Z'),
end: new Date('2014-08-31T05:00:00.000Z'),
data: [{
rxBytes: startValueInMb * 100000,
txBytes: (startValueInMb + 100) * 100000,
date: new Date(
Today.getFullYear(),
Today.getMonth(),
Today.getDate() - 15
)
}, {
rxBytes: startValueInMb * 200000,
txBytes: (startValueInMb + 100) * 200000,
date: Today
}]
};
}
const Samples = new Map([
['0', new Map([
[null, generateSample('0', null, 457)],
[appManifestURLs[0], generateSample('0', appManifestURLs[0], 457)]
])],
[navigator.mozIccManager.iccIds[0], new Map([
[null, generateSample(navigator.mozIccManager.iccIds[0], null, 257)],
[
appManifestURLs[0],
generateSample(
navigator.mozIccManager.iccIds[0],
appManifestURLs[0],
257
)
]
])]
]);
const Alarms = new Map();
navigator.mozNetworkStats = {
WIFI: NetworkInterfaceType.WIFI,
getAvailableNetworks: function() {
var returnResult = {};
setTimeout(() => {
returnResult.result = [];
Networks.forEach((network) => {
returnResult.result.push(network);
});
if (typeof returnResult.onsuccess === 'function') {
returnResult.onsuccess.call(returnResult);
}
});
return returnResult;
},
getSamples: function getSamples(networkInterface, start, end, options) {
var networkSamples = Samples.get(networkInterface.id);
var returnResult = {};
setTimeout(() => {
if (options && options.appManifestURL) {
returnResult.result = networkSamples.get(options.appManifestURL);
} else {
returnResult.result = networkSamples.get(null);
}
if (typeof returnResult.onsuccess === 'function') {
returnResult.onsuccess.call(returnResult);
}
});
return returnResult;
},
getAllAlarms: function(interfaceId) {
var returnResult = {};
setTimeout(() => {
returnResult.result = Alarms.get(interfaceId) || [];
if (typeof returnResult.onsuccess === 'function') {
returnResult.onsuccess.call(returnResult);
}
});
return returnResult;
},
addAlarm: function(interfaceId, alarm) {
var returnResult = {};
setTimeout(() => {
var interfaceAlarms = Alarms.get(interfaceId) || [];
interfaceAlarms.push(alarm);
Alarms.set(interfaceId, interfaceAlarms);
if (typeof returnResult.onsuccess === 'function') {
returnResult.onsuccess.call(returnResult);
}
});
return returnResult;
}
};
})();

View file

@ -0,0 +1,35 @@
(function() {
'use strict';
if (navigator.mozSettings) {
return;
}
const Settings = new Map([['locale.hour12', false]]);
navigator.mozSettings = {
createLock: function() {
return {
get: function(key) {
var request = {
addEventListener: function(eventName, callback) {
request[eventName] = callback;
}
};
window.setTimeout(function() {
if (typeof request.onsuccess === 'function') {
request.result = {};
request.result[key] = Settings.get(key);
request.onsuccess.call(request);
}
});
return request;
}
};
},
addObserver: function() {}
};
})();