Styling tweaks to schema alignment skeleton node dialog. Eliminated the auto create new topic option

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1628 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-10-25 02:07:09 +00:00
parent e601ad8d40
commit 1cc2097cf1
2 changed files with 19 additions and 35 deletions

View File

@ -290,9 +290,9 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
var self = this; var self = this;
var frame = DialogSystem.createDialog(); var frame = DialogSystem.createDialog();
frame.width("800px"); frame.width("750px");
var header = $('<div></div>').addClass("dialog-header").text("Schema Skeleton Node").appendTo(frame); var header = $('<div></div>').addClass("dialog-header").text("Schema Alignment Skeleton Node").appendTo(frame);
var body = $('<div></div>').addClass("dialog-body").appendTo(frame); var body = $('<div></div>').addClass("dialog-body").appendTo(frame);
var footer = $('<div></div>').addClass("dialog-footer").appendTo(frame); var footer = $('<div></div>').addClass("dialog-footer").appendTo(frame);
@ -309,10 +309,10 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<option value="/type/datetime">date/time</option>'; '<option value="/type/datetime">date/time</option>';
var html = $( var html = $(
'<table class="grid-layout layout-normal layout-full">' + '<div class="grid-layout layout-looser layout-full"><table>' +
'<tr>' + '<tr>' +
'<td>' + '<td>' +
'<table class="grid-layout layout-tight">' + '<div class="grid-layout layout-loose"><table>' +
'<tr>' + '<tr>' +
'<td>' + '<td>' +
'<div class="schema-align-node-dialog-node-type">' + '<div class="schema-align-node-dialog-node-type">' +
@ -322,11 +322,11 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td>' + '<td>' +
'<table class="grid-layout layout-tight">' + '<div class="grid-layout layout-normal"><table>' +
'<tr>' + '<tr>' +
'<td><div class="schema-alignment-node-dialog-column-list" bind="divColumns"></div></td>' + '<td><div class="schema-alignment-node-dialog-column-list grid-layout layout-tightest" bind="divColumns"></div></td>' +
'<td>' + '<td>' +
'<table class="grid-layout layout-tight" cols="4">' + '<div class="grid-layout layout-tight"><table cols="4">' +
'<tr>' + '<tr>' +
'<td colspan="4">The cell\'s content is used ...</td>' + '<td colspan="4">The cell\'s content is used ...</td>' +
'</tr>' + '</tr>' +
@ -336,16 +336,12 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td colspan="1" width="1%"><input type="checkbox" bind="radioNodeTypeCellAsTopicCreate" /></td>' + '<td colspan="3">Type new topics as</td>' +
'<td colspan="2">If not reconciled, create new topic named by the cell\'s content, and assign it a type</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td></td>' + '<td colspan="3"><input bind="cellAsTopicNodeTypeInput" /></td>' +
'<td colspan="1">Type:</td>' +
'<td colspan="1"><input bind="cellAsTopicNodeTypeInput" /></td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-value" bind="radioNodeTypeCellAsValue" /></td>' + '<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-value" bind="radioNodeTypeCellAsValue" /></td>' +
'<td colspan="3">as a literal value</td>' + '<td colspan="3">as a literal value</td>' +
@ -357,7 +353,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td colspan="2">Language (for text)</td>' + '<td colspan="2">Text language</td>' +
'<td colspan="1"><input bind="cellAsValueLanguageInput" /></td>' + '<td colspan="1"><input bind="cellAsValueLanguageInput" /></td>' +
'</tr>' + '</tr>' +
@ -370,17 +366,17 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<td colspan="2">Namespace</td>' + '<td colspan="2">Namespace</td>' +
'<td colspan="1"><input bind="cellAsKeyInput" /></td>' + '<td colspan="1"><input bind="cellAsKeyInput" /></td>' +
'</tr>' + '</tr>' +
'</table>' + '</table></div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
'</table>' + '</table></div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
'</table>' + '</table></div>' +
'</td>' + '</td>' +
'<td>' + '<td>' +
'<table class="grid-layout layout-tight">' + '<div class="grid-layout layout-normal"><table>' +
'<tr>' + '<tr>' +
'<td colspan="3">' + '<td colspan="3">' +
'<div class="schema-align-node-dialog-node-type">' + '<div class="schema-align-node-dialog-node-type">' +
@ -429,10 +425,10 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<td>Language</td>' + '<td>Language</td>' +
'<td><input bind="valueNodeTypeLanguageInput" /></td>' + '<td><input bind="valueNodeTypeLanguageInput" /></td>' +
'</tr>' + '</tr>' +
'</table>' + '</table></div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
'</table>' '</table></div>'
).appendTo(body); ).appendTo(body);
var elmts = DOM.bind(html); var elmts = DOM.bind(html);
@ -466,7 +462,6 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
elmts.cellAsTopicNodeTypeInput[0].value = typeName; elmts.cellAsTopicNodeTypeInput[0].value = typeName;
elmts.cellAsTopicNodeTypeInput.data("data.suggest", { "id" : typeID, "name" : typeName }); elmts.cellAsTopicNodeTypeInput.data("data.suggest", { "id" : typeID, "name" : typeName });
elmts.radioNodeTypeCellAsTopicCreate[0].checked = true;
elmts.radioNodeTypeCellAsTopic[0].checked = true; elmts.radioNodeTypeCellAsTopic[0].checked = true;
} }
}); });
@ -498,11 +493,6 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
.bind("focus", function() { elmts.radioNodeTypeValue[0].checked = true; }) .bind("focus", function() { elmts.radioNodeTypeValue[0].checked = true; })
.suggest({ type: "/type/lang" }); .suggest({ type: "/type/lang" });
elmts.radioNodeTypeCellAsTopicCreate
.click(function() {
elmts.radioNodeTypeCellAs[0].checked = true;
elmts.radioNodeTypeCellAsTopic[0].checked = true;
});
elmts.cellAsTopicNodeTypeInput elmts.cellAsTopicNodeTypeInput
.bind("focus", function() { .bind("focus", function() {
elmts.radioNodeTypeCellAs[0].checked = true; elmts.radioNodeTypeCellAs[0].checked = true;
@ -562,9 +552,6 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
elmts.cellAsKeyInput[0].value = this._node.namespace.name; elmts.cellAsKeyInput[0].value = this._node.namespace.name;
elmts.cellAsKeyInput.data("data.suggest", this._node.namespace); elmts.cellAsKeyInput.data("data.suggest", this._node.namespace);
} }
if ("createForNoReconMatch" in this._node) {
elmts.radioNodeTypeCellAsTopicCreate[0].checked = this._node.createForNoReconMatch;
}
if ("lang" in this._node) { if ("lang" in this._node) {
elmts.valueNodeTypeLanguageInput[0].value = this._node.lang; elmts.valueNodeTypeLanguageInput[0].value = this._node.lang;
elmts.valueNodeTypeLanguageInput.data("data.suggest", { id: this._node.lang }); elmts.valueNodeTypeLanguageInput.data("data.suggest", { id: this._node.lang });
@ -598,11 +585,10 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
} }
if (node.nodeType == "cell-as-topic") { if (node.nodeType == "cell-as-topic") {
node.createForNoReconMatch = elmts.radioNodeTypeCellAsTopicCreate[0].checked;
var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest"); var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest");
if (!(t) && node.createForNoReconMatch) { if (!(t)) {
alert("For creating a new graph node, you need to specify a type for it."); alert("For creating a new graph node, you need to specify a type for it.");
elmts.cellAsTopicNodeTypeInput.focus();
return null; return null;
} }
node.type = { node.type = {
@ -695,8 +681,7 @@ SchemaAlignmentDialog.UINode.prototype.getJSON = function() {
result = { result = {
nodeType: this._node.nodeType, nodeType: this._node.nodeType,
columnNames: this._node.columnNames, columnNames: this._node.columnNames,
type: "type" in this._node ? cloneDeep(this._node.type) : { "id" : "/common/topic", "name" : "Topic", "cvt" : false }, type: "type" in this._node ? cloneDeep(this._node.type) : { "id" : "/common/topic", "name" : "Topic", "cvt" : false }
createForNoReconMatch: "createForNoReconMatch" in this._node ? this._node.createForNoReconMatch : true
}; };
getLinks = true; getLinks = true;
} else if (this._node.nodeType == "cell-as-value") { } else if (this._node.nodeType == "cell-as-value") {

View File

@ -119,7 +119,6 @@ div.schema-alignment-dialog-preview {
.schema-align-node-dialog-node-type { .schema-align-node-dialog-node-type {
padding: 0.25em; padding: 0.25em;
background: #ddf; background: #ddf;
-moz-border-radius: 0.5em;
} }
.schema-align-node-dialog-node-type input { .schema-align-node-dialog-node-type input {
vertical-align: text-bottom; vertical-align: text-bottom;