Release Vulpes OS 2.7-preview.24
|
|
@ -794,21 +794,21 @@ function fetchIconBlob(iconUrl){return new Promise((resolve,reject)=>{var xhr=ne
|
|||
reject(new Error(`Got HTTP status ${xhr.status} trying to load ${iconUrl}.`));};xhr.onerror=xhr.ontimeout=()=>{reject(new Error(`Error while getting ${iconUrl}.`));};});}
|
||||
exports.IconsHelper={getIcon:getIcon,getIconBlob:getIconBlob,setElementIcon:setElementIcon,getBestIconFromWebManifest:getBestIconFromWebManifest,getBestIconFromMetaTags:getBestIconFromMetaTags,fetchIcon:fetchIcon,fetchIconBlob:fetchIconBlob,get defaultIconSize(){return getDefaultIconSize();},clear:clear,getNearestSize:getNearestSize,};})(window);;'use strict';(function(exports){const SETTINGS_STORE='homescreen_settings';const SETTINGS_VERSION=0;const COLUMNS_SETTING='grid.cols';const PAGING_SETTING='grid.paging';function Settings(){this.small=false;this.scrollSnapping=false;this.firstRun=false;if(navigator.getDataStores){navigator.getDataStores(SETTINGS_STORE).then(stores=>{if(stores.length<1){return Promise.reject('Settings datastore inaccessible');}
|
||||
var signalChange=()=>{this.save();window.dispatchEvent(new CustomEvent('settings-changed'));};var syncSmallSetting=(signal)=>{stores[0].get(COLUMNS_SETTING).then(cols=>{var oldSmall=this.small;this.small=cols>3;if(this.small!==oldSmall){signalChange();}});};var syncPagingSetting=()=>{stores[0].get(PAGING_SETTING).then(paging=>{var oldSnapping=this.scrollSnapping;this.scrollSnapping=paging||false;if(this.scrollSnapping!==oldSnapping){signalChange();}});};stores[0].addEventListener('change',e=>{switch(e.id){case COLUMNS_SETTING:syncSmallSetting();break;case PAGING_SETTING:syncPagingSetting();break;}});syncSmallSetting();syncPagingSetting();},e=>{console.error('Error retrieving home screen settings datastore:',e);});}else{console.error('Datastore API unavailable');}
|
||||
var settingsString=localStorage.getItem('settings');if(!settingsString){this.firstRun=true;return;}
|
||||
var settingsString;try{settingsString=localStorage.getItem('settings');}catch(e){console.error('Home screen local settings unavailable:',e);return;}if(!settingsString){this.firstRun=true;return;}
|
||||
var settings=JSON.parse(settingsString);if(settings.version!==SETTINGS_VERSION){return;}
|
||||
this.small=settings.small||false;this.scrollSnapping=settings.scrollSnapping||false;if(!navigator.getDataStores){console.error('Datastore API unavailable');return;}}
|
||||
Settings.prototype={save:function(){localStorage.setItem('settings',JSON.stringify({version:SETTINGS_VERSION,small:this.small,scrollSnapping:this.scrollSnapping}));}};exports.Settings=Settings;}(window));;'use strict';(function(exports){const DB_NAME='home-metadata';const DB_ORDER_STORE='order';const DB_ICON_STORE='icon';const DB_VERSION=1;function AppsMetadata(){}
|
||||
Settings.prototype={save:function(){try{localStorage.setItem('settings',JSON.stringify({version:SETTINGS_VERSION,small:this.small,scrollSnapping:this.scrollSnapping}));}catch(e){console.error('Home screen settings could not be saved:',e);}}};exports.Settings=Settings;}(window));;'use strict';(function(exports){const DB_NAME='home-metadata';const DB_ORDER_STORE='order';const DB_ICON_STORE='icon';const DB_VERSION=1;function AppsMetadata(){}
|
||||
AppsMetadata.prototype={db:null,init:function(){return new Promise((resolve,reject)=>{var req=window.indexedDB.open(DB_NAME,DB_VERSION);req.onupgradeneeded=this.upgradeSchema;req.onsuccess=(e)=>{this.db=e.target.result;resolve();};req.onerror=(e)=>{console.error('Error opening homescreen metadata db',e);reject(e);};});},upgradeSchema:function(e){var db=e.target.result;var fromVersion=e.oldVersion;if(fromVersion<1){var store=db.createObjectStore(DB_ORDER_STORE,{keyPath:'id'});store.createIndex('order','order',{unique:false});store=db.createObjectStore(DB_ICON_STORE,{keyPath:'id'});store.createIndex('icon','icon',{unique:false});}},set:function(data){return new Promise((resolve,reject)=>{var txn=this.db.transaction([DB_ORDER_STORE,DB_ICON_STORE],'readwrite');for(var entry of data){if(!entry.id){continue;}
|
||||
if(typeof entry.order!=='undefined'){txn.objectStore(DB_ORDER_STORE).put({id:entry.id,order:entry.order});}
|
||||
if(typeof entry.icon!=='undefined'){txn.objectStore(DB_ICON_STORE).put({id:entry.id,icon:entry.icon});}}
|
||||
txn.oncomplete=resolve;txn.onerror=reject;});},remove:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([DB_ORDER_STORE,DB_ICON_STORE],'readwrite');txn.objectStore(DB_ORDER_STORE).delete(id);txn.objectStore(DB_ICON_STORE).delete(id);txn.oncomplete=resolve;txn.onerror=reject;});},getAll:function(onResult){return new Promise((resolve,reject)=>{var txn=this.db.transaction([DB_ORDER_STORE,DB_ICON_STORE],'readonly');var orderStore=txn.objectStore(DB_ORDER_STORE);var iconStore=txn.objectStore(DB_ICON_STORE);var cursor=orderStore.index('order').openCursor();var results=[];cursor.onsuccess=e=>{var cursor=e.target.result;if(cursor){var result=cursor.value;var iconRequest=iconStore.get(result.id);iconRequest.onsuccess=function(result,e){if(e.target.result){result.icon=e.target.result.icon;}
|
||||
results.push(result);if(onResult){onResult(result);}}.bind(this,result);cursor.continue();}};txn.oncomplete=()=>{resolve(results);};});}};exports.AppsMetadata=AppsMetadata;}(window));;'use strict';(function(exports){function Datastore(name){this.name=name;}
|
||||
Datastore.prototype={name:'',DB_VERSION:1,datastore:null,lastRevision:null,db:null,get revisionName(){return this.name+'_revision';},get idbName(){return this.name+'_mirror';},get storeName(){return this.name+'_store';},init:function(){var revisionString=localStorage.getItem(this.revisionName);if(revisionString){this.lastRevision=JSON.parse(revisionString);}
|
||||
Datastore.prototype={name:'',DB_VERSION:1,datastore:null,lastRevision:null,db:null,get revisionName(){return this.name+'_revision';},get idbName(){return this.name+'_mirror';},get storeName(){return this.name+'_store';},init:function(){var revisionString;try{revisionString=localStorage.getItem(this.revisionName);}catch(e){console.error('Homescreen datastore revision unavailable:',e);}if(revisionString){this.lastRevision=JSON.parse(revisionString);}
|
||||
return new Promise((resolve,reject)=>{var req=window.indexedDB.open(this.idbName,this.DB_VERSION);req.onupgradeneeded=this.upgradeSchema.bind(this);req.onsuccess=(e)=>{this.db=e.target.result;resolve();if(!navigator.getDataStores){console.error('DataStore API is unavailable');return;}
|
||||
navigator.getDataStores(this.name).then((stores)=>{if(stores.length<1){console.error(this.name+' inaccessible');return;}
|
||||
this.datastore=stores[0];this.datastore.addEventListener('change',this.onChange.bind(this));this.synchronise();},(e)=>{console.error('Error getting datastore',e);});};req.onerror=(e)=>{console.error('Error opening datastore mirror database',e);reject(e);};});},upgradeSchema:function(e){var db=e.target.result;var fromVersion=e.oldVersion;if(fromVersion<1){var store=db.createObjectStore(this.storeName,{keyPath:'id'});store.createIndex('data','data',{unique:false});}},synchronise:function(){this._syncQueue=(this._syncQueue||Promise.resolve()).then(()=>this._synchronise());return this._syncQueue;},_synchronise:function(){return new Promise((resolve,reject)=>{var cursor=this.datastore.sync(this.lastRevision);var self=this;function cursorResolve(task){var promises=[];switch(task.operation){case'update':case'add':promises.push(self.set(task.data));break;case'remove':promises.push(self.remove(task.id));break;case'clear':promises.push(self.clear());break;case'done':self.updateRevision();resolve();return;}
|
||||
promises.push(cursor.next());Promise.all(promises).then((results)=>{cursorResolve(results.pop());},reject);}
|
||||
cursor.next().then(cursorResolve,reject);});},set:function(data){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(data,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-set',{detail:{id:data.id}}));}.bind(this,data,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).put({id:data.id,data:data});}catch(e){console.error('Error putting data in '+this.idbName+':',e);resolve();}});},remove:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(id,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-removed',{detail:{id:id}}));}.bind(this,id,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).delete(id);}catch(e){console.error('Error deleting data from '+this.idbName+':',e);resolve();}});},clear:function(){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-cleared'));}.bind(this,resolve);txn.onerror=reject;txn.objectStore(this.storeName).clear();});},updateRevision:function(){this.lastRevision=this.datastore.revisionId;localStorage.setItem(this.revisionName,JSON.stringify(this.lastRevision));},onChange:function(e){this.synchronise().then(()=>{},(error)=>{console.error('Failed to handle '+this.name+' change',error);});},get:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.objectStore(this.storeName).get(id).onsuccess=(event)=>{resolve(event.target.result);};});},getAll:function(filter=()=>true){return new Promise((resolve,reject)=>{var results=[];var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.oncomplete=()=>{resolve(results);};txn.objectStore(this.storeName).openCursor().onsuccess=(event)=>{var cursor=event.target.result;if(cursor){if(filter(cursor.value)){results.push(cursor.value);}
|
||||
cursor.next().then(cursorResolve,reject);});},set:function(data){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(data,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-set',{detail:{id:data.id}}));}.bind(this,data,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).put({id:data.id,data:data});}catch(e){console.error('Error putting data in '+this.idbName+':',e);resolve();}});},remove:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(id,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-removed',{detail:{id:id}}));}.bind(this,id,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).delete(id);}catch(e){console.error('Error deleting data from '+this.idbName+':',e);resolve();}});},clear:function(){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-cleared'));}.bind(this,resolve);txn.onerror=reject;txn.objectStore(this.storeName).clear();});},updateRevision:function(){this.lastRevision=this.datastore.revisionId;try{localStorage.setItem(this.revisionName,JSON.stringify(this.lastRevision));}catch(e){console.error('Homescreen datastore revision could not be saved:',e);}},onChange:function(e){this.synchronise().then(()=>{},(error)=>{console.error('Failed to handle '+this.name+' change',error);});},get:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.objectStore(this.storeName).get(id).onsuccess=(event)=>{resolve(event.target.result);};});},getAll:function(filter=()=>true){return new Promise((resolve,reject)=>{var results=[];var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.oncomplete=()=>{resolve(results);};txn.objectStore(this.storeName).openCursor().onsuccess=(event)=>{var cursor=event.target.result;if(cursor){if(filter(cursor.value)){results.push(cursor.value);}
|
||||
cursor.continue();}};});}};exports.Datastore=Datastore;}(window));;'use strict';(function(exports){function PagesStore(name){this.name=name;}
|
||||
PagesStore.prototype=Object.create(Datastore.prototype);PagesStore.prototype.DB_VERSION=1;PagesStore.prototype.set=function(data){data.id=data.url;return Datastore.prototype.set.call(this,data);};PagesStore.prototype.getAll=function(){var filter=(value)=>value.data&&value.data.pinned;return Datastore.prototype.getAll.call(this,filter);};exports.PagesStore=PagesStore;}(window));;'use strict';(function(exports){const PAGES_ICON_SIZE=30;function Pages(){this.panel=document.getElementById('pages-panel');this.panels=document.getElementById('panels');this.pages=document.getElementById('pages');this.scrollable=document.querySelector('#pages-panel > .scrollable');this.bottombar=document.getElementById('bottombar');this.remove=document.getElementById('remove');this.done=document.getElementById('done');this.empty=true;this.editMode=false;this.dialogs=[];this.pages.addEventListener('click',this);this.pages.addEventListener('contextmenu',this);this.pages.addEventListener('keydown',this);window.addEventListener('resize',this);this.done.addEventListener('click',e=>{e.preventDefault();this.exitEditMode();});this.remove.addEventListener('click',e=>{e.preventDefault();this.unpinSelectedCard();});this.pagesStore=new PagesStore('places');this.pagesStore.init().then(()=>{document.addEventListener('places-set',(e)=>{var id=e.detail.id;this.pagesStore.get(id).then((page)=>{for(var child of this.pages.children){if(child.dataset.id===id){if(!page.data.pinned){this.removeCard(child);}else{this.updatePinnedPage(child,page.data);}
|
||||
return;}}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
;'use strict';(function(exports){function Datastore(name){this.name=name;}
|
||||
Datastore.prototype={name:'',DB_VERSION:1,datastore:null,lastRevision:null,db:null,get revisionName(){return this.name+'_revision';},get idbName(){return this.name+'_mirror';},get storeName(){return this.name+'_store';},init:function(){var revisionString=localStorage.getItem(this.revisionName);if(revisionString){this.lastRevision=JSON.parse(revisionString);}
|
||||
Datastore.prototype={name:'',DB_VERSION:1,datastore:null,lastRevision:null,db:null,get revisionName(){return this.name+'_revision';},get idbName(){return this.name+'_mirror';},get storeName(){return this.name+'_store';},init:function(){var revisionString;try{revisionString=localStorage.getItem(this.revisionName);}catch(e){console.error('Homescreen datastore revision unavailable:',e);}if(revisionString){this.lastRevision=JSON.parse(revisionString);}
|
||||
return new Promise((resolve,reject)=>{var req=window.indexedDB.open(this.idbName,this.DB_VERSION);req.onupgradeneeded=this.upgradeSchema.bind(this);req.onsuccess=(e)=>{this.db=e.target.result;resolve();if(!navigator.getDataStores){console.error('DataStore API is unavailable');return;}
|
||||
navigator.getDataStores(this.name).then((stores)=>{if(stores.length<1){console.error(this.name+' inaccessible');return;}
|
||||
this.datastore=stores[0];this.datastore.addEventListener('change',this.onChange.bind(this));this.synchronise();},(e)=>{console.error('Error getting datastore',e);});};req.onerror=(e)=>{console.error('Error opening datastore mirror database',e);reject(e);};});},upgradeSchema:function(e){var db=e.target.result;var fromVersion=e.oldVersion;if(fromVersion<1){var store=db.createObjectStore(this.storeName,{keyPath:'id'});store.createIndex('data','data',{unique:false});}},synchronise:function(){this._syncQueue=(this._syncQueue||Promise.resolve()).then(()=>this._synchronise());return this._syncQueue;},_synchronise:function(){return new Promise((resolve,reject)=>{var cursor=this.datastore.sync(this.lastRevision);var self=this;function cursorResolve(task){var promises=[];switch(task.operation){case'update':case'add':promises.push(self.set(task.data));break;case'remove':promises.push(self.remove(task.id));break;case'clear':promises.push(self.clear());break;case'done':self.updateRevision();resolve();return;}
|
||||
promises.push(cursor.next());Promise.all(promises).then((results)=>{cursorResolve(results.pop());},reject);}
|
||||
cursor.next().then(cursorResolve,reject);});},set:function(data){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(data,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-set',{detail:{id:data.id}}));}.bind(this,data,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).put({id:data.id,data:data});}catch(e){console.error('Error putting data in '+this.idbName+':',e);resolve();}});},remove:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(id,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-removed',{detail:{id:id}}));}.bind(this,id,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).delete(id);}catch(e){console.error('Error deleting data from '+this.idbName+':',e);resolve();}});},clear:function(){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-cleared'));}.bind(this,resolve);txn.onerror=reject;txn.objectStore(this.storeName).clear();});},updateRevision:function(){this.lastRevision=this.datastore.revisionId;localStorage.setItem(this.revisionName,JSON.stringify(this.lastRevision));},onChange:function(e){this.synchronise().then(()=>{},(error)=>{console.error('Failed to handle '+this.name+' change',error);});},get:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.objectStore(this.storeName).get(id).onsuccess=(event)=>{resolve(event.target.result);};});},getAll:function(filter=()=>true){return new Promise((resolve,reject)=>{var results=[];var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.oncomplete=()=>{resolve(results);};txn.objectStore(this.storeName).openCursor().onsuccess=(event)=>{var cursor=event.target.result;if(cursor){if(filter(cursor.value)){results.push(cursor.value);}
|
||||
cursor.next().then(cursorResolve,reject);});},set:function(data){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(data,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-set',{detail:{id:data.id}}));}.bind(this,data,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).put({id:data.id,data:data});}catch(e){console.error('Error putting data in '+this.idbName+':',e);resolve();}});},remove:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(id,resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-removed',{detail:{id:id}}));}.bind(this,id,resolve);txn.onerror=reject;try{txn.objectStore(this.storeName).delete(id);}catch(e){console.error('Error deleting data from '+this.idbName+':',e);resolve();}});},clear:function(){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readwrite');txn.oncomplete=function onComplete(resolve){resolve();document.dispatchEvent(new CustomEvent(this.name+'-cleared'));}.bind(this,resolve);txn.onerror=reject;txn.objectStore(this.storeName).clear();});},updateRevision:function(){this.lastRevision=this.datastore.revisionId;try{localStorage.setItem(this.revisionName,JSON.stringify(this.lastRevision));}catch(e){console.error('Homescreen datastore revision could not be saved:',e);}},onChange:function(e){this.synchronise().then(()=>{},(error)=>{console.error('Failed to handle '+this.name+' change',error);});},get:function(id){return new Promise((resolve,reject)=>{var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.objectStore(this.storeName).get(id).onsuccess=(event)=>{resolve(event.target.result);};});},getAll:function(filter=()=>true){return new Promise((resolve,reject)=>{var results=[];var txn=this.db.transaction([this.storeName],'readonly');txn.onerror=reject;txn.oncomplete=()=>{resolve(results);};txn.objectStore(this.storeName).openCursor().onsuccess=(event)=>{var cursor=event.target.result;if(cursor){if(filter(cursor.value)){results.push(cursor.value);}
|
||||
cursor.continue();}};});}};exports.Datastore=Datastore;}(window));
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
;'use strict';(function(exports){const SETTINGS_STORE='homescreen_settings';const SETTINGS_VERSION=0;const COLUMNS_SETTING='grid.cols';const PAGING_SETTING='grid.paging';function Settings(){this.small=false;this.scrollSnapping=false;this.firstRun=false;if(navigator.getDataStores){navigator.getDataStores(SETTINGS_STORE).then(stores=>{if(stores.length<1){return Promise.reject('Settings datastore inaccessible');}
|
||||
var signalChange=()=>{this.save();window.dispatchEvent(new CustomEvent('settings-changed'));};var syncSmallSetting=(signal)=>{stores[0].get(COLUMNS_SETTING).then(cols=>{var oldSmall=this.small;this.small=cols>3;if(this.small!==oldSmall){signalChange();}});};var syncPagingSetting=()=>{stores[0].get(PAGING_SETTING).then(paging=>{var oldSnapping=this.scrollSnapping;this.scrollSnapping=paging||false;if(this.scrollSnapping!==oldSnapping){signalChange();}});};stores[0].addEventListener('change',e=>{switch(e.id){case COLUMNS_SETTING:syncSmallSetting();break;case PAGING_SETTING:syncPagingSetting();break;}});syncSmallSetting();syncPagingSetting();},e=>{console.error('Error retrieving home screen settings datastore:',e);});}else{console.error('Datastore API unavailable');}
|
||||
var settingsString=localStorage.getItem('settings');if(!settingsString){this.firstRun=true;return;}
|
||||
var settingsString;try{settingsString=localStorage.getItem('settings');}catch(e){console.error('Home screen local settings unavailable:',e);return;}if(!settingsString){this.firstRun=true;return;}
|
||||
var settings=JSON.parse(settingsString);if(settings.version!==SETTINGS_VERSION){return;}
|
||||
this.small=settings.small||false;this.scrollSnapping=settings.scrollSnapping||false;if(!navigator.getDataStores){console.error('Datastore API unavailable');return;}}
|
||||
Settings.prototype={save:function(){localStorage.setItem('settings',JSON.stringify({version:SETTINGS_VERSION,small:this.small,scrollSnapping:this.scrollSnapping}));}};exports.Settings=Settings;}(window));
|
||||
Settings.prototype={save:function(){try{localStorage.setItem('settings',JSON.stringify({version:SETTINGS_VERSION,small:this.small,scrollSnapping:this.scrollSnapping}));}catch(e){console.error('Home screen settings could not be saved:',e);}}};exports.Settings=Settings;}(window));
|
||||
|
|
@ -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);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -10,152 +10,20 @@
|
|||
},
|
||||
"locales": {
|
||||
"ar": {
|
||||
"name": "مُتصفّح",
|
||||
"description": "مُتصفّح نظام Gaia"
|
||||
},
|
||||
"bg": {
|
||||
"name": "Браузър",
|
||||
"description": "Системен уеб браузър на Gaia"
|
||||
},
|
||||
"bn-BD": {
|
||||
"name": "ব্রাউজার",
|
||||
"description": "গায়া সিস্টেম ওয়েব ব্রাউজার"
|
||||
},
|
||||
"ca": {
|
||||
"name": "Navegador",
|
||||
"description": "Navegador web del sistema del Gaia"
|
||||
},
|
||||
"cs": {
|
||||
"name": "Prohlížeč",
|
||||
"description": "Vyhledávání"
|
||||
},
|
||||
"da": {
|
||||
"name": "Browser",
|
||||
"description": "Gaia system-webbrowser"
|
||||
},
|
||||
"de": {
|
||||
"name": "Browser",
|
||||
"description": "System-Webbrowser für Gaia"
|
||||
},
|
||||
"el": {
|
||||
"name": "Περιηγητής",
|
||||
"description": "Περιηγητής Ιστού του Gaia"
|
||||
"description": "Gaia System Web Browser"
|
||||
},
|
||||
"en-US": {
|
||||
"name": "Browser",
|
||||
"description": "Gaia System Web Browser"
|
||||
},
|
||||
"es": {
|
||||
"name": "Navegador",
|
||||
"description": "Navegador del sistema Gaia"
|
||||
},
|
||||
"eu": {
|
||||
"name": "Nabigatzailea",
|
||||
"description": "Gaia, sistemaren web nagibatzailea"
|
||||
},
|
||||
"fr": {
|
||||
"name": "Navigateur",
|
||||
"description": "Navigateur web système de Gaia"
|
||||
},
|
||||
"gl": {
|
||||
"name": "Navegador",
|
||||
"description": "Navegador web do sistema Gaia"
|
||||
},
|
||||
"hr": {
|
||||
"zh-TW": {
|
||||
"name": "Browser",
|
||||
"description": "Gaia System Web Browser"
|
||||
},
|
||||
"hu": {
|
||||
"name": "Böngésző",
|
||||
"description": "Gaia webbögésző"
|
||||
},
|
||||
"it": {
|
||||
"name": "Browser",
|
||||
"description": "Browser di sistema di Gaia"
|
||||
},
|
||||
"ja": {
|
||||
"name": "ブラウザ",
|
||||
"description": "Gaia システムの Web ブラウザ"
|
||||
},
|
||||
"km": {
|
||||
"name": "Browser",
|
||||
"description": "កម្មវិធីអ៊ីនធឺណិតជាប្រព័ន្ធ Gaia"
|
||||
},
|
||||
"ko": {
|
||||
"name": "브라우저",
|
||||
"description": "가이아 시스템 웹 브라우저"
|
||||
},
|
||||
"lt": {
|
||||
"name": "Naršyklė",
|
||||
"description": "„Gaia“ saityno naršyklė"
|
||||
},
|
||||
"mk": {
|
||||
"name": "Пребарување",
|
||||
"description": "Резултати од пребарување"
|
||||
},
|
||||
"ms": {
|
||||
"name": "Pelayar",
|
||||
"description": "Pelayar Web Sistem Gaia"
|
||||
},
|
||||
"ne-NP": {
|
||||
"name": "ब्राउजर",
|
||||
"description": "गैया प्रणाली वेब ब्राउजर"
|
||||
},
|
||||
"nl": {
|
||||
"name": "Browser",
|
||||
"description": "Gaia-systeemwebbrowser"
|
||||
},
|
||||
"pa": {
|
||||
"name": "ਖੋਜ ਨਤੀਜੇ",
|
||||
"description": "ਖੋਜ ਨਤੀਜੇ"
|
||||
},
|
||||
"pl": {
|
||||
"name": "Firefox",
|
||||
"description": "Systemowa przeglądarka"
|
||||
},
|
||||
"pt-BR": {
|
||||
"name": "Navegador",
|
||||
"description": "Navegador do Gaia"
|
||||
},
|
||||
"ro": {
|
||||
"name": "Browser",
|
||||
"description": "Browser web în sistemul Gaia"
|
||||
},
|
||||
"ru": {
|
||||
"name": "Браузер",
|
||||
"description": "Системный веб-браузер Gaia"
|
||||
},
|
||||
"sk": {
|
||||
"name": "Prehliadač",
|
||||
"description": "Webový prehliadač Gaia"
|
||||
},
|
||||
"sq": {
|
||||
"name": "Shfletues",
|
||||
"description": "Shfletuesi Web i Sistemit Gaia"
|
||||
},
|
||||
"sr-Cyrl": {
|
||||
"name": "Прегледач",
|
||||
"description": "Gaia веб прегледач"
|
||||
},
|
||||
"sr-Latn": {
|
||||
"name": "Pregledač",
|
||||
"description": "Gaia veb pregledač"
|
||||
},
|
||||
"sv-SE": {
|
||||
"name": "Webbläsare",
|
||||
"description": "Gaia systemwebbläsare"
|
||||
},
|
||||
"tr": {
|
||||
"name": "Tarayıcı",
|
||||
"description": "Gaia Sistem Web Tarayıcısı"
|
||||
},
|
||||
"zh-CN": {
|
||||
"name": "浏览器",
|
||||
"description": "Gaga 系统的网页浏览器"
|
||||
},
|
||||
"zh-TW": {
|
||||
"name": "瀏覽器",
|
||||
"description": "Gaia 系統網頁瀏覽器"
|
||||
}
|
||||
},
|
||||
"default_locale": "en-US",
|
||||
|
|
@ -191,7 +59,12 @@
|
|||
}
|
||||
},
|
||||
"icons": {
|
||||
"284": "/shared/resources/branding/vulpes-browser.png"
|
||||
"84": "/shared/resources/branding/browser_84.png",
|
||||
"126": "/shared/resources/branding/browser_126.png",
|
||||
"142": "/shared/resources/branding/browser_142.png",
|
||||
"189": "/shared/resources/branding/browser_189.png",
|
||||
"256": "/shared/resources/branding/browser_256.png",
|
||||
"284": "/shared/resources/branding/browser_284.png"
|
||||
},
|
||||
"chrome": {
|
||||
"navigation": true
|
||||
|
|
@ -207,7 +80,5 @@
|
|||
"disposition": "window",
|
||||
"href": "/index.html"
|
||||
}
|
||||
},
|
||||
"origin": "app://search.gaiamobile.org",
|
||||
"version": "2.5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -1 +1,119 @@
|
|||
{"name":"Settings","description":"Gaia Settings","type":"certified","launch_path":"/index.html#","developer":{"name":"The Gaia Team","url":"https://github.com/mozilla-b2g/gaia"},"permissions":{"themeable":{},"browser":{},"embed-apps":{},"mobileconnection":{},"voicemail":{},"bluetooth":{},"device-storage:pictures":{"access":"readonly"},"device-storage:music":{"access":"readonly"},"device-storage:videos":{"access":"readonly"},"device-storage:sdcard":{"access":"readwrite"},"device-storage:apps":{"access":"readonly"},"webapps-manage":{},"open-remote-window":{},"permissions":{},"systemXHR":{},"settings":{"access":"readwrite"},"wifi-manage":{},"time":{},"desktop-notification":{},"power":{},"idle":{},"telephony":{},"audio-channel-notification":{},"audio-channel-alarm":{},"downloads":{},"nfc":{},"sms":{},"firefox-accounts":{},"moz-extremely-unstable-and-will-change-webcomponents":{}},"activities":{"configure":{"filters":{"target":"device"},"href":"index.html#activity-configure","disposition":"inline","returnValue":true},"moz_configure_window":{"filters":{"target":"device"},"href":"index.html#moz-configure-window","disposition":"window"}},"connections":{"settingsstk":{"description":"Communicate between Settings app and System app for SIM Toolkit.","rules":{}}},"locales":{"ar":{"name":"الإعدادات","description":"الإعدادات"},"bg":{"name":"Настройки","description":"Gaia Настройки"},"bn-BD":{"name":"সেটিং","description":"গায়া সেটিং"},"ca":{"name":"Paràmetres","description":"Paràmetres del Gaia"},"cs":{"name":"Nastavení","description":"Nastavení systému Gaia"},"da":{"name":"Indstillinger","description":"Gaia indstillinger"},"de":{"name":"Einstellungen","description":"Einstellungen für Gaia"},"el":{"name":"Ρυθμίσεις","description":"Ρυθμίσεις του Gaia"},"en-US":{"name":"Settings","description":"Gaia Settings"},"es":{"name":"Ajustes","description":"Ajustes de Gaia"},"eu":{"name":"Ezarpenak","description":"Gaia ezarpenak"},"fr":{"name":"Paramètres","description":"Paramètres de Gaia"},"gl":{"name":"Axustes","description":"Axustes de Gaia"},"hr":{"name":"Postavke","description":"Gaia postavke"},"hu":{"name":"Beállítások","description":"Gaia beállítások"},"it":{"name":"Impostazioni","description":"Impostazioni Gaia"},"ja":{"name":"環境設定","description":"Gaia 設定"},"km":{"name":"ការកំណត់","description":"ការកំណត់ Gaia"},"ko":{"name":"설정","description":"Gaia 설정"},"lt":{"name":"Nuostatos","description":"„Gaia“ nuostatos"},"mk":{"name":"Поставки","description":"Поставки за Гаја"},"ms":{"name":"Tetapan","description":"Tetapan Gaia"},"ne-NP":{"name":"सेटिङहरू","description":"गाइया सेटिङहरू"},"nl":{"name":"Instellingen","description":"Gaia-instellingen"},"pa":{"name":"ਸੈਟਿੰਗ","description":"ਗੀਗਾ ਸੈਟਿੰਗ"},"pl":{"name":"Ustawienia","description":"Ustawienia Gaia"},"pt-BR":{"name":"Configurações","description":"Configurações do Gaia"},"ro":{"name":"Setări","description":"Setări Gaia"},"ru":{"name":"Параметры","description":"Параметры Gaia"},"sk":{"name":"Nastavenia","description":"Nastavenia Gaia"},"sq":{"name":"Rregullime","description":"Rregullimet Gaia"},"sr-Cyrl":{"name":"Поставке","description":"Gaia поставке"},"sr-Latn":{"name":"Postavke","description":"Gaia postavke"},"sv-SE":{"name":"Inställningar","description":"Gaia inställningar"},"tr":{"name":"Ayarlar","description":"Gaia Ayarları"},"zh-CN":{"name":"设置","description":"Gaia 设置"},"zh-TW":{"name":"設定","description":"Gaia 設定"}},"datastores-owned":{"homescreen_settings":{"access":"readwrite","description":"Stores home screen settings"}},"datastores-access":{"download_store":{"readonly":false,"description":"Stores download finished"},"vertical_preferences_store":{"readonly":false,"description":"Vertical homescreen preferences"}},"default_locale":"en-US","icons":{"84":"/style/icons/settings_84.png","126":"/style/icons/settings_126.png","142":"/style/icons/settings_142.png","189":"/style/icons/settings_189.png","284":"/style/icons/settings_284.png"},"orientation":"default","origin":"app://settings.gaiamobile.org","version":"2.5"}
|
||||
{
|
||||
"name": "Settings",
|
||||
"description": "Gaia Settings",
|
||||
"type": "certified",
|
||||
"launch_path": "/index.html#",
|
||||
"developer": {
|
||||
"name": "The Gaia Team",
|
||||
"url": "https://github.com/mozilla-b2g/gaia"
|
||||
},
|
||||
"permissions": {
|
||||
"themeable": {},
|
||||
"browser": {},
|
||||
"embed-apps": {},
|
||||
"mobileconnection": {},
|
||||
"voicemail": {},
|
||||
"bluetooth": {},
|
||||
"device-storage:pictures": {
|
||||
"access": "readonly"
|
||||
},
|
||||
"device-storage:music": {
|
||||
"access": "readonly"
|
||||
},
|
||||
"device-storage:videos": {
|
||||
"access": "readonly"
|
||||
},
|
||||
"device-storage:sdcard": {
|
||||
"access": "readwrite"
|
||||
},
|
||||
"device-storage:apps": {
|
||||
"access": "readonly"
|
||||
},
|
||||
"webapps-manage": {},
|
||||
"open-remote-window": {},
|
||||
"permissions": {},
|
||||
"systemXHR": {},
|
||||
"settings": {
|
||||
"access": "readwrite"
|
||||
},
|
||||
"wifi-manage": {},
|
||||
"time": {},
|
||||
"desktop-notification": {},
|
||||
"power": {},
|
||||
"idle": {},
|
||||
"telephony": {},
|
||||
"audio-channel-notification": {},
|
||||
"audio-channel-alarm": {},
|
||||
"downloads": {},
|
||||
"nfc": {},
|
||||
"sms": {},
|
||||
"firefox-accounts": {},
|
||||
"moz-extremely-unstable-and-will-change-webcomponents": {}
|
||||
},
|
||||
"activities": {
|
||||
"configure": {
|
||||
"filters": {
|
||||
"target": "device"
|
||||
},
|
||||
"href": "index.html#activity-configure",
|
||||
"disposition": "inline",
|
||||
"returnValue": true
|
||||
},
|
||||
"moz_configure_window": {
|
||||
"filters": {
|
||||
"target": "device"
|
||||
},
|
||||
"href": "index.html#moz-configure-window",
|
||||
"disposition": "window"
|
||||
}
|
||||
},
|
||||
"connections": {
|
||||
"settingsstk": {
|
||||
"description": "Communicate between Settings app and System app for SIM Toolkit.",
|
||||
"rules": {}
|
||||
}
|
||||
},
|
||||
"locales": {
|
||||
"ar": {
|
||||
"name": "الضبط",
|
||||
"description": "Gaia الضبط"
|
||||
},
|
||||
"en-US": {
|
||||
"name": "Settings",
|
||||
"description": "Gaia Settings"
|
||||
},
|
||||
"fr": {
|
||||
"name": "Paramètres",
|
||||
"description": "Paramètres de Gaia"
|
||||
},
|
||||
"zh-TW": {
|
||||
"name": "設定",
|
||||
"description": "Gaia 設定"
|
||||
}
|
||||
},
|
||||
"datastores-owned": {
|
||||
"homescreen_settings": {
|
||||
"access": "readwrite",
|
||||
"description": "Stores home screen settings"
|
||||
}
|
||||
},
|
||||
"datastores-access": {
|
||||
"download_store": {
|
||||
"readonly": false,
|
||||
"description": "Stores download finished"
|
||||
},
|
||||
"vertical_preferences_store": {
|
||||
"readonly": false,
|
||||
"description": "Vertical homescreen preferences"
|
||||
}
|
||||
},
|
||||
"default_locale": "en-US",
|
||||
"icons": {
|
||||
"84": "/style/icons/settings_84.png",
|
||||
"126": "/style/icons/settings_126.png",
|
||||
"142": "/style/icons/settings_142.png",
|
||||
"189": "/style/icons/settings_189.png",
|
||||
"284": "/style/icons/settings_284.png"
|
||||
},
|
||||
"orientation": "default"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -475,20 +475,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Set the .icon property before saving for
|
||||
// backwards compatibility with verticalhome
|
||||
// Set the .icon property before saving for backwards compatibility with
|
||||
// verticalhome. A missing favicon must not prevent pinning the site.
|
||||
var saveSite = function(icon) {
|
||||
siteObject.icon = icon || '';
|
||||
BookmarksDatabase.put(siteObject, siteObject.id)
|
||||
.then(() => {
|
||||
this.app.debug('pinSite: ' + siteObject.id);
|
||||
this.systemBanner.show('site-pinned-to-home-screen');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('pinSite, Failed to pin site: ' + error);
|
||||
});
|
||||
}.bind(this);
|
||||
|
||||
IconsHelper.getIcon(siteObject.url, null,
|
||||
{icons: this.app.favicons}, siteObject).then(icon => {
|
||||
siteObject.icon = icon;
|
||||
BookmarksDatabase.put(siteObject, siteObject.id)
|
||||
.then(() => {
|
||||
this.app.debug('pinSite: ' + siteObject.id);
|
||||
this.systemBanner.show('site-pinned-to-home-screen');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('pinSite, Failed to pin site: ' + error);
|
||||
});
|
||||
});
|
||||
{icons: this.app.favicons}, siteObject).then(saveSite, function(error) {
|
||||
this.app.debug('pinSite: using no favicon: ' + error);
|
||||
saveSite('');
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -986,12 +991,14 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Enable/disable the bookmark option
|
||||
BookmarksDatabase.get(this._currentURL).then(function resolve(result) {
|
||||
// start_url is the bookmark key for installed web apps, while _currentURL
|
||||
// may be a later page in the app. Check the canonical key first.
|
||||
var siteUrl = this.getSiteUrl();
|
||||
BookmarksDatabase.get(siteUrl).then(function resolve(result) {
|
||||
this.addToHomeButton.hidden = !!result;
|
||||
}.bind(this),
|
||||
function reject() {
|
||||
this.addToHomeButton.hidden = true;
|
||||
this.addToHomeButton.hidden = false;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
|
|
@ -1282,7 +1289,13 @@
|
|||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.siteIcon.style.backgroundImage = '';
|
||||
// Installed apps have a manifest icon even when the Places cache has
|
||||
// no favicon. Keep the original chrome slot and select a crisp source.
|
||||
const icons = this.app.manifest && this.app.manifest.icons;
|
||||
const sizes = Object.keys(icons || {}).map(Number).filter(Number.isFinite).sort((a,b)=>a-b);
|
||||
const size = sizes.find(n => n >= ICON_SIZE * devicePixelRatio) || sizes[sizes.length-1];
|
||||
const icon = size && icons[size];
|
||||
this.siteIcon.style.backgroundImage = icon ? 'url(' + JSON.stringify(new URL(icon, this.app.manifestURL).href) + ')' : '';
|
||||
this.app.debug('setSiteIcon, error from getSiteIcon: %s', err);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -346,13 +346,26 @@
|
|||
|
||||
case this.fullApp:
|
||||
// XXX: This should be replaced probably by Web Activities
|
||||
var host = document.location.host;
|
||||
var domain = host.replace(/(^[\w\d]+\.)?([\w\d]+\.[a-z]+)/, '$2');
|
||||
var protocol = document.location.protocol + '//';
|
||||
applications.getByManifestURL(protocol + 'settings.' +
|
||||
domain + '/manifest.webapp').launch();
|
||||
|
||||
UtilityTray.hide();
|
||||
var settingsURL = new URL(document.location.href);
|
||||
if (settingsURL.hostname.indexOf('system.') !== 0) {
|
||||
console.error('Quick settings: cannot resolve Settings app host');
|
||||
return;
|
||||
}
|
||||
settingsURL.hostname = 'settings.' +
|
||||
settingsURL.hostname.slice('system.'.length);
|
||||
settingsURL.pathname = '/manifest.webapp';
|
||||
settingsURL.search = '';
|
||||
settingsURL.hash = '';
|
||||
applications.waitForReady().then(function() {
|
||||
var settingsApp = applications.getByManifestURL(
|
||||
settingsURL.href);
|
||||
if (!settingsApp) {
|
||||
console.error('Quick settings: Settings app is not installed');
|
||||
return;
|
||||
}
|
||||
settingsApp.launch();
|
||||
UtilityTray.hide();
|
||||
});
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -57,5 +57,5 @@
|
|||
#os-logo { background: #071d35 url('/shared/resources/branding/vulpes-wallpaper.png') center / cover; display:flex; flex-direction:column; align-items:center; justify-content:center; }
|
||||
#os-logo::before { content:""; width:190px; height:190px; flex:none; background:url('/shared/resources/branding/vulpes-symbol.png') center / contain no-repeat; }
|
||||
#os-logo::after { content:"Vulpes 2.7\A A community continuation of Firefox OS"; white-space:pre-line; padding:12px 22px; color:#f5f8fa; text-shadow:0 2px 8px #071d35; font:500 20px/1.8 sans-serif; text-align:center; }
|
||||
#poweroff-splash { background:#071d35 url('/shared/resources/branding/vulpes-symbol.png') center / 190px 190px no-repeat; }
|
||||
#poweroff-splash { background:#071d35; }
|
||||
/* VULPES BRAND END */
|
||||
|
|
|
|||
|
|
@ -88,17 +88,17 @@ textarea,
|
|||
|
||||
#poweroff-ring-1 {
|
||||
top: 25%;
|
||||
background-color: #e66600;
|
||||
background-color: #36a9e8;
|
||||
}
|
||||
|
||||
#poweroff-ring-2 {
|
||||
top: 50%;
|
||||
background-color: #dc4e00;
|
||||
background-color: #218bd1;
|
||||
}
|
||||
|
||||
#poweroff-ring-3 {
|
||||
top: 75%;
|
||||
background-color: #d24500;
|
||||
background-color: #1473b8;
|
||||
}
|
||||
|
||||
.poweroff-ring > span {
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ for(i in appIconsByManifestUrl){this.removeIconFromGrid(i);}
|
|||
toAdd.forEach(function _toAdd(newApp){this.addIconToGrid(newApp.app);},this);app.itemStore.deferredSave(app.grid.getItems());},addIconToGrid:function(application){this.makeIcons(application);var appObject=this.mapToApp({manifestURL:application.manifestURL});app.grid.appendItemToExpandedGroup(appObject);app.grid.render();},removeIconFromGrid:function(manifestURL){var icons=app.grid.getIcons();var appObject=icons[manifestURL];if(appObject){appObject.removeFromGrid();}},populate:function(success){success(this.entries);},makeIcons:function(eachApp){var manifest=eachApp.manifest||eachApp.updateManifest;if(app.HIDDEN_ROLES.indexOf(manifest.role)!==-1){return;}
|
||||
function eachIcon(icon){if(!icon.icon){return;}
|
||||
icon.setPosition(this.store.getNextPosition());this.entries.push(icon);}
|
||||
this.entriesByManifestUrl[eachApp.manifestURL]=eachApp;if(manifest.entry_points){for(var i in manifest.entry_points){eachIcon.call(this,new GaiaGrid.Mozapp(eachApp,i));}}else{eachIcon.call(this,new GaiaGrid.Mozapp(eachApp));}},mapToApp:function(entry){var app=this.entriesByManifestUrl[entry.manifestURL];app=app||{manifestURL:entry.manifestURL,manifest:{name:'',icons:[]}};return new GaiaGrid.Mozapp(app,entry.entryPoint,{decoratedIconBlob:entry.decoratedIconBlob});},addPreviouslyInstalledSvApp:function(manifest){this.svPreviouslyInstalledApps.push({manifestURL:manifest});},isPreviouslyInstalled:function(manifest){for(var i=0,elemNum=this.svPreviouslyInstalledApps.length;i<elemNum;i++){if(this.svPreviouslyInstalledApps[i].manifestURL===manifest){return true;}}
|
||||
this.entriesByManifestUrl[eachApp.manifestURL]=eachApp;if(manifest.entry_points){for(var i in manifest.entry_points){eachIcon.call(this,new GaiaGrid.Mozapp(eachApp,i));}}else{eachIcon.call(this,new GaiaGrid.Mozapp(eachApp));}},mapToApp:function(entry){var app=this.entriesByManifestUrl[entry.manifestURL];app=app||{manifestURL:entry.manifestURL,manifest:{name:'',icons:[]}};var isVulpesBrowser=/^(?:app:\/\/search\.gaiamobile\.org|http:\/\/search\.localhost(?::\d+)?)\/manifest\.webapp$/.test(entry.manifestURL);return new GaiaGrid.Mozapp(app,entry.entryPoint,{decoratedIconBlob:isVulpesBrowser?null:entry.decoratedIconBlob});},addPreviouslyInstalledSvApp:function(manifest){this.svPreviouslyInstalledApps.push({manifestURL:manifest});},isPreviouslyInstalled:function(manifest){for(var i=0,elemNum=this.svPreviouslyInstalledApps.length;i<elemNum;i++){if(this.svPreviouslyInstalledApps[i].manifestURL===manifest){return true;}}
|
||||
return false;}};exports.ApplicationSource=ApplicationSource;}(window));;'use strict';(function(exports){function AppManager(){var grid=document.querySelector('gaia-grid');var self=this;navigator.mozApps.getSelf().onsuccess=function(evt){self.app=evt.target.result;window.dispatchEvent(new CustomEvent('appmanager-ready'));};grid.addEventListener('removeitem',this);}
|
||||
AppManager.prototype={dialogVisible:false,get self(){return this.app;},handleItemRemoval:function(item){function errorLogger(err){console.error('Error while trying to remove',item.name,err);}
|
||||
switch(item.detail.type){case'bookmark':BookmarksDatabase.remove(item.identifier).catch(errorLogger);break;default:console.error('Cannot handle remove for item type ',item.detail.type);}},handleEvent:function(e){var nameObj={name:e.detail&&e.detail.name};switch(e.type){case'removeitem':if(this.dialogVisible){return;}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
[
|
||||
"Vulpes_Blue.png",
|
||||
"Illus_Flow2_Blue.jpg",
|
||||
"Illus_Flow2_Orange@2.25x.jpg",
|
||||
"FX_Bolt.jpg",
|
||||
|
|
@ -43,5 +42,6 @@
|
|||
"PH_Tree.jpg",
|
||||
"PH_TreeForest.jpg",
|
||||
"PH_Wheat.jpg",
|
||||
"PH_WhiteFlower.jpg"
|
||||
"PH_WhiteFlower.jpg",
|
||||
"Vulpes_Blue.png"
|
||||
]
|
||||
|
|
|
|||