Re-worked the cell editor popup.

Don't keep logging "Saved workspace."

git-svn-id: http://google-refine.googlecode.com/svn/trunk@235 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-03-08 06:30:47 +00:00
parent 5d3a57eeeb
commit ac50b3c48b
3 changed files with 37 additions and 16 deletions

View File

@ -210,7 +210,7 @@ public class ProjectManager {
oldFile.delete();
}
Gridworks.log("Saved workspace.");
//Gridworks.log("Saved workspace.");
}
}

View File

@ -290,15 +290,23 @@ DataTableCellUI.prototype._startEdit = function(elmt) {
var originalContent = this._cell == null || ("v" in this._cell && this._cell.v == null) ? "" : this._cell.v;
var menu = MenuSystem.createMenu().width("350px");
var menu = MenuSystem.createMenu().addClass("data-table-cell-editor").width("400px");
menu.html(
'<table class="data-table-cell-edit-layout">' +
'<table class="data-table-cell-editor-layout">' +
'<tr>' +
'<td colspan="4">' +
'<textarea class="data-table-cell-edit-editor" bind="textarea" />' +
'<td colspan="5">' +
'<textarea class="data-table-cell-editor-editor" bind="textarea" />' +
'</td>' +
'</tr>' +
'<tr>' +
'<td width="1%" align="center">' +
'<button bind="okButton">Apply</button><br/>' +
'<span class="data-table-cell-editor-key">Enter</span>' +
'</td>' +
'<td width="1%" align="center">' +
'<button bind="cancelButton">Cancel</button><br/>' +
'<span class="data-table-cell-editor-key">Esc</span>' +
'</td>' +
'<td>' +
'<select bind="typeSelect">' +
'<option value="text">text</option>' +
@ -312,10 +320,7 @@ DataTableCellUI.prototype._startEdit = function(elmt) {
'</td>' +
'<td>' +
'apply to other cells with<br/>' +
'same original content' +
'</td>' +
'<td width="1%">' +
'<button bind="okButton">&nbsp;&nbsp;OK&nbsp;&nbsp;</button>' +
'same content <span class="data-table-cell-editor-key">(Ctrl-Enter)</span>' +
'</td>' +
'</tr>' +
'</table>'
@ -392,6 +397,9 @@ DataTableCellUI.prototype._startEdit = function(elmt) {
.text(originalContent)
.keydown(function(evt) {
if (evt.keyCode == 13) {
if (evt.ctrlKey) {
elmts.applyOthersCheckbox[0].checked = true;
}
commit();
} else if (evt.keyCode == 27) {
MenuSystem.dismissAll();
@ -399,4 +407,8 @@ DataTableCellUI.prototype._startEdit = function(elmt) {
})
.select()
.focus();
elmts.cancelButton.click(function() {
MenuSystem.dismissAll();
});
};

View File

@ -163,24 +163,33 @@ a.data-table-star-off {
background-position: -17px 0px;
}
table.data-table-cell-edit-layout {
.data-table-cell-editor {
border: 1px solid #ccc;
padding: 5px;
background: #fffee0;
}
table.data-table-cell-editor-layout {
width: 100%;
white-space: pre;
}
table.data-table-cell-edit-layout > tbody > tr > td {
padding-right: 5px;
padding-bottom: 5px;
table.data-table-cell-editor-layout > tbody > tr > td {
padding-right: 3px;
padding-bottom: 3px;
}
table.data-table-cell-edit-layout > tbody > tr > td:last-child {
table.data-table-cell-editor-layout > tbody > tr > td:last-child {
padding-right: 0px;
}
table.data-table-cell-edit-layout > tbody > tr:last-child > td {
table.data-table-cell-editor-layout > tbody > tr:last-child > td {
padding-bottom: 0px;
}
textarea.data-table-cell-edit-editor {
textarea.data-table-cell-editor-editor {
display: block;
width: 96%;
padding: 2%;
height: 3em;
}
span.data-table-cell-editor-key {
color: #aaa;
}