Skip to content

Commit

Permalink
Merge pull request #2 from rpaladin/main
Browse files Browse the repository at this point in the history
Fix get latest version for download page
  • Loading branch information
luboslenco authored Jul 28, 2023
2 parents 0f1f03f + 875dea5 commit 66991ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions download.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ <h1 class="display-5 text-body-emphasis lh-1 mb-3">Latest Release</h1>
</div>

<script type="text/javascript">
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == XMLHttpRequest.DONE) {
if (req.status == 200) {
var data = JSON.parse(req.responseText);
var reqDownload = new XMLHttpRequest();
reqDownload.onreadystatechange = function() {
if (reqDownload.readyState == XMLHttpRequest.DONE) {
if (reqDownload.status == 200) {
var data = JSON.parse(reqDownload.responseText);
var s = data.version + '';
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var year = s[0] + s[1];
Expand All @@ -285,16 +285,16 @@ <h1 class="display-5 text-body-emphasis lh-1 mb-3">Latest Release</h1>
}
}
};
req.open("GET", "https://server.armorpaint.org/armorpaint.html", true);
req.send();
reqDownload.open("GET", "https://server.armorpaint.org/armorpaint.html", true);
reqDownload.send();

let _onclick = document.getElementById('buy_button').onclick;
document.getElementById('buy_button').onclick = function() {
_onclick();
var req = new XMLHttpRequest();
req.onreadystatechange = function() {};
req.open("GET", "https://server.armorpaint.org/cart_armorpaint.html", true);
req.send();
var reqDownload = new XMLHttpRequest();
reqDownload.onreadystatechange = function() {};
reqDownload.open("GET", "https://server.armorpaint.org/cart_armorpaint.html", true);
reqDownload.send();

}
</script>
Expand Down
22 changes: 11 additions & 11 deletions src/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ <h1 class="display-5 text-body-emphasis lh-1 mb-3">Latest Release</h1>
</div>

<script type="text/javascript">
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == XMLHttpRequest.DONE) {
if (req.status == 200) {
var data = JSON.parse(req.responseText);
var reqDownload = new XMLHttpRequest();
reqDownload.onreadystatechange = function() {
if (reqDownload.readyState == XMLHttpRequest.DONE) {
if (reqDownload.status == 200) {
var data = JSON.parse(reqDownload.responseText);
var s = data.version + '';
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var year = s[0] + s[1];
Expand All @@ -152,16 +152,16 @@ <h1 class="display-5 text-body-emphasis lh-1 mb-3">Latest Release</h1>
}
}
};
req.open("GET", "https://server.armorpaint.org/armorpaint.html", true);
req.send();
reqDownload.open("GET", "https://server.armorpaint.org/armorpaint.html", true);
reqDownload.send();

let _onclick = document.getElementById('buy_button').onclick;
document.getElementById('buy_button').onclick = function() {
_onclick();
var req = new XMLHttpRequest();
req.onreadystatechange = function() {};
req.open("GET", "https://server.armorpaint.org/cart_armorpaint.html", true);
req.send();
var reqDownload = new XMLHttpRequest();
reqDownload.onreadystatechange = function() {};
reqDownload.open("GET", "https://server.armorpaint.org/cart_armorpaint.html", true);
reqDownload.send();

}
</script>
Expand Down

0 comments on commit 66991ef

Please sign in to comment.