add clickLink to video widgets
This commit is contained in:
parent
41e191f217
commit
f2d7beeb22
6 changed files with 23 additions and 4 deletions
|
@ -11,6 +11,7 @@ Ox.ArrayEditable = function(options, self) {
|
||||||
tooltip: 'Doubleclick to add ' + (options.itemName || 'item')
|
tooltip: 'Doubleclick to add ' + (options.itemName || 'item')
|
||||||
}, self)
|
}, self)
|
||||||
.defaults({
|
.defaults({
|
||||||
|
clickLink: null,
|
||||||
editable: true,
|
editable: true,
|
||||||
itemName: 'item',
|
itemName: 'item',
|
||||||
items: [],
|
items: [],
|
||||||
|
@ -118,6 +119,7 @@ Ox.ArrayEditable = function(options, self) {
|
||||||
that.empty();
|
that.empty();
|
||||||
if (self.options.items.length == 0) {
|
if (self.options.items.length == 0) {
|
||||||
Ox.Editable({
|
Ox.Editable({
|
||||||
|
clickLink: self.options.clickLink,
|
||||||
editable: false,
|
editable: false,
|
||||||
type: 'text',
|
type: 'text',
|
||||||
value: self.options.placeholder
|
value: self.options.placeholder
|
||||||
|
@ -135,6 +137,7 @@ Ox.ArrayEditable = function(options, self) {
|
||||||
}
|
}
|
||||||
self.$items[i] = Ox.Editable({
|
self.$items[i] = Ox.Editable({
|
||||||
blurred: self.editing && i == self.selected ? blur : false,
|
blurred: self.editing && i == self.selected ? blur : false,
|
||||||
|
clickLink: self.options.clickLink,
|
||||||
editable: self.options.editable && item.editable,
|
editable: self.options.editable && item.editable,
|
||||||
editing: self.editing && i == self.selected,
|
editing: self.editing && i == self.selected,
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -43,11 +43,18 @@ Ox.Editable = function(options, self) {
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
doubleclick: edit,
|
doubleclick: edit,
|
||||||
singleclick: function(e) {
|
singleclick: function(e) {
|
||||||
if ($(e.target).is('a')) {
|
var $target = $(e.target),
|
||||||
|
$parent = $target.parent();
|
||||||
|
while(!$target.is('a') && !$parent.is('.OxEditableElement')) {
|
||||||
|
$target = $parent;
|
||||||
|
$parent = $target.parent();
|
||||||
|
}
|
||||||
|
if($target.is('a')) {
|
||||||
if (self.options.clickLink) {
|
if (self.options.clickLink) {
|
||||||
|
e.target = $target[0];
|
||||||
self.options.clickLink(e);
|
self.options.clickLink(e);
|
||||||
} else {
|
} else {
|
||||||
document.location.href = $(e.target).attr('href');
|
document.location.href = $target.attr('href');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
self = self || {};
|
self = self || {};
|
||||||
var that = Ox.Element({}, self)
|
var that = Ox.Element({}, self)
|
||||||
.defaults({
|
.defaults({
|
||||||
|
clickLink: null,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
editable: false,
|
editable: false,
|
||||||
id: '',
|
id: '',
|
||||||
|
@ -127,7 +128,8 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
if (!data.id && Ox.getObjectById(self.options.items, self.options.selected).event) {
|
Ox.print('SELECT >>> ', data)
|
||||||
|
if (!data.id && self.options.selected && Ox.getObjectById(self.options.items, self.options.selected).event) {
|
||||||
// only deselect annotation if the event deselect was not
|
// only deselect annotation if the event deselect was not
|
||||||
// caused by switching to an annotation without event
|
// caused by switching to an annotation without event
|
||||||
self.$annotations.options({selected: ''});
|
self.$annotations.options({selected: ''});
|
||||||
|
@ -154,7 +156,7 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
// FIXME: should be select, not selectplace
|
// FIXME: should be select, not selectplace
|
||||||
selectplace: function(data) {
|
selectplace: function(data) {
|
||||||
if (!data.id && Ox.getObjectById(self.options.items, self.options.selected).place) {
|
if (!data.id && self.options.selected && Ox.getObjectById(self.options.items, self.options.selected).place) {
|
||||||
// only deselect annotation if the place deselect was not
|
// only deselect annotation if the place deselect was not
|
||||||
// caused by switching to an annotation without place
|
// caused by switching to an annotation without place
|
||||||
self.$annotations.options({selected: ''});
|
self.$annotations.options({selected: ''});
|
||||||
|
@ -189,6 +191,7 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.$annotations = Ox.ArrayEditable({
|
self.$annotations = Ox.ArrayEditable({
|
||||||
|
clickLink: self.options.clickLink,
|
||||||
editable: self.options.editable,
|
editable: self.options.editable,
|
||||||
items: self.annotations,
|
items: self.annotations,
|
||||||
placeholder: 'No ' + self.options.title,
|
placeholder: 'No ' + self.options.title,
|
||||||
|
|
|
@ -10,6 +10,7 @@ Ox.AnnotationPanel = function(options, self) {
|
||||||
var that = Ox.Element({}, self)
|
var that = Ox.Element({}, self)
|
||||||
.defaults({
|
.defaults({
|
||||||
calendarSize: 256,
|
calendarSize: 256,
|
||||||
|
clickLink: null,
|
||||||
editable: false,
|
editable: false,
|
||||||
font: 'small',
|
font: 'small',
|
||||||
layers: [],
|
layers: [],
|
||||||
|
@ -149,6 +150,7 @@ Ox.AnnotationPanel = function(options, self) {
|
||||||
selected = item ? item.id : '';
|
selected = item ? item.id : '';
|
||||||
self.$folder[i] = Ox.AnnotationFolder(
|
self.$folder[i] = Ox.AnnotationFolder(
|
||||||
Ox.extend({
|
Ox.extend({
|
||||||
|
clickLink: self.options.clickLink,
|
||||||
collapsed: !self.options.showLayers[layer.id],
|
collapsed: !self.options.showLayers[layer.id],
|
||||||
editable: self.options.editable,
|
editable: self.options.editable,
|
||||||
font: self.options.font,
|
font: self.options.font,
|
||||||
|
|
|
@ -25,6 +25,7 @@ Ox.VideoEditor = function(options, self) {
|
||||||
annotationsSize: 256,
|
annotationsSize: 256,
|
||||||
annotationsSort: 'position',
|
annotationsSort: 'position',
|
||||||
censored: [],
|
censored: [],
|
||||||
|
clickLink: null,
|
||||||
cuts: [],
|
cuts: [],
|
||||||
duration: 0,
|
duration: 0,
|
||||||
enableSubtitles: false,
|
enableSubtitles: false,
|
||||||
|
@ -595,6 +596,7 @@ Ox.VideoEditor = function(options, self) {
|
||||||
|
|
||||||
self.$annotationPanel = Ox.AnnotationPanel({
|
self.$annotationPanel = Ox.AnnotationPanel({
|
||||||
calendarSize: self.options.annotationsCalendarSize,
|
calendarSize: self.options.annotationsCalendarSize,
|
||||||
|
clickLink: self.options.clickLink,
|
||||||
editable: true,
|
editable: true,
|
||||||
font: self.options.annotationsFont,
|
font: self.options.annotationsFont,
|
||||||
'in': self.options['in'],
|
'in': self.options['in'],
|
||||||
|
|
|
@ -21,6 +21,7 @@ Ox.VideoPanel = function(options, self) {
|
||||||
annotationsSize: 256,
|
annotationsSize: 256,
|
||||||
annotationsSort: 'position',
|
annotationsSort: 'position',
|
||||||
censored: [],
|
censored: [],
|
||||||
|
clickLink: null,
|
||||||
cuts: [],
|
cuts: [],
|
||||||
duration: 0,
|
duration: 0,
|
||||||
enableSubtitles: false,
|
enableSubtitles: false,
|
||||||
|
@ -168,6 +169,7 @@ Ox.VideoPanel = function(options, self) {
|
||||||
|
|
||||||
self.$annotationPanel = Ox.AnnotationPanel({
|
self.$annotationPanel = Ox.AnnotationPanel({
|
||||||
calendarSize: self.options.annotationsCalendarSize,
|
calendarSize: self.options.annotationsCalendarSize,
|
||||||
|
clickLink: self.options.clickLink,
|
||||||
editable: false,
|
editable: false,
|
||||||
font: self.options.annotationsFont,
|
font: self.options.annotationsFont,
|
||||||
'in': self.options['in'],
|
'in': self.options['in'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue