2011-01-19 08:05:08 +00:00
|
|
|
var app = new Ox.App({
|
|
|
|
apiURL: '/api/',
|
2011-02-01 15:13:30 +00:00
|
|
|
init: 'init',
|
2011-01-19 08:05:08 +00:00
|
|
|
config: 'site.json' //FIXME: shouldn't need this, get data with 'hello' or 'init'.
|
|
|
|
});
|
|
|
|
|
|
|
|
app.launch(function(data) {
|
|
|
|
Ox.theme("classic");
|
|
|
|
Ox.print(data);
|
2011-02-01 15:13:30 +00:00
|
|
|
|
2011-01-19 08:05:08 +00:00
|
|
|
/*
|
|
|
|
app.user = data.user;
|
|
|
|
app.config = data.config;
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
//FIXME: should this be a nested structure as their representation on the page?
|
|
|
|
app.constructors = ['wrapper', 'headerPanel', 'mainPanel', 'leftPanel', 'cityPicker', 'calendarBox', 'currentEventsList', 'middlePanel', 'middleTopPanel', 'newsfeedBox', 'aboutBox', 'itfBox', 'middleBottomPanel', 'erangBox', 'scriptArchiveBox', 'bestPracticesBox', 'biblioBox', 'offersNeedsBox', 'surveysBox', 'rightPanel', 'searchBox', 'loginBox', 'previewBox', 'footerPanel']
|
|
|
|
*/
|
|
|
|
|
2011-04-10 02:00:43 +00:00
|
|
|
|
2011-01-19 08:05:08 +00:00
|
|
|
app.$ui = {};
|
2011-04-10 02:00:43 +00:00
|
|
|
app.$body = $('body');
|
|
|
|
app.$document = $(document);
|
|
|
|
app.$window = $(window);
|
2011-01-19 08:05:08 +00:00
|
|
|
/*
|
|
|
|
Ox.each(app.constructors, function(i, v) {
|
|
|
|
app.$ui[v] = app.construct[v]();
|
|
|
|
});
|
|
|
|
*/
|
2011-04-10 02:00:43 +00:00
|
|
|
// Ox.print("BOO", data);
|
|
|
|
app.api.getPage({}, function(data) {
|
|
|
|
var wrapper = app.construct.wrapper(data.data);
|
|
|
|
app.$body.css({'opacity': 0});
|
|
|
|
//FIXME: user handling should be cleaner?
|
|
|
|
|
|
|
|
wrapper.appendTo(app.$body);
|
|
|
|
/*
|
|
|
|
if (data.user.level != 'guest') {
|
|
|
|
ITF.login(data);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
app.$window.resize(function() {
|
|
|
|
ITF.setSizes();
|
|
|
|
});
|
|
|
|
ITF.setSizes();
|
|
|
|
*/
|
|
|
|
app.$body.animate({
|
|
|
|
'opacity': 1
|
|
|
|
}, 2000);
|
|
|
|
});
|
2011-01-19 08:05:08 +00:00
|
|
|
});
|