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()
|
2014-01-22 13:56:04 +00:00
|
|
|
.bindEvent(Ox.extend(pandora.utils.commonKeyboardEvents, {
|
2013-03-04 08:44:48 +00:00
|
|
|
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];
|
2014-01-22 13:56:04 +00:00
|
|
|
pandora.utils.loadLocalFile(file);
|
2013-03-04 08:44:48 +00:00
|
|
|
} 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");
|
|
|
|
}
|
|
|
|
}
|
2014-01-22 13:56:04 +00:00
|
|
|
}));
|
2013-03-04 08:44:48 +00:00
|
|
|
|
|
|
|
return that;
|
|
|
|
}
|
|
|
|
|