When rendering recon candidates and matches, check for freebase ID on the recon object's identifier space, not the service's identifier space. This lets matches added by the "extend data" operation to be rendered properly as links.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1058 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
a1ae492a4d
commit
b47ada4dca
@ -67,13 +67,11 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
.attr("target", "_blank")
|
.attr("target", "_blank")
|
||||||
.appendTo(divContent);
|
.appendTo(divContent);
|
||||||
|
|
||||||
if (service) {
|
if (service && (service.view) && (service.view.url)) {
|
||||||
if ((service.view) && (service.view.url)) {
|
|
||||||
a.attr("href", service.view.url.replace("{{id}}", match.id));
|
a.attr("href", service.view.url.replace("{{id}}", match.id));
|
||||||
} else if (ReconciliationManager.isFreebaseId(service.identifierSpace)) {
|
} else if (ReconciliationManager.isFreebaseId(r.identifierSpace)) {
|
||||||
a.attr("href", "http://www.freebase.com/view" + match.id);
|
a.attr("href", "http://www.freebase.com/view" + match.id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$('<span> </span>').appendTo(divContent);
|
$('<span> </span>').appendTo(divContent);
|
||||||
$('<a href="javascript:{}"></a>')
|
$('<a href="javascript:{}"></a>')
|
||||||
@ -113,20 +111,18 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
.text(candidate.name)
|
.text(candidate.name)
|
||||||
.appendTo(li);
|
.appendTo(li);
|
||||||
|
|
||||||
if (service) {
|
if ((service) && (service.view) && (service.view.url)) {
|
||||||
if ((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.isFreebaseId(service.identifierSpace)) {
|
} else if (ReconciliationManager.isFreebaseId(r.identifierSpace)) {
|
||||||
a.attr("href", "http://www.freebase.com/view" + candidate.id);
|
a.attr("href", "http://www.freebase.com/view" + candidate.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
var preview = null;
|
var preview = null;
|
||||||
if (service.preview) {
|
if ((service) && (service.preview)) {
|
||||||
preview = service.preview;
|
preview = service.preview;
|
||||||
} else if (ReconciliationManager.isFreebaseId(service.identifierSpace)) {
|
} else if (ReconciliationManager.isFreebaseId(r.identifierSpace)) {
|
||||||
preview = DataTableCellUI.topicBlockPreview;
|
preview = DataTableCellUI.topicBlockPreview;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preview) {
|
if (preview) {
|
||||||
a.click(function(evt) {
|
a.click(function(evt) {
|
||||||
if (!evt.metaKey && !evt.ctrlKey) {
|
if (!evt.metaKey && !evt.ctrlKey) {
|
||||||
@ -136,7 +132,6 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var score;
|
var score;
|
||||||
if (candidate.score < 1) {
|
if (candidate.score < 1) {
|
||||||
@ -169,14 +164,12 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
|
|
||||||
$('<span>').text("(New topic)").appendTo(liNew);
|
$('<span>').text("(New topic)").appendTo(liNew);
|
||||||
|
|
||||||
if (service) {
|
|
||||||
var suggestOptions;
|
var suggestOptions;
|
||||||
var addSuggest = false;
|
var addSuggest = false;
|
||||||
|
if ((service) && (service.suggest) && (service.suggest.entity)) {
|
||||||
if ((service.suggest) && (service.suggest.entity)) {
|
|
||||||
suggestOptions = service.suggest.entity;
|
suggestOptions = service.suggest.entity;
|
||||||
addSuggest = true;
|
addSuggest = true;
|
||||||
} else if (ReconciliationManager.isFreebaseId(service.identifierSpace)) {
|
} else if (ReconciliationManager.isFreebaseId(r.identifierSpace)) {
|
||||||
addSuggest = true;
|
addSuggest = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +186,6 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
divContent.appendTo(this._td);
|
divContent.appendTo(this._td);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user