diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2018-02-08 13:18:55 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-02-08 20:19:39 +0100 |
commit | b6bc8c1cfecc55bebff8dc64fddb63e3edc109b5 (patch) | |
tree | c5fbe8eaf4829983126dc01571f00e3ddbb63257 /help3xsl/paginathing.js | |
parent | fd1e80bca4d05e1dac45fb226dff318e87b81ead (diff) |
tdf#115255 and auto-expand contents per subitem
JavaScript stuff moved from online_transform.xsl to help.js.
Simplified bookmarks markup.
Span elements with class "input" and length more than 3 characters
can be copied to clipboard by mouse click.
Bubli's feature request for auto-expanding contents per subitem
is also implemented.
Logic for adding headings to index list was reimplemented.
Change-Id: I87b6f189a040a73a1ab9dda1ec9cd790b06da202
Reviewed-on: https://gerrit.libreoffice.org/49421
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/paginathing.js')
-rw-r--r-- | help3xsl/paginathing.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/help3xsl/paginathing.js b/help3xsl/paginathing.js index 184a698550..8ecc4abd08 100644 --- a/help3xsl/paginathing.js +++ b/help3xsl/paginathing.js @@ -2,7 +2,7 @@ * Paginathing * Paginate Everything * - * Original @author Alfred Crosby <https://github.com/alfredcrosby> + * Original author Alfred Crosby <https://github.com/alfredcrosby> * Inspired from http://esimakin.github.io/twbs-pagination/ * Modified to pure JavaScript and specialised to LibreOffice Help by * Ilmari Lauhakangas @@ -55,7 +55,7 @@ })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); var options = { - perPage: 10, + perPage: 20, limitPagination: 6, prevNext: true, firstLast: true, @@ -71,11 +71,11 @@ var options = { }; var Paginator = function(element) { - el = element; - startPage = 1; - currentPage = 1; - pageDivision = 0; - totalItems = el.getElementsByClassName('fuseshown').length; + var el = element; + var startPage = 1; + var currentPage = 1; + var pageDivision = 0; + var totalItems = el.getElementsByClassName('fuseshown').length; var limitPagination = options.limitPagination; pageDivision = Math.ceil(totalItems / options.perPage); // let's not display pagination leading nowhere @@ -87,15 +87,15 @@ var Paginator = function(element) { } return limitPagination; } - totalPages = Math.max(pageDivision, pagLimit()); - existingContainer = document.getElementsByClassName('pagination-container')[0]; + var totalPages = Math.max(pageDivision, pagLimit()); + var existingContainer = document.getElementsByClassName('pagination-container')[0]; if (existingContainer) { parent = existingContainer.parentNode; parent.removeChild(existingContainer); } - container = document.createElement('nav'); + var container = document.createElement('nav'); container.setAttribute('class', options.containerClass); - ul = document.createElement('ul'); + var ul = document.createElement('ul'); ul.setAttribute('class', options.ulClass); function paginationFunc(type, page) { |