add linkVideoDialog
This commit is contained in:
parent
e05f918666
commit
70d362e655
1 changed files with 55 additions and 0 deletions
55
static/js/linkVideoDialog.js
Normal file
55
static/js/linkVideoDialog.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||
'use strict';
|
||||
|
||||
pandora.ui.linkVideoDialog = function() {
|
||||
|
||||
var ui = pandora.user.ui,
|
||||
|
||||
url = '/' + ui.item + '/480p' + ui.videoPoints[ui.item]['in'] + '.jpg',
|
||||
|
||||
$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(
|
||||
'<a href="' + document.location.href
|
||||
+ '"><img src="' + url + '"></a>'
|
||||
)
|
||||
.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;
|
||||
|
||||
};
|
Loading…
Reference in a new issue