Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(I #2638) Feature to Goto a page directly #2639

Merged
merged 99 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
50aa75f
Merge pull request #1 from OpenRefine/master
antoine2711 Apr 19, 2020
2f49878
Merge branch 'master' of https://github.com/OpenRefine/OpenRefine
antoine2711 May 11, 2020
c775556
2020-05-23 Merge branch 'master' of https://github.com/OpenRefine/Ope…
antoine2711 May 23, 2020
2f92e9b
Start for Goto Page link.
antoine2711 May 24, 2020
1cdf81b
Background-color & validation
antoine2711 May 24, 2020
1fa634c
Changed from prompt() to <input type="number">
antoine2711 May 25, 2020
55c57d4
Manage bounds in a sticky way
antoine2711 May 25, 2020
18cc070
width of <input> & « of X pages »
antoine2711 May 25, 2020
a5709fb
Update data-table-view.js
antoine2711 May 25, 2020
f50ceb9
Correct min and max for <input>
antoine2711 May 26, 2020
929b654
Managment of the arrow's key down.
antoine2711 May 26, 2020
ce6f7de
Fixes for Thad’s KeyDown's « Infinite Paging »
antoine2711 May 26, 2020
0003a74
Code rehookCurrentPageInput & spacing
antoine2711 May 26, 2020
6cbb13d
Update data-table-view.js
antoine2711 May 26, 2020
1d43827
Wrap in a Try/Catch the currentPageInput.focus()
antoine2711 May 27, 2020
197897e
Fixed currentPageInput != document.activeElement
antoine2711 May 27, 2020
9a18af2
Better handling of the « Infinite Paging »
antoine2711 May 30, 2020
6254eff
$.i18n('core-views/goto-page', …
antoine2711 May 31, 2020
ef288fa
Fix i18n plural
antoine2711 May 31, 2020
7274a21
Remove {{plural:$2|page|pages}} in french
antoine2711 Jun 1, 2020
00e5e67
Update data-table-view.js
antoine2711 Jun 1, 2020
2403959
Merge branch 'master' of https://github.com/OpenRefine/OpenRefine
antoine2711 Jun 6, 2020
77b38a7
Merge branch 'master' of https://github.com/OpenRefine/OpenRefine
antoine2711 Jun 8, 2020
82d87b1
First implementation
antoine2711 Jun 8, 2020
7136c11
Remove setTimeout(refocusCurrentPageInput, refocusDelay);
antoine2711 Jun 10, 2020
dbe3ed4
Typo: missing semi-colon
antoine2711 Jun 11, 2020
5797e78
Fix bug related to stealing focus of facets & added a delay
antoine2711 Jun 11, 2020
f3c6e77
Revert "Remove {{plural:$2|page|pages}} in french"
antoine2711 Jun 15, 2020
6b1b8e2
Merge branch 'master' of https://github.com/OpenRefine/OpenRefine int…
antoine2711 Jun 15, 2020
8e73eeb
Start for Goto Page link.
antoine2711 May 24, 2020
93c24ff
Background-color & validation
antoine2711 May 24, 2020
849e4de
Changed from prompt() to <input type="number">
antoine2711 May 25, 2020
7c65ea1
Manage bounds in a sticky way
antoine2711 May 25, 2020
8c885c3
width of <input> & « of X pages »
antoine2711 May 25, 2020
af5e4a7
Update data-table-view.js
antoine2711 May 25, 2020
02b1230
Correct min and max for <input>
antoine2711 May 26, 2020
d37152d
Managment of the arrow's key down.
antoine2711 May 26, 2020
5c26704
Fixes for Thad’s KeyDown's « Infinite Paging »
antoine2711 May 26, 2020
2ff5796
Code rehookCurrentPageInput & spacing
antoine2711 May 26, 2020
6c87fcb
Update data-table-view.js
antoine2711 May 26, 2020
486cf6c
Wrap in a Try/Catch the currentPageInput.focus()
antoine2711 May 27, 2020
0f5cc7f
Fixed currentPageInput != document.activeElement
antoine2711 May 27, 2020
0bc1f8c
Better handling of the « Infinite Paging »
antoine2711 May 30, 2020
8a54f4b
$.i18n('core-views/goto-page', …
antoine2711 May 31, 2020
1f903a9
Fix i18n plural
antoine2711 May 31, 2020
e84a476
Remove {{plural:$2|page|pages}} in french
antoine2711 Jun 1, 2020
83f35aa
Update data-table-view.js
antoine2711 Jun 1, 2020
25badaf
Remove setTimeout(refocusCurrentPageInput, refocusDelay);
antoine2711 Jun 10, 2020
f9bceca
Typo: missing semi-colon
antoine2711 Jun 11, 2020
f8225e1
Fix bug related to stealing focus of facets & added a delay
antoine2711 Jun 11, 2020
ba3498c
Revert "Remove {{plural:$2|page|pages}} in french"
antoine2711 Jun 15, 2020
e522400
Added conflicts-with constraints (#2641)
darecoder Jun 9, 2020
870d617
Fix a bug introduced by I #1038, PR #2616 (#2684)
antoine2711 Jun 9, 2020
d5f1fab
Trim input url whitespace (#2534)
Nishtha3512 Jun 10, 2020
ac68cc6
Fixed typos made in PR #2641
darecoder Jun 10, 2020
67b18ad
Bump guava from 19.0 to 23.0
dependabot-preview[bot] Jun 1, 2020
c955a73
Bump to Guava 23.6.1-jre
tfmorris Jun 3, 2020
400c4e7
Bump testng from 6.9.10 to 7.1.0
dependabot-preview[bot] Jun 3, 2020
6a8f352
Bump jasypt from 1.9.2 to 1.9.3
dependabot-preview[bot] Jun 4, 2020
991c878
Bump google-http-client-jackson2 from 1.20.0 to 1.35.0
dependabot-preview[bot] Jun 11, 2020
6da61ef
Bump rhino from 1.7.10 to 1.7.12
dependabot-preview[bot] May 28, 2020
c5828d7
Switch to new rhino-runtime component
tfmorris Jun 11, 2020
79b27ca
Replace Apache Ant with Commons Compress (#2691)
tfmorris Jun 11, 2020
f29376f
Bump butterfly from 1.0.2 to 1.0.3
dependabot-preview[bot] Jun 11, 2020
5ce9932
Bump httpclient from 4.5.5 to 4.5.12
dependabot-preview[bot] Jun 11, 2020
450b8ad
Bump maven-assembly-plugin from 3.1.0 to 3.3.0
dependabot-preview[bot] Jun 11, 2020
91187f2
Bump git-commit-id-plugin from 2.2.4 to 4.0.0
dependabot-preview[bot] Jun 11, 2020
1376b73
Bump slf4j-api from 1.7.18 to 1.7.30
dependabot-preview[bot] Jun 12, 2020
ca24b45
Bump powermock.version from 2.0.2 to 2.0.7
dependabot-preview[bot] Jun 11, 2020
4f85024
Disables FacetContainer while computing clusters
darecoder Jun 12, 2020
3ffd54a
Update to latest Jython version 2.7.2
thadguidry May 27, 2020
f298368
Bump commons-validator from 1.5.1 to 1.6
dependabot-preview[bot] Jun 12, 2020
0931780
Added translation using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
e52ce51
Added translation using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
8b2d33e
Added translation using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
e3e6367
Translated using Weblate (Japanese)
isaomatsunami Jun 12, 2020
81f124c
Translated using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
c044c39
Translated using Weblate (Japanese)
isaomatsunami Jun 12, 2020
916b549
Translated using Weblate (Japanese)
isaomatsunami Jun 12, 2020
01d37cc
Translated using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
cc058d5
Translated using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
62bcf7f
Translated using Weblate (Portuguese (Brazil))
rffontenelle Jun 12, 2020
df5755b
Load GDrive icon from local resource, not Github (#2689)
tfmorris Jun 14, 2020
767f5c8
Convert illegal characters into legal ones. (#2431)
cz2h Jun 14, 2020
621d0b3
Bump signpost-commonshttp4 from 1.2.1.2 to 2.0.0 (#2695)
dependabot-preview[bot] Jun 14, 2020
6b88947
Add comment to help designers understand TreeData (#2715)
thadguidry Jun 14, 2020
d0e2af5
Added translation using Weblate (Bengali (India))
brmanna Jun 14, 2020
72de727
Translated using Weblate (Japanese)
isaomatsunami Jun 14, 2020
e69ee63
Update jquery.i18n to 1.07 and fix non-English plural support (#2717)
tfmorris Jun 14, 2020
03b3205
Unused imports and other minor cleanups (#2723)
tfmorris Jun 14, 2020
072e394
Merge branch 'issue-2638-goto-any-page' of https://github.com/antoine…
antoine2711 Jun 17, 2020
c2ffe42
Remove feature Edit Facet Name
antoine2711 Jun 17, 2020
51b4fbc
Remove feature Edit Facet Name
antoine2711 Jun 17, 2020
cd0960f
Spacing
antoine2711 Jun 17, 2020
dd0b88b
Fix the delay, adjust to .2 s.
antoine2711 Jun 17, 2020
2c171ff
Merge branch 'master' into issue-2638-goto-any-page
antoine2711 Jun 17, 2020
07d26fb
Fix headerTable to tableHeader
antoine2711 Jun 17, 2020
3f246dd
data-header-table to data-table-header
antoine2711 Jun 17, 2020
1e6bd73
Remove .data-header-table-container
antoine2711 Jun 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions main/webapp/modules/core/langs/translation-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@
"core-views/move-to-left": "Move column left",
"core-views/move-to-right": "Move column right",
"core-views/show-as": "Show as",
"core-views/goto": "go to page…",
"core-views/first": "first",
"core-views/previous": "previous",
"core-views/next": "next",
Expand Down
1 change: 1 addition & 0 deletions main/webapp/modules/core/langs/translation-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"core-views/view": "Aperçu",
"core-views/extend-not-supported": "Ce service de réconciliation de supporte pas l'extension de données. Essayez de supprimer le service et de l'ajouter à nouveau. Si le problème persiste, contactez le fournisseur de service.",
"core-views/to-text": "En texte",
"core-views/goto": "aller à la page…",
"core-views/first": "première",
"core-views/word-facet": "Facette par mot",
"core-views/check-format": "Merci de vérifier le format du fichier.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function DataTableView(div) {
this._columnHeaderUIs = [];
this._shownulls = false;

this._currentPageNumber = 1;
this._showRows(0);
}

Expand Down Expand Up @@ -163,6 +164,9 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin
var from = (theProject.rowModel.start + 1);
var to = Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit);

self._lastPageNumber = Math.floor((theProject.rowModel.filtered - 1) / this._pageSize) + 1;
var pageInputSize = 20 + (8 * ui.dataTableView._lastPageNumber.toString().length);

var firstPage = $('<a href="javascript:{}">&laquo; '+$.i18n('core-views/first')+'</a>').appendTo(pagingControls);
var previousPage = $('<a href="javascript:{}">&lsaquo; '+$.i18n('core-views/previous')+'</a>').appendTo(pagingControls);
if (theProject.rowModel.start > 0) {
Expand All @@ -173,7 +177,21 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin
previousPage.addClass("inaction");
}

$('<span>').addClass("viewpanel-pagingcount").html(" " + from + " - " + to + " ").appendTo(pagingControls);
lastPageSpan = $('<span>').attr("id", "viewpanel-paging-last").text(self._lastPageNumber);
pageControlSpan = $('<span>').attr("id", "viewpanel-paging-current");

currentPageInput = $('<input type="number">')
.change(function(evt) { self._onChangeGotoPage(this, evt); })
antoine2711 marked this conversation as resolved.
Show resolved Hide resolved
.attr("id", "viewpanel-paging-current-input")
.val(self._currentPageNumber)
.css("max", self._lastPageNumber)
.css("width", pageInputSize +"px")
.appendTo(pageControlSpan);

pageControlSpan.append(' of ');
lastPageSpan.appendTo(pageControlSpan);
pageControlSpan.append(' pages');
pagingControls.append(pageControlSpan);

var nextPage = $('<a href="javascript:{}">'+$.i18n('core-views/next')+' &rsaquo;</a>').appendTo(pagingControls);
var lastPage = $('<a href="javascript:{}">'+$.i18n('core-views/last')+' &raquo;</a>').appendTo(pagingControls);
Expand Down Expand Up @@ -493,20 +511,35 @@ DataTableView.prototype._showRows = function(start, onDone) {
}, this._sorting);
};

DataTableView.prototype._onChangeGotoPage = function(elmt, evt) {
var gotoPageNumber = parseInt($('input#viewpanel-paging-current-input').val());

if(typeof gotoPageNumber != "number") { $('input#viewpanel-paging-current-input').val(this._currentPageNumber); return; }
if(gotoPageNumber > this._lastPageNumber) gotoPageNumber = this._lastPageNumber;
if(gotoPageNumber < 1) gotoPageNumber = 1;

this._currentPageNumber = gotoPageNumber;
this._showRows((gotoPageNumber - 1) * this._pageSize);
};

DataTableView.prototype._onClickPreviousPage = function(elmt, evt) {
this._currentPageNumber--;
this._showRows(theProject.rowModel.start - this._pageSize);
};

DataTableView.prototype._onClickNextPage = function(elmt, evt) {
this._currentPageNumber++;
this._showRows(theProject.rowModel.start + this._pageSize);
};

DataTableView.prototype._onClickFirstPage = function(elmt, evt) {
this._currentPageNumber = 1;
this._showRows(0);
};

DataTableView.prototype._onClickLastPage = function(elmt, evt) {
this._showRows(Math.floor((theProject.rowModel.filtered - 1) / this._pageSize) * this._pageSize);
this._currentPageNumber = this._lastPageNumber;
this._showRows((this._lastPageNumber - 1) * this._pageSize);
};

DataTableView.prototype._getSortingCriteriaCount = function() {
Expand Down
36 changes: 36 additions & 0 deletions main/webapp/modules/core/styles/views/data-table-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,42 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
font-weight: bold;
}

.viewpanel-rowrecord a {
background-color: @fill_primary;
margin: 0px 1px 0px 1px;
padding: 2px 5px 2px 5px;
.rounded_corners(4px);
}

.viewpanel-pagesize a {
background-color: @fill_primary;
margin: 0px 2px 0px 2px;
padding: 2px 3px 2px 3px;
.rounded_corners(4px);
}

.viewpanel-paging a {
background-color: @fill_primary;
margin: 0px 4px 0px 4px;
padding: 2px 10px 2px 10px;
.rounded_corners(4px);
}

.viewpanel-paging span#viewpanel-paging-current {
margin: 0 10px 0 10px;
padding: 0px;
}

.viewpanel-paging input#viewpanel-paging-current-input {
width: 60px;
min: 1;
margin: 0px;
padding: 0px;
height: 16px;
position: relative;
top: -2px;
}

.data-header-table-container {
lisa761 marked this conversation as resolved.
Show resolved Hide resolved
border-top: 1px solid @chrome_primary;
border-bottom: 2px solid @chrome_primary;
Expand Down