')
.addClass('ui line')
.css({
top: app.window.middle + 12 + 'px',
left: app.window.center - 192 + 'px',
})
.html('A JavaScript Library for Web Applications')
},
logo: function() {
return (Ox.UI ? $ : Ox.$)('
')
.addClass('ui logo')
.attr({
src: app.fn.getLogoURL()
})
.bind({
click: function() {
app.fn.url(app.fn.url() ? '' : app.user('url'));
}
});
},
page: function(page) {
var $element = Ox.Container();
Ox.get('readme/html/_' + page + '.html', function(html) {
$('
')
.addClass('OxSerif page')
.html(html)
.appendTo($element);
});
return $element;
},
panel: function() {
return Ox.UI
? Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 32}),
size: 32
},
{
element: Ox.Element()
}
],
orientation: 'vertical'
})
.css({opacity: 0})
: Ox.$('
').append(
Ox.$('
').addClass('bar').css({
width: '100%',
height: '32px'
})
);
},
readme: function() {
return Ox.Element();
},
sections: function() {
var $element = (Ox.UI ? $ : Ox.$)('
').addClass('ui sections');
[
'about', 'readme', 'examples', 'doc',
'downloads', 'dev', 'contact'
].forEach(function(section, i) {
Ox.$('
')
.addClass('button' + (
app.user('section') == section ? ' selected' : ''
))
.html(Ox.toTitleCase(
section == 'doc' ? 'documentation'
: section == 'dev' ? 'development'
: section
))
.bind({
click: function() {
app.$ui.sections.children().removeClass('selected');
$(this).addClass('selected');
app.fn.url(section);
}
})
.appendTo($element);
});
return $element;
},
themes: function() {
var $element = (Ox.UI ? $ : Ox.$)('').addClass('ui themes');
['classic', 'modern'].forEach(function(theme, i) {
Ox.$('')
.addClass('button' + (
app.user('theme') == theme ? ' selected' : ''
))
.html(theme == 'classic' ? 'Light' : 'Dark')
.bind({
click: function() {
app.$ui.themes.children().removeClass('selected');
$(this).addClass('selected');
app.fn.setTheme(theme)
}
})
.appendTo($element);
});
return $element;
}
},
user: Ox.localStorage('OxJS'),
};
app.url = app.fn.url();
app.window = app.fn.window();
app.fn.load();
});