forked from 0x2620/oxjs
remove new for all Ox.Elements, dont declare arguments again, add some semicolons
This commit is contained in:
parent
3eab11e967
commit
b27ed00356
69 changed files with 430 additions and 440 deletions
|
|
@ -16,8 +16,8 @@ Ox.AnnotationPanel <f:Ox.Element> AnnotationPanel Object
|
|||
|
||||
Ox.AnnotationPanel = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
id: '',
|
||||
items: [],
|
||||
|
|
@ -29,10 +29,10 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
|
||||
self.selected = -1;
|
||||
|
||||
that.$element = new Ox.CollapsePanel({
|
||||
that.$element = Ox.CollapsePanel({
|
||||
collapsed: false,
|
||||
extras: self.options.editable ? [
|
||||
new Ox.Button({
|
||||
Ox.Button({
|
||||
id: 'add',
|
||||
style: 'symbol',
|
||||
title: 'add',
|
||||
|
|
@ -53,9 +53,9 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
});
|
||||
that.$content = that.$element.$content;
|
||||
|
||||
self.$annotations = new Ox.List({
|
||||
self.$annotations = Ox.List({
|
||||
construct: function(data) {
|
||||
return new Ox.Element()
|
||||
return Ox.Element()
|
||||
.addClass('OxAnnotation OxEditable OxTarget')
|
||||
.html(Ox.parseHTML(data.value));
|
||||
},
|
||||
|
|
@ -87,11 +87,11 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
.appendTo(that.$content);
|
||||
|
||||
/*
|
||||
self.$annotations = new Ox.Element()
|
||||
self.$annotations = Ox.Element()
|
||||
.appendTo(that.$content);
|
||||
self.$annotation = [];
|
||||
self.options.items.forEach(function(item, i) {
|
||||
self.$annotation[i] = new Ox.Element()
|
||||
self.$annotation[i] = Ox.Element()
|
||||
.addClass('OxAnnotation')
|
||||
.html(item.value.replace(/\n/g, '<br/>'))
|
||||
.click(function() {
|
||||
|
|
@ -141,7 +141,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
that.deselectItems = function() {
|
||||
if(self.$annotations.options('selected'))
|
||||
self.$annotations.options('selected',[]);
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.BlockTimeline <f:Ox.Element> BlockTimeline Object
|
|||
|
||||
Ox.BlockTimeline = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
duration: 0,
|
||||
find: '',
|
||||
|
|
@ -40,7 +40,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
$markerPoint: [],
|
||||
$selection: [],
|
||||
$subtitles: [],
|
||||
$tooltip: new Ox.Tooltip({
|
||||
$tooltip: Ox.Tooltip({
|
||||
animate: false
|
||||
}).css({
|
||||
textAlign: 'center'
|
||||
|
|
@ -94,7 +94,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
|
||||
function addLine(i) {
|
||||
// fixme: get URLs once, not once for every line
|
||||
self.$lines[i] = new Ox.Element()
|
||||
self.$lines[i] = Ox.Element()
|
||||
.css({
|
||||
top: i * (self.height + self.margin) + 'px',
|
||||
width: self.options.width + 'px'
|
||||
|
|
@ -108,7 +108,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
.css({
|
||||
marginLeft: (-i * self.options.width) + 'px'
|
||||
})
|
||||
.appendTo(self.$lines[i].$element)
|
||||
.appendTo(self.$lines[i].$element);
|
||||
if (self.hasSubtitles) {
|
||||
self.subtitlesImageURL = getSubtitlesImageURL();
|
||||
self.$subtitles[i] = $('<img>')
|
||||
|
|
@ -169,7 +169,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
data[index] = color[0];
|
||||
data[index + 1] = color[1];
|
||||
data[index + 2] = color[2];
|
||||
data[index + 3] = color[3]
|
||||
data[index + 3] = color[3];
|
||||
});
|
||||
});
|
||||
context.putImageData(imageData, 0, 0);
|
||||
|
|
@ -213,7 +213,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
data[index] = color[0];
|
||||
data[index + 1] = color[1];
|
||||
data[index + 2] = color[2];
|
||||
data[index + 3] = 128
|
||||
data[index + 3] = 128;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -278,7 +278,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
$target.hasClass('OxTimelineSmallSubtitles') ||
|
||||
$target.hasClass('OxTimelineSmallSelection')
|
||||
) {
|
||||
position = getPosition(e),
|
||||
position = getPosition(e);
|
||||
subtitle = getSubtitle(position);
|
||||
self.$tooltip.options({
|
||||
title: subtitle ?
|
||||
|
|
@ -361,7 +361,7 @@ Ox.BlockTimeline = function(options, self) {
|
|||
//Ox.print('key', key, 'value', value)
|
||||
setMarkerPoint(0);
|
||||
setMarkerPoint(1);
|
||||
updateSelection()
|
||||
updateSelection();
|
||||
} else if (key == 'position') {
|
||||
setPosition();
|
||||
} else if (key == 'width') {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
Ox.BlockVideoTimeline = function(options, self) {
|
||||
|
||||
self = self || {};
|
||||
var that = new Ox.Element({}, self)
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
duration: 0,
|
||||
find: '',
|
||||
|
|
@ -32,7 +33,7 @@ Ox.BlockVideoTimeline = function(options, self) {
|
|||
self.$images = [];
|
||||
self.$interfaces = [];
|
||||
self.$lines = [];
|
||||
self.$tooltip = new Ox.Tooltip({
|
||||
self.$tooltip = Ox.Tooltip({
|
||||
animate: false
|
||||
}).css({
|
||||
textAlign: 'center'
|
||||
|
|
@ -263,7 +264,7 @@ Ox.BlockVideoTimeline = function(options, self) {
|
|||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'in' || key == 'out') {
|
||||
setPoint(key)
|
||||
setPoint(key);
|
||||
} else if (key == 'position') {
|
||||
setPositionMarker();
|
||||
} else if (key == 'results') {
|
||||
|
|
@ -271,8 +272,8 @@ Ox.BlockVideoTimeline = function(options, self) {
|
|||
} else if (key == 'width') {
|
||||
setWidth();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
Ox.Flipbook = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
frame = $('<img>').css({
|
||||
self = self || {};
|
||||
var frame = $('<img>').css({
|
||||
'position': 'absolute',
|
||||
'width': '100%',
|
||||
'height': 'auto'
|
||||
|
|
@ -22,7 +22,7 @@ Ox.Flipbook = function(options, self) {
|
|||
'width': '100%'
|
||||
})
|
||||
.hide(),
|
||||
that = new Ox.Element({}, self)
|
||||
that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
frames: {},
|
||||
duration: 0,
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.LargeTimeline <f:Ox.Element> LargeTimeline Object
|
|||
|
||||
Ox.LargeTimeline = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
cuts: [],
|
||||
duration: 0,
|
||||
|
|
@ -40,7 +40,7 @@ Ox.LargeTimeline = function(options, self) {
|
|||
$markerPoint: [],
|
||||
$subtitles: [],
|
||||
$tiles: {},
|
||||
$tooltip: new Ox.Tooltip({
|
||||
$tooltip: Ox.Tooltip({
|
||||
animate: false
|
||||
}),
|
||||
center: parseInt(self.options.width / 2),
|
||||
|
|
@ -55,7 +55,7 @@ Ox.LargeTimeline = function(options, self) {
|
|||
.css({
|
||||
left: self.center + 'px'
|
||||
})
|
||||
.appendTo(that.$element)
|
||||
.appendTo(that.$element);
|
||||
|
||||
self.options.subtitles.forEach(function(v, i) {
|
||||
self.$subtitles[i] = $('<div>')
|
||||
|
|
@ -65,7 +65,7 @@ Ox.LargeTimeline = function(options, self) {
|
|||
width: (((v['out'] - v['in']) * self.fps) - 2) + 'px'
|
||||
})
|
||||
.html(Ox.highlight(v.value, self.options.find, 'OxHighlight'))
|
||||
.appendTo(self.$timeline)
|
||||
.appendTo(self.$timeline);
|
||||
});
|
||||
|
||||
self.options.cuts.forEach(function(v, i) {
|
||||
|
|
@ -77,7 +77,7 @@ Ox.LargeTimeline = function(options, self) {
|
|||
.css({
|
||||
left: (v * self.fps) + 'px'
|
||||
})
|
||||
.appendTo(self.$timeline)
|
||||
.appendTo(self.$timeline);
|
||||
});
|
||||
|
||||
self.$markerPosition = $('<img>')
|
||||
|
|
@ -124,7 +124,7 @@ Ox.LargeTimeline = function(options, self) {
|
|||
}
|
||||
|
||||
function getPosition(e) {
|
||||
return self.options.position + (e.clientX - that.offset().left - self.center - 1) / self.fps
|
||||
return self.options.position + (e.clientX - that.offset().left - self.center - 1) / self.fps;
|
||||
}
|
||||
|
||||
function mouseleave(e) {
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.LargeVideoTimeline <f:Ox.Element> LargeTimeline Object
|
|||
|
||||
Ox.LargeVideoTimeline = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
cuts: [],
|
||||
duration: 0,
|
||||
|
|
@ -41,7 +41,7 @@ Ox.LargeVideoTimeline = function(options, self) {
|
|||
$cuts: [],
|
||||
$pointMarker: {},
|
||||
$tiles: {},
|
||||
$tooltip: new Ox.Tooltip({
|
||||
$tooltip: Ox.Tooltip({
|
||||
animate: false
|
||||
}),
|
||||
center: parseInt(self.options.width / 2),
|
||||
|
|
@ -117,7 +117,7 @@ Ox.LargeVideoTimeline = function(options, self) {
|
|||
}
|
||||
|
||||
function getPosition(e) {
|
||||
return self.options.position + (e.clientX - that.offset().left - self.center - 1) / self.fps
|
||||
return self.options.position + (e.clientX - that.offset().left - self.center - 1) / self.fps;
|
||||
}
|
||||
|
||||
function mouseleave(e) {
|
||||
|
|
@ -182,7 +182,7 @@ Ox.LargeVideoTimeline = function(options, self) {
|
|||
width: (((subtitle.out - subtitle['in']) * self.fps) - 2) + 'px'
|
||||
})
|
||||
.html(Ox.highlight(subtitle.text, self.options.find, 'OxHighlight'))
|
||||
.appendTo(self.$timeline)
|
||||
.appendTo(self.$timeline);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.SmallTimeline <f:Ox.Element> SmallTimeline Object
|
|||
|
||||
Ox.SmallTimeline = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
duration: 0,
|
||||
find: '',
|
||||
|
|
@ -38,7 +38,7 @@ Ox.SmallTimeline = function(options, self) {
|
|||
$images: [],
|
||||
$markerPoint: [],
|
||||
$subtitles: [],
|
||||
$tooltip: new Ox.Tooltip({
|
||||
$tooltip: Ox.Tooltip({
|
||||
animate: false
|
||||
}).css({
|
||||
textAlign: 'center'
|
||||
|
|
@ -135,7 +135,7 @@ Ox.SmallTimeline = function(options, self) {
|
|||
$target.hasClass('OxTimelineSmallImage') ||
|
||||
$target.hasClass('OxTimelineSmallSubtitles')
|
||||
) {
|
||||
position = getPosition(e),
|
||||
position = getPosition(e);
|
||||
subtitle = getSubtitle(position);
|
||||
self.$tooltip.options({
|
||||
title: subtitle ?
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ Ox.SmallVideoTimelineImage = function(options, self) {
|
|||
self.$subtitles.css({width: value + 'px'});
|
||||
self.$timeline.css({width: value + 'px'});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.VideoEditor <f:Ox.Element> VideoEditor Object
|
|||
|
||||
Ox.VideoEditor = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
annotationsSize: 0,
|
||||
cuts: [],
|
||||
|
|
@ -97,10 +97,10 @@ Ox.VideoEditor = function(options, self) {
|
|||
// toggleSize
|
||||
},
|
||||
key_shift_comma: function() {
|
||||
movePositionTo('match', -1)
|
||||
movePositionTo('match', -1);
|
||||
},
|
||||
key_shift_dot: function() {
|
||||
movePositionTo('match', 1)
|
||||
movePositionTo('match', 1);
|
||||
},
|
||||
key_shift_down: function() {
|
||||
movePositionBy(self.options.duration);
|
||||
|
|
@ -143,7 +143,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
videoRatio: self.options.videoWidth / self.options.videoHeight
|
||||
});
|
||||
|
||||
self.words = []
|
||||
self.words = [];
|
||||
Ox.forEach(Ox.count(Ox.words(self.options.subtitles.map(function(subtitle) {
|
||||
return subtitle.text;
|
||||
}).join(' '))), function(count, word) {
|
||||
|
|
@ -155,7 +155,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
return obj.word;
|
||||
});
|
||||
|
||||
self.$editor = new Ox.Element()
|
||||
self.$editor = Ox.Element()
|
||||
.addClass('OxVideoEditor')
|
||||
.click(function(e) {
|
||||
var $target = $(e.target);
|
||||
|
|
@ -165,7 +165,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
self.sizes = getSizes();
|
||||
|
||||
['play', 'in', 'out'].forEach(function(type, i) {
|
||||
self.$player[i] = new Ox.VideoPlayer({
|
||||
self.$player[i] = Ox.VideoPlayer({
|
||||
controlsBottom: type == 'play' ?
|
||||
['play', 'playInToOut', 'volume', 'size', 'space', 'position'] :
|
||||
['goto', 'set', 'space', 'position'],
|
||||
|
|
@ -207,7 +207,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.appendTo(self.$editor);
|
||||
});
|
||||
|
||||
self.$timeline[0] = new Ox.LargeVideoTimeline({
|
||||
self.$timeline[0] = Ox.LargeVideoTimeline({
|
||||
cuts: self.options.cuts,
|
||||
duration: self.options.duration,
|
||||
find: self.options.find,
|
||||
|
|
@ -228,7 +228,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.bindEvent('position', changeTimelineLarge)
|
||||
.appendTo(self.$editor);
|
||||
|
||||
self.$timeline[1] = new Ox.BlockVideoTimeline({
|
||||
self.$timeline[1] = Ox.BlockVideoTimeline({
|
||||
cuts: self.options.cuts,
|
||||
duration: self.options.duration,
|
||||
find: self.options.find,
|
||||
|
|
@ -249,14 +249,14 @@ Ox.VideoEditor = function(options, self) {
|
|||
.bindEvent('position', changeTimelineSmall)
|
||||
.appendTo(self.$editor);
|
||||
|
||||
self.$annotations = new Ox.Element()
|
||||
self.$annotations = Ox.Element()
|
||||
.css({
|
||||
overflowY: 'auto'
|
||||
});
|
||||
self.$annotationPanel = [];
|
||||
|
||||
self.options.layers.forEach(function(layer, i) {
|
||||
self.$annotationPanel[i] = new Ox.AnnotationPanel(
|
||||
self.$annotationPanel[i] = Ox.AnnotationPanel(
|
||||
$.extend({
|
||||
width: self.options.annotationSize
|
||||
}, layer)
|
||||
|
|
@ -352,7 +352,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.html(shortcut.action)
|
||||
)
|
||||
);
|
||||
})
|
||||
});
|
||||
|
||||
self.$videoMenuButton = Ox.Select({
|
||||
items: Ox.merge([
|
||||
|
|
@ -401,7 +401,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.appendTo(self.$videobar);
|
||||
self.$videoMenuButton.find('input').attr({
|
||||
src: Ox.UI.getImagePath('symbolSet.svg')
|
||||
})
|
||||
});
|
||||
|
||||
self.$selectButton = Ox.Button({
|
||||
style: 'symbol',
|
||||
|
|
@ -413,7 +413,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
click: function() {
|
||||
self.$menuButton.find('input').trigger('click')
|
||||
}
|
||||
})
|
||||
});
|
||||
//.appendTo(self.$videobar);
|
||||
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
change: function() {
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
//.appendTo(self.$videobar);
|
||||
|
||||
|
||||
|
|
@ -441,7 +441,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.css({float: 'left'})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
setPosition(self.options.posterFrame)
|
||||
setPosition(self.options.posterFrame);
|
||||
}
|
||||
})
|
||||
.appendTo(self.$videobar);
|
||||
|
|
@ -517,7 +517,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
}
|
||||
})
|
||||
.appendTo(self.$videobar);
|
||||
self.$findInput.find('input').css({background: 'transparent'})
|
||||
self.$findInput.find('input').css({background: 'transparent'});
|
||||
|
||||
self.$findButton = Ox.Button({
|
||||
//disabled: true,
|
||||
|
|
@ -531,7 +531,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
click: function() {
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
//.appendTo(self.$videobar);
|
||||
|
||||
self.$nextButton = Ox.Button({
|
||||
|
|
@ -544,7 +544,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.css({float: 'right'})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
setPosition(getNextPosition('result', 1))
|
||||
setPosition(getNextPosition('result', 1));
|
||||
}
|
||||
})
|
||||
.appendTo(self.$videobar);
|
||||
|
|
@ -559,7 +559,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.css({float: 'right'})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
setPosition(getNextPosition('result', -1))
|
||||
setPosition(getNextPosition('result', -1));
|
||||
}
|
||||
})
|
||||
.appendTo(self.$videobar);
|
||||
|
|
@ -597,7 +597,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
.appendTo(self.$annotationsbar);
|
||||
self.$annotationsMenuButton.find('input').attr({
|
||||
src: Ox.UI.getImagePath('symbolSet.svg')
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
that.$element = Ox.SplitPanel({
|
||||
|
|
@ -767,7 +767,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
top: self.margin / 2,
|
||||
width: widths[i],
|
||||
height: Math.round(widths[1] / self.videoRatio)
|
||||
}
|
||||
};
|
||||
width += widths[i];
|
||||
});
|
||||
} else {
|
||||
|
|
@ -775,32 +775,32 @@ Ox.VideoEditor = function(options, self) {
|
|||
left: self.margin / 2,
|
||||
top: self.margin / 2,
|
||||
width: Math.round((contentWidth - 3 * self.margin + (self.controlsHeight + self.margin) / 2 * self.videoRatio) * 2/3),
|
||||
}
|
||||
};
|
||||
size.player[0].height = Math.round(size.player[0].width / self.videoRatio);
|
||||
size.player[1] = {
|
||||
left: size.player[0].left + size.player[0].width + self.margin,
|
||||
top: size.player[0].top,
|
||||
width: contentWidth - 3 * self.margin - size.player[0].width
|
||||
}
|
||||
size.player[1].height = Math.ceil(size.player[1].width / self.videoRatio)
|
||||
};
|
||||
size.player[1].height = Math.ceil(size.player[1].width / self.videoRatio);
|
||||
size.player[2] = {
|
||||
left: size.player[1].left,
|
||||
top: size.player[0].top + size.player[1].height + self.controlsHeight + self.margin,
|
||||
width: size.player[1].width,
|
||||
height: size.player[0].height - size.player[1].height - self.controlsHeight - self.margin
|
||||
}
|
||||
};
|
||||
}
|
||||
size.timeline[0] = {
|
||||
left: self.margin / 2,
|
||||
top: size.player[0].height + self.controlsHeight + 1.5 * self.margin,
|
||||
width: contentWidth - 2 * self.margin,
|
||||
height: 64
|
||||
}
|
||||
};
|
||||
size.timeline[1] = {
|
||||
left: size.timeline[0].left,
|
||||
top: size.timeline[0].top + size.timeline[0].height + self.margin,
|
||||
width: size.timeline[0].width
|
||||
}
|
||||
};
|
||||
lines = Math.ceil(self.options.duration / size.timeline[1].width);
|
||||
height = getHeight();
|
||||
self.$editor.css({
|
||||
|
|
@ -1000,12 +1000,12 @@ Ox.VideoEditor = function(options, self) {
|
|||
that.addAnnotation = function(layer, item) {
|
||||
var i = Ox.getPositionById(self.options.layers, layer);
|
||||
self.$annotationPanel[i].addItem(item);
|
||||
}
|
||||
};
|
||||
|
||||
that.removeAnnotations = function(layer, ids) {
|
||||
var i = Ox.getPositionById(self.options.layers, layer);
|
||||
self.$annotationPanel[i].removeItems(ids);
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.VideoEditorPlayer <f:Ox.Element> VideoEditorPlayer Object
|
|||
|
||||
Ox.VideoEditorPlayer = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
duration: 0,
|
||||
find: '',
|
||||
|
|
@ -36,7 +36,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
self.controlsHeight = 16;
|
||||
|
||||
if (self.options.type == 'play') {
|
||||
self.$video = new Ox.VideoElement({
|
||||
self.$video = Ox.VideoElement({
|
||||
height: self.options.height,
|
||||
paused: true,
|
||||
points: self.options.points,
|
||||
|
|
@ -112,7 +112,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
});
|
||||
});
|
||||
|
||||
self.$controls = new Ox.Bar({
|
||||
self.$controls = Ox.Bar({
|
||||
size: self.controlsHeight
|
||||
})
|
||||
.css({
|
||||
|
|
@ -122,7 +122,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
|
||||
if (self.options.type == 'play') {
|
||||
// fixme: $buttonPlay etc. ?
|
||||
self.$playButton = new Ox.Button({
|
||||
self.$playButton = Ox.Button({
|
||||
id: self.options.id + 'Play',
|
||||
title: [
|
||||
{id: 'play', title: 'play'},
|
||||
|
|
@ -133,7 +133,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
})
|
||||
.bindEvent('click', togglePlay)
|
||||
.appendTo(self.$controls);
|
||||
self.$playInToOutButton = new Ox.Button({
|
||||
self.$playInToOutButton = Ox.Button({
|
||||
id: self.options.id + 'PlayInToOut',
|
||||
title: 'PlayInToOut',
|
||||
tooltip: 'Play In to Out',
|
||||
|
|
@ -143,7 +143,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
that.playInToOut();
|
||||
})
|
||||
.appendTo(self.$controls);
|
||||
self.$muteButton = new Ox.Button({
|
||||
self.$muteButton = Ox.Button({
|
||||
id: self.options.id + 'Mute',
|
||||
title: [
|
||||
{id: 'mute', title: 'mute'},
|
||||
|
|
@ -154,7 +154,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
})
|
||||
.bindEvent('click', toggleMute)
|
||||
.appendTo(self.$controls);
|
||||
self.$sizeButton = new Ox.Button({
|
||||
self.$sizeButton = Ox.Button({
|
||||
id: self.options.id + 'Size',
|
||||
title: self.options.size == 'small' ? [
|
||||
{id: 'large', title: 'grow'},
|
||||
|
|
@ -169,7 +169,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
.bindEvent('click', toggleSize)
|
||||
.appendTo(self.$controls);
|
||||
} else {
|
||||
self.$goToPointButton = new Ox.Button({
|
||||
self.$goToPointButton = Ox.Button({
|
||||
id: self.options.id + 'GoTo' + Ox.toTitleCase(self.options.type),
|
||||
title: 'GoTo' + Ox.toTitleCase(self.options.type),
|
||||
tooltip: 'Go to ' + Ox.toTitleCase(self.options.type) + ' Point',
|
||||
|
|
@ -177,7 +177,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
})
|
||||
.bindEvent('click', goToPoint)
|
||||
.appendTo(self.$controls);
|
||||
self.$setPointButton = new Ox.Button({
|
||||
self.$setPointButton = Ox.Button({
|
||||
id: self.options.id + 'Set' + Ox.toTitleCase(self.options.type),
|
||||
title: 'Set' + Ox.toTitleCase(self.options.type),
|
||||
tooltip: 'Set ' + Ox.toTitleCase(self.options.type) + ' Point',
|
||||
|
|
@ -187,7 +187,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
.appendTo(self.$controls);
|
||||
}
|
||||
|
||||
self.$positionInput = new Ox.TimeInput({
|
||||
self.$positionInput = Ox.TimeInput({
|
||||
milliseconds: true,
|
||||
seconds: true,
|
||||
value: Ox.formatDuration(self.options.position, 3)
|
||||
|
|
@ -220,7 +220,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
});
|
||||
|
||||
if (self.options.type == 'play') {
|
||||
self.$loadingIcon = new Ox.LoadingIcon()
|
||||
self.$loadingIcon = Ox.LoadingIcon()
|
||||
.appendTo(that)
|
||||
.start();
|
||||
self.loadingInterval = setInterval(function() {
|
||||
|
|
@ -309,7 +309,7 @@ Ox.VideoEditorPlayer = function(options, self) {
|
|||
self.$loadingIcon && self.$loadingIcon.stop();
|
||||
url = self.options.url(position);
|
||||
if (self.$video.attr('src') != url) {
|
||||
self.$loadingIcon = new Ox.LoadingIcon()
|
||||
self.$loadingIcon = Ox.LoadingIcon()
|
||||
.appendTo(that)
|
||||
.start();
|
||||
self.$video.attr({
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
Ox.VideoElement = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element('<video>', self)
|
||||
self = self || {};
|
||||
var that = Ox.Element('<video>', self)
|
||||
.defaults({
|
||||
fps: 25,
|
||||
height: 0,
|
||||
|
|
@ -42,7 +42,7 @@ Ox.VideoElement = function(options, self) {
|
|||
self.video.currentTime = self.options.position;
|
||||
that.triggerEvent('loadedmetadata', {
|
||||
video: self.video
|
||||
})
|
||||
});
|
||||
},
|
||||
progress: function() {
|
||||
that.triggerEvent('progress', {
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Ox.VideoPanelPlayer <f:Ox.Element> VideoPanelPlayer Object
|
|||
|
||||
Ox.VideoPanelPlayer = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
annotationsSize: 256,
|
||||
duration: 0,
|
||||
|
|
@ -60,7 +60,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
});
|
||||
//alert(JSON.stringify([self.playerHeight, self.playerWidth, self.videoCSS]))
|
||||
|
||||
self.$player = new Ox.Element()
|
||||
self.$player = Ox.Element()
|
||||
.css({
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'hidden'
|
||||
|
|
@ -72,7 +72,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
resize: resizeVideo
|
||||
});
|
||||
|
||||
self.$video = new Ox.VideoElement({
|
||||
self.$video = Ox.VideoElement({
|
||||
height: self.videoCSS.height,
|
||||
paused: true,
|
||||
points: self.options.points,
|
||||
|
|
@ -87,12 +87,12 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
})
|
||||
.appendTo(self.$player);
|
||||
|
||||
self.$controls = new Ox.Element()
|
||||
self.$controls = Ox.Element()
|
||||
.bindEvent({
|
||||
toggle: toggleControls
|
||||
});
|
||||
|
||||
self.$buttons = new Ox.Element()
|
||||
self.$buttons = Ox.Element()
|
||||
.css({
|
||||
float: 'left',
|
||||
width: '16px',
|
||||
|
|
@ -101,7 +101,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.appendTo(self.$controls);
|
||||
|
||||
self.$button = {
|
||||
play: new Ox.Button({
|
||||
play: Ox.Button({
|
||||
id: 'play',
|
||||
title: [
|
||||
{id: 'play', title: 'play'},
|
||||
|
|
@ -113,7 +113,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.bindEvent({
|
||||
click: self.$video.togglePlay
|
||||
}),
|
||||
mute: new Ox.Button({
|
||||
mute: Ox.Button({
|
||||
id: 'mute',
|
||||
title: [
|
||||
{id: 'mute', title: 'mute'},
|
||||
|
|
@ -125,7 +125,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.bindEvent({
|
||||
click: self.$video.toggleMute
|
||||
}),
|
||||
size: new Ox.Button({
|
||||
size: Ox.Button({
|
||||
id: 'size',
|
||||
title: self.options.videoSize == 'fit' ? [
|
||||
{id: 'fill', title: 'fill'},
|
||||
|
|
@ -144,7 +144,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.bindEvent({
|
||||
click: toggleSize
|
||||
}),
|
||||
fullscreen: new Ox.Button({
|
||||
fullscreen: Ox.Button({
|
||||
id: 'size',
|
||||
title: [
|
||||
{id: 'grow', title: 'grow'},
|
||||
|
|
@ -169,7 +169,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.appendTo(self.$buttons);
|
||||
});
|
||||
|
||||
self.$timelines = new Ox.Element()
|
||||
self.$timelines = Ox.Element()
|
||||
.css({
|
||||
float: 'left',
|
||||
margin: '4px'
|
||||
|
|
@ -177,7 +177,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.appendTo(self.$controls);
|
||||
|
||||
self.$timeline = {
|
||||
large: new Ox.LargeTimeline({
|
||||
large: Ox.LargeTimeline({
|
||||
duration: self.options.duration,
|
||||
position: self.options.position,
|
||||
subtitles: self.options.subtitles,
|
||||
|
|
@ -190,7 +190,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
.bindEvent({
|
||||
change: changeLargeTimeline
|
||||
}),
|
||||
small: new Ox.SmallTimeline({
|
||||
small: Ox.SmallTimeline({
|
||||
duration: self.options.duration,
|
||||
position: self.options.position,
|
||||
subtitles: self.options.subtitles,
|
||||
|
|
@ -208,7 +208,7 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
$timeline.appendTo(self.$timelines);
|
||||
});
|
||||
|
||||
self.$panel = new Ox.SplitPanel({
|
||||
self.$panel = Ox.SplitPanel({
|
||||
elements: [
|
||||
{
|
||||
element: self.$player
|
||||
|
|
@ -226,14 +226,14 @@ Ox.VideoPanelPlayer = function(options, self) {
|
|||
resize: resizePanel
|
||||
});
|
||||
|
||||
self.$annotations = new Ox.Element()
|
||||
self.$annotations = Ox.Element()
|
||||
.bindEvent({
|
||||
resize: resizeAnnotations,
|
||||
resizeend: resizeendAnnotations,
|
||||
toggle: toggleAnnotations
|
||||
});
|
||||
|
||||
that.$element = new Ox.SplitPanel({
|
||||
that.$element = Ox.SplitPanel({
|
||||
elements: [
|
||||
{
|
||||
element: self.$panel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue