oxspeed/js/speedtrans.js

59 lines
1.5 KiB
JavaScript
Raw Normal View History

2011-12-24 10:18:48 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
(function() {
2011-12-29 23:01:23 +00:00
Ox.load({
UI: {
2012-01-06 12:24:12 +00:00
// theme: 'modern' //FIXME: get theme through localStorage
2011-12-29 23:01:23 +00:00
}
}, loadSpeedtrans);
2011-12-24 10:18:48 +00:00
function loadSpeedtrans(browserSupported) {
2012-01-06 12:24:12 +00:00
alert("hi");
2011-12-24 10:18:48 +00:00
if (!browserSupported) { alert("your browser is not supported"); return; }
2011-12-29 23:01:23 +00:00
window.pandora = Ox.App({url: '/api/'}).bindEvent({
'load': function(data) {
// console.log(data);
Ox.extend(pandora, {
$ui: {
body: $('body'),
document: $(document),
window: $(window).resize(function() {
pandora.resizeWindow();
})
},
ui: {},
site: {},
user: {}
});
pandora.resizeWindow = function() {
pandora.$ui.textArea.options({
'width': pandora.$ui.textPanel.width() - 20,
'height': pandora.$ui.textPanel.height() - 40
});
}
var prefix = "/speedtrans/js/";
Ox.loadFile(prefix + "pandora-ui.js", function() {
initSpeedtrans(data);
});
}
});
2011-12-24 10:18:48 +00:00
}
function initSpeedtrans(data) {
2011-12-29 23:01:23 +00:00
pandora.$ui.appPanel = pandora.ui.appPanel().appendTo(pandora.$ui.body);
pandora.resizeWindow();
2011-12-24 10:18:48 +00:00
}
2011-12-29 23:01:23 +00:00
2011-12-24 10:18:48 +00:00
})();
2011-12-29 23:01:23 +00:00