Fixed Issue 433: Usability: use HTML <label> (e.g., for checkboxes) (for index page)
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2260 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
fbc990a2e0
commit
0e6c37ce35
@ -19,15 +19,21 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" /></td><td>Discard initial</td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip"/></td>
|
||||
<td><label for="$skip">Discard initial</label></td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$skip">row(s) of data</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" /></td>
|
||||
<td colspan="2">Store blank rows</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /></td>
|
||||
<td colspan="2">Store blank cells as nulls</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">row(s) of data</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
|
||||
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
|
||||
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div></div>
|
@ -22,19 +22,30 @@
|
||||
<td rowspan="2" width="40%"><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer"></table></div></td>
|
||||
|
||||
<td colspan="2"><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" /></td><td>Ignore first</td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> line(s) at beginning of file</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" /></td><td>Parse next</td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> line(s) as column headers</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" /></td><td>Discard initial</td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
|
||||
<td><label for="$ignore">Ignore first</label></td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$ignore">line(s) at beginning of file</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" /></td>
|
||||
<td colspan="2">Store blank rows</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /></td>
|
||||
<td colspan="2">Store blank cells as nulls</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
|
||||
<td><label for="$headers">Parse next</label></td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
|
||||
<label for="$headers">line(s) as column headers</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
|
||||
<td><label for="$skip">Discard initial</label></td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$skip">row(s) of data</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">row(s) of data</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
|
||||
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
|
||||
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div></div>
|
@ -192,9 +192,12 @@ Refine.GDataImportingController.prototype._showParsingPanel = function() {
|
||||
if (this._doc.type != 'table') {
|
||||
var sheetTable = this._parsingPanelElmts.sheetRecordContainer[0];
|
||||
$.each(this._options.worksheets, function(i, v) {
|
||||
var id = 'gdata-worksheet-' + Math.round(Math.random() * 1000000);
|
||||
|
||||
var tr = sheetTable.insertRow(sheetTable.rows.length);
|
||||
var td0 = $(tr.insertCell(0)).attr('width', '1%');
|
||||
var checkbox = $('<input>')
|
||||
.attr('id', id)
|
||||
.attr('type', 'radio')
|
||||
.attr('name', 'gdata-importing-parsing-worksheet')
|
||||
.attr('sheetUrl', this.link)
|
||||
@ -202,8 +205,16 @@ Refine.GDataImportingController.prototype._showParsingPanel = function() {
|
||||
if (i === 0) {
|
||||
checkbox.attr('checked', 'true');
|
||||
}
|
||||
$(tr.insertCell(1)).text(this.name);
|
||||
$(tr.insertCell(2)).text(this.rows + ' rows');
|
||||
|
||||
$('<label>')
|
||||
.attr('for', id)
|
||||
.text(this.name)
|
||||
.appendTo(tr.insertCell(1));
|
||||
|
||||
$('<label>')
|
||||
.attr('for', id)
|
||||
.text(this.rows + ' rows')
|
||||
.appendTo(tr.insertCell(2));
|
||||
});
|
||||
|
||||
if (this._options.ignoreLines > 0) {
|
||||
|
@ -14,23 +14,32 @@
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" /></td><td>Ignore first</td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> line(s) at beginning of file</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" /></td><td>Parse next</td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> line(s) as column headers</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" /></td><td>Discard initial</td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr>
|
||||
<td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
|
||||
<td><label for="$ignore">Ignore first</label></td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$ignore">line(s) at beginning of file</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
|
||||
<td><label for="$headers">Parse next</label></td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
|
||||
<label for="$headers">line(s) as column headers</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
|
||||
<td><label for="$skip">Discard initial</label></td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$skip">row(s) of data</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">row(s) of data</label></td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" /></td>
|
||||
<td colspan="2">Store blank rows</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /></td>
|
||||
<td colspan="2">Store blank cells as nulls</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" /></td>
|
||||
<td>Store file source<br/>(file names, URLs)<br/>in each row</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
|
||||
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
|
||||
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
|
||||
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -121,9 +121,11 @@ Refine.ExcelParserUI.prototype._initialize = function() {
|
||||
|
||||
var sheetTable = this._optionContainerElmts.sheetRecordContainer[0];
|
||||
$.each(this._config.sheetRecords, function(i, v) {
|
||||
var id = 'core-excel-worksheet-' + Math.round(Math.random() * 1000000);
|
||||
var tr = sheetTable.insertRow(sheetTable.rows.length);
|
||||
var td0 = $(tr.insertCell(0)).attr('width', '1%');
|
||||
var checkbox = $('<input>')
|
||||
.attr('id', id)
|
||||
.attr('type', 'checkbox')
|
||||
.attr('index', i)
|
||||
.appendTo(td0);
|
||||
@ -131,8 +133,15 @@ Refine.ExcelParserUI.prototype._initialize = function() {
|
||||
checkbox.attr('checked', 'true');
|
||||
}
|
||||
|
||||
$(tr.insertCell(1)).text(this.name);
|
||||
$(tr.insertCell(2)).text(this.rows + ' rows');
|
||||
$('<label>')
|
||||
.attr('for', id)
|
||||
.text(this.name)
|
||||
.appendTo(tr.insertCell(1));
|
||||
|
||||
$('<label>')
|
||||
.attr('for', id)
|
||||
.text(this.rows + ' rows')
|
||||
.appendTo(tr.insertCell(2));
|
||||
});
|
||||
|
||||
if (this._config.ignoreLines > 0) {
|
||||
|
@ -22,30 +22,42 @@
|
||||
<tr>
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td colspan="2">Rows are separated by</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="new-line" /></td><td>new line characters \n</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="custom" /></td><td>custom
|
||||
<input bind="rowSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="new-line" id="$row-separator-new-line" /></td>
|
||||
<td><label for="$row-separator-new-line">new line characters \n</label></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="custom" id="$row-separator-custom" /></td>
|
||||
<td><label for="$row-separator-custom">custom</label>
|
||||
<input bind="rowSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td colspan="2">Escape special characters with \</td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" /></td><td>Ignore first</td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> line(s) at beginning of file</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" /></td><td>Parse next</td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> line(s) as column headers</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" /></td><td>Discard initial</td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
|
||||
<td><label for="$ignore">Ignore first</label></td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$ignore">line(s) at beginning of file</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
|
||||
<td><label for="$headers">Parse next</label></td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
|
||||
<label for="$headers">line(s) as column headers</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
|
||||
<td><label for="$skip">Discard initial</label></td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$skip">row(s) of data</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">row(s) of data</label></td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" /></td>
|
||||
<td>Parse cell text into<br/>numbers, dates, ...</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" /></td>
|
||||
<td colspan="2">Store blank rows</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /></td>
|
||||
<td colspan="2">Store blank cells as nulls</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" /></td>
|
||||
<td>Store file source<br/>(file names, URLs)<br/>in each row</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td>
|
||||
<td><label for="$guess">Parse cell text into<br/>numbers, dates, ...</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
|
||||
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
|
||||
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
|
||||
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -10,10 +10,12 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> record(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" /></td>
|
||||
<td colspan="2">Store file source (file names, URLs) in each row</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">record(s) of data</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
|
||||
<td colspan="2"><label for="$include-file-sources">Store file source (file names, URLs) in each row</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -70,6 +70,17 @@ Refine.JsonParserUI.prototype.getOptions = function() {
|
||||
recordPath: this._config.recordPath
|
||||
};
|
||||
|
||||
var parseIntDefault = function(s, def) {
|
||||
try {
|
||||
var n = parseInt(s);
|
||||
if (!isNaN(n)) {
|
||||
return n;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore
|
||||
}
|
||||
return def;
|
||||
};
|
||||
if (this._optionContainerElmts.limitCheckbox[0].checked) {
|
||||
options.limit = parseIntDefault(this._optionContainerElmts.limitInput[0].value, -1);
|
||||
} else {
|
||||
|
@ -20,26 +20,36 @@
|
||||
</td></tr>
|
||||
|
||||
<tr><td colspan="2">Lines are separated by</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="new-line" /></td><td>new line characters \n</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="custom" /></td><td>custom
|
||||
<input bind="rowSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="new-line" id="$row-separator-new-line" /></td>
|
||||
<td><label for="$row-separator-new-line">new line characters \n</label></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="custom" id="$row-separator-custom" /></td>
|
||||
<td><label for="$row-separator-custom">custom</label>
|
||||
<input bind="rowSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td colspan="2">Escape special characters with \</td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" /></td>
|
||||
<td colspan="2">Store blank rows</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /></td>
|
||||
<td colspan="2">Store blank cells as nulls</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" /></td>
|
||||
<td>Store file source<br/>(file names, URLs)<br/>in each row</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
|
||||
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
|
||||
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
|
||||
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td colspan="2"><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" /></td><td>Ignore first</td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> line(s) at beginning of file</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" /></td><td>Discard initial</td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
|
||||
<td><label for="$ignore">Ignore first</label></td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$ignore">line(s) at beginning of file</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
|
||||
<td><label for="$skip">Discard initial</label></td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$skip">row(s) of data</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">row(s) of data</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -16,45 +16,65 @@
|
||||
<tr>
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td colspan="2">Columns are separated by</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="column-separator" value="comma" /></td><td>commas (CSV)</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="column-separator" value="tab" /></td><td>tabs (TSV)</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="column-separator" value="custom" /></td>
|
||||
<td>custom <input bind="columnSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="column-separator" value="comma" id="$column-separator-comma" /></td>
|
||||
<td><label for="$column-separator-comma">commas (CSV)</label></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="column-separator" value="tab" id="$column-separator-tab" /></td>
|
||||
<td><label for="$column-separator-tab">tabs (TSV)</label></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="column-separator" value="custom" id="$column-separator-custom" /></td>
|
||||
<td><label for="$column-separator-custom">custom</label>
|
||||
<input bind="columnSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td colspan="2">Escape special characters with \</td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td colspan="2"><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" /></td><td>Ignore first</td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> line(s) at beginning of file</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" /></td><td>Parse next</td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> line(s) as column headers</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" /></td><td>Discard initial</td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> row(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
|
||||
<td><label for="$ignore">Ignore first</label></td>
|
||||
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$ignore">line(s) at beginning of file</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
|
||||
<td><label for="$headers">Parse next</label></td>
|
||||
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
|
||||
<label for="$headers">line(s) as column headers</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
|
||||
<td><label for="$skip">Discard initial</label></td>
|
||||
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$skip">row(s) of data</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">row(s) of data</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td colspan="2">Rows are separated by</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="new-line" /></td><td>new line characters \n</td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="custom" /></td><td>custom
|
||||
<input bind="rowSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="new-line" id="$row-separator-new-line" /></td>
|
||||
<td><label for="$row-separator-new-line">new line characters \n</label></td></tr>
|
||||
<tr><td width="1%"><input type="radio" name="row-separator" value="custom" id="$row-separator-custom" /></td>
|
||||
<td><label for="$row-separator-custom">custom</label>
|
||||
<input bind="rowSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
|
||||
<tr><td colspan="2">Escape special characters with \</td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" /></td>
|
||||
<td>Parse cell text into<br/>numbers, dates, ...</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="processQuoteMarksCheckbox" /></td>
|
||||
<td>Quotation marks are used<br/>to enclose cells containing<br/>column separators</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td>
|
||||
<td><label for="$guess">Parse cell text into<br/>numbers, dates, ...</label></td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="processQuoteMarksCheckbox" id="$quotes" /></td>
|
||||
<td><label for="$quotes">Quotation marks are used<br/>to enclose cells containing<br/>column separators</label></td></tr>
|
||||
</table></div></td>
|
||||
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" /></td>
|
||||
<td colspan="2">Store blank rows</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /></td>
|
||||
<td colspan="2">Store blank cells as nulls</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" /></td>
|
||||
<td>Store file source<br/>(file names, URLs)<br/>in each row</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
|
||||
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
|
||||
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
|
||||
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -10,10 +10,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="grid-layout layout-tightest"><table>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" /></td><td>Load at most</td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> record(s) of data</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" /></td>
|
||||
<td colspan="2">Store file source (file names, URLs) in each row</td></tr>
|
||||
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
|
||||
<td><label for="$limit">Load at most</label></td>
|
||||
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
|
||||
<label for="$limit">record(s) of data</label></td></tr>
|
||||
|
||||
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
|
||||
<td colspan="2"><label for="$include-file-sources">Store file source (file names, URLs) in each row</label></td></tr>
|
||||
</table></div></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -69,7 +69,17 @@ Refine.XmlParserUI.prototype.getOptions = function() {
|
||||
var options = {
|
||||
recordPath: this._config.recordPath
|
||||
};
|
||||
|
||||
var parseIntDefault = function(s, def) {
|
||||
try {
|
||||
var n = parseInt(s);
|
||||
if (!isNaN(n)) {
|
||||
return n;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore
|
||||
}
|
||||
return def;
|
||||
};
|
||||
if (this._optionContainerElmts.limitCheckbox[0].checked) {
|
||||
options.limit = parseIntDefault(this._optionContainerElmts.limitInput[0].value, -1);
|
||||
} else {
|
||||
@ -194,7 +204,9 @@ Refine.XmlParserUI.prototype._showPickRecordElementsUI = function() {
|
||||
});
|
||||
}
|
||||
};
|
||||
renderNode(this._config.dom, elmts.domContainer, []);
|
||||
if (this._config.dom) {
|
||||
renderNode(this._config.dom, elmts.domContainer, []);
|
||||
}
|
||||
};
|
||||
|
||||
Refine.XmlParserUI.prototype._scheduleUpdatePreview = function() {
|
||||
|
@ -35,31 +35,69 @@ var DOM = {};
|
||||
|
||||
DOM.bind = function(elmt) {
|
||||
var map = {};
|
||||
var idmap = {};
|
||||
|
||||
for (var i = 0; i < elmt.length; i++) {
|
||||
DOM._bindDOMElement(elmt[i], map);
|
||||
DOM._bindDOMElement(elmt[i], map, idmap);
|
||||
}
|
||||
for (var key in idmap) {
|
||||
if (idmap.hasOwnProperty(key)) {
|
||||
for (var i = 0; i < elmt.length; i++) {
|
||||
DOM._resolveIdInDOMElement(elmt[i], idmap);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
DOM._bindDOMElement = function(elmt, map) {
|
||||
DOM._bindDOMElement = function(elmt, map, idmap) {
|
||||
var bind = elmt.getAttribute("bind");
|
||||
if (bind !== null && bind.length > 0) {
|
||||
map[bind] = $(elmt);
|
||||
}
|
||||
|
||||
var id = elmt.id;
|
||||
if (id !== null && id.length > 0 && id.substring(0, 1) == '$') {
|
||||
var newID = id.substring(1) + '-' + Math.round(Math.random() * 1000000);
|
||||
idmap[id] = newID;
|
||||
elmt.id = newID;
|
||||
}
|
||||
|
||||
if (elmt.hasChildNodes()) {
|
||||
DOM._bindDOMChildren(elmt, map);
|
||||
DOM._bindDOMChildren(elmt, map, idmap);
|
||||
}
|
||||
};
|
||||
|
||||
DOM._bindDOMChildren = function(elmt, map) {
|
||||
DOM._bindDOMChildren = function(elmt, map, idmap) {
|
||||
var node = elmt.firstChild;
|
||||
while (node !== null) {
|
||||
var node2 = node.nextSibling;
|
||||
if (node.nodeType == 1) {
|
||||
DOM._bindDOMElement(node, map);
|
||||
DOM._bindDOMElement(node, map, idmap);
|
||||
}
|
||||
node = node2;
|
||||
}
|
||||
};
|
||||
|
||||
DOM._resolveIdInDOMElement = function(elmt, idmap) {
|
||||
var forAttr = elmt.getAttribute("for");
|
||||
if (forAttr !== null && forAttr.length > 0 && forAttr in idmap) {
|
||||
elmt.setAttribute("for", idmap[forAttr]);
|
||||
}
|
||||
|
||||
if (elmt.hasChildNodes()) {
|
||||
DOM._resolveIdInDOMChildren(elmt, idmap);
|
||||
}
|
||||
};
|
||||
|
||||
DOM._resolveIdInDOMChildren = function(elmt, idmap) {
|
||||
var node = elmt.firstChild;
|
||||
while (node !== null) {
|
||||
var node2 = node.nextSibling;
|
||||
if (node.nodeType == 1) {
|
||||
DOM._resolveIdInDOMElement(node, idmap);
|
||||
}
|
||||
node = node2;
|
||||
}
|
||||
|
@ -55,6 +55,10 @@ h2 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
padding: @padding_tighter;
|
||||
font-size: 1em;
|
||||
|
Loading…
Reference in New Issue
Block a user