Browse Source

change download button logic, remove request to github

Signed-off-by: R4SAS <r4sas@i2pmail.org>
master
R4SAS 3 years ago
parent
commit
3ceb6fe707
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 153
      index.html
  2. 56
      js/app.js
  3. 8
      locales/data.ini

153
index.html

@ -1,75 +1,84 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Invisible Internet Protocol Daemon</title> <title>Invisible Internet Protocol Daemon</title>
<link href="css/app.css" rel="stylesheet"> <link href="css/app.css" rel="stylesheet">
<link rel="prefetch" type="application/l10n" href="locales/data.ini" /> <link rel="prefetch" type="application/l10n" href="locales/data.ini" />
<script defer src="js/l10n.js"></script> <script defer src="js/l10n.js"></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
<link rel="icon" type="image/png" href="images/favicon.png" /> <link rel="icon" type="image/png" href="images/favicon.png" />
<meta name="yandex-verification" content="b50a274d8f4a99cd" /> <meta name="yandex-verification" content="b50a274d8f4a99cd" />
</head> </head>
<body> <body>
<a class="github-fork-ribbon" href="https://github.com/PurpleI2P/i2pd" <a class="github-fork-ribbon" href="https://github.com/PurpleI2P/i2pd"
title="Fork me on GitHub">Fork me on GitHub</a> title="Fork me on GitHub">Fork me on GitHub</a>
<div class="container"> <div class="container">
<div class="header"> <div class="header">
<div class="align-center"> <div class="align-center">
<img src="images/favicon.png" id="logo"> <img src="images/favicon.png" id="logo">
<h2 data-l10n-id="header-title">Invisible Internet Protocol:</h2> <h2 data-l10n-id="header-title">Invisible Internet Protocol:</h2>
<h1 data-l10n-id="header-slogan">Network without borders</h1> <h1 data-l10n-id="header-slogan">Network without borders</h1>
<p data-l10n-id="header-p1">We are building network which helps people to communicate and share information without restrictions.</p> <p data-l10n-id="header-p1">We are building network which helps people to communicate and share information without restrictions.</p>
<p data-l10n-id="header-p2">Free from censorship. Free from privacy violations.</p> <p data-l10n-id="header-p2">Free from censorship. Free from privacy violations.</p>
<div class="download"> <div class="download">
<a href="https://github.com/PurpleI2P/i2pd/releases/latest" <a href="https://github.com/PurpleI2P/i2pd/releases/latest"
id="dl-btn" target="_blank">Downloads</a> id="dl-btn" target="_blank">Downloads</a>
</div> </div>
<p class="header-links"> <div id="all-dls" style="display: none;">
<a href="https://github.com/PurpleI2P/i2pd/releases/latest" id="all-dls" <p class="header-links">
data-l10n-id="header-dl-all" style="display: none;" target="_blank"> <a href="https://github.com/PurpleI2P/i2pd/releases/latest"
All downloads</a> data-l10n-id="header-dl-all" target="_blank">
<a href="https://i2pd.readthedocs.io/en/latest/" target="_blank" All downloads</a>
data-l10n-id="header-docs">Documentation</a> <a href="https://github.com/PurpleI2P/i2pd-android/releases/latest"
</p> data-l10n-id="header-dl-android" target="_blank">
</div> Android app</a>
</div> <a href="https://github.com/PurpleI2P/i2pdbrowser/releases/latest"
<div class="content"> data-l10n-id="header-dl-browser" target="_blank">
<p style="font-weight: bold;" data-l10n-id="content-how-title">i2pd (I2P Daemon) is a full-featured C++ implementation of I2P client</p> I2PdBrowser bundle</a>
<p data-l10n-id="content-how-p1">I2P (Invisible Internet Protocol) is a universal anonymous network layer. All communications over I2P are anonymous and end-to-end encrypted, participants don't reveal their real IP addresses.</p> </p>
<p data-l10n-id="content-how-p2">I2P client is a software used for building and using anonymous I2P networks. Such networks are commonly used for anonymous peer-to-peer applications (filesharing, cryptocurrencies) and anonymous client-server applications (websites, instant messengers, chat-servers).</p> </div>
<p data-l10n-id="content-how-p3">I2P allows people from all around the world to communicate and share information without restrictions.</p> <p class="header-links">
<p> <a href="https://i2pd.readthedocs.io/en/latest/" target="_blank"
<span data-l10n-id="content-how-p4">If you are interested in deeper technical details, visit</span> data-l10n-id="header-docs">Documentation</a>
<a data-l10n-id="content-how-details" href="https://i2p.net/en/about/intro" </p>
target="_blank">this page</a>. </div>
</p> </div>
<div class="p-hr"></div> <div class="content">
<h2 data-l10n-id="content-support-title">Let's make the world a better place</h2> <p style="font-weight: bold;" data-l10n-id="content-how-title">i2pd (I2P Daemon) is a full-featured C++ implementation of I2P client</p>
<p data-l10n-id="content-support-p1">I2P runs and is developed by people like you.</p> <p data-l10n-id="content-how-p1">I2P (Invisible Internet Protocol) is a universal anonymous network layer. All communications over I2P are anonymous and end-to-end encrypted, participants don't reveal their real IP addresses.</p>
<p data-l10n-id="content-support-p2">You can help to protect our civil rights online, just run I2P node 24/7 and spread the word!</p> <p data-l10n-id="content-how-p2">I2P client is a software used for building and using anonymous I2P networks. Such networks are commonly used for anonymous peer-to-peer applications (filesharing, cryptocurrencies) and anonymous client-server applications (websites, instant messengers, chat-servers).</p>
<p><a data-l10n-id="content-support-donate-link" href="#donations">Support with coins</a></p> <p data-l10n-id="content-how-p3">I2P allows people from all around the world to communicate and share information without restrictions.</p>
<div id="donations"> <p>
<p style="font-weight: bold;" data-l10n-id="content-support-donate-text">Donations for Purple I2P developing:</p> <span data-l10n-id="content-how-p4">If you are interested in deeper technical details, visit</span>
<p>E-Mail: i2porignal at yandex.ru</p> <a data-l10n-id="content-how-details" href="https://i2p.net/en/about/intro"
<p>BTC: 3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f</p> target="_blank">this page</a>.
<p>LTC: LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59</p> </p>
<p>ETH: 0x9e5bac70d20d1079ceaa111127f4fb3bccce379d</p> <div class="p-hr"></div>
<p>GST: GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG</p> <h2 data-l10n-id="content-support-title">Let's make the world a better place</h2>
<p>DASH: Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF</p> <p data-l10n-id="content-support-p1">I2P runs and is developed by people like you.</p>
<p>ZEC: t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ</p> <p data-l10n-id="content-support-p2">You can help to protect our civil rights online, just run I2P node 24/7 and spread the word!</p>
<p>ANC: AQJYweYYUqM1nVfLqfoSMpUMfzxvS4Xd7z</p> <p><a data-l10n-id="content-support-donate-link" href="#donations">Support with coins</a></p>
<p>XMR: 497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH</p> <div id="donations">
</div> <p style="font-weight: bold;" data-l10n-id="content-support-donate-text">Donations for Purple I2P developing:</p>
<div class="p-hr"></div> <p>E-Mail: i2porignal at yandex.ru</p>
<p class="links"> <p>BTC: 3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f</p>
<a href="https://github.com/PurpleI2P/i2pd" target="_blank"><img alt="@GitHub" src="images/github.png"></a> <p>LTC: LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59</p>
<a href="https://en.wikipedia.org/wiki/I2P" target="_blank"><img alt="@Wikipedia" src="images/wikipedia.png"></a> <p>ETH: 0x9e5bac70d20d1079ceaa111127f4fb3bccce379d</p>
<a href="https://twitter.com/hashtag/i2pd" target="_blank"><img alt="@Twitter" src="images/twitter.png"></a> <p>GST: GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG</p>
<!-- <a href="http://purplete.ch" target="_blank"><img alt="Purple Tech" src="images/purpletech.png"></a> --> <p>DASH: Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF</p>
<a href="https://i2p.net/" target="_blank"><img alt="Vanilla I2P" src="images/itoopie.png"></a> <p>ZEC: t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ</p>
</p> <p>ANC: AQJYweYYUqM1nVfLqfoSMpUMfzxvS4Xd7z</p>
</div> <p>XMR: 497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH</p>
</div> </div>
</body> <div class="p-hr"></div>
<p class="links">
<a href="https://github.com/PurpleI2P/i2pd" target="_blank"><img alt="@GitHub" src="images/github.png"></a>
<a href="https://en.wikipedia.org/wiki/I2P" target="_blank"><img alt="@Wikipedia" src="images/wikipedia.png"></a>
<a href="https://twitter.com/hashtag/i2pd" target="_blank"><img alt="@Twitter" src="images/twitter.png"></a>
<a href="https://i2p.net/" target="_blank"><img alt="Vanilla I2P" src="images/itoopie.png"></a>
</p>
</div>
</div>
</body>
</html> </html>

56
js/app.js

@ -1,49 +1,21 @@
var url = "https://api.github.com/repos/PurpleI2P/i2pdbrowser/releases/latest"; function renderDownloadButton() {
//var url = "http://127.0.0.1:9889/latest.json"; var downloadCount = 0, dl_btn = document.getElementById("dl-btn"), all_dls = document.getElementById("all-dls");
function renderReleaseInfo(data) { if (window.navigator.platform.toUpperCase().startsWith("WIN")) {
if (!data) return; dl_btn.innerText = document.webL10n.get("header-dl-btn-bundle", null, "Download I2PdBrowser");
var release = JSON.parse(data); dl_btn.setAttribute("href", "https://github.com/PurpleI2P/i2pdbrowser/releases/latest");
var downloadCount = 0, dl_btn = document.getElementById("dl-btn"), all_dls = document.getElementById("all-dls"); all_dls.style.display = "block";
for (var i = 0; i < release.assets.length; i++) } else if (window.navigator.userAgent.toUpperCase().indexOf("ANDROID") !== -1) {
downloadCount += release.assets[i].download_count; dl_btn.innerText = document.webL10n.get("header.dl-btn-android", null, "Download for Android");
console.log(release.name+" downloaded "+downloadCount.toLocaleString()+" times."); dl_btn.setAttribute("href", droid_asset[0].browser_download_url);
all_dls.style.display = "block";
if (window.navigator.platform.toUpperCase().startsWith("WIN")) { } else {
var win_asset = release.assets.filter(function(a) { dl_btn.innerText = document.webL10n.get("header-dl-btn", null, "Downloads");
if (a.name.startsWith("I2PdBrowser") && a.name.endsWith("exe")) }
return true;
});
if (win_asset.length > 0) {
dl_btn.innerText = document.webL10n.get("header-dl-btn-windows", null, "Download for Windows");
dl_btn.setAttribute("href", win_asset[0].browser_download_url);
all_dls.style.display = "block";
}
/*
} else if (window.navigator.userAgent.toUpperCase().indexOf("ANDROID") !== -1) {
var droid_asset = release.assets.filter(function(a) {
if (a.name.toUpperCase().indexOf("ANDROID") !== -1) return true;
});
if (droid_asset.length > 0) {
dl_btn.text(document.webL10n.get("header.dl-btn-android"));
dl_btn.setAttribute("href", droid_asset[0].browser_download_url);
all_dls.show();
}
*/
} else {
dl_btn.innerText = document.webL10n.get("header-dl-btn", null, "Downloads");
}
} }
window.addEventListener('localized', function() { window.addEventListener('localized', function() {
var httpRequest = new XMLHttpRequest(); renderDownloadButton();
httpRequest.onreadystatechange = function(){
if (httpRequest.readyState == XMLHttpRequest.DONE)
renderReleaseInfo(httpRequest.responseText);
}
httpRequest.open('GET', url);
httpRequest.send();
}, false); }, false);

8
locales/data.ini

@ -4,9 +4,11 @@ header-slogan = Network without borders
header-p1 = We are building network which helps people to communicate and share information without restrictions. header-p1 = We are building network which helps people to communicate and share information without restrictions.
header-p2 = Free from censorship. Free from privacy violations. header-p2 = Free from censorship. Free from privacy violations.
header-dl-btn = Download header-dl-btn = Download
header-dl-btn-windows = Download for Windows header-dl-btn-bundle = Download I2PdBrowser
header-dl-btn-android = Download for Android header-dl-btn-android = Download for Android
header-dl-all = All downloads header-dl-all = All downloads
header-dl-android = Android app
header-dl-browser = I2PdBrowser bundle
header-docs = Documentation header-docs = Documentation
content-how-title = i2pd (I2P Daemon) is a full-featured C++ implementation of I2P client content-how-title = i2pd (I2P Daemon) is a full-featured C++ implementation of I2P client
content-how-p1 = I2P (Invisible Internet Protocol) is a universal anonymous network layer. All communications over I2P are anonymous and end-to-end encrypted, participants don't reveal their real IP addresses. content-how-p1 = I2P (Invisible Internet Protocol) is a universal anonymous network layer. All communications over I2P are anonymous and end-to-end encrypted, participants don't reveal their real IP addresses.
@ -26,9 +28,11 @@ header-slogan = Сеть без границ
header-p1 = Мы строим сеть, которая позволяет людям общаться и обмениваться информацией без искусственных преград. header-p1 = Мы строим сеть, которая позволяет людям общаться и обмениваться информацией без искусственных преград.
header-p2 = Без цензуры. Без нарушений права на частную жизнь. header-p2 = Без цензуры. Без нарушений права на частную жизнь.
header-dl-btn = Скачать header-dl-btn = Скачать
header-dl-btn-windows = Скачать для Windows header-dl-btn-bundle = Скачать I2PdBrowser
header-dl-btn-android = Скачать для Android header-dl-btn-android = Скачать для Android
header-dl-all = Все загрузки header-dl-all = Все загрузки
header-dl-android = Android приложение
header-dl-browser = Комплект I2PdBrowser
header-docs = Документация header-docs = Документация
content-how-title = i2pd (I2P Daemon) это полнофункциональная реализация I2P клиента на языке C++ content-how-title = i2pd (I2P Daemon) это полнофункциональная реализация I2P клиента на языке C++
content-how-p1 = I2P (Невидимый Интернет Протокол) это универсальный анонимный сетевой уровень. Все соединения через I2P анонимны и используют сквозное (end-to-end) шифрование, участники не раскрывают свои настоящие IP адреса. content-how-p1 = I2P (Невидимый Интернет Протокол) это универсальный анонимный сетевой уровень. Все соединения через I2P анонимны и используют сквозное (end-to-end) шифрование, участники не раскрывают свои настоящие IP адреса.

Loading…
Cancel
Save