diff --git a/index.html b/index.html
index 1d5931047..3aaba26c7 100644
--- a/index.html
+++ b/index.html
@@ -55,7 +55,7 @@ root: .
Torque is being constantly developed by an enthusiastic community.
- Its future is in your hands, not those of a company with a
+ Its future is in our hands, not those of a company with a
bottom line to meet.
+
+
Recent news
+
Loading news...
+
See all
+
+
Activity
Loading activity...
-
Status
-
-
- | Current version |
- ... |
-
-
- | Continuous integration |
- t3dci.org |
-
-
-
-
-
@@ -181,56 +159,89 @@ $(document).ready(function() {
createBreaks();
- var numResults = 2;
- var feed = 'https://github.com/GarageGames/Torque3D/commits/development.atom';
- var now = new Date();
- var googleAPI = document.location.protocol +
- '//ajax.googleapis.com/ajax/services/feed/load?' +
- 'v=1.0' +
- '&dailycache=' + [now.getUTCDate(), now.getUTCMonth(), now.getUTCFullYear()].join('-') +
- '&num=' + numResults +
- '&callback=?&q=';
- var url = googleAPI + encodeURIComponent(feed);
- $.ajax({
- url: url,
- dataType: 'json',
- success: function (data) {
- if(data.responseData.feed && data.responseData.feed.entries) {
- var list = $('
').addClass('list-unstyled');
- $.each(data.responseData.feed.entries, function (i, e) {
- var li = $('
').addClass('commit').appendTo(list);
- var hash = e.link.split('/').pop().substr(0, 6);
+ getFeed('https://github.com/GarageGames/Torque3D/commits/development.atom', 2)
+ .done(function (data) {
+ if(data.responseData.feed && data.responseData.feed.entries) {
+ var list = $('
').addClass('list-unstyled');
+ $.each(data.responseData.feed.entries, function (i, e) {
+ var li = $('
').addClass('commit').appendTo(list);
+ var hash = e.link.split('/').pop().substr(0, 6);
- var content = e.contentSnippet.split('\n').pop();
- li.append($('
').text(content));
+ var content = e.contentSnippet.split('\n').pop();
+ var contentel = $('
').text(content).appendTo(li);
- var hashel = $('
').addClass('inline').appendTo(li);
- hashel.append($('
')
- .text(hash)
+ var hashel = $('
').addClass('inline').prependTo(contentel);
+ hashel.append($('
')
+ .text(hash)
+ .attr('href', e.link)
+ .attr('target', '_blank'));
+
+ var d = new Date(e.publishedDate);
+ var stamp = $('
').addClass('timeago').text('by ' + e.author + ' ').appendTo(li);
+ stamp.append($('
')
+ .attr('title', d.toISOString())
+ .timeago());
+ });
+ $('#activity-loading').replaceWith(list);
+ }
+ })
+
+ getFeed('http://forums.torque3d.org/feed.php?mode=news', 3)
+ .done(function(data) {
+ if(data.responseData.feed && data.responseData.feed.entries) {
+ var news = $('#recent-news');
+ $.each(data.responseData.feed.entries, function (i, e) {
+ news.html('');
+
+ news.append($('
')
+ .append($('
')
.attr('href', e.link)
- .attr('target', '_blank'));
+ .html(e.title)
+ )
+ );
- var d = new Date(e.publishedDate);
- var stamp = $('
').addClass('timeago').text('by ' + e.author + ' ').appendTo(li);
- stamp.append($('
')
- .attr('title', d.toISOString())
- .timeago());
- });
- $('#activity-loading').replaceWith(list);
- }
+ var d = new Date(e.publishedDate);
+ var stamp = $('
').addClass('timeago').text('by ' + e.author + ' ').appendTo(news);
+ stamp.append($('
')
+ .attr('title', d.toISOString())
+ .timeago());
+
+ news.append($('
').html(e.contentSnippet + ' ')
+ .append($('
')
+ .attr('href', e.link)
+ .html('Read more')
+ )
+ );
+ });
}
});
$.get('http://api.github.com/repos/GarageGames/Torque3D/releases')
.done(function(releases) {
var latest = releases[0];
- $('#current-version').html($('
')
+ $('
').append($('
')
.attr('href', latest.html_url)
- .html(latest.name)
- );
+ .html('Version ' + latest.name)
+ ).prependTo('#quick-links');
})
.fail(function() {
- $('#curent-version').html('error');
+ $('#current-version').html('error');
});
+
+ // Get a feed through the Google feeds API with hourly caching.
+ function getFeed(feed, numResults) {
+ var now = new Date();
+ var googleAPI = document.location.protocol +
+ '//ajax.googleapis.com/ajax/services/feed/load?' +
+ 'v=1.0' +
+ '&dailycache=' + [now.getUTCDate(), now.getUTCMonth(), now.getUTCFullYear()].join('-') +
+ '&num=' + numResults +
+ '&callback=?&q=';
+ var url = googleAPI + encodeURIComponent(feed);
+ return $.ajax({
+ url: url,
+ dataType: 'json'
+ });
+ }
});