From feb4ec31a970489f403260ea800ed420ade2eccb Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Mon, 26 Aug 2019 11:30:11 +0200 Subject: [PATCH 1/8] Auto-focus input fields into which users likely type immediately --- main/webapp/modules/core/scripts/project/history-panel.html | 2 +- .../core/scripts/views/data-table/split-column-dialog.html | 2 +- .../views/data-table/split-multi-valued-cells-dialog.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/webapp/modules/core/scripts/project/history-panel.html b/main/webapp/modules/core/scripts/project/history-panel.html index ea10e168c..c13adf4ad 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.html +++ b/main/webapp/modules/core/scripts/project/history-panel.html @@ -7,7 +7,7 @@
- +
diff --git a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html index beccb99ef..ce0da045d 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html @@ -14,7 +14,7 @@ - + diff --git a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html index c68744865..aa77b14eb 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html @@ -14,7 +14,7 @@ - + From 870a1b20a1338b8adf71e8d10acf2b4b8261f8d2 Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Mon, 26 Aug 2019 15:12:51 +0200 Subject: [PATCH 2/8] Use JavaScript-based focussing, rathrer than Reverts feb4ec3 --- .../modules/core/scripts/project/history-panel.html | 9 +++++++-- .../scripts/views/data-table/split-column-dialog.html | 9 +++++++-- .../data-table/split-multi-valued-cells-dialog.html | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/main/webapp/modules/core/scripts/project/history-panel.html b/main/webapp/modules/core/scripts/project/history-panel.html index c13adf4ad..72abb39a1 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.html +++ b/main/webapp/modules/core/scripts/project/history-panel.html @@ -7,7 +7,7 @@
- +
@@ -17,4 +17,9 @@
-
' \ No newline at end of file +
+ diff --git a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html index ce0da045d..9418f059d 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html @@ -14,7 +14,7 @@ - + @@ -56,4 +56,9 @@
- \ No newline at end of file + + diff --git a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html index aa77b14eb..4f7e712ad 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html @@ -14,7 +14,7 @@ - + @@ -37,4 +37,9 @@ - \ No newline at end of file + + From 90af379d5f432d020f665866b8837ed86e094bcc Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Wed, 28 Aug 2019 19:21:10 +0200 Subject: [PATCH 3/8] Partially revert "Use JavaScript-based focussing, rathrer than" This partially reverts commit 870a1b20a1338b8adf71e8d10acf2b4b8261f8d2. --- .../webapp/modules/core/scripts/project/history-panel.html | 7 +------ .../core/scripts/views/data-table/split-column-dialog.html | 7 +------ .../views/data-table/split-multi-valued-cells-dialog.html | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/main/webapp/modules/core/scripts/project/history-panel.html b/main/webapp/modules/core/scripts/project/history-panel.html index 72abb39a1..17e655176 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.html +++ b/main/webapp/modules/core/scripts/project/history-panel.html @@ -17,9 +17,4 @@
- - +' \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html index 9418f059d..35bae7969 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html @@ -56,9 +56,4 @@ - - + \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html index 4f7e712ad..a7f84be2f 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html @@ -37,9 +37,4 @@ - - + \ No newline at end of file From 439f34171c5a2bb90a7809d0478589bac7874acf Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Wed, 28 Aug 2019 19:26:28 +0200 Subject: [PATCH 4/8] Fix typo in input field id --- main/webapp/modules/core/scripts/project/history-panel.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/webapp/modules/core/scripts/project/history-panel.html b/main/webapp/modules/core/scripts/project/history-panel.html index 17e655176..da5cf9ebd 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.html +++ b/main/webapp/modules/core/scripts/project/history-panel.html @@ -7,7 +7,7 @@
- +
From 609a6391291df8d7850768776bba349d3b5e2f3d Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Wed, 28 Aug 2019 19:35:33 +0200 Subject: [PATCH 5/8] Move focussing code to proper .js file --- main/webapp/modules/core/scripts/project/history-panel.js | 4 ++++ .../modules/core/scripts/views/data-table/menu-edit-cells.js | 4 ++++ .../modules/core/scripts/views/data-table/menu-edit-column.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/main/webapp/modules/core/scripts/project/history-panel.js b/main/webapp/modules/core/scripts/project/history-panel.js index 2ac703933..b848f0e60 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.js +++ b/main/webapp/modules/core/scripts/project/history-panel.js @@ -256,6 +256,10 @@ HistoryPanel.prototype._showExtractOperationsDialog = function(json) { }); var level = DialogSystem.showDialog(frame); + + function setFocusToTextBox() { + document.getElementById("filterInput").focus(); + } elmts.textarea[0].select(); }; diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js index 3bfb5bb6e..928adc8c2 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js @@ -304,6 +304,10 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var level = DialogSystem.showDialog(frame); var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; + + function setFocusToTextBox() { + document.getElementById("separatorInput").focus(); + } elmts.cancelButton.click(dismiss); elmts.okButton.click(function() { diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js index 676ced7ab..3c2ab81c7 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js @@ -277,6 +277,10 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var level = DialogSystem.showDialog(frame); var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; + + function setFocusToTextBox() { + document.getElementById("separatorInput").focus(); + } elmts.cancelButton.click(dismiss); elmts.okButton.click(function() { From 200d11cbef89904384f483598c6a11b5500b666b Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Wed, 28 Aug 2019 19:59:59 +0200 Subject: [PATCH 6/8] Search autofocus element in DOM, instead of defining function --- main/webapp/modules/core/scripts/project/history-panel.js | 4 +--- .../core/scripts/views/data-table/menu-edit-cells.js | 6 ++---- .../core/scripts/views/data-table/menu-edit-column.js | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/main/webapp/modules/core/scripts/project/history-panel.js b/main/webapp/modules/core/scripts/project/history-panel.js index b848f0e60..fddaac55e 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.js +++ b/main/webapp/modules/core/scripts/project/history-panel.js @@ -257,9 +257,7 @@ HistoryPanel.prototype._showExtractOperationsDialog = function(json) { var level = DialogSystem.showDialog(frame); - function setFocusToTextBox() { - document.getElementById("filterInput").focus(); - } + elmts.getElementById("filterInput").focus(); elmts.textarea[0].select(); }; diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js index 928adc8c2..5543761e5 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js @@ -305,10 +305,8 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var level = DialogSystem.showDialog(frame); var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; - function setFocusToTextBox() { - document.getElementById("separatorInput").focus(); - } - + elmts.getElementById("separatorInput").focus(); + elmts.cancelButton.click(dismiss); elmts.okButton.click(function() { var mode = $("input[name='split-by-mode']:checked")[0].value; diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js index 3c2ab81c7..798ec3ac9 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js @@ -278,9 +278,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var level = DialogSystem.showDialog(frame); var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; - function setFocusToTextBox() { - document.getElementById("separatorInput").focus(); - } + elmts.getElementById("separatorInput").focus(); elmts.cancelButton.click(dismiss); elmts.okButton.click(function() { From abe4137ae528cc2c02d402d9fb4585c35a48d197 Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Sat, 31 Aug 2019 06:50:34 +0200 Subject: [PATCH 7/8] Speed up input of separator characters (fix #2130) --- .../modules/core/scripts/views/data-table/menu-edit-cells.js | 2 +- .../modules/core/scripts/views/data-table/menu-edit-column.js | 2 +- .../core/scripts/views/data-table/split-column-dialog.html | 2 +- .../views/data-table/split-multi-valued-cells-dialog.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js index 5543761e5..a1191ecbb 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-cells.js @@ -305,7 +305,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var level = DialogSystem.showDialog(frame); var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; - elmts.getElementById("separatorInput").focus(); + elmts.separatorInput.focus().select(); elmts.cancelButton.click(dismiss); elmts.okButton.click(function() { diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js index 798ec3ac9..8556b0683 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js @@ -278,7 +278,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var level = DialogSystem.showDialog(frame); var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; - elmts.getElementById("separatorInput").focus(); + elmts.separatorInput.focus().select(); elmts.cancelButton.click(dismiss); elmts.okButton.click(function() { diff --git a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html index 35bae7969..beccb99ef 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html @@ -14,7 +14,7 @@ - + diff --git a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html index a7f84be2f..c68744865 100644 --- a/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html +++ b/main/webapp/modules/core/scripts/views/data-table/split-multi-valued-cells-dialog.html @@ -14,7 +14,7 @@ - + From 8a3cc41acb3961c371bdf5117112461f56f6f670 Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Sat, 31 Aug 2019 06:59:43 +0200 Subject: [PATCH 8/8] Reset history-panel to 4a8d8afb The changes in abe4137a do not translate here. Maybe because history-panel-filter is loaded in the background in the "Undo / Redo" tab? --- main/webapp/modules/core/scripts/project/history-panel.html | 2 +- main/webapp/modules/core/scripts/project/history-panel.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/main/webapp/modules/core/scripts/project/history-panel.html b/main/webapp/modules/core/scripts/project/history-panel.html index da5cf9ebd..ea10e168c 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.html +++ b/main/webapp/modules/core/scripts/project/history-panel.html @@ -7,7 +7,7 @@
- +
diff --git a/main/webapp/modules/core/scripts/project/history-panel.js b/main/webapp/modules/core/scripts/project/history-panel.js index fddaac55e..2ac703933 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.js +++ b/main/webapp/modules/core/scripts/project/history-panel.js @@ -256,8 +256,6 @@ HistoryPanel.prototype._showExtractOperationsDialog = function(json) { }); var level = DialogSystem.showDialog(frame); - - elmts.getElementById("filterInput").focus(); elmts.textarea[0].select(); };