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
37
gaia/tv_apps/smart-system/fxa/test/marionette/test-fxa-client/index.html
Executable file
37
gaia/tv_apps/smart-system/fxa/test/marionette/test-fxa-client/index.html
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>FxAccounts testing tools</title>
|
||||
<!-- We don't need localization for this app. -->
|
||||
<script defer type="text/javascript" src="/js/fxa_iac_client.js"></script>
|
||||
<script defer type="text/javascript" src="/js/app.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="style/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<section role="dialog">
|
||||
<menu>
|
||||
<button id="getAccount">Get Fx Account</button>
|
||||
<button id="openFlow">Launch FxAccounts flow</button>
|
||||
<button id="logout">Logout</button>
|
||||
<div class="refresh-auth">
|
||||
<button id="refreshAuthentication">Refresh Authentication UI</button>
|
||||
<input id="accountId" type="text" value="dummy@account" x-inputmode="verbatim">
|
||||
</div>
|
||||
</menu>
|
||||
|
||||
<section id="result">
|
||||
<p id="result-text"></p>
|
||||
</section>
|
||||
|
||||
<section id="events">
|
||||
<p id="events-text"></p>
|
||||
</section>
|
||||
</section>
|
||||
<!-- Progress overlay -->
|
||||
<section id="overlay" role="dialog">
|
||||
<progress></progress>
|
||||
<p id="overlay-msg">Connecting to Firefox</p>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
124
gaia/tv_apps/smart-system/fxa/test/marionette/test-fxa-client/js/app.js
Executable file
124
gaia/tv_apps/smart-system/fxa/test/marionette/test-fxa-client/js/app.js
Executable file
|
|
@ -0,0 +1,124 @@
|
|||
'use strict';
|
||||
/* global FxAccountsIACHelper */
|
||||
|
||||
var hideTimer;
|
||||
var Overlay = {
|
||||
show: function fxam_overlay_show() {
|
||||
if (hideTimer) {
|
||||
return;
|
||||
}
|
||||
var overlay = document.querySelector('#overlay');
|
||||
overlay.classList.add('show');
|
||||
hideTimer = setTimeout(Overlay.hide, 2000);
|
||||
},
|
||||
hide: function fxam_overlay_hide() {
|
||||
hideTimer = clearTimeout(hideTimer);
|
||||
var overlay = document.querySelector('#overlay');
|
||||
if (!overlay) {
|
||||
return;
|
||||
}
|
||||
overlay.classList.remove('show');
|
||||
}
|
||||
};
|
||||
|
||||
var TestFxAClient = function TestFxAClient() {
|
||||
|
||||
var getFxAccountsButton, launchFxAFlowButton, logoutButton,
|
||||
refreshAuthButton, resultTextEl, resultEl, timer, eventsEl,
|
||||
eventsTextEl, eventsTimer, accountIdInput;
|
||||
|
||||
var init = function init() {
|
||||
resultEl = document.getElementById('result');
|
||||
resultTextEl = document.getElementById('result-text');
|
||||
getFxAccountsButton = document.getElementById('getAccount');
|
||||
launchFxAFlowButton = document.getElementById('openFlow');
|
||||
logoutButton = document.getElementById('logout');
|
||||
refreshAuthButton = document.getElementById('refreshAuthentication');
|
||||
eventsEl = document.getElementById('events');
|
||||
eventsTextEl = document.getElementById('events-text');
|
||||
accountIdInput = document.getElementById('accountId');
|
||||
|
||||
getFxAccountsButton.addEventListener('click', handler);
|
||||
launchFxAFlowButton.addEventListener('click', handler);
|
||||
logoutButton.addEventListener('click', handler);
|
||||
refreshAuthButton.addEventListener('click', handler);
|
||||
|
||||
FxAccountsIACHelper.addEventListener('onlogin', function() {
|
||||
showEvent('onlogin');
|
||||
});
|
||||
|
||||
FxAccountsIACHelper.addEventListener('onlogout', function() {
|
||||
showEvent('onlogout');
|
||||
});
|
||||
|
||||
FxAccountsIACHelper.addEventListener('onverifiedlogin', function() {
|
||||
showEvent('onverifiedlogin');
|
||||
});
|
||||
};
|
||||
|
||||
function _setResponse(response, errorDebug) {
|
||||
resultTextEl.innerHTML = '';
|
||||
|
||||
var text = document.createTextNode((errorDebug)? 'Error ' : 'Success :');
|
||||
resultTextEl.appendChild(text);
|
||||
var responseBeautyfied =
|
||||
document.createTextNode(JSON.stringify(response || 'No params', null, 4));
|
||||
resultTextEl.appendChild(responseBeautyfied);
|
||||
|
||||
clearTimeout(timer);
|
||||
resultEl.classList.add('show');
|
||||
timer = setTimeout(function() {
|
||||
resultEl.classList.remove('show');
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
function showEvent(eventName) {
|
||||
eventsTextEl.innerHTML = '';
|
||||
|
||||
var text = document.createTextNode('Event received: ' + eventName);
|
||||
eventsTextEl.appendChild(text);
|
||||
|
||||
clearTimeout(timer);
|
||||
eventsEl.classList.add('show');
|
||||
eventsTimer = setTimeout(function() {
|
||||
eventsEl.classList.remove('show');
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
var showResponse = function showResponse(response) {
|
||||
Overlay.hide();
|
||||
_setResponse(response);
|
||||
};
|
||||
|
||||
var showError = function showResponse(response) {
|
||||
Overlay.hide();
|
||||
_setResponse(response, true);
|
||||
};
|
||||
|
||||
var handler = function handler(evt) {
|
||||
var method = evt.target.id;
|
||||
switch (method) {
|
||||
case 'openFlow':
|
||||
FxAccountsIACHelper[method](showResponse, showError);
|
||||
break;
|
||||
case 'getAccount':
|
||||
case 'logout':
|
||||
Overlay.show();
|
||||
FxAccountsIACHelper[method](showResponse, showError);
|
||||
break;
|
||||
case 'refreshAuthentication':
|
||||
FxAccountsIACHelper[method](accountIdInput.value,
|
||||
showResponse, showError);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
'init': init
|
||||
};
|
||||
|
||||
}();
|
||||
|
||||
TestFxAClient.init();
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "Test FxA Client",
|
||||
"launch_path": "/index.html",
|
||||
"type": "certified",
|
||||
"developer": {
|
||||
"name": "The Gaia Team",
|
||||
"url": "https://github.com/mozilla-b2g/gaia"
|
||||
},
|
||||
"icons": {
|
||||
"120": "/style/icons/icon.png"
|
||||
},
|
||||
"orientation": "default"
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -0,0 +1,97 @@
|
|||
html, body {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000;
|
||||
/* XXX: The below overflow property is being ignored by B2G Phone
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=777672
|
||||
*/
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 6rem;
|
||||
line-height: 6rem;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
menu {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#result {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#result.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#events {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#events.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding: 1rem 1.5rem;
|
||||
-moz-box-sizing: border-box;
|
||||
font-size: 2rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 1rem 1.5rem;
|
||||
-moz-box-sizing: border-box;
|
||||
font-size: 1.6rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Overlay:
|
||||
* IMPORTANT: Avoid to use 'visibility' or 'opacity' due
|
||||
* to performance issues. For hiding, use 'display:none;''
|
||||
* * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#overlay {
|
||||
display: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
font-size: 2rem;
|
||||
background-color: rgba(200,200,200,0.9);
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#overlay.show {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 4rem;
|
||||
line-height: 6rem;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.refresh-auth {
|
||||
border-top: 0.1rem solid;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
Loading…
Reference in a new issue