Release Preview 20 shared desktop, Android and Sargo updates
Restore Gaia settings and media workflows, extend native network adapters, and align the APK payload. Generate French/English changelogs and website entries from the simplified JSON source. Validation: shared JS and Tundra unit tests; desktop workflows and persistence; signed APK payload parity; Sargo RAM and installed startup with boot readback. Android runtime qualification is recorded separately.
This commit is contained in:
parent
be2cdce823
commit
1311bed5e9
170 changed files with 19698 additions and 2495 deletions
1069
CHANGELOG.en.md
1069
CHANGELOG.en.md
File diff suppressed because it is too large
Load diff
1093
CHANGELOG.md
1093
CHANGELOG.md
File diff suppressed because it is too large
Load diff
|
|
@ -4,7 +4,7 @@
|
||||||
<p align="center">Firefox OS fork · Open source</p>
|
<p align="center">Firefox OS fork · Open source</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://nnsprod.com/git/oversu/VulpesOS/releases"><img src="https://img.shields.io/badge/Vulpes-2.7%20Preview%2017-0755be?style=flat-square" alt="Vulpes: 2.7 Preview 17"></a>
|
<a href="https://nnsprod.com/git/oversu/VulpesOS/releases"><img src="https://img.shields.io/badge/Vulpes-2.7%20Preview%2020-0755be?style=flat-square" alt="Vulpes: 2.7 Preview 20"></a>
|
||||||
<img src="https://img.shields.io/badge/Gaia-2.7-0755be?style=flat-square" alt="Gaia: 2.7">
|
<img src="https://img.shields.io/badge/Gaia-2.7-0755be?style=flat-square" alt="Gaia: 2.7">
|
||||||
<img src="https://img.shields.io/badge/Gecko-156.0.1-0099cc?style=flat-square" alt="Gecko: 156.0.1">
|
<img src="https://img.shields.io/badge/Gecko-156.0.1-0099cc?style=flat-square" alt="Gecko: 156.0.1">
|
||||||
<img src="https://img.shields.io/badge/Tundra-0.1.0-0099cc?style=flat-square" alt="Tundra: 0.1.0">
|
<img src="https://img.shields.io/badge/Tundra-0.1.0-0099cc?style=flat-square" alt="Tundra: 0.1.0">
|
||||||
|
|
@ -38,6 +38,12 @@ Je développe Vulpes principalement seul, sous le nom d’OverSu, avec l’aide
|
||||||
|
|
||||||
Sur Pixel 3a, **Tundra démarre directement Gecko et Gaia** et assure leur accès au matériel. Droidian a servi d’environnement de test au début du projet : il n’est pas inclus dans Vulpes OS et Tundra ne repose pas dessus.
|
Sur Pixel 3a, **Tundra démarre directement Gecko et Gaia** et assure leur accès au matériel. Droidian a servi d’environnement de test au début du projet : il n’est pas inclus dans Vulpes OS et Tundra ne repose pas dessus.
|
||||||
|
|
||||||
|
### Preview 20 · 13 octobre 2026
|
||||||
|
|
||||||
|
[Télécharger l’APK](https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.20). Les corrections communes concernent les paramètres Gaia, l’enregistrement vidéo, les contacts et les médias. Les adaptations réseau natives sont incluses dans les sources. Le [changelog](CHANGELOG.md) précise les vérifications et les limites restantes.
|
||||||
|
|
||||||
|
PC/Sargo utilisent Gecko **156.0.1** ; Android utilise GeckoView **156.0**. Android 8 / API 26 minimum déclaré, sans validation de tous les appareils. Appels et SMS ouvrent les applications Android. L’APK est un build de développement signé, avec débogage via ADB autorisé.
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
Prérequis : Linux x86_64, Git, Python 3 et les bibliothèques système nécessaires à Firefox.
|
Prérequis : Linux x86_64, Git, Python 3 et les bibliothèques système nécessaires à Firefox.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<p align="center">Firefox OS fork · Open source</p>
|
<p align="center">Firefox OS fork · Open source</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://nnsprod.com/git/oversu/VulpesOS/releases"><img src="https://img.shields.io/badge/Vulpes-2.7%20Preview%2017-0755be?style=flat-square" alt="Vulpes: 2.7 Preview 17"></a>
|
<a href="https://nnsprod.com/git/oversu/VulpesOS/releases"><img src="https://img.shields.io/badge/Vulpes-2.7%20Preview%2020-0755be?style=flat-square" alt="Vulpes: 2.7 Preview 20"></a>
|
||||||
<img src="https://img.shields.io/badge/Gaia-2.7-0755be?style=flat-square" alt="Gaia: 2.7">
|
<img src="https://img.shields.io/badge/Gaia-2.7-0755be?style=flat-square" alt="Gaia: 2.7">
|
||||||
<img src="https://img.shields.io/badge/Gecko-156.0.1-0099cc?style=flat-square" alt="Gecko: 156.0.1">
|
<img src="https://img.shields.io/badge/Gecko-156.0.1-0099cc?style=flat-square" alt="Gecko: 156.0.1">
|
||||||
<img src="https://img.shields.io/badge/Tundra-0.1.0-0099cc?style=flat-square" alt="Tundra: 0.1.0">
|
<img src="https://img.shields.io/badge/Tundra-0.1.0-0099cc?style=flat-square" alt="Tundra: 0.1.0">
|
||||||
|
|
@ -38,6 +38,12 @@ I’m OverSu, and I develop Vulpes mostly on my own, with help from people who t
|
||||||
|
|
||||||
On the Pixel 3a, **Tundra boots Gecko and Gaia directly** and provides access to the hardware. Droidian was used as a testing environment early in development. It is not included in Vulpes OS, and Tundra is not based on it.
|
On the Pixel 3a, **Tundra boots Gecko and Gaia directly** and provides access to the hardware. Droidian was used as a testing environment early in development. It is not included in Vulpes OS, and Tundra is not based on it.
|
||||||
|
|
||||||
|
### Preview 20 · 13 October 2026
|
||||||
|
|
||||||
|
[Download the APK](https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.20). Shared updates cover Gaia settings, camera recording, contacts and media. Native network changes are included in the sources. See the [changelog](CHANGELOG.en.md) for checks and remaining limitations.
|
||||||
|
|
||||||
|
Desktop/Sargo use Gecko **156.0.1**; Android uses GeckoView **156.0**. Android 8 / API 26 minimum is declared; not every device is tested. Calls and SMS open Android applications. The APK is a signed development build, with debugging through authorized ADB.
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
You’ll need Linux x86_64, Git, Python 3 and the system libraries required by Firefox.
|
You’ll need Linux x86_64, Git, Python 3 and the system libraries required by Firefox.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
||||||
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
|
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,18 @@ final class AndroidServices {
|
||||||
);
|
);
|
||||||
result.complete(null);
|
result.complete(null);
|
||||||
break;
|
break;
|
||||||
|
case "android.storage":
|
||||||
|
io.execute(() -> {
|
||||||
|
try {
|
||||||
|
File data = new File(app.getApplicationInfo().dataDir);
|
||||||
|
File mediaRoot = new File(app.getFilesDir(), "media");
|
||||||
|
JSONObject stats = new JSONObject().put("free", data.getUsableSpace())
|
||||||
|
.put("apps", storageBytes(data, mediaRoot)).put("sdcard", storageBytes(mediaRoot, null))
|
||||||
|
.put("scope", "vulpes-profile");
|
||||||
|
main.post(() -> result.complete(stats));
|
||||||
|
} catch (Exception e) { fail(result, e); }
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "android.media":
|
case "android.media":
|
||||||
JSONObject params = p;
|
JSONObject params = p;
|
||||||
io.execute(() -> {
|
io.execute(() -> {
|
||||||
|
|
@ -122,6 +134,15 @@ final class AndroidServices {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static long storageBytes(File file, File skip) throws IOException {
|
||||||
|
if (file.equals(skip) || !file.exists() || !file.getCanonicalFile().equals(file.getAbsoluteFile())) return 0;
|
||||||
|
if (file.isFile()) return file.length();
|
||||||
|
long size = 0;
|
||||||
|
File[] children = file.listFiles();
|
||||||
|
if (children != null) for (File child : children) size += storageBytes(child, skip);
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
private void fail(GeckoResult<Object> result, Exception e) {
|
private void fail(GeckoResult<Object> result, Exception e) {
|
||||||
main.post(() -> {
|
main.post(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -550,12 +550,17 @@ public final class MainActivity extends Activity {
|
||||||
"http".equals(origin.getScheme()) &&
|
"http".equals(origin.getScheme()) &&
|
||||||
"camera.localhost".equals(origin.getHost()) &&
|
"camera.localhost".equals(origin.getHost()) &&
|
||||||
origin.getPort() == 18765;
|
origin.getPort() == 18765;
|
||||||
if (!camera || (audio != null && audio.length > 0) || video == null || video.length == 0) {
|
boolean hasVideo = video != null && video.length > 0;
|
||||||
|
boolean hasAudio = audio != null && audio.length > 0;
|
||||||
|
if (!camera || (!hasVideo && !hasAudio)) {
|
||||||
callback.reject();
|
callback.reject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
permission(new String[] { android.Manifest.permission.CAMERA }, granted -> {
|
java.util.ArrayList<String> requested = new java.util.ArrayList<>();
|
||||||
if (granted) callback.grant(video[0], null);
|
if (hasVideo) requested.add(android.Manifest.permission.CAMERA);
|
||||||
|
if (hasAudio) requested.add(android.Manifest.permission.RECORD_AUDIO);
|
||||||
|
permission(requested.toArray(new String[0]), granted -> {
|
||||||
|
if (granted) callback.grant(hasVideo ? video[0] : null, hasAudio ? audio[0] : null);
|
||||||
else callback.reject();
|
else callback.reject();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import {Input} from './services/input.mjs';
|
||||||
import { Packages, packageURL } from './services/packages.mjs';
|
import { Packages, packageURL } from './services/packages.mjs';
|
||||||
import { Activities, isGaiaActivity } from './services/activities.mjs';
|
import { Activities, isGaiaActivity } from './services/activities.mjs';
|
||||||
import { authorizePlatform } from './services/platform.mjs';
|
import { authorizePlatform } from './services/platform.mjs';
|
||||||
|
|
@ -10,6 +11,8 @@ import { Connections } from './Connections.mjs';
|
||||||
import { Alarms } from './Alarms.mjs';
|
import { Alarms } from './Alarms.mjs';
|
||||||
const peers = new Set();
|
const peers = new Set();
|
||||||
let activities, packages;
|
let activities, packages;
|
||||||
|
const input = new Input({identity:peer=>peer.app,broadcast});
|
||||||
|
let editSequence=0;
|
||||||
const nativePackages=(operation,data={})=>browser.runtime.sendNativeMessage('vulpes',{type:'packages.'+operation,...data}).then(JSON.parse);
|
const nativePackages=(operation,data={})=>browser.runtime.sendNativeMessage('vulpes',{type:'packages.'+operation,...data}).then(JSON.parse);
|
||||||
async function refreshInstalled(){const installed=await nativePackages('list');apps.splice(0,apps.length,...apps.filter(a=>!a.installed),...installed);}
|
async function refreshInstalled(){const installed=await nativePackages('list');apps.splice(0,apps.length,...apps.filter(a=>!a.installed),...installed);}
|
||||||
let apps, values, settings, dataStores, contacts, messages, connections, alarms, storage;
|
let apps, values, settings, dataStores, contacts, messages, connections, alarms, storage;
|
||||||
|
|
@ -31,7 +34,7 @@ function grants(app) {
|
||||||
function broadcast(type, data, target) {
|
function broadcast(type, data, target) {
|
||||||
for (const peer of peers) {
|
for (const peer of peers) {
|
||||||
if (target && peer.app.id !== target) continue;
|
if (target && peer.app.id !== target) continue;
|
||||||
if (type === 'settingchange' && data.key !== 'language.current' && !grants(peer.app).includes('settings.read')) continue;
|
if (type === 'settingchange' && !['language.current', 'vulpes.theme'].includes(data.key) && !grants(peer.app).includes('settings.read')) continue;
|
||||||
if (
|
if (
|
||||||
type === 'contactchange' &&
|
type === 'contactchange' &&
|
||||||
!peer.app.manifest.permissions?.contacts?.access?.includes('read')
|
!peer.app.manifest.permissions?.contacts?.access?.includes('read')
|
||||||
|
|
@ -90,6 +93,7 @@ const ready = (async () => {
|
||||||
await browser.storage.local.set({ settings: values });
|
await browser.storage.local.set({ settings: values });
|
||||||
}
|
}
|
||||||
activities = new Activities({identity,apps:()=>apps,notify,uuid:()=>crypto.randomUUID(),
|
activities = new Activities({identity,apps:()=>apps,notify,uuid:()=>crypto.randomUUID(),
|
||||||
|
choose:data=>broadcast('activity-choice',data,'system'),
|
||||||
launch:(target,path,{reload=false,entryPoint}={})=>launch(target,entryPoint,path,reload)});
|
launch:(target,path,{reload=false,entryPoint}={})=>launch(target,entryPoint,path,reload)});
|
||||||
let writes = Promise.resolve();
|
let writes = Promise.resolve();
|
||||||
settings = new SettingsService(
|
settings = new SettingsService(
|
||||||
|
|
@ -100,7 +104,12 @@ const ready = (async () => {
|
||||||
const next = { ...values, ...Object.fromEntries(entries) };
|
const next = { ...values, ...Object.fromEntries(entries) };
|
||||||
await browser.storage.local.set({ settings: next });
|
await browser.storage.local.set({ settings: next });
|
||||||
values = next;
|
values = next;
|
||||||
for (const [key, value] of entries) broadcast('settingchange', { key, value });
|
for (const [key, value] of entries) {
|
||||||
|
broadcast('settingchange', { key, value });
|
||||||
|
if(key==='keyboard.gaia.enabled') {
|
||||||
|
input.hide();broadcast('input-mode',{enabled:value===true});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
writes = write.catch(() => {});
|
writes = write.catch(() => {});
|
||||||
return write;
|
return write;
|
||||||
|
|
@ -302,6 +311,9 @@ async function handle(peer, request) {
|
||||||
}
|
}
|
||||||
if (!Object.keys(params.values).length) return null;
|
if (!Object.keys(params.values).length) return null;
|
||||||
}
|
}
|
||||||
|
if (method === 'input.config') return values['keyboard.gaia.enabled'] === true;
|
||||||
|
if (method === 'input.request') return input.request(peer,params);
|
||||||
|
if (method === 'appearance.current') return values['vulpes.theme'] || 'light';
|
||||||
if (method === 'locale.current') return values['language.current'] || 'en-US';
|
if (method === 'locale.current') return values['language.current'] || 'en-US';
|
||||||
if (method === 'settings.snapshot') {
|
if (method === 'settings.snapshot') {
|
||||||
if (!grants(app).includes('settings.read')) throw Error('PERMISSION_DENIED');
|
if (!grants(app).includes('settings.read')) throw Error('PERMISSION_DENIED');
|
||||||
|
|
@ -357,6 +369,7 @@ async function handle(peer, request) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (method === 'activities.cancel') return activities.cancel(peer);
|
if (method === 'activities.cancel') return activities.cancel(peer);
|
||||||
|
if (method === 'activities.select') return activities.select(peer,params);
|
||||||
if (method === 'activities.subscribe') return activities.subscribe(peer);
|
if (method === 'activities.subscribe') return activities.subscribe(peer);
|
||||||
if (method === 'activities.finish') return activities.finish(peer,params);
|
if (method === 'activities.finish') return activities.finish(peer,params);
|
||||||
if (method === 'activities.start' && isGaiaActivity(params)) return activities.start(peer,params);
|
if (method === 'activities.start' && isGaiaActivity(params)) return activities.start(peer,params);
|
||||||
|
|
@ -412,6 +425,7 @@ async function handle(peer, request) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (method === 'desktop.wakelock') return null; // Android Activity owns the visible screen.
|
if (method === 'desktop.wakelock') return null; // Android Activity owns the visible screen.
|
||||||
|
if (method === 'storage.stats') {if(app.id!=='settings')throw Error('PERMISSION_DENIED');return android('storage',{});}
|
||||||
if (method === 'media.request') return media(app, params);
|
if (method === 'media.request') return media(app, params);
|
||||||
throw Error('METHOD_NOT_SUPPORTED');
|
throw Error('METHOD_NOT_SUPPORTED');
|
||||||
}
|
}
|
||||||
|
|
@ -449,6 +463,15 @@ browser.runtime.onConnect.addListener((port) => {
|
||||||
app,
|
app,
|
||||||
manager: { documentURI: { spec: url.href } },
|
manager: { documentURI: { spec: url.href } },
|
||||||
sendAsyncMessage: (_, event) => notify(peer, event.type, event.data),
|
sendAsyncMessage: (_, event) => notify(peer, event.type, event.data),
|
||||||
|
edits: new Map(),
|
||||||
|
sendQuery(_, params) {
|
||||||
|
const id=++editSequence;
|
||||||
|
return new Promise((resolve,reject)=>{
|
||||||
|
const timer=setTimeout(()=>{peer.edits.delete(id);reject(Error('INPUT_CONTEXT_EXPIRED'));},5000);
|
||||||
|
peer.edits.set(id,{resolve,reject,timer});
|
||||||
|
port.postMessage({edit:{id,params}});
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
peers.add(peer);
|
peers.add(peer);
|
||||||
});
|
});
|
||||||
|
|
@ -456,6 +479,16 @@ browser.runtime.onConnect.addListener((port) => {
|
||||||
let reply;
|
let reply;
|
||||||
try {
|
try {
|
||||||
await attached;
|
await attached;
|
||||||
|
if(Object.hasOwn(message,'inputFocus')) {
|
||||||
|
if(values['keyboard.gaia.enabled']===true) input.changed(peer,message.inputFocus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(Object.hasOwn(message,'editReply')) {
|
||||||
|
const edit=peer.edits.get(message.editReply);
|
||||||
|
if(edit) {clearTimeout(edit.timer);peer.edits.delete(message.editReply);
|
||||||
|
if(message.error)edit.reject(Error(message.error));else edit.resolve(message.result);}
|
||||||
|
return;
|
||||||
|
}
|
||||||
reply = { result: await handle(peer, message.request) };
|
reply = { result: await handle(peer, message.request) };
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
reply = { error: { code: e.message || 'HOST_ERROR' } };
|
reply = { error: { code: e.message || 'HOST_ERROR' } };
|
||||||
|
|
@ -469,6 +502,9 @@ browser.runtime.onConnect.addListener((port) => {
|
||||||
attached
|
attached
|
||||||
.then(() => {
|
.then(() => {
|
||||||
peers.delete(peer);
|
peers.delete(peer);
|
||||||
|
input.cleanup(peer);
|
||||||
|
for(const edit of peer.edits.values()) {clearTimeout(edit.timer);edit.reject(Error('INPUT_CONTEXT_EXPIRED'));}
|
||||||
|
peer.edits.clear();
|
||||||
if (peer.app.id === 'system' && ![...peers].some((p) => p.app.id === 'system'))
|
if (peer.app.id === 'system' && ![...peers].some((p) => p.app.id === 'system'))
|
||||||
systemReady = false;
|
systemReady = false;
|
||||||
activities.cleanup(peer);
|
activities.cleanup(peer);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,23 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function onMessage(message) {
|
function onMessage(message) {
|
||||||
|
if (message.edit) {
|
||||||
|
try {
|
||||||
|
const result=editor.edit(message.edit.params);
|
||||||
|
result.inputMode=originalModes.get(editor.inputElement) ||
|
||||||
|
(editor.inputElement.classList.contains('recipient')?'tel':'');
|
||||||
|
port.postMessage({editReply:message.edit.id, result});
|
||||||
|
}
|
||||||
|
catch (error) { port.postMessage({editReply:message.edit.id, error:String(error.message)}); }
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (message.event) {
|
if (message.event) {
|
||||||
|
if(message.event.type==='input-mode') {
|
||||||
|
gaiaKeyboard=message.event.data.enabled===true;
|
||||||
|
if(!gaiaKeyboard) restoreMode();
|
||||||
|
win.VulpesNativeInput=gaiaKeyboard;
|
||||||
|
win.dispatchEvent(new window.Event('vulpes-input-configured'));
|
||||||
|
}
|
||||||
win.dispatchEvent(
|
win.dispatchEvent(
|
||||||
new window.CustomEvent('vulpes-service-event', { detail: cloneInto(message.event, win) }),
|
new window.CustomEvent('vulpes-service-event', { detail: cloneInto(message.event, win) }),
|
||||||
);
|
);
|
||||||
|
|
@ -50,6 +66,45 @@
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
connect();
|
connect();
|
||||||
|
const editor = new InputEditor(window);
|
||||||
|
let gaiaKeyboard = false;
|
||||||
|
const originalModes = new WeakMap();
|
||||||
|
function restoreMode() {
|
||||||
|
const field = editor.inputElement;
|
||||||
|
if (!field || !originalModes.has(field)) return;
|
||||||
|
const value = originalModes.get(field);
|
||||||
|
if (value === null) field.removeAttribute('inputmode');
|
||||||
|
else field.setAttribute('inputmode', value);
|
||||||
|
originalModes.delete(field);
|
||||||
|
}
|
||||||
|
request({version:1,id:0,method:'input.config',params:{}}).then(reply => {
|
||||||
|
gaiaKeyboard = reply.result === true;
|
||||||
|
win.VulpesNativeInput = gaiaKeyboard;
|
||||||
|
win.dispatchEvent(new window.Event('vulpes-input-configured'));
|
||||||
|
}).catch(error => console.error('Gaia input configuration:', error));
|
||||||
|
for (const type of ['focusin', 'pointerdown', 'click']) addEventListener(type, event => {
|
||||||
|
if (!gaiaKeyboard || editor.editing || location.hostname === 'keyboard.localhost') return;
|
||||||
|
let element = event.target;
|
||||||
|
if (element?.isContentEditable) element=element.closest('[contenteditable=true]') || element;
|
||||||
|
const editable = element?.isContentEditable ||
|
||||||
|
(['input','textarea'].includes(element?.localName) &&
|
||||||
|
!['button','submit','range','checkbox','radio','date','time','datetime-local','file'].includes(element.type));
|
||||||
|
if (!editable || element.disabled || element.readOnly) {
|
||||||
|
if (type === 'click' && !element?.closest?.('[data-vulpes-keep-input]')) port.postMessage({inputFocus:null});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (element !== editor.inputElement) restoreMode();
|
||||||
|
editor.focus(element);
|
||||||
|
if (!originalModes.has(element)) originalModes.set(element, element.getAttribute('inputmode'));
|
||||||
|
// Suppress Android's IME only in this editor; external web pages keep it.
|
||||||
|
element.setAttribute('inputmode', 'none');
|
||||||
|
const state=editor.state();
|
||||||
|
state.inputMode=originalModes.get(element) || (element.classList.contains('recipient')?'tel':'');
|
||||||
|
port.postMessage({inputFocus:state});
|
||||||
|
}, true);
|
||||||
|
addEventListener('visibilitychange', () => {
|
||||||
|
if (document.hidden && gaiaKeyboard) { restoreMode(); port.postMessage({inputFocus:null}); }
|
||||||
|
});
|
||||||
addEventListener('unload', () => clearTimeout(reconnect));
|
addEventListener('unload', () => clearTimeout(reconnect));
|
||||||
exportFunction(request, win.navigator, { defineAs: 'vulpesRequest' });
|
exportFunction(request, win.navigator, { defineAs: 'vulpesRequest' });
|
||||||
const frames = new Map();
|
const frames = new Map();
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
"http://*.localhost/*"
|
"http://*.localhost/*"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
|
"input-editor.js",
|
||||||
"content.js"
|
"content.js"
|
||||||
],
|
],
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,11 @@ result["camera_resumes_from_android_background"] = wait(
|
||||||
"camera",
|
"camera",
|
||||||
'!document.hidden && !!app.camera.mozCamera && app.camera.mozCamera!==__streamBefore && app.camera.mozCamera.getVideoTracks().every(t=>t.readyState==="live") && !app.camera.isBusy',
|
'!document.hidden && !!app.camera.mozCamera && app.camera.mozCamera!==__streamBefore && app.camera.mozCamera.getVideoTracks().every(t=>t.readyState==="live") && !app.camera.isBusy',
|
||||||
)
|
)
|
||||||
result["unavailable_controls"] = ev(
|
result["capability_controls"] = ev(
|
||||||
"camera",
|
"camera",
|
||||||
'[".js-flash",".mode-switch"].every(s=>document.querySelector(s).getAttribute("aria-disabled")==="true")',
|
'document.querySelector(".js-flash").getAttribute("aria-disabled")==="true" && (document.querySelector(".mode-switch").getAttribute("aria-disabled")!=="true") === !!Object.keys(app.camera.mozCamera.capabilities.recorderProfiles).length',
|
||||||
)
|
)
|
||||||
assert result["unavailable_controls"]
|
assert result["capability_controls"]
|
||||||
result["errors"] = ev(
|
result["errors"] = ev(
|
||||||
"camera", '__vulpesDiagnostics.filter(d=>d.kind==="error" || d.kind==="rejection")'
|
"camera", '__vulpesDiagnostics.filter(d=>d.kind==="error" || d.kind==="rejection")'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ from pathlib import Path
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[2]
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
sys.path.insert(0, str(ROOT / "tools"))
|
sys.path.insert(0, str(ROOT / "tools"))
|
||||||
from project import build_info, validate_assets, release_info, application_manifest
|
from project import SOURCE_OVERRIDES, build_info, validate_assets, release_info, application_manifest
|
||||||
|
|
||||||
validate_assets()
|
validate_assets()
|
||||||
OUT = ROOT / "android/app/src/main/assets"
|
OUT = ROOT / "android/app/src/main/assets"
|
||||||
|
|
@ -46,17 +46,8 @@ info = build_info()
|
||||||
release = release_info()
|
release = release_info()
|
||||||
revision = info["revision"]
|
revision = info["revision"]
|
||||||
commit_time = str(info["timestamp"])
|
commit_time = str(info["timestamp"])
|
||||||
source_overrides = {
|
|
||||||
"system": [
|
|
||||||
"js/launcher.js",
|
|
||||||
"js/gaia_scheduler.js",
|
|
||||||
"js/keyboard_manager.js",
|
|
||||||
"js/core.js",
|
|
||||||
"js/rocketbar.js",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
textsuffix = {".html", ".js", ".css", ".json", ".webapp", ".properties", ".svg"}
|
textsuffix = {".html", ".js", ".css", ".json", ".webapp", ".properties", ".svg"}
|
||||||
head = b'<head><script src="/_vulpes/platform-config.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><link rel="stylesheet" href="/_vulpes/desktop.css"><link rel="stylesheet" href="/_vulpes/android.css"><script src="/_vulpes/settings-codec.js"></script><script src="/_vulpes/gaia-compat.js"></script><script src="/_vulpes/gaia-wifi.js"></script><script src="/_vulpes/gaia-services.js"></script><script src="/_vulpes/gaia-styles.js"></script><script src="/_vulpes/android-ui.js"></script><script src="/_vulpes/gaia-restoration.js"></script><script src="/_vulpes/platform-ui.js"></script><script src="/_vulpes/gaia-camera.js"></script>'
|
head = b'<head><script src="/_vulpes/platform-config.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><link rel="stylesheet" href="/_vulpes/desktop.css"><link rel="stylesheet" href="/_vulpes/android.css"><script src="/_vulpes/settings-codec.js"></script><script src="/_vulpes/gaia-compat.js"></script><script src="/_vulpes/gaia-wifi.js"></script><script src="/_vulpes/gaia-mobile-settings.js"></script><script src="/_vulpes/gaia-bluetooth.js"></script><script src="/_vulpes/gaia-input.js"></script><script src="/_vulpes/gaia-services.js"></script><script src="/_vulpes/gaia-styles.js"></script><link rel="stylesheet" href="/_vulpes/gaia-theme.css"><script src="/_vulpes/gaia-theme.js"></script><script src="/_vulpes/gaia-select.js"></script><script src="/_vulpes/android-ui.js"></script><script src="/_vulpes/gaia-restoration.js"></script><script src="/_vulpes/platform-ui.js"></script><script src="/_vulpes/gaia-camera.js"></script>'
|
||||||
if "--bridge-only" not in sys.argv or not (OUT / "gaia.zip").exists():
|
if "--bridge-only" not in sys.argv or not (OUT / "gaia.zip").exists():
|
||||||
with zipfile.ZipFile(OUT / "gaia.zip", "w", zipfile.ZIP_DEFLATED, compresslevel=6) as z:
|
with zipfile.ZipFile(OUT / "gaia.zip", "w", zipfile.ZIP_DEFLATED, compresslevel=6) as z:
|
||||||
hashes = {}
|
hashes = {}
|
||||||
|
|
@ -82,7 +73,7 @@ if "--bridge-only" not in sys.argv or not (OUT / "gaia.zip").exists():
|
||||||
if p.is_file() and p.name != "manifest.webapp"
|
if p.is_file() and p.name != "manifest.webapp"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
for name in source_overrides.get(app["id"], []):
|
for name in SOURCE_OVERRIDES.get(app["id"], []):
|
||||||
files[name] = ROOT / "gaia/apps" / app["id"] / name
|
files[name] = ROOT / "gaia/apps" / app["id"] / name
|
||||||
for name, p in files.items():
|
for name, p in files.items():
|
||||||
data = p.read_bytes()
|
data = p.read_bytes()
|
||||||
|
|
@ -120,7 +111,7 @@ if "--bridge-only" not in sys.argv or not (OUT / "gaia.zip").exists():
|
||||||
data = translate(data.decode("utf8")).encode()
|
data = translate(data.decode("utf8")).encode()
|
||||||
put("_shared/" + p.relative_to(ROOT / "gaia/shared").as_posix(), data)
|
put("_shared/" + p.relative_to(ROOT / "gaia/shared").as_posix(), data)
|
||||||
put("_vulpes/platform-config.js", b'window.VulpesPlatform="android";')
|
put("_vulpes/platform-config.js", b'window.VulpesPlatform="android";')
|
||||||
for name in ["gaia-compat.js", "gaia-services.js", "gaia-styles.js", "gaia-restoration.js", "gaia-wifi.js", "desktop.css", "platform-ui.js", "gaia-camera.js"]:
|
for name in ["gaia-compat.js", "gaia-input.js", "gaia-services.js", "gaia-styles.js", "gaia-theme.js", "gaia-select.js", "gaia-mobile-settings.js", "gaia-theme.css", "gaia-restoration.js", "gaia-wifi.js", "gaia-bluetooth.js", "desktop.css", "platform-ui.js", "gaia-camera.js"]:
|
||||||
text = (
|
text = (
|
||||||
(ROOT / "host" / name)
|
(ROOT / "host" / name)
|
||||||
.read_text()
|
.read_text()
|
||||||
|
|
@ -145,6 +136,7 @@ for name in ["Connections", "Contacts", "Messages"]:
|
||||||
)
|
)
|
||||||
(ext / f"{name}.mjs").write_text(text)
|
(ext / f"{name}.mjs").write_text(text)
|
||||||
shutil.copy2(ROOT / "host/Alarms.sys.mjs", ext / "Alarms.mjs")
|
shutil.copy2(ROOT / "host/Alarms.sys.mjs", ext / "Alarms.mjs")
|
||||||
|
(ext / "input-editor.js").write_text((ROOT / "services/input-editor.mjs").read_text().replace('export class InputEditor', 'class InputEditor'))
|
||||||
shutil.copy2(ROOT / "host/marketplace-page.js", ext / "marketplace-page.js")
|
shutil.copy2(ROOT / "host/marketplace-page.js", ext / "marketplace-page.js")
|
||||||
(ext / "release.json").write_text(json.dumps(release))
|
(ext / "release.json").write_text(json.dumps(release))
|
||||||
(ext / "registry.json").write_text(json.dumps(registry, ensure_ascii=False))
|
(ext / "registry.json").write_text(json.dumps(registry, ensure_ascii=False))
|
||||||
|
|
|
||||||
|
|
@ -5447,6 +5447,9 @@ define('views/viewfinder', [
|
||||||
if (!preview) {
|
if (!preview) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Recompute when the embedded app becomes visible or rotates.
|
||||||
|
this.getSize();
|
||||||
|
if (!this.width || !this.height) { return; }
|
||||||
var aspect;
|
var aspect;
|
||||||
if (sensorAngle % 180 === 0) {
|
if (sensorAngle % 180 === 0) {
|
||||||
this.container = {
|
this.container = {
|
||||||
|
|
@ -5697,6 +5700,7 @@ define('controllers/viewfinder', [
|
||||||
this.views.viewfinder.set('grid', 'off');
|
this.views.viewfinder.set('grid', 'off');
|
||||||
};
|
};
|
||||||
ViewfinderController.prototype.bindEvents = function () {
|
ViewfinderController.prototype.bindEvents = function () {
|
||||||
|
window.addEventListener('resize', this.configurePreview);
|
||||||
this.views.viewfinder.on('fadedin', this.app.firer('viewfinder:visible'));
|
this.views.viewfinder.on('fadedin', this.app.firer('viewfinder:visible'));
|
||||||
this.views.viewfinder.on('fadedout', this.app.firer('viewfinder:hidden'));
|
this.views.viewfinder.on('fadedout', this.app.firer('viewfinder:hidden'));
|
||||||
this.views.viewfinder.on('click', this.app.firer('viewfinder:click'));
|
this.views.viewfinder.on('click', this.app.firer('viewfinder:click'));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
define('modules/navigator/mozPermissionSettings',[],function(){'use strict';return window.navigator.mozPermissionSettings;});define('panels/app_permissions_list/app_permissions_list',['require','modules/settings_service','shared/manifest_helper','modules/apps_cache','modules/navigator/mozApps','modules/navigator/mozPermissionSettings'],function(require){'use strict';var SettingsService=require('modules/settings_service');var ManifestHelper=require('shared/manifest_helper');var AppsCache=require('modules/apps_cache');var mozApps=require('modules/navigator/mozApps');var mozPerms=require('modules/navigator/mozPermissionSettings');var PermissionsList=function pl(){this._listRoot=null;this._permissionsTable=null;this._permissionTableHaveProcessed=false;this._apps=null;this._enabled=false;};PermissionsList.prototype={init:function pl_init(listRoot){this._listRoot=listRoot;this._boundOnAppChoose=this._onAppChoose.bind(this);this._boundOnApplicationInstall=this._onApplicationInstall.bind(this);this._boundOnApplicationUninstall=this._onApplicationUninstall.bind(this);},set enabled(value){if(value!==this._enabled){this._enabled=value;if(this._enabled){this._bindEvents();}else{this._unbindEvents();}}},_bindEvents:function pl__bindEvents(){this._listRoot.addEventListener('click',this._boundOnAppChoose);AppsCache.addEventListener('oninstall',this._boundOnApplicationInstall);AppsCache.addEventListener('onuninstall',this._boundOnApplicationUninstall);},_unbindEvents:function pl__unbindEvents(){this._listRoot.removeEventListener('click',this._boundOnAppChoose);AppsCache.removeEventListener('oninstall',this._boundOnApplicationInstall);AppsCache.removeEventListener('onuninstall',this._boundOnApplicationUninstall);},setPermissionsTable:function pl_setPermissionsTable(permissionTable){this._permissionTable=permissionTable;},refresh:function pl_refresh(){var self=this;this._apps=[];if(this._permissionTableHaveProcessed){return this.loadApps();}else{return mozApps.getSelf().then(function(app){return self._initExplicitPermissionsTable(app);}).then(function(){return self.loadApps();});}},_onAppChoose:function pl__onAppChoose(evt){if(evt.target.dataset&&evt.target.dataset.appIndex){SettingsService.navigate('appPermissions-details',{app:this._apps[evt.target.dataset.appIndex],permissionsTable:this._permissionTable});}},_onApplicationInstall:function pl__onApplicationInstall(evt){var app=evt.application;this._apps.push(app);this._sortApps();this.renderList();},_onApplicationUninstall:function pl__onApplicationUninstall(evt){var app;var appIndex;this._apps.some(function findApp(anApp,index){if(anApp.origin===evt.application.origin){app=anApp;appIndex=index;return true;}
|
define('modules/navigator/mozPermissionSettings',[],function(){'use strict';return window.navigator.mozPermissionSettings;});define('panels/app_permissions_list/app_permissions_list',['require','modules/settings_service','shared/manifest_helper','modules/apps_cache','modules/navigator/mozApps','modules/navigator/mozPermissionSettings'],function(require){'use strict';var SettingsService=require('modules/settings_service');var ManifestHelper=require('shared/manifest_helper');var AppsCache=require('modules/apps_cache');var mozApps=require('modules/navigator/mozApps');var mozPerms=require('modules/navigator/mozPermissionSettings');var PermissionsList=function pl(){this._listRoot=null;this._permissionsTable=null;this._permissionTableHaveProcessed=false;this._apps=null;this._enabled=false;};PermissionsList.prototype={init:function pl_init(listRoot){this._listRoot=listRoot;this._boundOnAppChoose=this._onAppChoose.bind(this);this._boundOnApplicationInstall=this._onApplicationInstall.bind(this);this._boundOnApplicationUninstall=this._onApplicationUninstall.bind(this);},set enabled(value){if(value!==this._enabled){this._enabled=value;if(this._enabled){this._bindEvents();}else{this._unbindEvents();}}},_bindEvents:function pl__bindEvents(){this._listRoot.addEventListener('click',this._boundOnAppChoose);AppsCache.addEventListener('oninstall',this._boundOnApplicationInstall);AppsCache.addEventListener('onuninstall',this._boundOnApplicationUninstall);},_unbindEvents:function pl__unbindEvents(){this._listRoot.removeEventListener('click',this._boundOnAppChoose);AppsCache.removeEventListener('oninstall',this._boundOnApplicationInstall);AppsCache.removeEventListener('onuninstall',this._boundOnApplicationUninstall);},setPermissionsTable:function pl_setPermissionsTable(permissionTable){this._permissionTable=permissionTable;},refresh:function pl_refresh(){var self=this;this._apps=[];if(this._permissionTableHaveProcessed){return this.loadApps();}else{return mozApps.getSelf().then(function(app){return self._initExplicitPermissionsTable(app);}).then(function(){return self.loadApps();});}},_onAppChoose:function pl__onAppChoose(evt){var target=evt.target.closest('[data-app-index]');if(target&&this._listRoot.contains(target)){SettingsService.navigate('appPermissions-details',{app:this._apps[target.dataset.appIndex],permissionsTable:this._permissionTable});}},_onApplicationInstall:function pl__onApplicationInstall(evt){var app=evt.application;this._apps.push(app);this._sortApps();this.renderList();},_onApplicationUninstall:function pl__onApplicationUninstall(evt){var app;var appIndex;this._apps.some(function findApp(anApp,index){if(anApp.origin===evt.application.origin){app=anApp;appIndex=index;return true;}
|
||||||
return false;});if(!app){return;}
|
return false;});if(!app){return;}
|
||||||
SettingsService.navigate('appPermissions');this._apps.splice(appIndex,1);this.renderList();},_sortApps:function pl__sortApps(){this._apps.sort(function alphabeticalSort(app,otherApp){var manifest=new ManifestHelper(app.manifest?app.manifest:app.updateManifest);var otherManifest=new ManifestHelper(otherApp.manifest?otherApp.manifest:otherApp.updateManifest);return manifest.name>otherManifest.name;});},_genAppItemTemplate:function pl__genAppItemTemplate(itemData){var icon=document.createElement('img');var item=document.createElement('li');var link=document.createElement('a');var span=document.createElement('span');span.textContent=itemData.name;span.dir='auto';icon.src=itemData.iconSrc;link.dataset.appIndex=itemData.index;link.href='#';link.classList.add('menu-item');link.appendChild(icon);link.appendChild(span);item.appendChild(link);return item;},renderList:function pl_renderList(){this._listRoot.innerHTML='';var listFragment=document.createDocumentFragment();this._apps.forEach(function appIterator(app,index){var manifest=new ManifestHelper(app.manifest?app.manifest:app.updateManifest);var li=this._genAppItemTemplate({name:manifest.displayName,index:index,iconSrc:this._getBestIconURL(app,manifest.icons)});listFragment.appendChild(li);}.bind(this));this._listRoot.appendChild(listFragment);},_initExplicitPermissionsTable:function pl__initExplicitPermissionsTable(app){this._currentApp=app;var table=this._permissionTable;table.explicitCertifiedPermissions=[];table.plainPermissions.forEach(function plainPermIterator(perm){if(this._isExplicitPerm(perm)){table.explicitCertifiedPermissions.push({explicitPermission:perm,permission:perm});}}.bind(this));table.composedPermissions.forEach(function permIterator(perm){table.accessModes.forEach(function modeIterator(mode){var composedPerm=perm+'-'+mode;if(this._isExplicitPerm(composedPerm)){table.explicitCertifiedPermissions.push({explicitPermission:composedPerm,permission:perm});}}.bind(this));}.bind(this));this._permissionTableHaveProcessed=true;},_isExplicitPerm:function pl_isExplicitPerm(perm){return mozPerms.isExplicit(perm,this._currentApp.manifestURL,this._currentApp.origin,false);},loadApps:function pl_loadApps(){var self=this;return AppsCache.apps().then(function(apps){self._loadApps(apps);});},_loadApps:function pl__loadApps(apps){var table=this._permissionTable;apps.forEach(function(app){var manifest=app.manifest?app.manifest:app.updateManifest;if(manifest.type!='certified'){this._apps.push(app);return;}
|
SettingsService.navigate('appPermissions');this._apps.splice(appIndex,1);this.renderList();},_sortApps:function pl__sortApps(){this._apps.sort(function alphabeticalSort(app,otherApp){var manifest=new ManifestHelper(app.manifest?app.manifest:app.updateManifest);var otherManifest=new ManifestHelper(otherApp.manifest?otherApp.manifest:otherApp.updateManifest);return manifest.name>otherManifest.name;});},_genAppItemTemplate:function pl__genAppItemTemplate(itemData){var icon=document.createElement('img');var item=document.createElement('li');var link=document.createElement('a');var span=document.createElement('span');span.textContent=itemData.name;span.dir='auto';icon.src=itemData.iconSrc;link.dataset.appIndex=itemData.index;link.href='#';link.classList.add('menu-item');link.appendChild(icon);link.appendChild(span);item.appendChild(link);return item;},renderList:function pl_renderList(){this._listRoot.innerHTML='';var listFragment=document.createDocumentFragment();this._apps.forEach(function appIterator(app,index){var manifest=new ManifestHelper(app.manifest?app.manifest:app.updateManifest);var li=this._genAppItemTemplate({name:manifest.displayName,index:index,iconSrc:this._getBestIconURL(app,manifest.icons)});listFragment.appendChild(li);}.bind(this));this._listRoot.appendChild(listFragment);},_initExplicitPermissionsTable:function pl__initExplicitPermissionsTable(app){this._currentApp=app;var table=this._permissionTable;table.explicitCertifiedPermissions=[];table.plainPermissions.forEach(function plainPermIterator(perm){if(this._isExplicitPerm(perm)){table.explicitCertifiedPermissions.push({explicitPermission:perm,permission:perm});}}.bind(this));table.composedPermissions.forEach(function permIterator(perm){table.accessModes.forEach(function modeIterator(mode){var composedPerm=perm+'-'+mode;if(this._isExplicitPerm(composedPerm)){table.explicitCertifiedPermissions.push({explicitPermission:composedPerm,permission:perm});}}.bind(this));}.bind(this));this._permissionTableHaveProcessed=true;},_isExplicitPerm:function pl_isExplicitPerm(perm){return mozPerms&&mozPerms.isExplicit(perm,this._currentApp.manifestURL,this._currentApp.origin,false);},loadApps:function pl_loadApps(){var self=this;return AppsCache.apps().then(function(apps){self._loadApps(apps);});},_loadApps:function pl__loadApps(apps){var table=this._permissionTable;apps.forEach(function(app){var manifest=app.manifest?app.manifest:app.updateManifest;if(manifest.type!='certified'){this._apps.push(app);return;}
|
||||||
var display=table.explicitCertifiedPermissions.some(function iterator(perm){var permInfo=mozPerms.get(perm.explicitPermission,app.manifestURL,app.origin,false);return permInfo!='unknown';}.bind(this));if(display){this._apps.push(app);}}.bind(this));this._sortApps();this.renderList();},_getBestIconURL:function pl__getBestIconURL(app,icons){if(!icons||!Object.keys(icons).length){return'../style/images/default.png';}
|
var display=table.explicitCertifiedPermissions.some(function iterator(perm){var permInfo=mozPerms.get(perm.explicitPermission,app.manifestURL,app.origin,false);return permInfo!='unknown';}.bind(this));if(display){this._apps.push(app);}}.bind(this));this._sortApps();this.renderList();},_getBestIconURL:function pl__getBestIconURL(app,icons){if(!icons||!Object.keys(icons).length){return'../style/images/default.png';}
|
||||||
var preferredIconSize=30*(window.devicePixelRatio||1);var preferredSize=Number.MAX_VALUE;var max=0;for(var size in icons){size=parseInt(size,10);if(size>max){max=size;}
|
var preferredIconSize=30*(window.devicePixelRatio||1);var preferredSize=Number.MAX_VALUE;var max=0;for(var size in icons){size=parseInt(size,10);if(size>max){max=size;}
|
||||||
if(size>=preferredIconSize&&size<preferredSize){preferredSize=size;}}
|
if(size>=preferredIconSize&&size<preferredSize){preferredSize=size;}}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,17 @@
|
||||||
|
|
||||||
define('panels/screen_lock_passcode/panel',['require','modules/settings_utils','modules/dialog_panel','shared/passcode_helper'],function(require){'use strict';var SettingsUtils=require('modules/settings_utils');var DialogPanel=require('modules/dialog_panel');var PasscodeHelper=require('shared/passcode_helper');return function ctor_screenlockPasscode(){var mozSettings=window.navigator.mozSettings;return DialogPanel({_elements:{},_mode:'create',_leftApp:false,_passcodeBuffer:'',_checkingLength:{'create':8,'new':8,'edit':4,'confirm':4,'confirmLock':4},_headerL10nIdMapping:{'create':'new-passcode','edit':'current-passcode','new':'new-passcode','confirm':'enter-passcode','confirmLock':'enter-passcode'},_submitButtonL10nIdMapping:{'new':'change','create':'create','edit':'','confirm':'','confirmLock':''},onInit:function(panel){this._elements.panel=panel;this._elements.gaiaHeader=panel.querySelector('gaia-header');this._elements.header=panel.querySelector('gaia-header h1');this._elements.passcodeInput=panel.querySelector('.passcode-input');this._elements.passcodeDigits=panel.querySelectorAll('.passcode-digit');this._elements.passcodeContainer=panel.querySelector('.passcode-container');this._elements.submitButton=panel.querySelector('button[type="submit"]');this._elements.submitButtonText=this._elements.submitButton.querySelector('span');this._bindEvents();},_bindEvents:function(){this._elements.passcodeInput.onkeypress=this._onPasscodeInputKeypress.bind(this);this._elements.passcodeContainer.onclick=this._onPasscodeContainerClick.bind(this);},_onPasscodeContainerClick:function(evt){evt.preventDefault();this._elements.passcodeInput.focus();},_onPasscodeInputKeypress:function(evt){var keyCode=evt.keyCode;if(keyCode!==0&&keyCode!==8){return;}
|
define('panels/screen_lock_passcode/panel',['require','modules/settings_utils','modules/dialog_panel','shared/passcode_helper'],function(require){'use strict';var SettingsUtils=require('modules/settings_utils');var DialogPanel=require('modules/dialog_panel');var PasscodeHelper=require('shared/passcode_helper');return function ctor_screenlockPasscode(){var mozSettings=window.navigator.mozSettings;return DialogPanel({_elements:{},_mode:'create',_leftApp:false,_passcodeBuffer:'',_checkingLength:{'create':8,'new':8,'edit':4,'confirm':4,'confirmLock':4},_headerL10nIdMapping:{'create':'new-passcode','edit':'current-passcode','new':'new-passcode','confirm':'enter-passcode','confirmLock':'enter-passcode'},_submitButtonL10nIdMapping:{'new':'change','create':'create','edit':'','confirm':'','confirmLock':''},onInit:function(panel){this._elements.panel=panel;this._elements.gaiaHeader=panel.querySelector('gaia-header');this._elements.header=panel.querySelector('gaia-header h1');this._elements.passcodeInput=panel.querySelector('.passcode-input');this._elements.passcodeDigits=panel.querySelectorAll('.passcode-digit');this._elements.passcodeContainer=panel.querySelector('.passcode-container');this._elements.submitButton=panel.querySelector('button[type="submit"]');this._elements.submitButtonText=this._elements.submitButton.querySelector('span');this._bindEvents();},_bindEvents:function(){this._elements.passcodeInput.type='password';this._elements.passcodeInput.inputMode='numeric';this._elements.passcodeInput.maxLength=8;this._elements.passcodeInput.oninput=this._onPasscodeInput.bind(this);this._elements.passcodeContainer.onclick=this._onPasscodeContainerClick.bind(this);},_onPasscodeContainerClick:function(evt){evt.preventDefault();this._elements.passcodeInput.focus();},_onPasscodeInput: function() {
|
||||||
evt.preventDefault();if(this._passcodeBuffer===''){this._hideErrorMessage();}
|
// Android IMEs commit text without legacy keypress/charCode events.
|
||||||
var code=evt.charCode;if(code!==0&&(code<0x30||code>0x39)){return;}
|
var value = this._elements.passcodeInput.value.replace(/[^0-9]/g, '').slice(0, 8);
|
||||||
var key=String.fromCharCode(code);if(evt.charCode===0){if(this._passcodeBuffer.length>0){this._passcodeBuffer=this._getPasscodeBuffer('all');if(this._elements.panel.dataset.passcodeStatus==='success'){this._resetPasscodeStatus();}}}else if(this._passcodeBuffer.length<8){this._passcodeBuffer+=key;}
|
this._hideErrorMessage();
|
||||||
this._updatePassCodeUI();this._processPasscode();},_updateHeaderAndButtonUI:function(){var headerL10nId=this._headerL10nIdMapping[this._mode];var buttonL10nId=this._submitButtonL10nIdMapping[this._mode];if(headerL10nId){this._elements.header.setAttribute('data-l10n-id',headerL10nId);}
|
if (this._elements.panel.dataset.passcodeStatus === 'success') {
|
||||||
|
this._resetPasscodeStatus();
|
||||||
|
}
|
||||||
|
this._passcodeBuffer = value;
|
||||||
|
this._updatePassCodeUI();
|
||||||
|
this._processPasscode();
|
||||||
|
},_updateHeaderAndButtonUI:function(){var headerL10nId=this._headerL10nIdMapping[this._mode];var buttonL10nId=this._submitButtonL10nIdMapping[this._mode];if(headerL10nId){this._elements.header.setAttribute('data-l10n-id',headerL10nId);}
|
||||||
if(buttonL10nId===''){this._elements.submitButton.disabled=true;this._elements.submitButtonText.removeAttribute('data-l10n-id');this._elements.submitButtonText.textContent='';}else if(buttonL10nId){this._elements.submitButton.disabled=false;this._elements.submitButtonText.setAttribute('data-l10n-id',buttonL10nId);}
|
if(buttonL10nId===''){this._elements.submitButton.disabled=true;this._elements.submitButtonText.removeAttribute('data-l10n-id');this._elements.submitButtonText.textContent='';}else if(buttonL10nId){this._elements.submitButton.disabled=false;this._elements.submitButtonText.setAttribute('data-l10n-id',buttonL10nId);}
|
||||||
SettingsUtils.runHeaderFontFit(this._elements.gaiaHeader);},_updatePassCodeUI:function(){for(var i=0;i<8;i++){if(i<this._passcodeBuffer.length){this._elements.passcodeDigits[i].dataset.dot=true;}else{delete this._elements.passcodeDigits[i].dataset.dot;}}},_processPasscode:function(){if(this._passcodeBuffer.length===this._checkingLength[this._mode]){switch(this._mode){case'create':case'new':var originalPasscode=this._getPasscodeBuffer('original');var confirmPasscode=this._getPasscodeBuffer('confirm');if(originalPasscode!==confirmPasscode){this._passcodeBuffer='';this._updatePassCodeUI();this._showErrorMessage();}else{this._showSuccessPasscodeStatus();}
|
SettingsUtils.runHeaderFontFit(this._elements.gaiaHeader);},_updatePassCodeUI:function(){this._elements.passcodeInput.value=this._passcodeBuffer;for(var i=0;i<8;i++){if(i<this._passcodeBuffer.length){this._elements.passcodeDigits[i].dataset.dot=true;}else{delete this._elements.passcodeDigits[i].dataset.dot;}}},_processPasscode:function(){if(this._passcodeBuffer.length===this._checkingLength[this._mode]){switch(this._mode){case'create':case'new':var originalPasscode=this._getPasscodeBuffer('original');var confirmPasscode=this._getPasscodeBuffer('confirm');if(originalPasscode!==confirmPasscode){this._passcodeBuffer='';this._updatePassCodeUI();this._showErrorMessage();}else{this._showSuccessPasscodeStatus();}
|
||||||
break;case'confirm':this._checkPasscode().then((result)=>{if(result){mozSettings.createLock().set({'lockscreen.passcode-lock.enabled':false}).then(()=>{this._showSuccessPasscodeStatus();this.cancel();}).catch((error)=>{console.log(error);});}else{this._passcodeBuffer='';this._updatePassCodeUI();}});break;case'confirmLock':this._checkPasscode().then((result)=>{if(result){mozSettings.createLock().set({'lockscreen.enabled':false,'lockscreen.passcode-lock.enabled':false}).then(()=>{this._showSuccessPasscodeStatus();this.cancel();}).catch((error)=>{console.log(error);});}else{this._passcodeBuffer='';this._updatePassCodeUI();}});break;case'edit':this._checkPasscode().then((result)=>{if(result){this._passcodeBuffer='';this._updatePassCodeUI();this._showDialogInMode('new');}else{this._passcodeBuffer='';this._updatePassCodeUI();}});break;}}},_showDialogInMode:function(mode){this._mode=mode;this._elements.panel.dataset.mode=mode;this._hideErrorMessage();this._updatePassCodeUI();this._updateHeaderAndButtonUI();},onSubmit:function(){if(this._elements.panel.dataset.passcodeStatus!=='success'){this._showErrorMessage();this._elements.passcodeInput.focus();return Promise.reject();}else{var originalPasscode=this._getPasscodeBuffer('original');return mozSettings.createLock().set({'lockscreen.passcode-lock.enabled':true}).then(()=>{return PasscodeHelper.set(originalPasscode);});}},onCancel:function(){this._elements.passcodeInput.blur();},onBeforeShow:function(panel,options){this._mode=options.mode;if(!this._leftApp){this._showDialogInMode(this._mode);}
|
break;case'confirm':this._checkPasscode().then((result)=>{if(result){mozSettings.createLock().set({'lockscreen.passcode-lock.enabled':false}).then(()=>{this._showSuccessPasscodeStatus();this.cancel();}).catch((error)=>{console.log(error);});}else{this._passcodeBuffer='';this._updatePassCodeUI();}});break;case'confirmLock':this._checkPasscode().then((result)=>{if(result){mozSettings.createLock().set({'lockscreen.enabled':false,'lockscreen.passcode-lock.enabled':false}).then(()=>{this._showSuccessPasscodeStatus();this.cancel();}).catch((error)=>{console.log(error);});}else{this._passcodeBuffer='';this._updatePassCodeUI();}});break;case'edit':this._checkPasscode().then((result)=>{if(result){this._passcodeBuffer='';this._updatePassCodeUI();this._showDialogInMode('new');}else{this._passcodeBuffer='';this._updatePassCodeUI();}});break;}}},_showDialogInMode:function(mode){this._mode=mode;this._elements.panel.dataset.mode=mode;this._hideErrorMessage();this._updatePassCodeUI();this._updateHeaderAndButtonUI();},onSubmit:function(){if(this._elements.panel.dataset.passcodeStatus!=='success'){this._showErrorMessage();this._elements.passcodeInput.focus();return Promise.reject();}else{var originalPasscode=this._getPasscodeBuffer('original');return mozSettings.createLock().set({'lockscreen.passcode-lock.enabled':true}).then(()=>{return PasscodeHelper.set(originalPasscode);});}},onCancel:function(){this._elements.passcodeInput.blur();},onBeforeShow:function(panel,options){this._mode=options.mode;if(!this._leftApp){this._showDialogInMode(this._mode);}
|
||||||
this._leftApp=false;},onShow:function(){this._elements.passcodeInput.focus();},onHide:function(){this._leftApp=document.hidden;if(!this._leftApp){this._passcodeBuffer='';}},_checkPasscode:function(){return PasscodeHelper.check(this._passcodeBuffer).then((result)=>{if(result){this._hideErrorMessage();}else{this._showErrorMessage();}
|
this._leftApp=false;},onShow:function(){this._elements.passcodeInput.focus();},onHide:function(){this._leftApp=document.hidden;if(!this._leftApp){this._passcodeBuffer='';}},_checkPasscode:function(){return PasscodeHelper.check(this._passcodeBuffer).then((result)=>{if(result){this._hideErrorMessage();}else{this._showErrorMessage();}
|
||||||
return result;}).catch(()=>{this._showErrorMessage();});},_showErrorMessage:function(){this._elements.panel.dataset.passcodeStatus='error';},_hideErrorMessage:function(){this._elements.panel.dataset.passcodeStatus='';},_resetPasscodeStatus:function(){this._elements.panel.dataset.passcodeStatus='';},_showSuccessPasscodeStatus:function(){this._elements.panel.dataset.passcodeStatus='success';},_getPasscodeBuffer:function(part){if(part==='original'){return this._passcodeBuffer.substring(0,4);}else if(part==='confirm'){return this._passcodeBuffer.substring(4,8);}else if(part==='all'){return this._passcodeBuffer.substring(0,this._passcodeBuffer.length-1);}else{console.log('You are using _getPasscodeBuffer wrongly, '+'please check your argument again - '+part);}}});};});
|
return result;}).catch(()=>{this._showErrorMessage();});},_showErrorMessage:function(){this._elements.panel.dataset.passcodeStatus='error';},_hideErrorMessage:function(){this._elements.panel.dataset.passcodeStatus='';},_resetPasscodeStatus:function(){this._elements.panel.dataset.passcodeStatus='';},_showSuccessPasscodeStatus:function(){this._elements.panel.dataset.passcodeStatus='success';},_getPasscodeBuffer:function(part){if(part==='original'){return this._passcodeBuffer.substring(0,4);}else if(part==='confirm'){return this._passcodeBuffer.substring(4,8);}else if(part==='all'){return this._passcodeBuffer.substring(0,this._passcodeBuffer.length-1);}else{console.log('You are using _getPasscodeBuffer wrongly, '+'please check your argument again - '+part);}}});};});
|
||||||
|
|
@ -399,7 +399,7 @@ function iteratorSV(value){this.applicationSource.addPreviouslyInstalledSvApp(va
|
||||||
loadTable(DB_SV_APP_STORE_NAME,'indexSV',iteratorSV.bind(this));loadTable(DB_ITEM_STORE,'index',iterator,finish.bind(this));function addIfUnique(item){if(!cached[item.identifier]){cached[item.identifier]=true;this._allItems.push(item);}}
|
loadTable(DB_SV_APP_STORE_NAME,'indexSV',iteratorSV.bind(this));loadTable(DB_ITEM_STORE,'index',iterator,finish.bind(this));function addIfUnique(item){if(!cached[item.identifier]){cached[item.identifier]=true;this._allItems.push(item);}}
|
||||||
function finish(){for(var i=0,iLen=collected.length;i<iLen;i++){var thisItem=collected[i];if(thisItem.type==='app'){var itemObj=this.applicationSource.mapToApp(thisItem);addIfUnique.call(this,itemObj);}else if(thisItem.type==='divider'){var divider=new GaiaGrid.Divider(thisItem);this._allItems.push(divider);}else if(thisItem.type==='bookmark'){var bookmark=new GaiaGrid.Bookmark(thisItem);addIfUnique.call(this,bookmark);}}
|
function finish(){for(var i=0,iLen=collected.length;i<iLen;i++){var thisItem=collected[i];if(thisItem.type==='app'){var itemObj=this.applicationSource.mapToApp(thisItem);addIfUnique.call(this,itemObj);}else if(thisItem.type==='divider'){var divider=new GaiaGrid.Divider(thisItem);this._allItems.push(divider);}else if(thisItem.type==='bookmark'){var bookmark=new GaiaGrid.Bookmark(thisItem);addIfUnique.call(this,bookmark);}}
|
||||||
this.notifyReady();if(callback&&typeof callback==='function'){callback();}}},synchronize:function(){this.sources.forEach(function eachSource(source){source.synchronize();});},initSources:function(callback){var pending=this.sources.length;var allEntries=[];var self=this;var current=0;function handleSource(){var source=self.sources[current];current++;source.populate(next);}
|
this.notifyReady();if(callback&&typeof callback==='function'){callback();}}},synchronize:function(){this.sources.forEach(function eachSource(source){source.synchronize();});},initSources:function(callback){var pending=this.sources.length;var allEntries=[];var self=this;var current=0;function handleSource(){var source=self.sources[current];current++;source.populate(next);}
|
||||||
handleSource();function next(entries){allEntries=allEntries.concat(entries);if(!(--pending)){callback(allEntries);}else{handleSource();}}},populate:function(callback){this.initSources(function(entries){this.deferredSave(entries,callback);}.bind(this));},notifyReady:function(){this.ready=true;dispatchEvent(new CustomEvent('databaseready'));},getNextPosition:function(){var nextPosition=this.nextPosition;this.nextPosition++;return nextPosition;},handleIAC:function(connectionRequest){if(connectionRequest.keyword!=='verticalhome-migrate'){return;}
|
handleSource();function next(entries){allEntries=allEntries.concat(entries);if(!(--pending)){callback(allEntries);}else{handleSource();}}},populate:function(callback){this.initSources(function(entries){this.save(entries,callback);}.bind(this));},notifyReady:function(){this.ready=true;dispatchEvent(new CustomEvent('databaseready'));},getNextPosition:function(){var nextPosition=this.nextPosition;this.nextPosition++;return nextPosition;},handleIAC:function(connectionRequest){if(connectionRequest.keyword!=='verticalhome-migrate'){return;}
|
||||||
var port=connectionRequest.port;port.onmessage=(event)=>{if(event.data.action!=='migrate'){console.error('Unhandled migration action requested:',event.data.action);return;}
|
var port=connectionRequest.port;port.onmessage=(event)=>{if(event.data.action!=='migrate'){console.error('Unhandled migration action requested:',event.data.action);return;}
|
||||||
this.migrate(event.data.manifestURL);};port.start();},migrate:function(manifestURL){this.migratingTo=manifestURL;console.info('verticalhome migrating to '+this.migratingTo);if(this.migrating){return;}
|
this.migrate(event.data.manifestURL);};port.start();},migrate:function(manifestURL){this.migratingTo=manifestURL;console.info('verticalhome migrating to '+this.migratingTo);if(this.migrating){return;}
|
||||||
this.migrating=true;(datastore?Promise.resolve():navigator.getDataStores(DATASTORE_NAME).then(stores=>{datastore=stores[0];return Promise.resolve();},(e)=>{return Promise.reject(e);})).then(()=>{this.all(entries=>{this.saveMigrationData(entries,'detail',true).then(()=>{this.migrating=false;window.navigator.mozSettings.createLock().set({'homescreen.manifestURL':this.migratingTo});navigator.getDataStores(PREFS_STORE).then(stores=>{if(stores.length<1){console.error('Error opening verticalhome prefs datastore');return;}
|
this.migrating=true;(datastore?Promise.resolve():navigator.getDataStores(DATASTORE_NAME).then(stores=>{datastore=stores[0];return Promise.resolve();},(e)=>{return Promise.reject(e);})).then(()=>{this.all(entries=>{this.saveMigrationData(entries,'detail',true).then(()=>{this.migrating=false;window.navigator.mozSettings.createLock().set({'homescreen.manifestURL':this.migratingTo});navigator.getDataStores(PREFS_STORE).then(stores=>{if(stores.length<1){console.error('Error opening verticalhome prefs datastore');return;}
|
||||||
|
|
|
||||||
|
|
@ -70,3 +70,6 @@ html[dir="rtl"] .wallpaper {
|
||||||
margin: 0 0.5rem;
|
margin: 0 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Keep preview tiles aligned when source wallpapers have different ratios. */
|
||||||
|
#wallpapers .wallpaper { aspect-ratio: 2 / 3; object-fit: cover; display: block; }
|
||||||
|
|
|
||||||
776
changelog.json
776
changelog.json
File diff suppressed because one or more lines are too long
|
|
@ -272,7 +272,7 @@ ActivityController.prototype.onActivityConfirmed = function(newMedia) {
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
if (newMedia.isVideo) {
|
if (newMedia.isVideo) {
|
||||||
media.type = 'video/3gpp';
|
media.type = media.blob.type || 'video/3gpp';
|
||||||
media.poster = newMedia.poster.blob;
|
media.poster = newMedia.poster.blob;
|
||||||
activity.postResult(media);
|
activity.postResult(media);
|
||||||
this.app.clearSpinner();
|
this.app.clearSpinner();
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ OverlayController.prototype.updateOverlay = function(type, enabled, reason) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var closable = self.activity.pick && type !== 'request-fail';
|
var closable = self.activity.pick || reason === 'request-fail';
|
||||||
var view = new OverlayView({
|
var view = new OverlayView({
|
||||||
type: reason,
|
type: reason,
|
||||||
closable: closable,
|
closable: closable,
|
||||||
|
|
@ -118,6 +118,10 @@ OverlayController.prototype.updateOverlay = function(type, enabled, reason) {
|
||||||
|
|
||||||
overlay.view = view.appendTo(document.body)
|
overlay.view = view.appendTo(document.body)
|
||||||
.on('click:close-btn', function() {
|
.on('click:close-btn', function() {
|
||||||
|
if (reason === 'request-fail' && !self.activity.pick) {
|
||||||
|
self.updateOverlay(type, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
self.app.emit('activitycanceled');
|
self.app.emit('activitycanceled');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue