Add DEV download page
This commit is contained in:
parent
629796b128
commit
9088722024
4 changed files with 164 additions and 31 deletions
19
app.css
19
app.css
|
@ -46,6 +46,10 @@ a {
|
||||||
text-shadow: #000 5px 5px 5px;
|
text-shadow: #000 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header__link {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.header__description {
|
.header__description {
|
||||||
text-shadow: #000 1px 1px 5px;
|
text-shadow: #000 1px 1px 5px;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
|
@ -135,15 +139,26 @@ a {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button span[id$="date"] {
|
.button span[class$="date"] {
|
||||||
color: transparent;
|
color: transparent;
|
||||||
transition: 0.3s color;
|
transition: 0.3s color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover span[id$="date"] {
|
.button:hover span[class$="date"] {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-more__link {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-more__link:hover,
|
||||||
|
.button-more__link:focus,
|
||||||
|
.button-more__link:active
|
||||||
|
{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
95
app.js
95
app.js
|
@ -1,11 +1,15 @@
|
||||||
var disableClick = function(e) {e.preventDefault()};
|
var disableClick = function(e) {e.preventDefault()};
|
||||||
|
|
||||||
var addButtonInfo = function(url, prefix, cb) {
|
var addButtonInfo = function(url, prefix, cb) {
|
||||||
var buttonElement = document.querySelector("#" + prefix + "-button");
|
var buttonElement = document.querySelector("." + prefix + "-button");
|
||||||
|
if (null === buttonElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
buttonElement.addEventListener("click", disableClick);
|
buttonElement.addEventListener("click", disableClick);
|
||||||
var versionElement = document.querySelector("#" + prefix + "-version");
|
var versionElement = document.querySelector("." + prefix + "-version");
|
||||||
versionElement.innerHTML = "Ładowanie…";
|
versionElement.innerHTML = "Ładowanie…";
|
||||||
var dateElement = document.querySelector("#" + prefix + "-date");
|
var dateElement = document.querySelector("." + prefix + "-date");
|
||||||
|
|
||||||
var res = new XMLHttpRequest();
|
var res = new XMLHttpRequest();
|
||||||
res.open("GET", url, true);
|
res.open("GET", url, true);
|
||||||
|
@ -20,24 +24,71 @@ var addButtonInfo = function(url, prefix, cb) {
|
||||||
res.send(null);
|
res.send(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
addButtonInfo("https://api.github.com/repos/wulkanowy/wulkanowy/releases/latest", "beta",
|
if (null === document.querySelector(".button-container--list")) {
|
||||||
function(res, button, version, date) {
|
addButtonInfo("https://api.github.com/repos/wulkanowy/wulkanowy/releases/latest", "beta",
|
||||||
var json = JSON.parse(res.responseText);
|
function(res, button, version, date) {
|
||||||
button.href = json.assets[0].browser_download_url;
|
var json = JSON.parse(res.responseText);
|
||||||
version.innerHTML = "v" + json.name;
|
button.href = json.assets[0].browser_download_url;
|
||||||
date.innerHTML = new Date(json.published_at).toLocaleString("pl-PL");
|
version.innerHTML = "v" + json.name;
|
||||||
}
|
date.innerHTML = new Date(json.published_at).toLocaleString("pl-PL");
|
||||||
);
|
}
|
||||||
|
);
|
||||||
|
|
||||||
addButtonInfo("https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk/info", "dev",
|
addButtonInfo("https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk/info", "dev",
|
||||||
function(res, button, version, date) {
|
function(res, button, version, date) {
|
||||||
var json = JSON.parse(res.responseText);
|
if (null !== document.querySelector(".button-container--list")) return;
|
||||||
button.href = json.expiring_download_url;
|
var json = JSON.parse(res.responseText);
|
||||||
version.innerHTML = "Build " + json.build_number;
|
version.innerHTML = "Build " + json.build_number;
|
||||||
date.innerHTML = new Date(json.finished_at).toLocaleString("pl-PL");
|
date.innerHTML = new Date(json.finished_at).toLocaleString("pl-PL");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(function() {
|
(function (d) {
|
||||||
button.href = json.public_install_page_url;
|
var list = d.querySelector(".button-container--list");
|
||||||
}, 60 * 1000);
|
var base = d.querySelector(".button-container--list .button");
|
||||||
}
|
if (null === base) return;
|
||||||
);
|
|
||||||
|
var baseCopy = base.cloneNode(true);
|
||||||
|
base.style.display = "none";
|
||||||
|
|
||||||
|
var res = new XMLHttpRequest();
|
||||||
|
res.open("GET", "https://api.github.com/repos/wulkanowy/wulkanowy/branches", true);
|
||||||
|
res.onloadend = function () {
|
||||||
|
if(res.status === 200) {
|
||||||
|
JSON.parse(res.responseText).forEach(function (item) {
|
||||||
|
if ("master" === item.name) return;
|
||||||
|
|
||||||
|
var url = "https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/" + item.name
|
||||||
|
+ "/artifacts/app-debug-bitrise-signed.apk";
|
||||||
|
|
||||||
|
|
||||||
|
var branch = baseCopy.cloneNode(true);
|
||||||
|
branch.href = url;
|
||||||
|
branch.innerText = item.name;
|
||||||
|
|
||||||
|
var button_info = d.createElement("p");
|
||||||
|
button_info.setAttribute("class", "button__info");
|
||||||
|
|
||||||
|
var button_version = d.createElement("span");
|
||||||
|
button_version.setAttribute("class", "dev-version");
|
||||||
|
|
||||||
|
var button_date = d.createElement("span");
|
||||||
|
button_date.setAttribute("class", "dev-date");
|
||||||
|
|
||||||
|
button_info.appendChild(button_version);
|
||||||
|
button_info.appendChild(button_date);
|
||||||
|
|
||||||
|
addButtonInfo(url + "/info", "dev", function(res) {
|
||||||
|
var json = JSON.parse(res.responseText);
|
||||||
|
button_version.innerHTML = "Build " + json.build_number;
|
||||||
|
button_date.innerHTML = new Date(json.finished_at).toLocaleString("pl-PL");
|
||||||
|
});
|
||||||
|
branch.appendChild(button_info);
|
||||||
|
list.appendChild(branch);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
res.send(null);
|
||||||
|
|
||||||
|
})(document);
|
||||||
|
|
60
dev.html
Normal file
60
dev.html
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico?v=1">
|
||||||
|
<title>Wersje DEV - Wulkanowy</title>
|
||||||
|
<link rel="stylesheet" href="app.css">
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-99646499-3"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
|
||||||
|
function gtag() {
|
||||||
|
dataLayer.push(arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
gtag("js", new Date());
|
||||||
|
gtag("config", "UA-99646499-3");
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section class="wrapper">
|
||||||
|
<div class="container">
|
||||||
|
<header class="header">
|
||||||
|
<h1 class="header__title">
|
||||||
|
<a class="header__link" href="https://wulkanowy.github.io/">Wulkanowy</a>
|
||||||
|
</h1>
|
||||||
|
<p class="header__description">Nieoficjalna aplikacja mobilna <br>ucznia i rodzica <br>dla dziennika VULCAN UONET+</p>
|
||||||
|
</header>
|
||||||
|
<main class="main">
|
||||||
|
<section class="section">
|
||||||
|
<div class="button-container button-container--list">
|
||||||
|
<a class="button button--dev dev-button"
|
||||||
|
title="Pobierz wersję DEV"
|
||||||
|
href="https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk">
|
||||||
|
master
|
||||||
|
<p class="button__info">
|
||||||
|
<span class="dev-version">Build 0000</span>
|
||||||
|
<span class="dev-date"></span>
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
<footer id="footer" class="footer">
|
||||||
|
<a title="Zobacz repozytorium na Githubie" href="https://github.com/wulkanowy/wulkanowy" class="github">
|
||||||
|
<img src="./github.svg" alt="Zobacz repozytorium na Githubie">
|
||||||
|
</a>
|
||||||
|
<ul class="footer__nav">
|
||||||
|
<li class="footer__item">
|
||||||
|
<a class="footer__link" href="https://github.com/wulkanowy">Wszystkie projekty</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
21
index.html
21
index.html
|
@ -23,7 +23,9 @@
|
||||||
<section class="wrapper">
|
<section class="wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<h1 class="header__title">Wulkanowy</h1>
|
<h1 class="header__title">
|
||||||
|
<a class="header__link" href="https://wulkanowy.github.io/">Wulkanowy</a>
|
||||||
|
</h1>
|
||||||
<p class="header__description">Nieoficjalna aplikacja mobilna <br>ucznia i rodzica <br>dla dziennika VULCAN UONET+</p>
|
<p class="header__description">Nieoficjalna aplikacja mobilna <br>ucznia i rodzica <br>dla dziennika VULCAN UONET+</p>
|
||||||
</header>
|
</header>
|
||||||
<main class="main">
|
<main class="main">
|
||||||
|
@ -36,22 +38,27 @@
|
||||||
<a class="button button--beta" id="beta-button" title="Pobierz wersję beta" href="https://github.com/wulkanowy/wulkanowy/releases">
|
<a class="button button--beta" id="beta-button" title="Pobierz wersję beta" href="https://github.com/wulkanowy/wulkanowy/releases">
|
||||||
Pobierz wersję beta
|
Pobierz wersję beta
|
||||||
<p class="button__info">
|
<p class="button__info">
|
||||||
<span id="beta-version">v0.0.0</span>
|
<span class="beta-version">v0.0.0</span>
|
||||||
<span id="beta-date"></span>
|
<span class="beta-date"></span>
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
|
<p class="button-more">
|
||||||
|
<a class="button-more__link" href="https://github.com/wulkanowy/wulkanowy/releases">Więcej wersji</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<a class="button button--dev"
|
<a class="button button--dev dev-button"
|
||||||
id="dev-button"
|
|
||||||
title="Pobierz wersję DEV"
|
title="Pobierz wersję DEV"
|
||||||
href="https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk">
|
href="https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk">
|
||||||
Pobierz wersję DEV
|
Pobierz wersję DEV
|
||||||
<p class="button__info">
|
<p class="button__info">
|
||||||
<span id="dev-version">Build 0000</span>
|
<span class="dev-version">Build 0000</span>
|
||||||
<span id="dev-date"></span>
|
<span class="dev-date"></span>
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
|
<p class="button-more">
|
||||||
|
<a href="dev.html" class="button-more__link">Więcej wersji</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
Loading…
Reference in a new issue