' + app.data.version + '.
'
}
]
},
resize: function() {
[
'logo', 'loading', 'label', 'menu', 'switch'
].forEach(function(element) {
app.$ui[element] && app.$ui[element].css(app.getCSS(element));
});
},
setTheme: function(theme) {
app.user({theme: theme});
(Ox.$('#icon') || Ox.$('').attr({
id: 'icon',
rel: 'shortcut icon',
type: 'image/png'
}).appendTo(Ox.$('head'))).attr({
href: app.getSRC('icon')
});
app.$ui.logo && app.$ui.logo
.attr({src: app.getSRC('logo')})
.css(app.getCSS('logo'));
Ox.Theme
? Ox.Theme(theme)
: Ox.$('body').addClass('OxTheme' + Ox.toTitleCase(theme)
);
},
ui: {
doc: function() {
return Ox.DocPanel({
files: app.data.documentation,
getModule: function(item) {
var file = item.file.replace(/^dev\//, '');
return file.split('/')[0];
},
getSection: function(item) {
var file = item.file.replace(/^dev\//, '');
return item.section || file.split('/')[2].split('.')[0];
},
path: 'dev/',
replace: [app.re.code],
});
},
examples: function() {
return Ox.ExamplePanel({
examples: app.data.examples,
keywords: /\b(Ox\.[\w]+)\b/g,
path: 'examples/',
replaceCode: [app.re.code],
replaceComment: [app.re.comment],
selected: ''
})
.bindEvent({
select: function(data) {
app.url.push(
'examples' + (data.id ? '/' + data.id : '')
)
}
});
},
label: function() {
return Ox.Label({
textAlign: 'center',
title: 'A JavaScript Library for Web Applications',
width: 256
})
.addClass('label animate')
.bindEvent({
anyclick: function() {
app.url.set(app.url.get() ? '' : app.user('url'));
}
});
},
loading: function() {
return Ox.$('')
.addClass('loading')
.attr({src: app.getSRC('loading')})
.css(app.getCSS('loading'));
},
logo: function() {
return Ox.$('')
.addClass('logo animate')
.attr({src: app.getSRC('logo')})
.css(app.getCSS('logo'));
},
menu: function() {
return Ox.ButtonGroup({
buttons: app.data.sections,
min: 0,
selectable: true,
})
.addClass('menu animate')
.bindEvent({
change: function(data) {
data.value && app.url.set(data.value);
}
})
},
page: function(page, replace) {
var $element = Ox.Container();
Ox.get('readme/html/_' + page + '.html', function(html) {
$('