This commit is contained in:
Abhinav Adduri 2017-07-20 15:20:52 -07:00
parent 37bb6fd982
commit b9eb653f1f
2 changed files with 16 additions and 16 deletions

View File

@ -28,7 +28,7 @@ $(document).ready(function() {
$('.legal-links a, .social-links a, #dl-firefox').click(function(target) { $('.legal-links a, .social-links a, #dl-firefox').click(function(target) {
target.preventDefault(); target.preventDefault();
let metric = findMetric(target.currentTarget.href); const metric = findMetric(target.currentTarget.href);
// record exited event by recipient // record exited event by recipient
window.analytics window.analytics
.sendEvent('recipient', 'exited', { .sendEvent('recipient', 'exited', {
@ -59,7 +59,7 @@ $(document).ready(function() {
}); });
$('#download-btn').click(download); $('#download-btn').click(download);
function download() { function download() {
let totalDownloads = localStorage.getItem('totalDownloads'); const totalDownloads = localStorage.getItem('totalDownloads');
localStorage.setItem('totalDownloads', Number(totalDownloads) + 1); localStorage.setItem('totalDownloads', Number(totalDownloads) + 1);
const fileReceiver = new FileReceiver(); const fileReceiver = new FileReceiver();
@ -67,9 +67,9 @@ $(document).ready(function() {
for (let i = 0; i < localStorage.length; i++) { for (let i = 0; i < localStorage.length; i++) {
const id = localStorage.key(i); const id = localStorage.key(i);
if (id != 'totalUploads' && if (id !== 'totalUploads' &&
id != 'totalDownloads' && id !== 'totalDownloads' &&
id != 'referrer') { id !== 'referrer') {
unexpiredFiles += 1; unexpiredFiles += 1;
} }
} }

View File

@ -33,7 +33,7 @@ $(document).ready(function() {
$('.legal-links a, .social-links a, #dl-firefox').click(function(target) { $('.legal-links a, .social-links a, #dl-firefox').click(function(target) {
target.preventDefault(); target.preventDefault();
let metric = findMetric(target.currentTarget.href); const metric = findMetric(target.currentTarget.href);
// record exited event by recipient // record exited event by recipient
window.analytics window.analytics
.sendEvent('sender', 'exited', { .sendEvent('sender', 'exited', {
@ -134,7 +134,7 @@ $(document).ready(function() {
function onUpload(event) { function onUpload(event) {
event.preventDefault(); event.preventDefault();
let totalUploads = localStorage.getItem('totalUploads'); const totalUploads = localStorage.getItem('totalUploads');
localStorage.setItem('totalUploads', Number(totalUploads) + 1); localStorage.setItem('totalUploads', Number(totalUploads) + 1);
let file = ''; let file = '';
@ -239,9 +239,9 @@ $(document).ready(function() {
for (let i = 0; i < localStorage.length; i++) { for (let i = 0; i < localStorage.length; i++) {
const id = localStorage.key(i); const id = localStorage.key(i);
if (id != 'totalUploads' && if (id !== 'totalUploads' &&
id != 'totalDownloads' && id !== 'totalDownloads' &&
id != 'referrer') { id !== 'referrer') {
unexpiredFiles += 1; unexpiredFiles += 1;
} }
} }
@ -347,9 +347,9 @@ $(document).ready(function() {
populateFileList(localStorage.getItem(id)); populateFileList(localStorage.getItem(id));
} }
} else if (xhr.status === 404) { } else if (xhr.status === 404) {
if (id != 'totalUploads' && if (id !== 'totalUploads' &&
id != 'totalDownloads' && id !== 'totalDownloads' &&
id != 'referrer') { id !== 'referrer') {
localStorage.removeItem(id); localStorage.removeItem(id);
} }
} }
@ -505,9 +505,9 @@ $(document).ready(function() {
for (let i = 0; i < localStorage.length; i++) { for (let i = 0; i < localStorage.length; i++) {
const id = localStorage.key(i); const id = localStorage.key(i);
if (id != 'totalUploads' && if (id !== 'totalUploads' &&
id != 'totalDownloads' && id !== 'totalDownloads' &&
id != 'referrer') { id !== 'referrer') {
unexpiredFiles += 1; unexpiredFiles += 1;
} }
} }