oxspeed/js/speedtrans.js

61 lines
1.6 KiB
JavaScript
Raw Normal View History

2011-12-24 15:48:48 +05:30
// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
(function() {
2011-12-30 04:31:23 +05:30
Ox.load({
UI: {
2012-01-06 17:54:12 +05:30
// theme: 'modern' //FIXME: get theme through localStorage
2011-12-30 04:31:23 +05:30
}
}, loadSpeedtrans);
2011-12-24 15:48:48 +05:30
function loadSpeedtrans(browserSupported) {
2012-01-09 00:15:28 +05:30
2011-12-24 15:48:48 +05:30
if (!browserSupported) { alert("your browser is not supported"); return; }
window.pandora = {
'load': function() {
2011-12-30 04:31:23 +05:30
// console.log(data);
Ox.extend(pandora, {
$ui: {
body: $('body'),
document: $(document),
window: $(window).resize(function() {
pandora.resizeWindow();
})
},
2012-01-09 00:15:28 +05:30
storage: Ox.localStorage("speedtrans"),
2011-12-30 04:31:23 +05:30
ui: {},
site: {},
user: {}
});
pandora.resizeWindow = function() {
pandora.$ui.textArea.options({
'width': pandora.$ui.textPanel.width() - 20,
'height': pandora.$ui.textPanel.height() - 40
});
}
var prefix = "js/";
Ox.getFile([prefix + "pandora-ui.js"], function() {
initSpeedtrans();
2011-12-30 04:31:23 +05:30
});
}
};
pandora.load();
2011-12-24 15:48:48 +05:30
}
function initSpeedtrans(data) {
2011-12-30 04:31:23 +05:30
pandora.$ui.appPanel = pandora.ui.appPanel().appendTo(pandora.$ui.body);
pandora.resizeWindow();
2011-12-24 15:48:48 +05:30
}
2011-12-30 04:31:23 +05:30
2011-12-24 15:48:48 +05:30
})();
2011-12-30 04:31:23 +05:30