Commit 99d02f37 authored by intrigeri's avatar intrigeri
Browse files

Merge remote-tracking branch 'origin/master'

parents 5551d2aa 249e6f21
......@@ -4,9 +4,7 @@ document.addEventListener('DOMContentLoaded', function() {
return;
}
if(event.data.action === 'verifying'){
showVerifyingDownload();
var element = document.getElementById("verifying-download");
element.innerHTML = "Verifying: "+event.data.fileName;
showVerifyingDownload(event.data.fileName);
}
else if(event.data.action === 'verification-failed'){
showVerificationResult('failed');
......@@ -18,8 +16,7 @@ document.addEventListener('DOMContentLoaded', function() {
showVerificationResult('successful');
}
else if (event.data.action === 'progress'){
var percentage = event.data.percentage;
console.log(percentage)
showVerificationProgress(event.data.percentage);
}
});
function showFloatingToggleableLinks() {
......@@ -130,11 +127,23 @@ document.addEventListener('DOMContentLoaded', function() {
toggleContinueLink('direct', 'skip-verification-direct');
}
function showVerifyingDownload() {
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;
show(document.getElementById('verifying-download'));
}
function showVerificationProgress(percentage) {
document.getElementById('progress-bar').style.width = percentage + '%';
document.getElementById('progress-bar').setAttribute('aria-valuenow', percentage.toString());
}
function showVerificationResult(result) {
hide(document.getElementById('verify-download-wrapper'));
resetVerificationResult();
......@@ -189,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();
}
});
......@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2017-11-07 12:54+0100\n"
"POT-Creation-Date: 2017-11-07 16:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -135,8 +135,8 @@ msgid ""
"label>"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
msgid "Verifying $FILENAME&hellip;"
#. type: Content of: <div><div><div><div><div><div><p>
msgid "Verifying <span id=\"filename\">$FILENAME</span>&hellip;"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
......
......@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2017-11-07 12:54+0100\n"
"POT-Creation-Date: 2017-11-07 16:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -135,8 +135,8 @@ msgid ""
"label>"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
msgid "Verifying $FILENAME&hellip;"
#. type: Content of: <div><div><div><div><div><div><p>
msgid "Verifying <span id=\"filename\">$FILENAME</span>&hellip;"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
......
......@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2017-11-07 12:54+0100\n"
"POT-Creation-Date: 2017-11-07 16:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -135,8 +135,8 @@ msgid ""
"label>"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
msgid "Verifying $FILENAME&hellip;"
#. type: Content of: <div><div><div><div><div><div><p>
msgid "Verifying <span id=\"filename\">$FILENAME</span>&hellip;"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
......
......@@ -51,7 +51,12 @@
Verify download&hellip;
<input id="verify-download" type="file"/>
</label>
<p id="verifying-download" class="block">Verifying $FILENAME&hellip;</p>
<div id="verifying-download">
<p>Verifying <span id="filename">$FILENAME</span>&hellip;</p>
<div class="progress">
<div id="progress-bar" class="progress-bar" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<p id="verification-successful" class="block">Verification successful!</p>
<div id="verification-failed">
<p><b>Verification failed!</b></p>
......
......@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2017-11-07 12:54+0100\n"
"POT-Creation-Date: 2017-11-07 16:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -135,8 +135,8 @@ msgid ""
"label>"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
msgid "Verifying $FILENAME&hellip;"
#. type: Content of: <div><div><div><div><div><div><p>
msgid "Verifying <span id=\"filename\">$FILENAME</span>&hellip;"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
......
......@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2017-11-07 12:54+0100\n"
"POT-Creation-Date: 2017-11-07 16:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -135,8 +135,8 @@ msgid ""
"label>"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
msgid "Verifying $FILENAME&hellip;"
#. type: Content of: <div><div><div><div><div><div><p>
msgid "Verifying <span id=\"filename\">$FILENAME</span>&hellip;"
msgstr ""
#. type: Content of: <div><div><div><div><div><p>
......
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