Merge remote-tracking branch 'origin/master'

This commit is contained in:
Hosted Weblate 2021-11-26 21:36:26 +01:00
commit a56ec3b69f
No known key found for this signature in database
GPG Key ID: A3FAAA06E6569B4C
27 changed files with 229 additions and 17 deletions

View File

@ -46,7 +46,8 @@
"database-parsing/updating-preview": "Updating preview …", "database-parsing/updating-preview": "Updating preview …",
"database-parsing/worksheet": "Worksheets", "database-parsing/worksheet": "Worksheets",
"database-parsing/option": "Options", "database-parsing/option": "Options",
"database-parsing/preview-button": "Update Preview", "database-parsing/preview-button": "Update preview",
"database-parsing/disable-auto-preview": "Disable auto preview",
"database-parsing/ignore-first": "Ignore first", "database-parsing/ignore-first": "Ignore first",
"database-parsing/ignore": "line(s) at beginning of file", "database-parsing/ignore": "line(s) at beginning of file",
"database-parsing/parse-next": "Parse next", "database-parsing/parse-next": "Parse next",

View File

@ -13,7 +13,7 @@
"database-parsing/parse-next": "Parse next", "database-parsing/parse-next": "Parse next",
"database-parsing/ignore": "line(s) at beginning of file", "database-parsing/ignore": "line(s) at beginning of file",
"database-parsing/ignore-first": "Ignore first", "database-parsing/ignore-first": "Ignore first",
"database-parsing/preview-button": "Update Preview", "database-parsing/preview-button": "Update preview",
"database-parsing/option": "Options", "database-parsing/option": "Options",
"database-parsing/worksheet": "Worksheets", "database-parsing/worksheet": "Worksheets",
"database-parsing/updating-preview": "Updating preview …", "database-parsing/updating-preview": "Updating preview …",

View File

@ -131,6 +131,8 @@ Refine.DatabaseImportController.prototype.getOptions = function() {
options.storeBlankRows = this._parsingPanelElmts.storeBlankRowsCheckbox[0].checked; options.storeBlankRows = this._parsingPanelElmts.storeBlankRowsCheckbox[0].checked;
options.storeBlankCellsAsNulls = this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox[0].checked; options.storeBlankCellsAsNulls = this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox[0].checked;
options.disableAutoPreview = this._parsingPanelElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -155,6 +157,7 @@ Refine.DatabaseImportController.prototype._showParsingPanel = function() {
this._parsingPanelElmts.database_limit.html($.i18n('database-parsing/limit')); this._parsingPanelElmts.database_limit.html($.i18n('database-parsing/limit'));
this._parsingPanelElmts.database_store_row.html($.i18n('database-parsing/store-row')); this._parsingPanelElmts.database_store_row.html($.i18n('database-parsing/store-row'));
this._parsingPanelElmts.database_store_cell.html($.i18n('database-parsing/store-cell')); this._parsingPanelElmts.database_store_cell.html($.i18n('database-parsing/store-cell'));
this._parsingPanelElmts.database_disable_auto_preview.text($.i18n('database-parsing/disable-auto-preview'));
if (this._parsingPanelResizer) { if (this._parsingPanelResizer) {
$(window).unbind('resize', this._parsingPanelResizer); $(window).unbind('resize', this._parsingPanelResizer);
@ -220,8 +223,16 @@ Refine.DatabaseImportController.prototype._showParsingPanel = function() {
this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox.prop("checked", true); this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox.prop("checked", true);
} }
if (this._options.disableAutoPreview) {
this._parsingPanelElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._parsingPanelElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._parsingPanel.find("input").bind("change", onChange); this._parsingPanel.find("input").bind("change", onChange);
this._parsingPanel.find("select").bind("change", onChange); this._parsingPanel.find("select").bind("change", onChange);

View File

@ -23,6 +23,11 @@
<td bind="database_options"></td> <td bind="database_options"></td>
<td><button class="button" bind="previewButton"></button></td> <td><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" bind="database_disable_auto_preview"></label></td>
</tr>
<tr> <tr>
<td> <td>
<div class="grid-layout layout-tightest"> <div class="grid-layout layout-tightest">

View File

@ -17,7 +17,8 @@
"gdata-parsing/updating-preview": "Updating preview …", "gdata-parsing/updating-preview": "Updating preview …",
"gdata-parsing/worksheet": "Worksheets", "gdata-parsing/worksheet": "Worksheets",
"gdata-parsing/option": "Options", "gdata-parsing/option": "Options",
"gdata-parsing/preview-button": "Update&nbsp;Preview", "gdata-parsing/preview-button": "Update&nbsp;preview",
"gdata-parsing/disable-auto-preview": "Disable auto preview",
"gdata-parsing/ignore-first": "Ignore first", "gdata-parsing/ignore-first": "Ignore first",
"gdata-parsing/ignore": "line(s) at beginning of file", "gdata-parsing/ignore": "line(s) at beginning of file",
"gdata-parsing/parse-next": "Parse next", "gdata-parsing/parse-next": "Parse next",

View File

@ -18,6 +18,11 @@
<td colspan="2" bind="gdata_options"></td> <td colspan="2" bind="gdata_options"></td>
<td rowspan="2"><button class="button" bind="previewButton"></button></td> <td rowspan="2"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" bind="gdata_disable_auto_preview"></label></td>
</tr>
<tr> <tr>
<td rowspan="2" width="40%"><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer"></table></div></td> <td rowspan="2" width="40%"><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer"></table></div></td>

View File

@ -157,6 +157,8 @@ Refine.GDataImportingController.prototype.getOptions = function() {
options.storeBlankRows = this._parsingPanelElmts.storeBlankRowsCheckbox[0].checked; options.storeBlankRows = this._parsingPanelElmts.storeBlankRowsCheckbox[0].checked;
options.storeBlankCellsAsNulls = this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox[0].checked; options.storeBlankCellsAsNulls = this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox[0].checked;
options.disableAutoPreview = this._parsingPanelElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -177,6 +179,7 @@ Refine.GDataImportingController.prototype._showParsingPanel = function() {
this._parsingPanelElmts.gdata_proj_name.html($.i18n('gdata-parsing/proj-name')); this._parsingPanelElmts.gdata_proj_name.html($.i18n('gdata-parsing/proj-name'));
this._parsingPanelElmts.createProjectButton.html($.i18n('gdata-parsing/create-proj')); this._parsingPanelElmts.createProjectButton.html($.i18n('gdata-parsing/create-proj'));
this._parsingPanelElmts.gdata_options.html($.i18n('gdata-parsing/option')); this._parsingPanelElmts.gdata_options.html($.i18n('gdata-parsing/option'));
this._parsingPanelElmts.gdata_disable_auto_preview.text($.i18n('gdata-parsing/disable-auto-preview'));
this._parsingPanelElmts.previewButton.html($.i18n('gdata-parsing/preview-button')); this._parsingPanelElmts.previewButton.html($.i18n('gdata-parsing/preview-button'));
this._parsingPanelElmts.gdata_updating.html($.i18n('gdata-parsing/updating-preview')); this._parsingPanelElmts.gdata_updating.html($.i18n('gdata-parsing/updating-preview'));
this._parsingPanelElmts.gdata_discard_next.html($.i18n('gdata-parsing/discard-next')); this._parsingPanelElmts.gdata_discard_next.html($.i18n('gdata-parsing/discard-next'));
@ -286,8 +289,16 @@ Refine.GDataImportingController.prototype._showParsingPanel = function() {
this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox.prop("checked", true); this._parsingPanelElmts.storeBlankCellsAsNullsCheckbox.prop("checked", true);
} }
if (this._options.disableAutoPreview) {
this._parsingPanelElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._parsingPanelElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._parsingPanel.find("input").bind("change", onChange); this._parsingPanel.find("input").bind("change", onChange);
this._parsingPanel.find("select").bind("change", onChange); this._parsingPanel.find("select").bind("change", onChange);

View File

@ -9,7 +9,12 @@
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td width="1%"><button class="button" bind="previewButton">Update&nbsp;preview</button></td>
</tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable">Disable auto preview</label></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>

View File

@ -109,6 +109,8 @@ Refine.PCAxisParserUI.prototype.getOptions = function() {
options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked; options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked;
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -143,8 +145,15 @@ Refine.PCAxisParserUI.prototype._initialize = function() {
this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true); this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true);
} }
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -219,4 +219,37 @@ describe(__filename, function () {
cy.get('table.data-table tr').eq(1).should('to.contain', '15.87'); cy.get('table.data-table tr').eq(1).should('to.contain', '15.87');
cy.get('table.data-table tr').eq(1).should('to.contain', '717'); cy.get('table.data-table tr').eq(1).should('to.contain', '717');
}); });
/*
The test case below uses the ignore feature to test the disable automatic preview update checkbox
We first test with automatic preview updates enabled
Then, we test with automatic preview updates disabled, which requires the update button to change the preview
*/
it('Tests disabling of automatic preview', function () {
navigateToProjectPreview();
// **Testing ignore feature with auto preview enabled** //
cy.get('input[bind="ignoreInput"]').type('{backspace}1');
cy.get('input[bind="ignoreCheckbox"]').check();
cy.waitForImportUpdate();
// Look for automatic preview update
cy.get('table.data-table tr').eq(1);
cy.get('table.data-table tr').eq(1).should('to.contain', '01002');
cy.get('input[bind="ignoreCheckbox"]').uncheck();
cy.waitForImportUpdate();
// **Testing ignore feature with auto preview disabled** //
cy.get('input[bind="disableAutoPreviewCheckbox"]').check();
// Verify no auto update
cy.get('input[bind="ignoreCheckbox"]').check();
cy.wait(5000); // 5 second wait. No choice but to use this here because the dom is not rendered.
cy.get('table.data-table tr').eq(1).should('to.contain', '1.');
cy.get('table.data-table tr').eq(1).should('to.contain', '01001');
// Verify update on button click
cy.get('button[bind="previewButton"]').click();
cy.waitForImportUpdate();
cy.get('table.data-table tr').eq(1).should('to.contain', '1.');
cy.get('table.data-table tr').eq(1).should('to.contain', '01002');
cy.get('input[bind="disableAutoPreviewCheckbox"]').uncheck();
});
}); });

View File

@ -131,6 +131,7 @@
"core-index-lang/label": "Select preferred language", "core-index-lang/label": "Select preferred language",
"core-index-lang/send-req": "Change language", "core-index-lang/send-req": "Change language",
"core-index-lang/page-reload": "The page will be refreshed to apply the change.", "core-index-lang/page-reload": "The page will be refreshed to apply the change.",
"core-index-parser/disable-auto-preview": "Disable auto preview",
"core-index-parser/ignore-first": "Ignore first", "core-index-parser/ignore-first": "Ignore first",
"core-index-parser/lines-beg": "line(s) at beginning of file", "core-index-parser/lines-beg": "line(s) at beginning of file",
"core-index-parser/parse-next": "Parse next", "core-index-parser/parse-next": "Parse next",
@ -735,7 +736,7 @@
"core-buttons/next": "Next &raquo;", "core-buttons/next": "Next &raquo;",
"core-buttons/previous": "Back", "core-buttons/previous": "Back",
"core-buttons/add-url": "Add another URL", "core-buttons/add-url": "Add another URL",
"core-buttons/update-preview": "Update&nbsp;Preview", "core-buttons/update-preview": "Update&nbsp;preview",
"core-buttons/pick-record": "Pick record elements", "core-buttons/pick-record": "Pick record elements",
"core-buttons/merge-cluster": "Merge selected &amp; re-cluster", "core-buttons/merge-cluster": "Merge selected &amp; re-cluster",
"core-buttons/merge-close": "Merge selected &amp; Close", "core-buttons/merge-close": "Merge selected &amp; Close",

View File

@ -6,6 +6,11 @@
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="..."></td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>

View File

@ -110,6 +110,8 @@ Refine.ExcelParserUI.prototype.getOptions = function() {
options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked; options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked;
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -125,6 +127,7 @@ Refine.ExcelParserUI.prototype._initialize = function() {
this._optionContainerElmts.selectAllButton.html($.i18n('core-buttons/select-all')); this._optionContainerElmts.selectAllButton.html($.i18n('core-buttons/select-all'));
this._optionContainerElmts.unselectAllButton.click(function() { self._unselectAll(); }); this._optionContainerElmts.unselectAllButton.click(function() { self._unselectAll(); });
this._optionContainerElmts.unselectAllButton.html($.i18n('core-buttons/unselect-all')); this._optionContainerElmts.unselectAllButton.html($.i18n('core-buttons/unselect-all'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-worksheet').text($.i18n('core-index-import/import-worksheet')); $('#or-import-worksheet').text($.i18n('core-index-import/import-worksheet'));
$('#or-import-ignore').text($.i18n('core-index-parser/ignore-first')); $('#or-import-ignore').text($.i18n('core-index-parser/ignore-first'));
$('#or-import-lines').text($.i18n('core-index-parser/lines-beg')); $('#or-import-lines').text($.i18n('core-index-parser/lines-beg'));
@ -192,8 +195,16 @@ Refine.ExcelParserUI.prototype._initialize = function() {
this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true); this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true);
} }
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -11,6 +11,11 @@
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>

View File

@ -112,6 +112,8 @@ Refine.FixedWidthParserUI.prototype.getOptions = function() {
options.includeArchiveFile = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked; options.includeArchiveFile = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked;
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -124,6 +126,7 @@ Refine.FixedWidthParserUI.prototype._initialize = function() {
this._optionContainerElmts.previewButton.click(function() { self.updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self.updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-encoding').html($.i18n('core-index-import/char-encoding')); $('#or-import-encoding').html($.i18n('core-index-import/char-encoding'));
$('#or-import-columnWidth').text($.i18n('core-index-import/column-widths')); $('#or-import-columnWidth').text($.i18n('core-index-import/column-widths'));
$('#or-import-columnNames').text($.i18n('core-index-import/column-names')); $('#or-import-columnNames').text($.i18n('core-index-import/column-names'));
@ -192,8 +195,16 @@ Refine.FixedWidthParserUI.prototype._initialize = function() {
this._optionContainerElmts.includeArchiveFileCheckbox.prop('checked', true); this._optionContainerElmts.includeArchiveFileCheckbox.prop('checked', true);
} }
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -6,6 +6,11 @@
<td width="1%"><button class="button" bind="pickRecordElementsButton"></button></td> <td width="1%"><button class="button" bind="pickRecordElementsButton"></button></td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>

View File

@ -97,6 +97,7 @@ Refine.JsonParserUI.prototype.getOptions = function() {
options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked; options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked;
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -111,6 +112,7 @@ Refine.JsonParserUI.prototype._initialize = function() {
this._optionContainerElmts.pickRecordElementsButton.text($.i18n('core-index-import/warning-record-path')); this._optionContainerElmts.pickRecordElementsButton.text($.i18n('core-index-import/warning-record-path'));
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-load').text($.i18n('core-index-parser/load-at-most')); $('#or-import-load').text($.i18n('core-index-parser/load-at-most'));
$('#or-import-rows').text($.i18n('core-index-parser/rows-data')); $('#or-import-rows').text($.i18n('core-index-parser/rows-data'));
$('#or-import-preserve').text($.i18n('core-index-parser/preserve-empty')); $('#or-import-preserve').text($.i18n('core-index-parser/preserve-empty'));
@ -143,8 +145,16 @@ Refine.JsonParserUI.prototype._initialize = function() {
self._showPickRecordNodesUI(); self._showPickRecordNodesUI();
}); });
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -11,6 +11,11 @@
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>

View File

@ -100,6 +100,8 @@ Refine.LineBasedParserUI.prototype.getOptions = function() {
options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked; options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked;
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -113,6 +115,7 @@ Refine.LineBasedParserUI.prototype._initialize = function() {
$('#or-import-encoding').html($.i18n('core-index-import/char-encoding')); $('#or-import-encoding').html($.i18n('core-index-import/char-encoding'));
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-parseEvery').html($.i18n('core-index-parser/parse-every')); $('#or-import-parseEvery').html($.i18n('core-index-parser/parse-every'));
$('#or-import-linesIntoRow').html($.i18n('core-index-parser/lines-into-row')); $('#or-import-linesIntoRow').html($.i18n('core-index-parser/lines-into-row'));
$('#or-import-blank').text($.i18n('core-index-parser/store-blank')); $('#or-import-blank').text($.i18n('core-index-parser/store-blank'));
@ -164,8 +167,16 @@ Refine.LineBasedParserUI.prototype._initialize = function() {
this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true); this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true);
} }
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -11,6 +11,11 @@
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -65,6 +65,9 @@ Refine.RdfTriplesParserUI.prototype.getOptions = function() {
var options = { var options = {
encoding: $.trim(this._optionContainerElmts.encodingInput[0].value) encoding: $.trim(this._optionContainerElmts.encodingInput[0].value)
}; };
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -77,6 +80,7 @@ Refine.RdfTriplesParserUI.prototype._initialize = function() {
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-encoding').html($.i18n('core-index-import/char-encoding')); $('#or-import-encoding').html($.i18n('core-index-import/char-encoding'));
this._optionContainerElmts.encodingInput this._optionContainerElmts.encodingInput
@ -87,8 +91,16 @@ Refine.RdfTriplesParserUI.prototype._initialize = function() {
}); });
}); });
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -6,13 +6,20 @@
<td><input bind="encodingInput"></input></td> <td><input bind="encodingInput"></input></td>
</tr> </tr>
</table></div></td> </table></div></td>
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td colspan="2" id="or-import-colsep"></td></tr> <tr><td colspan="2" id="or-import-colsep"></td></tr>

View File

@ -120,6 +120,8 @@ Refine.SeparatorBasedParserUI.prototype.getOptions = function() {
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.trimStrings = this._optionContainerElmts.trimStringsCheckbox[0].checked; options.trimStrings = this._optionContainerElmts.trimStringsCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
if (this._optionContainerElmts.columnNamesCheckbox[0].checked) { if (this._optionContainerElmts.columnNamesCheckbox[0].checked) {
var columnNames = this._optionContainerElmts.columnNamesInput.val(); var columnNames = this._optionContainerElmts.columnNamesInput.val();
if (columnNames != undefined && columnNames != null && columnNames != '') { if (columnNames != undefined && columnNames != null && columnNames != '') {
@ -139,6 +141,7 @@ Refine.SeparatorBasedParserUI.prototype._initialize = function() {
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-encoding').html($.i18n('core-index-import/char-encoding')); $('#or-import-encoding').html($.i18n('core-index-import/char-encoding'));
$('#or-import-colsep').html($.i18n('core-index-parser/col-separated-by')); $('#or-import-colsep').html($.i18n('core-index-parser/col-separated-by'));
$('#or-import-commas').html($.i18n('core-index-parser/commas')); $('#or-import-commas').html($.i18n('core-index-parser/commas'));
@ -247,9 +250,18 @@ Refine.SeparatorBasedParserUI.prototype._initialize = function() {
this._optionContainerElmts.trimStringsCheckbox.prop('checked', false); this._optionContainerElmts.trimStringsCheckbox.prop('checked', false);
} }
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);
this._optionContainerElmts.columnNamesInput.bind("keyup",onChange); this._optionContainerElmts.columnNamesInput.bind("keyup",onChange);

View File

@ -36,4 +36,9 @@
<td width="1%"></td> <td width="1%"></td>
<td><button class="button" bind="previewButton"></button></td> <td><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td width="1%"></td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div> </table></div>

View File

@ -104,6 +104,8 @@ Refine.WikitextParserUI.prototype.getOptions = function() {
options.reconService = ReconciliationManager.ensureDefaultServicePresent(); options.reconService = ReconciliationManager.ensureDefaultServicePresent();
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -116,7 +118,7 @@ Refine.WikitextParserUI.prototype._initialize = function() {
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-wiki-base-url').text($.i18n('core-index-parser/wiki-base-url')); $('#or-import-wiki-base-url').text($.i18n('core-index-parser/wiki-base-url'));
$('#or-import-parse').text($.i18n('core-index-parser/parse-next')); $('#or-import-parse').text($.i18n('core-index-parser/parse-next'));
$('#or-import-header').text($.i18n('core-index-parser/lines-header')); $('#or-import-header').text($.i18n('core-index-parser/lines-header'));
@ -188,8 +190,16 @@ Refine.WikitextParserUI.prototype._initialize = function() {
this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true); this._optionContainerElmts.includeArchiveFileCheckbox.prop("checked", true);
} }
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);

View File

@ -6,6 +6,11 @@
<td width="1%"><button class="button" bind="pickRecordElementsButton"></button></td> <td width="1%"><button class="button" bind="pickRecordElementsButton"></button></td>
<td width="1%"><button class="button" bind="previewButton"></button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr>
<td style="text-align: right;">&nbsp;</td>
<td width="1%"><input type="checkbox" bind="disableAutoPreviewCheckbox" id="$disable" />
<label for="$disable" id="or-disable-auto-preview"></label></td>
</tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>

View File

@ -95,6 +95,8 @@ Refine.XmlParserUI.prototype.getOptions = function() {
options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked; options.includeFileSources = this._optionContainerElmts.includeFileSourcesCheckbox[0].checked;
options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked; options.includeArchiveFileName = this._optionContainerElmts.includeArchiveFileCheckbox[0].checked;
options.disableAutoPreview = this._optionContainerElmts.disableAutoPreviewCheckbox[0].checked;
return options; return options;
}; };
@ -108,6 +110,7 @@ Refine.XmlParserUI.prototype._initialize = function() {
this._optionContainerElmts.pickRecordElementsButton.html($.i18n('core-buttons/pick-record')); this._optionContainerElmts.pickRecordElementsButton.html($.i18n('core-buttons/pick-record'));
this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview')); this._optionContainerElmts.previewButton.html($.i18n('core-buttons/update-preview'));
$('#or-disable-auto-preview').text($.i18n('core-index-parser/disable-auto-preview'));
$('#or-import-rows').text($.i18n('core-index-parser/rows-data')); $('#or-import-rows').text($.i18n('core-index-parser/rows-data'));
$('#or-import-load').text($.i18n('core-index-parser/load-at-most')); $('#or-import-load').text($.i18n('core-index-parser/load-at-most'));
$('#or-import-preserve').text($.i18n('core-index-parser/preserve-empty')); $('#or-import-preserve').text($.i18n('core-index-parser/preserve-empty'));
@ -140,8 +143,16 @@ Refine.XmlParserUI.prototype._initialize = function() {
self._showPickRecordElementsUI(); self._showPickRecordElementsUI();
}); });
if (this._config.disableAutoPreview) {
this._optionContainerElmts.disableAutoPreviewCheckbox.prop('checked', true);
}
// If disableAutoPreviewCheckbox is not checked, we will schedule an automatic update
var onChange = function() { var onChange = function() {
if (!self._optionContainerElmts.disableAutoPreviewCheckbox[0].checked)
{
self._scheduleUpdatePreview(); self._scheduleUpdatePreview();
}
}; };
this._optionContainer.find("input").bind("change", onChange); this._optionContainer.find("input").bind("change", onChange);
this._optionContainer.find("select").bind("change", onChange); this._optionContainer.find("select").bind("change", onChange);