Fix filter to blacklist documents correctly

This commit is contained in:
Tom Morris 2013-02-25 19:45:25 -05:00
parent ed07a4d489
commit a2b60d3d4b

View File

@ -148,6 +148,7 @@ DataTableCellUI.prototype._render = function() {
.text(candidate.name) .text(candidate.name)
.appendTo(li); .appendTo(li);
// TODO: replace view URL with local code?
if ((service) && (service.view) && (service.view.url)) { if ((service) && (service.view) && (service.view.url)) {
a.attr("href", service.view.url.replace("{{id}}", candidate.id)); a.attr("href", service.view.url.replace("{{id}}", candidate.id));
} else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) { } else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) {
@ -378,7 +379,7 @@ DataTableCellUI.prototype._searchForMatch = function(suggestOptions) {
var suggestOptions2 = $.extend({ align: "left" }, suggestOptions var suggestOptions2 = $.extend({ align: "left" }, suggestOptions
|| { all_types: true, // FIXME: all_types isn't documented for Suggest. Is it still implemented? || { all_types: true, // FIXME: all_types isn't documented for Suggest. Is it still implemented?
filter: "(not type:/common/document)" }); // blacklist documents filter: "(not (any type:/common/document type:/type/content))" }); // blacklist documents and images
if (suggestOptions2.service_url) { if (suggestOptions2.service_url) {
// Old style suggest API // Old style suggest API
suggestOptions2.key = null; suggestOptions2.key = null;
@ -432,6 +433,7 @@ DataTableCellUI.topicBlockPreview = {
height: 300 height: 300
}; };
// TODO: Inject code to format using Suggest here?
DataTableCellUI.prototype._previewCandidateTopic = function(candidate, elmt, preview) { DataTableCellUI.prototype._previewCandidateTopic = function(candidate, elmt, preview) {
var self = this; var self = this;
var id = candidate.id; var id = candidate.id;
@ -576,4 +578,4 @@ DataTableCellUI.prototype._startEdit = function(elmt) {
elmts.cancelButton.click(function() { elmts.cancelButton.click(function() {
MenuSystem.dismissAll(); MenuSystem.dismissAll();
}); });
}; };