2013-03-04 08:44:48 +00:00
|
|
|
pandora.ui.mainMenu = function() {
|
|
|
|
var that = Ox.MainMenu({
|
|
|
|
extras: [],
|
|
|
|
id: 'mainMenu',
|
|
|
|
menus: [
|
|
|
|
{
|
|
|
|
'id': 'speedtransMenu',
|
|
|
|
'title': 'Speedtrans',
|
|
|
|
'items': [
|
|
|
|
{ id: 'TestMenu1', title: 'Test Menu Item'},
|
|
|
|
{ id: 'TestMenu2', title: 'Test Menu Itemm'}
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'id': 'fileMenu',
|
|
|
|
'title': 'File',
|
|
|
|
'items': [
|
|
|
|
{ id: 'openLocalFileMenu', title: 'Open Local File', 'file': {
|
|
|
|
'maxFiles': 1
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ id: 'openRemoteFileMenu', title: 'Open online pan.do/ra file'},
|
2013-03-05 11:50:51 +00:00
|
|
|
{ id: 'openSRT', title: 'Load SRT file'},
|
2013-03-04 08:44:48 +00:00
|
|
|
{ id: 'saveFileMenu', title: 'Save File', keyboard: 'shift control s'}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
})
|
|
|
|
.bindKeyboard()
|
|
|
|
.bindEvent({
|
|
|
|
click: function(data) {
|
|
|
|
// Ox.print(data);
|
|
|
|
var selected = data.id;
|
|
|
|
if (data.id == 'saveFileMenu') {
|
|
|
|
pandora.$ui.textArea.speedtrans.save();
|
|
|
|
// speedtrans.saveFile();
|
|
|
|
} else if (data.id == 'openLocalFileMenu') {
|
|
|
|
var file = data.files[0];
|
|
|
|
Ox.oshash(file, function(oshash) {
|
|
|
|
console.log(oshash);
|
|
|
|
var url = window.URL.createObjectURL(file);
|
|
|
|
var options = {
|
|
|
|
'type': 'local',
|
|
|
|
'url': url,
|
|
|
|
'name': oshash
|
|
|
|
}
|
|
|
|
pandora.$ui.textArea.speedtrans.load(options);
|
|
|
|
});
|
|
|
|
//console.log(data.files[0]);
|
|
|
|
|
|
|
|
} else if (data.id == 'openRemoteFileMenu') {
|
2013-03-05 11:50:51 +00:00
|
|
|
pandora.$ui.openRemoteDialog.open();
|
|
|
|
} else if (data.id == 'openSRT') {
|
|
|
|
pandora.$ui.openSRTDialog.open();
|
2013-03-04 08:44:48 +00:00
|
|
|
} else if (data.id == 'TestMenu1') {
|
|
|
|
alert("clicked TestMenu1");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
key_control_shift_s: function() {
|
|
|
|
pandora.$ui.textArea.speedtrans.save();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return that;
|
|
|
|
}
|
|
|
|
|