Commit 73cec4b2 authored by sajolida's avatar sajolida

Wire the display logic for installed and outdated extension in CSS instead of JS

The extension sets a custom data attribute when the extension is
installed or updated but I don't know how to listen to that change with
JavaScript so unfortunately, I'm encoding this logic in CSS for now.
parent 249e6f21
......@@ -112,13 +112,6 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
function showUpdateExtension() {
hide(document.getElementById('install-extension'));
hide(document.getElementById('extension-installed'));
show(document.getElementById('update-extension'));
show(document.getElementById('extension-updated'));
}
function resetVerificationResult(result) {
hide(document.getElementById('verifying-download'));
hide(document.getElementById('verification-successful'));
......@@ -198,13 +191,4 @@ document.addEventListener('DOMContentLoaded', function() {
toggleDirectBitTorrent('bittorrent');
}
// Display "Update extension" instead of "Install extension" if extension is installed but outdated
if(document.documentElement.dataset.extension === 'old') {
showUpdateExtension();
}
// Display "Verify download" once extension is installed
if(document.documentElement.dataset.extension === 'ok') {
showVerifyDownload();
}
});
......@@ -44,8 +44,7 @@
<a class="install-extension-btn chrome btn btn-primary">Update extension (no restart)</a>
</div>
<div id="verification" class="indent block">
<p id="extension-installed" class="block">Installed!</p>
<p id="extension-updated" class="block">Updated!</p>
<p id="extension-installed" class="block"><u>Tails verification</u> extension Installed!</p>
<!--<a id="verify-download" class="btn btn-primary">Verify download&hellip;</a>-->
<label id="verify-download-wrapper" class="btn btn-primary btn-verify">
Verify download&hellip;
......
/* Display No JS version by default */
.supported-browser,
.outdated-browser,
.unsupported-browser {
......@@ -12,7 +13,10 @@
#skip-verification-direct,
#verification,
#update-extension,
#extension-updated,
#verifying-download,
#verification-successful,
#verification-failed,
#verification-failed-again,
#skip-download-direct,
#skip-download-bittorrent,
#extension-version {
......@@ -23,6 +27,20 @@
display: none;
}
/* Display logic in case the extension is installed or outdated */
html[data-extension="ok"] #install-extension,
html[data-extension="old"] #install-extension {
display: none;
}
html[data-extension="old"] #update-extension,
html[data-extension="ok"] #verification {
display: block;
}
/* Layout */
#content {
padding-left: 0 !important;
}
......
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