created /unsupported page and added gcmCompliant to /download page

This commit is contained in:
Danny Coates 2017-07-21 17:40:29 -07:00
parent 0d5fb1740d
commit f5bd332ff8
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
5 changed files with 26 additions and 15 deletions

View File

@ -1,6 +1,6 @@
require('./common'); require('./common');
const FileReceiver = require('./fileReceiver'); const FileReceiver = require('./fileReceiver');
const { notify, findMetric, sendEvent } = require('./utils'); const { notify, findMetric, gcmCompliant, sendEvent } = require('./utils');
const bytes = require('bytes'); const bytes = require('bytes');
const Storage = require('./storage'); const Storage = require('./storage');
const storage = new Storage(localStorage); const storage = new Storage(localStorage);
@ -11,6 +11,14 @@ require('jquery-circle-progress');
const Raven = window.Raven; const Raven = window.Raven;
$(document).ready(function() { $(document).ready(function() {
gcmCompliant().catch(err => {
$('#download').attr('hidden', true);
sendEvent('recipient', 'unsupported', {
cd6: err
}).then(() => {
location.replace('/unsupported');
});
});
//link back to homepage //link back to homepage
$('.send-new').attr('href', window.location.origin); $('.send-new').attr('href', window.location.origin);

View File

@ -27,10 +27,10 @@ if (storage.has('referrer')) {
$(document).ready(function() { $(document).ready(function() {
gcmCompliant().catch(err => { gcmCompliant().catch(err => {
$('#page-one').attr('hidden', true); $('#page-one').attr('hidden', true);
$('#unsupported-browser').removeAttr('hidden');
// record unsupported event
sendEvent('sender', 'unsupported', { sendEvent('sender', 'unsupported', {
cd6: err cd6: err
}).then(() => {
location.replace('/unsupported');
}); });
}); });

View File

@ -80,6 +80,10 @@ app.get('/', (req, res) => {
res.render('index'); res.render('index');
}); });
app.get('/unsupported', (req, res) => {
res.render('unsupported');
});
app.get('/jsconfig.js', (req, res) => { app.get('/jsconfig.js', (req, res) => {
res.set('Content-Type', 'application/javascript'); res.set('Content-Type', 'application/javascript');
res.render('jsconfig', { res.render('jsconfig', {

View File

@ -71,15 +71,3 @@
<img id="upload-error-img" data-l10n-id="errorAltText" src="/resources/illustration_error.svg"/> <img id="upload-error-img" data-l10n-id="errorAltText" src="/resources/illustration_error.svg"/>
<a class="send-new" id="send-new-error" data-l10n-id="sendAnotherFileLink"></a> <a class="send-new" id="send-new-error" data-l10n-id="sendAnotherFileLink"></a>
</div> </div>
<div id="unsupported-browser" hidden="true">
<div class="title" data-l10n-id="notSupportedHeader"></div>
<div class="description" data-l10n-id="notSupportedDetail"></div>
<a id="dl-firefox" href="https://www.mozilla.org/firefox/new/?scene=2" target="_blank">
<img src="/resources/firefox_logo-only.svg" id="firefox-logo" alt="Firefox"/>
<div id="dl-firefox-text">Firefox<br>
<span data-l10n-id="downloadFirefoxButtonSub"></span>
</div>
</a>
<div class="unsupported-description" data-l10n-id="uploadPageExplainer"></div>
</div>

View File

@ -0,0 +1,11 @@
<div id="unsupported-browser">
<div class="title" data-l10n-id="notSupportedHeader"></div>
<div class="description" data-l10n-id="notSupportedDetail"></div>
<a id="dl-firefox" href="https://www.mozilla.org/firefox/new/?scene=2" target="_blank">
<img src="/resources/firefox_logo-only.svg" id="firefox-logo" alt="Firefox"/>
<div id="dl-firefox-text">Firefox<br>
<span data-l10n-id="downloadFirefoxButtonSub"></span>
</div>
</a>
<div class="unsupported-description" data-l10n-id="uploadPageExplainer"></div>
</div>