oxspeed/js/ui/openRemoteDialog.js
2013-03-04 14:14:48 +05:30

63 lines
1.8 KiB
JavaScript

pandora.ui.openRemoteDialog = function() {
// var $inputs = Ox.InputGroup({
// 'inputs': [
// Ox.Input({
// 'label': 'Pan.do/ra instance URL',
// 'id': 'pandoraInstance',
// 'width': 250
// }),
// Ox.Input({
// 'label': 'Pan.do/ra Video ID',
// 'id': 'pandoraID',
// 'width': 250
// })
// ],
// 'width': 250
// });
//FIXME: convert to SelectInput
var $input1 = Ox.Input({
'label': 'Pan.do/ra instance URL',
'id': 'pandoraInstance',
'labelWidth': 250,
'width': 600
}).css({'margin': '4px'});
var $input2 = Ox.Input({
'label': 'Pan.do/ra Video ID',
'id': 'pandoraID',
'labelWidth': 250,
'width': 600
}).css({'margin': '4px'});
var $content = Ox.Element().append($input1).append($input2);
var that = Ox.Dialog({
'content': $content.css({'padding': '12px'}),
'buttons': [
Ox.Button({
'group': true,
'id': 'loadRemoteVideoButton',
'title': 'Load Video'
}).bindEvent("click", function() {
var pandoraInstance = $input1.value();
var pandoraID = $input2.value();
var base_url = pandoraInstance + "/" + pandoraID;
var options = {
'name': base_url,
'url': base_url + "/480p.webm",
'type': 'remote'
};
pandora.$ui.textArea.speedtrans.load(options);
that.close();
})
],
'closeButton': true,
'title': 'Open Remote Video',
'width': 700,
'fixedSize': true
});
return that;
};