it/itf/static/js/itf/app.js

42 lines
1.1 KiB
JavaScript

var app = new Ox.App({
apiURL: '/api/',
init: 'hello',
config: 'site.json' //FIXME: shouldn't need this, get data with 'hello' or 'init'.
});
/*
app.api.hell = function() {
setTimeout("app.api.hello()", 1000);
}
*/
app.launch(function(data) {
Ox.theme("classic");
Ox.print(data);
app.$body = $('body');
app.$document = $(document);
app.$window = $(window);
/*
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']
*/
app.$ui = {};
/*
Ox.each(app.constructors, function(i, v) {
app.$ui[v] = app.construct[v]();
});
*/
var wrapper = app.construct.wrapper();
app.$body.css({'opacity': 0});
wrapper.appendTo(app.$body);
app.$body.animate({
'opacity': 1
}, 2000);
});