use getMatches option of ListMap

This commit is contained in:
rolux 2011-10-30 14:59:54 +00:00
parent e71421f597
commit b2550c81d7
3 changed files with 19 additions and 4 deletions

View file

@ -55,6 +55,7 @@ pandora.UI = (function() {
// switch from item view to list view
args['item'] = '';
}
add['itemFind'] = pandora.site.user.ui.itemFind;
if (!pandora.user.ui.lists[list]) {
add['lists.' + that.encode(list)] = {};
}

View file

@ -174,10 +174,10 @@ pandora.ui.item = function() {
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
}).bindEvent({
find: function(data) {
pandora.UI.set('itemFind', {
pandora.UI.set('itemFind', data.find ? {
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
operator: '&'
});
} : pandora.site.user.ui.itemFind);
},
muted: function(data) {
pandora.UI.set('muted', data.muted);
@ -241,10 +241,10 @@ pandora.ui.item = function() {
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
}).bindEvent({
find: function(data) {
pandora.UI.set('itemFind', {
pandora.UI.set('itemFind', data.find ? {
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
operator: '&'
});
} : pandora.site.user.ui.itemFind);
},
points: function(data) {
pandora.UI.set('videoPoints.' + pandora.user.ui.item, {

View file

@ -22,6 +22,20 @@ pandora.ui.placesDialog = function() {
callback(result);
});
},
getMatches: function(names, callback) {
// fixme: the results of this are of course
// not identical to actual place matches
pandora.api.findClips({
query: {
conditions: names.map(function(name) {
return {key: 'subtitles', value: name, operator: '='};
}),
operator: names.length == 1 ? '&' : '|'
}
}, function(result) {
callback(result.data.items);
});
},
removePlace: function(place, callback) {
pandora.api.removePlace(place, function(result) {
Ox.Request.clearCache(); // fixme: remove