Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
define(['require','modules/settings_service','modules/navigator/mozApps','shared/manifest_helper'],function(require){'use strict';const MANIFEST_URL_PREF='homescreen.manifestURL';const DEFAULT_MANIFEST='app://homescreen.gaiamobile.org/manifest.webapp';var SettingsService=require('modules/settings_service');var mozApps=require('modules/navigator/mozApps');var ManifestHelper=require('shared/manifest_helper');var HomescreenDetails=function ctor_homescreen_details(){this._elements={};this._app=null;};HomescreenDetails.prototype={init:function hd_init(elements){this._elements=elements;this._elements.uninstallButton.addEventListener('click',this.uninstall.bind(this));},onBeforeShow:function hd_onBeforeShow(options){options.author=options.author||{url:'',name:''};options.version=options.version||'0.0.0';options.description=options.description||'';this._app=options.app;var iconSrc='../style/images/default.png';var manifest=new ManifestHelper(this._app.manifest||this._app.updateManifest);if(manifest.icons&&Object.keys(manifest.icons).length){var key=Object.keys(manifest.icons)[0];var iconUrl=manifest.icons[key];if(!(/^(http|https|data):/.test(iconUrl))){iconUrl=this._app.origin+'/'+iconUrl;}
|
||||
iconSrc=iconUrl;}
|
||||
this._elements.icon.src=iconSrc;this._elements.headerTitle.textContent=options.name;this._elements.detailTitle.textContent=options.name;this._elements.detailName.textContent=options.author.name;this._elements.detailVersion.textContent=`v.${options.version}`;this._elements.detailDescription.textContent=options.description;this._elements.detailURLLink.href=options.author.url;this._elements.detailURLLink.textContent=options.author.url;this._elements.uninstallButton.disabled=!options.removable;},uninstall:function hd_uninstall(){const settings=window.navigator.mozSettings;var uninstallApp=()=>{mozApps.mgmt.uninstall(this._app).onsuccess=()=>{this.back();};};var manifestURL=this._app.manifestURL;var homescreenSetting=settings.createLock().get(MANIFEST_URL_PREF);homescreenSetting.onsuccess=()=>{var homeManifestURL=homescreenSetting.result[MANIFEST_URL_PREF];if(homeManifestURL===manifestURL){var settingObject={};settingObject[MANIFEST_URL_PREF]=DEFAULT_MANIFEST;homescreenSetting=settings.createLock().set(settingObject);homescreenSetting.onsuccess=()=>{uninstallApp();};}else{uninstallApp();}};},back:function hd_back(){SettingsService.navigate('homescreens-list');}};return()=>new HomescreenDetails();});
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
define(['require','modules/settings_panel','panels/homescreen_details/homescreen_details'],function(require){'use strict';var SettingsPanel=require('modules/settings_panel');var HomescreensDetails=require('panels/homescreen_details/homescreen_details');return function ctor_homescreen_details_panel(){var homescreensDetails=HomescreensDetails();return SettingsPanel({onInit:function hdp_onInit(panel){homescreensDetails.init({icon:panel.querySelector('.developer-infos img'),headerTitle:panel.querySelector('.detail-title'),detailTitle:panel.querySelector('.developer-infos .title'),detailName:panel.querySelector('.developer-infos .name'),detailVersion:panel.querySelector('.version'),detailDescription:panel.querySelector('.description'),detailURL:panel.querySelector('.url'),detailURLLink:panel.querySelector('.url a'),uninstallButton:panel.querySelector('button.uninstall-homescreen')});},onBeforeShow:function hdp_onBeforeShow(panel,options){homescreensDetails.onBeforeShow(options);}});};});
|
||||
Loading…
Reference in a new issue