pandora/static/js/embedVideoDialog.js

60 lines
1.5 KiB
JavaScript
Raw Normal View History

2012-01-30 23:29:04 +00:00
'use strict';
2013-04-26 10:43:46 +02:00
pandora.ui.embedVideoDialog = function() {
2012-06-10 20:31:02 +02:00
2013-04-26 10:43:46 +02:00
var width = 640,
2012-02-15 00:18:08 +05:30
height = 360,
2013-04-26 10:43:46 +02:00
url = document.location.href + (
2013-07-12 12:32:02 +02:00
document.location.hash ? 'embed' : '#embed'
2013-04-26 10:43:46 +02:00
),
$content = Ox.Element()
.css({margin: '16px'})
2014-02-04 05:52:37 +00:00
.html(Ox._('To embed this clip, use the following HTML:')),
2013-04-26 10:43:46 +02:00
$embed = $('<textarea>')
.css({
2014-02-04 05:52:37 +00:00
width: '322px',
2013-04-26 10:43:46 +02:00
height: '64px',
marginTop: '8px'
})
.val(
'<iframe width="' + width
+ '" height="' + height
+ '" src="' + url
+ '" frameborder="0" '
2013-09-03 15:43:16 +02:00
+ 'allowfullscreen></iframe>'
2013-04-26 10:43:46 +02:00
)
.on({
click: function() {
this.focus();
this.select();
}
})
.appendTo($content),
2012-01-30 23:29:04 +00:00
that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'close',
2013-05-09 10:13:58 +00:00
title: Ox._('Close')
2012-01-30 23:29:04 +00:00
}).bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
2013-04-26 10:43:46 +02:00
content: $content,
fixedSize: true,
height: 128,
keys: {escape: 'close'},
2012-02-15 09:23:30 +00:00
removeOnClose: true,
2013-05-09 10:13:58 +00:00
title: Ox._('Embed Video'),
2013-04-26 10:43:46 +02:00
width: 368
2012-02-15 11:56:41 +05:30
});
2012-01-30 23:29:04 +00:00
return that;
2012-06-10 20:31:02 +02:00
2012-01-30 23:29:04 +00:00
};