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 0c89c6f + 965ab6d commit de0919b
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 @@ -243,11 +243,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 @@ -261,16 +261,16 @@ <h1 class="display-5 text-body-emphasis lh-1 mb-3">Latest Release</h1>
}
}
};
req.open("GET", "https://server.armorpaint.org/armorlab.html", true);
req.send();
reqDownload.open("GET", "https://server.armorpaint.org/armorlab.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_armorlab.html", true);
req.send();
var reqDownload = new XMLHttpRequest();
reqDownload.onreadystatechange = function() {};
reqDownload.open("GET", "https://server.armorpaint.org/cart_armorlab.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 @@ -108,11 +108,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 @@ -126,16 +126,16 @@ <h1 class="display-5 text-body-emphasis lh-1 mb-3">Latest Release</h1>
}
}
};
req.open("GET", "https://server.armorpaint.org/armorlab.html", true);
req.send();
reqDownload.open("GET", "https://server.armorpaint.org/armorlab.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_armorlab.html", true);
req.send();
var reqDownload = new XMLHttpRequest();
reqDownload.onreadystatechange = function() {};
reqDownload.open("GET", "https://server.armorpaint.org/cart_armorlab.html", true);
reqDownload.send();

}
</script>
Expand Down

0 comments on commit de0919b

Please sign in to comment.