pandora/static/js/linkVideoDialog.js

61 lines
1.7 KiB
JavaScript
Raw Permalink Normal View History

2014-06-06 11:20:49 +00:00
'use strict';
pandora.ui.linkVideoDialog = function() {
var ui = pandora.user.ui,
2014-06-06 11:41:42 +00:00
href = (pandora.site.site.https ? 'https' : 'http') + '://'
+ pandora.site.site.url + '/' + ui.item + '/'
2014-06-06 11:33:57 +00:00
+ ui.videoPoints[ui.item]['in'] + ','
+ ui.videoPoints[ui.item]['out'],
2014-06-06 11:46:02 +00:00
src = (pandora.site.site.https ? 'https' : 'http') + '://'
+ pandora.site.site.url + '/' + ui.item
+ '/480p' + ui.videoPoints[ui.item]['in'] + '.jpg',
2014-06-06 11:20:49 +00:00
$content = Ox.Element()
.css({margin: '16px'})
.html(Ox._('To link to this clip, use the following HTML:')),
$embed = $('<textarea>')
.css({
width: '322px',
height: '64px',
marginTop: '8px'
})
.val(
2014-06-06 11:33:57 +00:00
'<a href="' + href + '"><img src="' + src + '"></a>'
2014-06-06 11:20:49 +00:00
)
.on({
click: function() {
this.focus();
this.select();
}
})
.appendTo($content),
that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'close',
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: $content,
fixedSize: true,
height: 128,
keys: {escape: 'close'},
removeOnClose: true,
title: Ox._('Link to Video'),
width: 368
});
return that;
};