diff --git a/src/main/webapp/scripts/project/menu-bar.js b/src/main/webapp/scripts/project/menu-bar.js index 31b3fb073..7fe622d3d 100644 --- a/src/main/webapp/scripts/project/menu-bar.js +++ b/src/main/webapp/scripts/project/menu-bar.js @@ -59,7 +59,7 @@ MenuBar.prototype._initializeUI = function() { {}, { label: "Load into Freebase ...", - click: function() {} + click: function() { alert("Not implemented yet."); } } ]); this._createTopLevelMenuItem("Scatterplots", [ diff --git a/src/main/webapp/scripts/views/data-table-column-header-ui.js b/src/main/webapp/scripts/views/data-table-column-header-ui.js index fdc0e49c3..89a4628a0 100644 --- a/src/main/webapp/scripts/views/data-table-column-header-ui.js +++ b/src/main/webapp/scripts/views/data-table-column-header-ui.js @@ -751,20 +751,35 @@ DataTableColumnHeaderUI.prototype._doSearchToMatch = function() { var input = $('').appendTo($('
').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); + } + ); }); $('').text("Cancel").click(function() {