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) {
|
2014-01-22 13:56:04 +00:00
|
|
|
console.log("loaded speedtrans");
|
2011-12-24 10:18:48 +00:00
|
|
|
if (!browserSupported) { alert("your browser is not supported"); return; }
|
2013-03-04 08:25:54 +00:00
|
|
|
window.pandora = {
|
|
|
|
'load': function() {
|
2011-12-29 23:01:23 +00:00
|
|
|
// console.log(data);
|
|
|
|
|
|
|
|
Ox.extend(pandora, {
|
|
|
|
$ui: {
|
|
|
|
body: $('body'),
|
|
|
|
document: $(document),
|
|
|
|
window: $(window).resize(function() {
|
|
|
|
pandora.resizeWindow();
|
|
|
|
})
|
|
|
|
},
|
2012-01-08 18:45:28 +00:00
|
|
|
storage: Ox.localStorage("speedtrans"),
|
2011-12-29 23:01:23 +00:00
|
|
|
ui: {},
|
|
|
|
site: {},
|
2014-01-22 13:56:04 +00:00
|
|
|
state: {},
|
2011-12-29 23:01:23 +00:00
|
|
|
user: {}
|
|
|
|
|
|
|
|
});
|
|
|
|
pandora.resizeWindow = function() {
|
|
|
|
pandora.$ui.textArea.options({
|
|
|
|
'width': pandora.$ui.textPanel.width() - 20,
|
|
|
|
'height': pandora.$ui.textPanel.height() - 40
|
|
|
|
});
|
2014-01-22 13:56:04 +00:00
|
|
|
};
|
2013-03-04 08:25:54 +00:00
|
|
|
var prefix = "js/";
|
2014-01-22 13:56:04 +00:00
|
|
|
var files = ['appPanel', 'mainMenu', 'mainPanel', 'videoPanel', 'annotationsPanel', 'videoPlayer', 'openRemoteDialog', 'openSRTDialog', 'newSRTDialog', 'selectAnnotationType', 'helpPanel', 'textPanel', 'textArea', 'textToolBar', 'utils'];
|
2013-03-04 08:44:48 +00:00
|
|
|
var prefix = "js/ui/";
|
|
|
|
var filesToLoad = Ox.map(files, function(v) {
|
|
|
|
return prefix + v + ".js";
|
|
|
|
});
|
|
|
|
//console.log(filesToLoad);
|
|
|
|
Ox.getFile(filesToLoad, function() {
|
2014-01-22 13:56:04 +00:00
|
|
|
console.log("got filed");
|
2013-03-04 08:25:54 +00:00
|
|
|
initSpeedtrans();
|
2011-12-29 23:01:23 +00:00
|
|
|
});
|
|
|
|
}
|
2013-03-04 08:25:54 +00:00
|
|
|
};
|
|
|
|
pandora.load();
|
2011-12-24 10:18:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function initSpeedtrans(data) {
|
2014-01-22 13:56:04 +00:00
|
|
|
console.log("init speedtrans");
|
|
|
|
var $loadButton = Ox.FileInput({
|
|
|
|
maxFiles: 1,
|
|
|
|
width: 512
|
|
|
|
})
|
|
|
|
.bindEvent("change", function(data) {
|
|
|
|
console.log(data);
|
|
|
|
var file = data.value[0];
|
|
|
|
this.remove();
|
|
|
|
pandora.$ui.appPanel.appendTo(pandora.$ui.body);
|
|
|
|
pandora.utils.loadLocalFile(file);
|
|
|
|
pandora.resizeWindow();
|
|
|
|
}).appendTo(pandora.$ui.body);
|
|
|
|
|
|
|
|
pandora.$ui.appPanel = pandora.ui.appPanel() //.appendTo(pandora.$ui.body);
|
2013-03-05 11:50:51 +00:00
|
|
|
pandora.$ui.openRemoteDialog = pandora.ui.openRemoteDialog();
|
|
|
|
pandora.$ui.openSRTDialog = pandora.ui.openSRTDialog();
|
2011-12-29 23:01:23 +00:00
|
|
|
pandora.resizeWindow();
|
2014-01-22 13:56:04 +00:00
|
|
|
//console.log("am here");
|
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
|
|
|
|