From 7697365180d6fc2d9ea35b29782229798e9d160d Mon Sep 17 00:00:00 2001 From: David Huynh Date: Fri, 5 Mar 2010 19:28:35 +0000 Subject: [PATCH] Added custom suggest for types as well. Styled property and type suggest panes to be wider to accommodate long IDs. Fixed event wiring bugs in recon dialog. Made cell edit popup wider and position it relative to the whole cell rather than to the edit link. git-svn-id: http://google-refine.googlecode.com/svn/trunk@212 7d457c2a-affb-35e4-300a-418c747d4874 --- src/main/webapp/project.html | 2 +- .../webapp/scripts/dialogs/recon-dialog.js | 4 +- .../protograph/schema-alignment-ui-node.js | 4 +- ...{property-suggest.js => custom-suggest.js} | 49 +++++++++++++++++++ .../scripts/views/data-table-cell-ui.js | 4 +- src/main/webapp/styles/custom-suggest.css | 3 ++ 6 files changed, 60 insertions(+), 6 deletions(-) rename src/main/webapp/scripts/util/{property-suggest.js => custom-suggest.js} (61%) create mode 100644 src/main/webapp/styles/custom-suggest.css diff --git a/src/main/webapp/project.html b/src/main/webapp/project.html index 8f936c916..c3457eb5a 100644 --- a/src/main/webapp/project.html +++ b/src/main/webapp/project.html @@ -1 +1 @@ - Gridworks
starting up ...
\ No newline at end of file + Gridworks
starting up ...
\ No newline at end of file diff --git a/src/main/webapp/scripts/dialogs/recon-dialog.js b/src/main/webapp/scripts/dialogs/recon-dialog.js index 559792512..a8644e9d9 100644 --- a/src/main/webapp/scripts/dialogs/recon-dialog.js +++ b/src/main/webapp/scripts/dialogs/recon-dialog.js @@ -171,8 +171,10 @@ ReconDialog.prototype._populateDialog = function() { }; ReconDialog.prototype._wireEvents = function() { + var self = this; + this._elmts.heuristicTypeInput - .suggest({ type : '/type/type' }) + .suggestT({ type : '/type/type' }) .bind("fb-select", function(e, data) { $('input[name="recon-dialog-type-choice"][value=""]').attr("checked", "true"); diff --git a/src/main/webapp/scripts/protograph/schema-alignment-ui-node.js b/src/main/webapp/scripts/protograph/schema-alignment-ui-node.js index 6376e9bd0..b0be39bc3 100644 --- a/src/main/webapp/scripts/protograph/schema-alignment-ui-node.js +++ b/src/main/webapp/scripts/protograph/schema-alignment-ui-node.js @@ -435,7 +435,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() { elmts.anonymousNodeTypeInput .bind("focus", function() { elmts.radioNodeTypeAnonymous[0].checked = true; }) - .suggest({ type: "/type/type" }); + .suggestT({ type: "/type/type" }); elmts.topicNodeTypeInput .bind("focus", function() { elmts.radioNodeTypeTopic[0].checked = true; }) @@ -459,7 +459,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() { elmts.radioNodeTypeCellAs[0].checked = true; elmts.radioNodeTypeCellAsTopic[0].checked = true; }) - .suggest({ type: "/type/type" }); + .suggestT({ type: "/type/type" }); elmts.cellAsValueTypeSelect .bind("focus", function() { diff --git a/src/main/webapp/scripts/util/property-suggest.js b/src/main/webapp/scripts/util/custom-suggest.js similarity index 61% rename from src/main/webapp/scripts/util/property-suggest.js rename to src/main/webapp/scripts/util/custom-suggest.js index de3ea42c3..6a8fcbb70 100644 --- a/src/main/webapp/scripts/util/property-suggest.js +++ b/src/main/webapp/scripts/util/custom-suggest.js @@ -3,6 +3,9 @@ response: $.suggest.suggest.prototype.response }; + /* + * Property suggest + */ $.suggest( "suggestP", $.extend( @@ -60,6 +63,52 @@ true, {}, $.suggest.suggest.defaults, { + css: { pane: "fbs-pane fbs-pane-property" } + } + ) + } + ); + + /* + * Type suggest + */ + $.suggest( + "suggestT", + $.extend( + true, + {}, + $.suggest.suggest.prototype, + { + create_item: function(data, response_data) { + var css = this.options.css; + + var li = $("
  • ").addClass(css.item); + + var name = $("
    ") + .addClass(css.item_name) + .append( + $("