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
76
gaia/tv_apps/browser/js/fte.js
Executable file
76
gaia/tv_apps/browser/js/fte.js
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* global Browser */
|
||||
/* global FTEWizard */
|
||||
/* global ResourceLoader */
|
||||
/* global SyncManagerBridge */
|
||||
|
||||
// XXX: If Firefox sign in is available outside of the browser app, we'll have
|
||||
// to remove or redesign FTE.
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (exports) {
|
||||
|
||||
if (localStorage.getItem('browserFTE.fteskip')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var FTE = {
|
||||
|
||||
fteContainer: null,
|
||||
|
||||
fteWizard: null,
|
||||
|
||||
onuninit: function () {},
|
||||
|
||||
init(options) {
|
||||
this.onuninit = options.onuninit;
|
||||
|
||||
ResourceLoader.loadByName('fte')
|
||||
.then(node => {
|
||||
document.body.appendChild(node);
|
||||
|
||||
this.fteContainer = document.getElementById('fte-container');
|
||||
|
||||
this.fteWizard = new FTEWizard('browserFTE');
|
||||
this.fteWizard.init({
|
||||
container: this.fteContainer,
|
||||
propagateKeyEvent: true,
|
||||
onfinish: () => {
|
||||
SyncManagerBridge.enable();
|
||||
this.uninit();
|
||||
},
|
||||
onskip: () => {
|
||||
this.uninit();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('visibilitychange', this);
|
||||
});
|
||||
},
|
||||
|
||||
handleEvent() {
|
||||
if (!document.hidden) {
|
||||
this.fteWizard.focus();
|
||||
}
|
||||
},
|
||||
|
||||
uninit() {
|
||||
document.body.removeChild(this.fteContainer);
|
||||
document.removeEventListener('visibilitychange', this);
|
||||
ResourceLoader.unloadByName('fte');
|
||||
this.onuninit();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.FTE = FTE;
|
||||
exports.FTE.init({onuninit: () => {
|
||||
Browser.switchCursorMode(true);
|
||||
delete exports.FTE;
|
||||
}});
|
||||
|
||||
})(window);
|
||||
Loading…
Reference in a new issue