From b1375a8997b5ddf7c74cb50baeeabbad188c7711 Mon Sep 17 00:00:00 2001 From: Stefano Mazzocchi Date: Tue, 27 Apr 2010 08:13:45 +0000 Subject: [PATCH] more polish git-svn-id: http://google-refine.googlecode.com/svn/trunk@555 7d457c2a-affb-35e4-300a-418c747d4874 --- .../browsing/facets/ScatterplotFacet.java | 2 -- .../commands/edit/MQLWriteCommand.java | 1 - .../scripts/dialogs/freebase-loading-dialog.js | 17 ++++++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/metaweb/gridworks/browsing/facets/ScatterplotFacet.java b/src/main/java/com/metaweb/gridworks/browsing/facets/ScatterplotFacet.java index f0f4281cc..d1165a3fd 100644 --- a/src/main/java/com/metaweb/gridworks/browsing/facets/ScatterplotFacet.java +++ b/src/main/java/com/metaweb/gridworks/browsing/facets/ScatterplotFacet.java @@ -254,8 +254,6 @@ public class ScatterplotFacet implements Facet { boolean value = p.x >= from_x && p.x < to_x && p.y >= from_y && p.y < to_y; - //System.out.println(p + " " + value); - return value; }; }; diff --git a/src/main/java/com/metaweb/gridworks/commands/edit/MQLWriteCommand.java b/src/main/java/com/metaweb/gridworks/commands/edit/MQLWriteCommand.java index d41de01ac..86fb200b2 100644 --- a/src/main/java/com/metaweb/gridworks/commands/edit/MQLWriteCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/edit/MQLWriteCommand.java @@ -28,7 +28,6 @@ public class MQLWriteCommand extends Command { if (access_credentials != null) { String query = request.getParameter("query"); - System.out.println(query); String result = FreebaseUtils.mqlwrite(access_credentials, provider, query); response.getWriter().write(result); } else { diff --git a/src/main/webapp/scripts/dialogs/freebase-loading-dialog.js b/src/main/webapp/scripts/dialogs/freebase-loading-dialog.js index 1152d72f3..83b51b0cd 100644 --- a/src/main/webapp/scripts/dialogs/freebase-loading-dialog.js +++ b/src/main/webapp/scripts/dialogs/freebase-loading-dialog.js @@ -48,6 +48,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() { DOM.bind(authorization).signout.click(function() { self._signedin = false; load_button.attr("disabled","disabled"); + $("#freebase-loading-graph-selector-freebase").attr("disabled","disabled").button("refresh"); Sign.signout(check_authorization,provider); }); load_button.unbind().click(function() { @@ -89,19 +90,20 @@ FreebaseLoadingDialog.prototype._createDialog = function() { }; var make_topic = function(new_topic_id, topic_type, cont) { - var mql_query = { + var mql_query = [{ "create": "unless_exists", "name": new_topic_id, - "type": topic_type, + "a:type": topic_type, + "b:type": "/common/topic" "id": null, "guid": null - }; + }]; $.post("/command/mqlwrite/" + provider, { "query" : JSON.stringify(mql_query) }, function(data) { if ("status" in data && data.code == "/api/status/ok") { - self._elmts.source_id.val(data.result.id); + self._elmts.source_id.val(data.result[0].id); if (typeof cont == "function") cont(); } else { self._show_error("Error creating new topic", data); @@ -125,7 +127,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() { '

Have you aligned it with the Freebase schemas yet?

' + '' ); - + self._elmts = DOM.bind(frame); self._end(); } else { body.html( @@ -149,8 +151,9 @@ FreebaseLoadingDialog.prototype._createDialog = function() { self._elmts.source_id.suggest({ "type": "/dataworld/information_source", - "soft": true, "suggest_new": "Click here to add a new information source" + }).bind("fb-select", function(e, data) { + self._elmts.source_id.val(data.id); }).bind("fb-select-new", function(e, val) { make_topic(val, "/dataworld/information_source"); }); @@ -251,7 +254,7 @@ FreebaseLoadingDialog.prototype._show_error = function(msg, error) { FreebaseLoadingDialog.prototype._end = function() { var self = this; - self._elmts.load.text("Close").unbind().click(function() { + self._elmts.load.text("Close").removeAttr("disabled").unbind().click(function() { self._dismiss(); }); self._elmts.cancel.hide();