use getMatches option of ListMap
This commit is contained in:
parent
e71421f597
commit
b2550c81d7
3 changed files with 19 additions and 4 deletions
|
@ -55,6 +55,7 @@ pandora.UI = (function() {
|
||||||
// switch from item view to list view
|
// switch from item view to list view
|
||||||
args['item'] = '';
|
args['item'] = '';
|
||||||
}
|
}
|
||||||
|
add['itemFind'] = pandora.site.user.ui.itemFind;
|
||||||
if (!pandora.user.ui.lists[list]) {
|
if (!pandora.user.ui.lists[list]) {
|
||||||
add['lists.' + that.encode(list)] = {};
|
add['lists.' + that.encode(list)] = {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,10 +174,10 @@ pandora.ui.item = function() {
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
find: function(data) {
|
find: function(data) {
|
||||||
pandora.UI.set('itemFind', {
|
pandora.UI.set('itemFind', data.find ? {
|
||||||
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
|
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
|
||||||
operator: '&'
|
operator: '&'
|
||||||
});
|
} : pandora.site.user.ui.itemFind);
|
||||||
},
|
},
|
||||||
muted: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set('muted', data.muted);
|
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
|
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
find: function(data) {
|
find: function(data) {
|
||||||
pandora.UI.set('itemFind', {
|
pandora.UI.set('itemFind', data.find ? {
|
||||||
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
|
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
|
||||||
operator: '&'
|
operator: '&'
|
||||||
});
|
} : pandora.site.user.ui.itemFind);
|
||||||
},
|
},
|
||||||
points: function(data) {
|
points: function(data) {
|
||||||
pandora.UI.set('videoPoints.' + pandora.user.ui.item, {
|
pandora.UI.set('videoPoints.' + pandora.user.ui.item, {
|
||||||
|
|
|
@ -22,6 +22,20 @@ pandora.ui.placesDialog = function() {
|
||||||
callback(result);
|
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) {
|
removePlace: function(place, callback) {
|
||||||
pandora.api.removePlace(place, function(result) {
|
pandora.api.removePlace(place, function(result) {
|
||||||
Ox.Request.clearCache(); // fixme: remove
|
Ox.Request.clearCache(); // fixme: remove
|
||||||
|
|
Loading…
Reference in a new issue