Added topic block previews for recon candidates.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@82 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
7510594d0d
commit
39899b9eeb
@ -65,6 +65,11 @@ DataTableCellUI.prototype._render = function() {
|
||||
.addClass("data-table-recon-topic")
|
||||
.attr("href", "http://www.freebase.com/view" + candidate.id)
|
||||
.attr("target", "_blank")
|
||||
.click(function(evt) {
|
||||
self._previewCandidateTopic(candidate.id, this);
|
||||
evt.preventDefault();
|
||||
return false;
|
||||
})
|
||||
.text(candidate.name)
|
||||
.appendTo(li);
|
||||
|
||||
@ -136,3 +141,25 @@ DataTableCellUI.prototype.doPostThenUpdate = function(command, params) {
|
||||
"json"
|
||||
);
|
||||
};
|
||||
|
||||
DataTableCellUI.prototype._previewCandidateTopic = function(id, elmt) {
|
||||
var url = "http://www.freebase.com/widget/topic" + id + '?mode=content&blocks=[{"block"%3A"image"}%2C{"block"%3A"full_info"}%2C{"block"%3A"article_props"}]';
|
||||
|
||||
var fakeMenu = MenuSystem.createMenu();
|
||||
fakeMenu
|
||||
.width(700)
|
||||
.height(300)
|
||||
.css("background", "none")
|
||||
.css("border", "none");
|
||||
|
||||
var iframe = $('<iframe></iframe>')
|
||||
.attr("width", "100%")
|
||||
.attr("height", "100%")
|
||||
.css("background", "none")
|
||||
.css("border", "none")
|
||||
.attr("src", url)
|
||||
.appendTo(fakeMenu);
|
||||
|
||||
MenuSystem.showMenu(fakeMenu, function(){});
|
||||
MenuSystem.positionMenuLeftRight(fakeMenu, $(elmt));
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user