pandora/static/js/pandora/clipsView.js

52 lines
2.1 KiB
JavaScript
Raw Normal View History

2011-10-30 16:00:21 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-11-05 17:04:10 +00:00
'use strict';
2011-10-30 15:36:14 +00:00
pandora.ui.clipsView = function(videoRatio) {
2012-01-20 18:10:25 +00:00
var that = Ox.SplitPanel({
2011-10-30 15:36:14 +00:00
elements: [
{
element: Ox.Bar({size: 24})
.append(
pandora.$ui.sortSelect = pandora.ui.sortSelect()
)
.append(
pandora.$ui.orderButton = pandora.ui.orderButton()
)
2011-10-30 16:00:21 +00:00
.append(
Ox.Input({
clear: true,
placeholder: 'Find Clips',
value: pandora.user.ui.itemFind.conditions[0]
? pandora.user.ui.itemFind.conditions[0].value : '',
width: 192
})
.css({float: 'right', margin: '4px'})
.bindEvent({
submit: function(data) {
pandora.UI.set('itemFind', data.value ? {
2012-01-20 18:10:25 +00:00
conditions: [{key: 'annotations', value: data.value, operator: '='}],
2011-10-30 16:00:21 +00:00
operator: '&'
} : pandora.site.user.ui.itemFind);
// since this is the only way itemFind can change,
// there's no need for an event handler
that.replaceElement(1,
pandora.$ui.clipList = pandora.ui.clipList(videoRatio)
);
}
})
),
size: 24
2011-10-30 15:36:14 +00:00
},
{
2011-10-30 16:00:21 +00:00
element: pandora.$ui.clipList = pandora.ui.clipList(videoRatio)
2011-10-30 15:36:14 +00:00
}
],
orientation: 'vertical'
});
return that;
};