Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
7 lines
No EOL
1.8 KiB
JavaScript
7 lines
No EOL
1.8 KiB
JavaScript
|
|
window.Settings={get hasMozSettings(){var settings=navigator.mozSettings;return(settings&&typeof(settings.createLock)=='function')?settings:null;},isTabletAndLandscape:function is_tablet_and_landscape(){return this.ScreenLayout.getCurrentLayout('tabletAndLandscaped');},_isTabletAndLandscapeLastTime:null,rotate:function rotate(evt){var isTabletAndLandscapeThisTime=Settings.isTabletAndLandscape();var panelsWithCurrentClass;if(Settings._isTabletAndLandscapeLastTime!==isTabletAndLandscapeThisTime){panelsWithCurrentClass=document.querySelectorAll('section[role="region"].current');if(panelsWithCurrentClass.length===1&&panelsWithCurrentClass[0].id==='root'){Settings.currentPanel=Settings.initialPanelForTablet;}}
|
|
Settings._isTabletAndLandscapeLastTime=isTabletAndLandscapeThisTime;},initialPanelForTablet:'#wifi',_currentPanel:null,get currentPanel(){return this._currentPanel;},set currentPanel(hash){if(!hash.startsWith('#')){hash='#'+hash;}
|
|
if(hash===this._currentPanel){return;}
|
|
var panelID=hash;if(panelID.startsWith('#')){panelID=panelID.substring(1);}
|
|
this.SettingsService.navigate(panelID,this._initialOptions);},get _initialOptions(){delete this._initialOptions;return window.LaunchContext.activityHandler&&window.LaunchContext.activityHandler.targetPanelOptions;},init:function settings_init(options){if(!this.hasMozSettings||!navigator.mozSetMessageHandler){return;}
|
|
this.SettingsService=options.SettingsService;this.ScreenLayout=options.ScreenLayout;this.currentPanel=window.LaunchContext.initialPanelId;setTimeout((function nextTick(){this.ScreenLayout.watch('tabletAndLandscaped','(min-width: 768px) and (orientation: landscape)');window.addEventListener('screenlayoutchange',this.rotate);if(this.isTabletAndLandscape()){this.currentPanel=this.initialPanelForTablet;}}).bind(this));window.performance.mark('startupPathEnd');}}; |