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
|
|
@ -12,7 +12,8 @@
|
|||
'The catalogue is closed. You can reopen it below.'));
|
||||
document.getElementById('open').hidden=true;
|
||||
});
|
||||
function browse(){labels();message.hidden=true;dialog.hidden=true;frame.style.visibility='visible';frame.src='https://vulpes-os.org/marketplace/?mode=app&lang='+(fr()?'fr':'en');}
|
||||
let catalogueUrl='';
|
||||
function browse(reload=false){labels();message.hidden=true;dialog.hidden=true;frame.style.visibility='visible';const next='https://vulpes-os.org/marketplace/?mode=app&lang='+(fr()?'fr':'en');if(reload||!catalogueUrl){catalogueUrl=next;frame.src=next;}}
|
||||
function status(value){frame.style.visibility='hidden';message.hidden=false;document.getElementById('status').textContent=value;}
|
||||
async function prepare(url){
|
||||
if(busy)return;const current=++attempt;busy=true;prepared=null;installed=null;document.getElementById('open').hidden=true;
|
||||
|
|
@ -22,7 +23,10 @@
|
|||
document.getElementById('question').textContent=text('Installer cette application archivée ?','Install this archived application?')+' ('+(prepared.bytes/1048576).toFixed(1)+' Mio)';
|
||||
document.getElementById('permissions').textContent=text('Elle sera exécutée comme une application web, sans accès aux fonctions système. Certains anciens services peuvent ne plus fonctionner.','It will run as a web application without system access. Some old services may no longer work.');
|
||||
message.hidden=true;dialog.hidden=false;
|
||||
}catch(error){if(current!==attempt)return;status(text('Installation impossible : ','Cannot install: ')+error.message);busy=false;}
|
||||
}catch(error){if(current!==attempt)return;status(error.message==='PRIVILEGED_APP_UNSUPPORTED'?
|
||||
text('Cette application demande des API privilégiées qui ne sont pas disponibles dans Vulpes OS.',
|
||||
'This app requires privileged APIs that are not available in Vulpes OS.'):
|
||||
text('Installation impossible : ','Cannot install: ')+error.message);busy=false;}
|
||||
}
|
||||
dialog.addEventListener('submit',async event=>{event.preventDefault();if(!prepared)return;const token=prepared.token;prepared=null;dialog.hidden=true;status(text('Installation…','Installing…'));
|
||||
try {installed=await VulpesCompat.call('marketplace.install',{token});status(text('Application ajoutée à l’accueil.','Application added to Home.'));document.getElementById('open').hidden=false;}
|
||||
|
|
@ -32,7 +36,7 @@
|
|||
document.getElementById('cancel').onclick=cancel;
|
||||
document.getElementById('browse').onclick=cancel;
|
||||
document.getElementById('open').onclick=()=>installed && VulpesCompat.call('apps.launch',{manifestURL:installed.manifestURL});
|
||||
addEventListener('languagechange',()=>{language=navigator.language;if(!busy)browse();});
|
||||
addEventListener('languagechange',()=>{language=navigator.language;if(!busy)browse(true);});
|
||||
browse();
|
||||
setInterval(async()=>{if(busy)return;try{const url=await VulpesCompat.call('marketplace.poll');if(url)await prepare(url);}catch(error){console.error(error);}},750);
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue