Commit 249e6f21 authored by sajolida's avatar sajolida
Browse files

Wire extension status: installed and outdated

parent f3d56841
......@@ -127,6 +127,12 @@ document.addEventListener('DOMContentLoaded', function() {
toggleContinueLink('direct', 'skip-verification-direct');
}
function showVerifyDownload() {
hide(document.getElementById('install-extension'));
hide(document.getElementById('update-extension'));
show(document.getElementById('verification'));
}
function showVerifyingDownload(filename) {
hide(document.getElementById('verify-download-wrapper'));
document.getElementById("filename").innerHTML = filename;
......@@ -192,18 +198,13 @@ document.addEventListener('DOMContentLoaded', function() {
toggleDirectBitTorrent('bittorrent');
}
// Display "Update extension" instead of "Install extension"
// XXX: This should be done by the extension instead
// showUpdateExtension();
// Display "Update extension" instead of "Install extension" if extension is installed but outdated
if(document.documentElement.dataset.extension === 'old') {
showUpdateExtension();
}
// Display "Verify download" when "Install extension" or "Update extension" is clicked
// XXX: This should be done by the extension instead
var buttons = document.getElementsByClassName('install-extension-btn');
for (let i = 0; i < buttons.length; i++) {
buttons[i].addEventListener('click', function() {
hide(document.getElementById('install-extension'));
hide(document.getElementById('update-extension'));
show(document.getElementById('verification'));
});
// Display "Verify download" once extension is installed
if(document.documentElement.dataset.extension === 'ok') {
showVerifyDownload();
}
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment