55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
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'},
|
|
{ id: 'openSRT', title: 'Load SRT file'},
|
|
{ id: 'saveFileMenu', title: 'Save File', keyboard: 'shift control s'}
|
|
]
|
|
}
|
|
|
|
]
|
|
})
|
|
.bindKeyboard()
|
|
.bindEvent(Ox.extend(pandora.utils.commonKeyboardEvents, {
|
|
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];
|
|
pandora.utils.loadLocalFile(file);
|
|
} else if (data.id == 'openRemoteFileMenu') {
|
|
pandora.$ui.openRemoteDialog.open();
|
|
} else if (data.id == 'openSRT') {
|
|
pandora.$ui.openSRTDialog.open();
|
|
} else if (data.id == 'TestMenu1') {
|
|
alert("clicked TestMenu1");
|
|
}
|
|
}
|
|
}));
|
|
|
|
return that;
|
|
}
|
|
|