Pārlūkot izejas kodu

Fetch latest version automatically.

Daniel Buckmaster 10 gadi atpakaļ
vecāks
revīzija
7343667b50
1 mainītis faili ar 13 papildinājumiem un 1 dzēšanām
  1. 13 1
      index.html

+ 13 - 1
index.html

@@ -96,7 +96,7 @@ root: .
             <table class="borderless table">
                 <tr>
                     <td>Current version</td>
-                    <td><a href="http://wiki.torque3d.org/release:three-six-two">3.6.2</a></td>
+                    <td id="current-version">...</td>
                 </tr>
                 <tr>
                     <td>Continuous integration</td>
@@ -219,5 +219,17 @@ $(document).ready(function() {
       }
     }
   });
+
+  $.get('http://api.github.com/repos/GarageGames/Torque3D/releases')
+  .done(function(releases) {
+    var latest = releases[0];
+    $('#current-version').html($('<a/>')
+      .attr('href', latest.html_url)
+      .html(latest.name)
+    );
+  })
+  .fail(function() {
+    $('#curent-version').html('error');
+  });
 });
 </script>