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() { ...@@ -127,6 +127,12 @@ document.addEventListener('DOMContentLoaded', function() {
toggleContinueLink('direct', 'skip-verification-direct'); toggleContinueLink('direct', 'skip-verification-direct');
} }
function showVerifyDownload() {
hide(document.getElementById('install-extension'));
hide(document.getElementById('update-extension'));
show(document.getElementById('verification'));
}
function showVerifyingDownload(filename) { function showVerifyingDownload(filename) {
hide(document.getElementById('verify-download-wrapper')); hide(document.getElementById('verify-download-wrapper'));
document.getElementById("filename").innerHTML = filename; document.getElementById("filename").innerHTML = filename;
...@@ -192,18 +198,13 @@ document.addEventListener('DOMContentLoaded', function() { ...@@ -192,18 +198,13 @@ document.addEventListener('DOMContentLoaded', function() {
toggleDirectBitTorrent('bittorrent'); toggleDirectBitTorrent('bittorrent');
} }
// Display "Update extension" instead of "Install extension" // Display "Update extension" instead of "Install extension" if extension is installed but outdated
// XXX: This should be done by the extension instead if(document.documentElement.dataset.extension === 'old') {
// showUpdateExtension(); showUpdateExtension();
}
// Display "Verify download" when "Install extension" or "Update extension" is clicked // Display "Verify download" once extension is installed
// XXX: This should be done by the extension instead if(document.documentElement.dataset.extension === 'ok') {
var buttons = document.getElementsByClassName('install-extension-btn'); showVerifyDownload();
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'));
});
} }
}); });
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