Added temporary message for the Load into Freebase feature.

Fixed command Match Filtered Cells To, which didn't work because freebase suggest no longer returns types.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@449 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-04-12 03:59:19 +00:00
parent 8fb23913ce
commit f6dcdf23c4
2 changed files with 29 additions and 14 deletions

View File

@ -59,7 +59,7 @@ MenuBar.prototype._initializeUI = function() {
{},
{
label: "Load into Freebase ...",
click: function() {}
click: function() { alert("Not implemented yet."); }
}
]);
this._createTopLevelMenuItem("Scatterplots", [

View File

@ -751,20 +751,35 @@ DataTableColumnHeaderUI.prototype._doSearchToMatch = function() {
var input = $('<input />').appendTo($('<p></p>').appendTo(body));
input.suggest({}).bind("fb-select", function(e, data) {
Gridworks.postProcess(
"recon-match-specific-topic-to-cells",
{
columnName: self._column.name,
topicID: data.id,
topicGUID: data.guid,
topicName: data.name,
types: $.map(data.type, function(elmt) { return elmt.id; }).join(",")
},
null,
{ cellsChanged: true, columnStatsChanged: true }
);
var query = {
"id" : data.id,
"type" : []
};
var baseUrl = "http://api.freebase.com/api/service/mqlread";
var url = baseUrl + "?" + $.param({ query: JSON.stringify({ query: query }) }) + "&callback=?";
DialogSystem.dismissUntil(level - 1);
$.getJSON(
url,
null,
function(o) {
var types = "result" in o ? o.result.type : [];
Gridworks.postProcess(
"recon-match-specific-topic-to-cells",
{
columnName: self._column.name,
topicID: data.id,
topicGUID: data.guid,
topicName: data.name,
types: types.join(",")
},
null,
{ cellsChanged: true, columnStatsChanged: true }
);
DialogSystem.dismissUntil(level - 1);
}
);
});
$('<button></button>').text("Cancel").click(function() {