add status bar text to edit

This commit is contained in:
rlx 2013-07-14 18:58:31 +00:00
parent 5b29e4348b
commit 99eddfb806
2 changed files with 22 additions and 4 deletions

View file

@ -6,6 +6,7 @@ Ox.ClipPanel = function(options, self) {
var that = Ox.Element({}, self) var that = Ox.Element({}, self)
.defaults({ .defaults({
clips: [], clips: [],
duration: 0,
editable: false, editable: false,
'in': 0, 'in': 0,
out: 0, out: 0,
@ -24,7 +25,9 @@ Ox.ClipPanel = function(options, self) {
sort: self.options.sort, sort: self.options.sort,
sortable: isSortable() sortable: isSortable()
}); });
updateStatus();
}, },
duration: updateStatus,
sort: function() { sort: function() {
updateSortElement(); updateSortElement();
self.$list.options({ self.$list.options({
@ -129,6 +132,15 @@ Ox.ClipPanel = function(options, self) {
size: 16 size: 16
}); });
self.$status = Ox.Element()
.css({
marginTop: '2px',
fontSize: '9px',
textAlign: 'center',
textOverflow: 'ellipsis'
})
.appendTo(self.$statusbar);
that.setElement( that.setElement(
self.$panel = Ox.SplitPanel({ self.$panel = Ox.SplitPanel({
elements: [ elements: [
@ -148,9 +160,7 @@ Ox.ClipPanel = function(options, self) {
}) })
); );
function cutClips() { updateStatus();
}
function editClip(data) { function editClip(data) {
var value = self.$list.value(data.id, data.key); var value = self.$list.value(data.id, data.key);
@ -241,7 +251,6 @@ Ox.ClipPanel = function(options, self) {
sortable: isSortable(), sortable: isSortable(),
unique: 'id' unique: 'id'
}) : Ox.Element(); }) : Ox.Element();
$list.bindEvent({ $list.bindEvent({
copy: function(data) { copy: function(data) {
that.triggerEvent('copy', data); that.triggerEvent('copy', data);
@ -303,6 +312,13 @@ Ox.ClipPanel = function(options, self) {
}); });
} }
function updateStatus() {
self.$status.html(
Ox.toTitleCase(Ox.formatCount(self.options.clips.length, 'Clip'))
+ ', ' + Ox.formatDuration(self.options.duration, 3)
);
}
that.updateItem = function(id, data) { that.updateItem = function(id, data) {
['in', 'out', 'duration'].forEach(function(key) { ['in', 'out', 'duration'].forEach(function(key) {
self.$list.value(id, key, data[key]); self.$list.value(id, key, data[key]);

View file

@ -168,6 +168,7 @@ Ox.VideoEditPanel = function(options, self) {
self.$timeline = getTimeline() self.$timeline = getTimeline()
); );
setPosition(self.$video.options('position'), true); setPosition(self.$video.options('position'), true);
self.$clipPanel.options({duration: self.options.duration});
}, },
fullscreen: function(data) { fullscreen: function(data) {
self.options.fullscreen = data.fullscreen; self.options.fullscreen = data.fullscreen;
@ -237,6 +238,7 @@ Ox.VideoEditPanel = function(options, self) {
self.$clipPanel = Ox.ClipPanel({ self.$clipPanel = Ox.ClipPanel({
clips: Ox.clone(self.options.clips), clips: Ox.clone(self.options.clips),
duration: self.options.duration,
editable: self.options.editable, editable: self.options.editable,
'in': self.options['in'], 'in': self.options['in'],
out: self.options.out, out: self.options.out,