diff --git a/static/js/pandora/UI.js b/static/js/pandora/UI.js index 53e565c79..86ce18ecc 100644 --- a/static/js/pandora/UI.js +++ b/static/js/pandora/UI.js @@ -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)] = {}; } diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 8eafa4400..77cce5874 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -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, { diff --git a/static/js/pandora/placesDialog.js b/static/js/pandora/placesDialog.js index 2b870b86d..958c658ca 100644 --- a/static/js/pandora/placesDialog.js +++ b/static/js/pandora/placesDialog.js @@ -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