From 88023238395ce79e68e715873900d9a0d6d3e740 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Tue, 9 Feb 2010 00:45:54 +0000 Subject: [PATCH] Some more code for the schema alignment dialog box, but nothing is working yet, and I still need to think about how this should work. git-svn-id: http://google-refine.googlecode.com/svn/trunk@76 7d457c2a-affb-35e4-300a-418c747d4874 --- src/main/webapp/project.html | 2 +- src/main/webapp/scripts/project/menu-bar.js | 12 ++++- .../scripts/project/schema-alignment.js | 52 ++++++++++++++++++- .../webapp/styles/schema-alignment-dialog.css | 5 ++ 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 src/main/webapp/styles/schema-alignment-dialog.css diff --git a/src/main/webapp/project.html b/src/main/webapp/project.html index 21bee9488..059100eb7 100644 --- a/src/main/webapp/project.html +++ b/src/main/webapp/project.html @@ -1,2 +1,2 @@ - Gridlock + Gridlock
starting up ...
\ No newline at end of file diff --git a/src/main/webapp/scripts/project/menu-bar.js b/src/main/webapp/scripts/project/menu-bar.js index 374bff8f4..4dcf5e6eb 100644 --- a/src/main/webapp/scripts/project/menu-bar.js +++ b/src/main/webapp/scripts/project/menu-bar.js @@ -135,5 +135,15 @@ MenuBar.prototype._doExportRows = function() { }; MenuBar.prototype._doAutoSchemaAlignment = function() { - SchemaAlignment.autoAlign(); + //SchemaAlignment.autoAlign(); + new SchemaAlignmentDialog({ + rootNodes: [ + { + nodeType: "existing", + column: "name", + linkages: [ + ] + } + ] + }); }; diff --git a/src/main/webapp/scripts/project/schema-alignment.js b/src/main/webapp/scripts/project/schema-alignment.js index f216ee081..020bdcbf9 100644 --- a/src/main/webapp/scripts/project/schema-alignment.js +++ b/src/main/webapp/scripts/project/schema-alignment.js @@ -88,4 +88,54 @@ SchemaAlignment._batchSearch = function(queries, onDone) { SchemaAlignment._cleanName = function(s) { return s.replace(/\W/g, " ").replace(/\s+/g, " ").toLowerCase(); -} \ No newline at end of file +} + +function SchemaAlignmentDialog(protograph) { + var protograph = { + rootNodes: [ + { + nodeType: "existing", + column: "name", + linkages: [ + ] + } + ] + }; + + this._createDialog(); +}; + +SchemaAlignmentDialog.prototype._createDialog = function() { + var self = this; + var frame = DialogSystem.createDialog(); + + frame.width("1000px"); + + var header = $('
').addClass("dialog-header").text("Schema Alignment").appendTo(frame); + var body = $('
').addClass("dialog-body").appendTo(frame); + var footer = $('
').addClass("dialog-footer").appendTo(frame); + + this._renderFooter(footer); + this._renderBody(body); + + this._level = DialogSystem.showDialog(frame); +}; + +SchemaAlignmentDialog.prototype._renderFooter = function(footer) { + var self = this; + + $('').html("  OK  ").click(function() { + DialogSystem.dismissUntil(self._level - 1); + self._onDone(self._getNewProtograph()); + }).appendTo(footer); + + $('').text("Cancel").click(function() { + DialogSystem.dismissUntil(self._level - 1); + }).appendTo(footer); +}; + +SchemaAlignmentDialog.prototype._renderBody = function(body) { + var self = this; + + this._canvas = $('
').addClass("schema-alignment-dialog-canvas").appendTo(body); +}; diff --git a/src/main/webapp/styles/schema-alignment-dialog.css b/src/main/webapp/styles/schema-alignment-dialog.css new file mode 100644 index 000000000..48517e2dc --- /dev/null +++ b/src/main/webapp/styles/schema-alignment-dialog.css @@ -0,0 +1,5 @@ +.schema-alignment-dialog-canvas { + height: 500px; + overflow: auto; + border: 1px solid #aaa; +} \ No newline at end of file