pandora/static/js/embedVideoDialog.js

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2012-01-30 23:29:04 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
2013-04-26 08:43:46 +00:00
pandora.ui.embedVideoDialog = function() {
2012-06-10 18:31:02 +00:00
2013-04-26 08:43:46 +00:00
var width = 640,
2012-02-14 18:48:08 +00:00
height = 360,
2013-04-26 08:43:46 +00:00
url = document.location.href + (
2013-07-12 10:32:02 +00:00
document.location.hash ? 'embed' : '#embed'
2013-04-26 08:43:46 +00:00
),
$content = Ox.Element()
.css({margin: '16px'})
2013-05-09 10:13:58 +00:00
.html(Ox._('To embed this clip, use the following HTML:<br>')),
2013-04-26 08:43:46 +00:00
$embed = $('<textarea>')
.css({
width: '336px',
height: '64px',
marginTop: '8px'
})
.val(
'<iframe width="' + width
+ '" height="' + height
+ '" src="' + url
+ '" frameborder="0" '
2013-09-03 13:43:16 +00:00
+ 'allowfullscreen></iframe>'
2013-04-26 08:43:46 +00: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 08:43:46 +00: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 08:43:46 +00:00
width: 368
2012-02-15 06:26:41 +00:00
});
2012-01-30 23:29:04 +00:00
return that;
2012-06-10 18:31:02 +00:00
2012-01-30 23:29:04 +00:00
};