1
0
Fork 0
forked from 0x2620/oxjs

add some support for unsupported browsers

This commit is contained in:
rolux 2012-04-07 17:58:44 +02:00
commit 0a778de247
2 changed files with 36 additions and 5 deletions

View file

@ -96,6 +96,11 @@ Ox.load(function() {
top: '8px',
right: '8px'
};
} else if (element == 'warning') {
css = {
left: center - 128 + 'px',
top: middle + 16 + 'px',
};
}
return css;
},
@ -122,7 +127,7 @@ Ox.load(function() {
});
});
},
load: function() {
load: function(browserSupported) {
var url = app.url.get();
if (url) {
app.user({url: url})
@ -139,7 +144,19 @@ Ox.load(function() {
app.$ui.loading.animate({opacity: 0}, 500, function() {
app.$ui.loading.remove();
});
if (!url) {
if (!browserSupported) {
app.$ui.warning = app.ui.warning()
.css(app.getCSS('warning'))
.appendTo(Ox.$body);
app.$ui.logo
.css({cursor: 'pointer'})
.one({
click: function() {
app.$ui.warning.remove();
app.load(true);
}
});
} else if (!url) {
app.$ui.logo
.css({cursor: 'pointer'})
.bind({
@ -443,6 +460,16 @@ Ox.load(function() {
app.setTheme(data.value);
}
});
},
warning: function() {
return $('<div>')
.addClass('warning')
.html(
'Aw, snap! This website requires an up-to-date, HTML5-compliant web browser. '
+ 'It should work fine in current versions of Chrome, Firefox and Safari, '
+ 'or Internet Explorer with Chrome Frame installed. '
+ 'To proceed at your own risk, click on the logo above.'
);
}
},
url: {