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 @@ @@ -1,75 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Invisible Internet Protocol Daemon</title>
<link href="css/app.css" rel="stylesheet">
<link rel="prefetch" type="application/l10n" href="locales/data.ini" />
<script defer src="js/l10n.js"></script>
<script src="js/app.js"></script>
<link rel="icon" type="image/png" href="images/favicon.png" />
<meta name="yandex-verification" content="b50a274d8f4a99cd" />
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/PurpleI2P/i2pd"
title="Fork me on GitHub">Fork me on GitHub</a>
<div class="container">
<div class="header">
<div class="align-center">
<img src="images/favicon.png" id="logo">
<h2 data-l10n-id="header-title">Invisible Internet Protocol:</h2>
<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-p2">Free from censorship. Free from privacy violations.</p>
<div class="download">
<a href="https://github.com/PurpleI2P/i2pd/releases/latest"
id="dl-btn" target="_blank">Downloads</a>
</div>
<p class="header-links">
<a href="https://github.com/PurpleI2P/i2pd/releases/latest" id="all-dls"
data-l10n-id="header-dl-all" style="display: none;" target="_blank">
All downloads</a>
<a href="https://i2pd.readthedocs.io/en/latest/" target="_blank"
data-l10n-id="header-docs">Documentation</a>
</p>
</div>
</div>
<div class="content">
<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-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-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 data-l10n-id="content-how-p3">I2P allows people from all around the world to communicate and share information without restrictions.</p>
<p>
<span data-l10n-id="content-how-p4">If you are interested in deeper technical details, visit</span>
<a data-l10n-id="content-how-details" href="https://i2p.net/en/about/intro"
target="_blank">this page</a>.
</p>
<div class="p-hr"></div>
<h2 data-l10n-id="content-support-title">Let's make the world a better place</h2>
<p data-l10n-id="content-support-p1">I2P runs and is developed by people like you.</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><a data-l10n-id="content-support-donate-link" href="#donations">Support with coins</a></p>
<div id="donations">
<p style="font-weight: bold;" data-l10n-id="content-support-donate-text">Donations for Purple I2P developing:</p>
<p>E-Mail: i2porignal at yandex.ru</p>
<p>BTC: 3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f</p>
<p>LTC: LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59</p>
<p>ETH: 0x9e5bac70d20d1079ceaa111127f4fb3bccce379d</p>
<p>GST: GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG</p>
<p>DASH: Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF</p>
<p>ZEC: t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ</p>
<p>ANC: AQJYweYYUqM1nVfLqfoSMpUMfzxvS4Xd7z</p>
<p>XMR: 497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH</p>
</div>
<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="http://purplete.ch" target="_blank"><img alt="Purple Tech" src="images/purpletech.png"></a> -->
<a href="https://i2p.net/" target="_blank"><img alt="Vanilla I2P" src="images/itoopie.png"></a>
</p>
</div>
</div>
</body>
<head>
<meta charset="utf-8">
<title>Invisible Internet Protocol Daemon</title>
<link href="css/app.css" rel="stylesheet">
<link rel="prefetch" type="application/l10n" href="locales/data.ini" />
<script defer src="js/l10n.js"></script>
<script src="js/app.js"></script>
<link rel="icon" type="image/png" href="images/favicon.png" />
<meta name="yandex-verification" content="b50a274d8f4a99cd" />
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/PurpleI2P/i2pd"
title="Fork me on GitHub">Fork me on GitHub</a>
<div class="container">
<div class="header">
<div class="align-center">
<img src="images/favicon.png" id="logo">
<h2 data-l10n-id="header-title">Invisible Internet Protocol:</h2>
<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-p2">Free from censorship. Free from privacy violations.</p>
<div class="download">
<a href="https://github.com/PurpleI2P/i2pd/releases/latest"
id="dl-btn" target="_blank">Downloads</a>
</div>
<div id="all-dls" style="display: none;">
<p class="header-links">
<a href="https://github.com/PurpleI2P/i2pd/releases/latest"
data-l10n-id="header-dl-all" target="_blank">
All downloads</a>
<a href="https://github.com/PurpleI2P/i2pd-android/releases/latest"
data-l10n-id="header-dl-android" target="_blank">
Android app</a>
<a href="https://github.com/PurpleI2P/i2pdbrowser/releases/latest"
data-l10n-id="header-dl-browser" target="_blank">
I2PdBrowser bundle</a>
</p>
</div>
<p class="header-links">
<a href="https://i2pd.readthedocs.io/en/latest/" target="_blank"
data-l10n-id="header-docs">Documentation</a>
</p>
</div>
</div>
<div class="content">
<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-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-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 data-l10n-id="content-how-p3">I2P allows people from all around the world to communicate and share information without restrictions.</p>
<p>
<span data-l10n-id="content-how-p4">If you are interested in deeper technical details, visit</span>
<a data-l10n-id="content-how-details" href="https://i2p.net/en/about/intro"
target="_blank">this page</a>.
</p>
<div class="p-hr"></div>
<h2 data-l10n-id="content-support-title">Let's make the world a better place</h2>
<p data-l10n-id="content-support-p1">I2P runs and is developed by people like you.</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><a data-l10n-id="content-support-donate-link" href="#donations">Support with coins</a></p>
<div id="donations">
<p style="font-weight: bold;" data-l10n-id="content-support-donate-text">Donations for Purple I2P developing:</p>
<p>E-Mail: i2porignal at yandex.ru</p>
<p>BTC: 3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f</p>
<p>LTC: LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59</p>
<p>ETH: 0x9e5bac70d20d1079ceaa111127f4fb3bccce379d</p>
<p>GST: GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG</p>
<p>DASH: Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF</p>
<p>ZEC: t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ</p>
<p>ANC: AQJYweYYUqM1nVfLqfoSMpUMfzxvS4Xd7z</p>
<p>XMR: 497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH</p>
</div>
<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>

56
js/app.js

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

8
locales/data.ini

@ -4,9 +4,11 @@ header-slogan = Network without borders @@ -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-p2 = Free from censorship. Free from privacy violations.
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-all = All downloads
header-dl-android = Android app
header-dl-browser = I2PdBrowser bundle
header-docs = Documentation
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.
@ -26,9 +28,11 @@ header-slogan = Сеть без границ @@ -26,9 +28,11 @@ header-slogan = Сеть без границ
header-p1 = Мы строим сеть, которая позволяет людям общаться и обмениваться информацией без искусственных преград.
header-p2 = Без цензуры. Без нарушений права на частную жизнь.
header-dl-btn = Скачать
header-dl-btn-windows = Скачать для Windows
header-dl-btn-bundle = Скачать I2PdBrowser
header-dl-btn-android = Скачать для Android
header-dl-all = Все загрузки
header-dl-android = Android приложение
header-dl-browser = Комплект I2PdBrowser
header-docs = Документация
content-how-title = i2pd (I2P Daemon) это полнофункциональная реализация I2P клиента на языке C++
content-how-p1 = I2P (Невидимый Интернет Протокол) это универсальный анонимный сетевой уровень. Все соединения через I2P анонимны и используют сквозное (end-to-end) шифрование, участники не раскрывают свои настоящие IP адреса.

Loading…
Cancel
Save