diff --git a/index.js b/index.js
index 70d794a9..ccac1040 100644
--- a/index.js
+++ b/index.js
@@ -46,7 +46,7 @@ Ox.load(function() {
{id: 'readme', title: 'Readme'},
{id: 'examples', title: 'Examples'},
{id: 'doc', title: 'Documentation'},
- {id: 'downloads', title: 'Downloads'},
+ {id: 'download', title: 'Download'},
{id: 'development', title: 'Development'}
],
user: {
@@ -218,15 +218,25 @@ Ox.load(function() {
app.state.loaded = true;
},
loadData: function(callback) {
- Ox.getJSON('index.json?'+Ox.random(1000), function(data) {
+ var url = 'https://oxjs.org/dev/Ox/json/Ox.json';
+ Ox.getJSON('index.json?' + Ox.random(1000000), function(data) {
app.data = Ox.extend(app.data, data);
app.data.pages.forEach(function(page) {
var id = page.id == 'doc' ? 'documentation' : page.id;
Ox.get('readme/html/_' + (id) + '.html', function(html) {
app.html[id] = html;
- Ox.len(app.html) == app.data.pages.length && callback();
+ if (Ox.len(app.html) == app.data.pages.length) {
+ if (navigator.onLine) {
+ Ox.getJSON(url, function(data) {
+ app.data.version = data.version;
+ callback();
+ });
+ } else {
+ callback();
+ }
+ }
});
- })
+ });
});
},
loadScreen: function(callback) {
@@ -288,11 +298,13 @@ Ox.load(function() {
version: [
'{version}',
function() {
- return (
- /:\/\/oxjs.org\//.test(window.location.href)
- ? 'The latest version is'
- : 'You\'re currently running version'
- ) + ' ' + Ox.VERSION + '.
'
+ var current = 'You\'re currently running version '
+ + Ox.VERSION + '
.',
+ latest = 'The latest version is '
+ + app.data.version + '
.';
+ return app.data.version ? latest + (
+ app.data.version == Ox.VERSION ? '' : ' ' + current
+ ) : current;
}
]
},
@@ -481,7 +493,9 @@ Ox.load(function() {
var $element = Ox.Container();
$('
Please note that these are pre-release versions. {version}
+{version}
Development version, including everything but the kitchen sink.