CustomTarget_html.mk          |   20 ++++---
 Package_html_static.mk        |    1 
 help3xsl/default.css          |  115 ++++++++++++++++++++++++++++++++----------
 help3xsl/get_bookmark.xsl     |    8 +-
 help3xsl/get_media.sh         |    1 
 help3xsl/help.js              |   33 ------------
 help3xsl/list.min.js          |    2 
 help3xsl/online_transform.xsl |  108 +++++++++++++++++++++++++++++++--------
 help3xsl/xhp2html.sh          |    1 
 9 files changed, 195 insertions(+), 94 deletions(-)

New commits:
commit 995f740adfff22aff1105a7e1b2801dfdab43434
Author: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
Date:   Mon Jan 22 16:48:08 2018 +0200

    Use list.js for Index listing and search
    
    List.js - http://listjs.com/ - allows us to paginate the results
    so the height does not get out of hand.
    Fuzzy search would be cool: http://listjs.com/docs/fuzzysearch/
    ...but it gives too big of a perf hit with our 5700 items.
    Might try to bribe the creator to look into perf.
    Thanks a lot to David Tardon for the makefile solution and to
    Christian Lohmaier for playing a rubber duck.
    
    Change-Id: I359eed541470ccaa309b0b6ff5d809a796d9befd
    Reviewed-on: https://gerrit.libreoffice.org/48335
    Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org>
    Tested-by: Olivier Hallot <olivier.hal...@libreoffice.org>

diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index 85ae29b2a..0c71db255 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -12,7 +12,7 @@ $(eval $(call 
gb_CustomTarget_CustomTarget,helpcontent2/help3xsl))
 # HACK!!
 html_TREE_MODULES := sbasic scalc schart shared simpress smath swriter
 html_TEXT_MODULES := $(html_TREE_MODULES) sdatabase sdraw
-html_BMARK_MODULES := scalc:CALC schart:CHART swriter:WRITER sdraw:DRAW 
simpress:IMPRESS smath:MATH sbasic:BASIC shared:SHARED 
shared/explorer/database:BASE
+html_BMARK_MODULES := swriter:writer scalc:calc simpress:impress sdraw:draw 
shared/explorer/database:base smath:math schart:chart sbasic:basic shared:shared
 
 $(eval $(call gb_CustomTarget_register_targets,helpcontent2/help3xsl,\
        hid2file.js \
@@ -113,7 +113,11 @@ $(call 
gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/html.text : \
 $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.js :
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,2)
        $(call gb_Helper_abbreviate_dirs,\
-               cat $(filter %.part,$^) > $@ \
+               ( \
+                       echo 
'document.getElementById("Bookmarks").getElementsByClassName( "list" 
)[0].innerHTML='"'"'\' \
+                       && cat $(filter %.part,$^) \
+                       && echo "'" \
+               ) > $@ \
        )
 
 define html__gen_bookmarks_lang_dep
@@ -150,11 +154,10 @@ $(call 
gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.part : \
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSL,1)
        $(call gb_Helper_abbreviate_dirs,\
                ( \
-                       echo 
"document.getElementById(\"bookmark$(APP)\").innerHTML='\\" \
-                       && find $(if $(filter 
en-US,$(HELP_LANG)),$(SRCDIR),$(call 
gb_HelpTranslatePartTarget_get_workdir,$(HELP_LANG)))/helpcontent2/source/text/$(APPDIR)
 -name "*.xhp" \
-                       | while read xhp; do \
-                               $(call 
gb_ExternalExecutable_get_command,xsltproc) \
-                                       --stringparam app $(APP) \
+                       find $(if $(filter en-US,$(HELP_LANG)),$(SRCDIR),$(call 
gb_HelpTranslatePartTarget_get_workdir,$(HELP_LANG)))/helpcontent2/source/text/$(APPDIR)
 -name "*.xhp" \
+                       | while read xhp; do \
+                               $(call 
gb_ExternalExecutable_get_command,xsltproc) \
+                                       --stringparam app $(APP) \
                                        --stringparam Language $(HELP_LANG) \
                                        --stringparam productversion 
$(PRODUCTVERSION) \
                                        
$(SRCDIR)/helpcontent2/help3xsl/get_bookmark.xsl \
@@ -162,8 +165,7 @@ $(call 
gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.part : \
                        ; done \
                        | sort -k3b -t\> -s \
                        | awk 'NF' \
-                       && echo "'" \
                ) > $@ \
-       )
+       )       
 
 # vim: set noet sw=4 ts=4:
diff --git a/Package_html_static.mk b/Package_html_static.mk
index e6767f6a6..32d4b05fe 100644
--- a/Package_html_static.mk
+++ b/Package_html_static.mk
@@ -19,6 +19,7 @@ $(eval $(call 
gb_Package_add_file,helpcontent2_html_static,$(LIBO_SHARE_HELP_FOL
 $(eval $(call 
gb_Package_add_files,helpcontent2_html_static,$(LIBO_SHARE_HELP_FOLDER)/$(PRODUCTVERSION),\
        help.js \
        jquery-3.1.1.min.js \
+       list.min.js \
        normalize.css \
        default.css \
 ))
diff --git a/help3xsl/default.css b/help3xsl/default.css
index 9efce4d33..70af31efb 100644
--- a/help3xsl/default.css
+++ b/help3xsl/default.css
@@ -347,14 +347,8 @@ aside input[type=checkbox]:checked ~ .contents-treeview {
     float: left;
     font-size: 29px;
     color: #18A303;
-    margin-right: 10px;
-}
-#SearchBox {
     padding-left: 20px;
-    margin: 20px 0 20px 0;
-}
-#SearchBox p {
-    font-size: 29px;
+    margin: 20px 0 0 0;
 }
 #Index {
     margin-top: 10px;
@@ -363,21 +357,88 @@ aside input[type=checkbox]:checked ~ .contents-treeview {
     padding-left: 15px;
 }
 #Index ul li {
-    list-style-type: none;
+    list-style: none;
     font-size: 16px;
     margin-bottom: 5px;
 }
+#Bookmarks {
+    padding: 0 20px;
+}
 #Bookmarks p {
     font-size: 22px;
     font-weight: bold;
     color: #18A303;
 }
+#writer::before {
+    content: "WRITER";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#calc::before {
+    content: "CALC";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#impress::before {
+    content: "IMPRESS";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#draw::before {
+    content: "DRAW";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#base::before {
+    content: "BASE";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#math::before {
+    content: "MATH";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#chart::before {
+    content: "CHART";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#basic::before {
+    content: "BASIC";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+#shared::before {
+    content: "GLOBAL";
+    display: block;
+    font-size: 22px;
+    font-weight: bold;
+    color: #18A303;
+}
+.pagination li {
+    display: inline-block;
+    padding: 5px;
+}
 #search-bar {
     margin-top: 10px;
 }
-#Bookmarks {
-    padding: 0 20px;
-}
 .google-search {
     max-width: 300px;
     margin: 0 auto;
@@ -399,41 +460,41 @@ aside input[type=checkbox]:checked ~ .contents-treeview {
     float: left;
     display: none;
 }
-.calc,
-.chart,
-.writer,
-.impress,
-.draw,
-.math,
-.basic,
-.base {
+.calc-icon,
+.chart-icon,
+.writer-icon,
+.impress-icon,
+.draw-icon,
+.math-icon,
+.basic-icon,
+.base-icon {
     width: 21.5px;
     height: 26px;
     position: relative;
     margin-right: 5px;
 }
-.calc {
+.calc-icon {
     background-image: url(media/navigation/libo-calc.svg);
 }
-.writer {
+.writer-icon {
     background-image: url(media/navigation/libo-writer.svg);
 }
-.impress {
+.impress-icon {
     background-image: url(media/navigation/libo-impress.svg);
 }
-.draw {
+.draw-icon {
     background-image: url(media/navigation/libo-draw.svg);
 }
-.math {
+.math-icon {
     background-image: url(media/navigation/libo-math.svg);
 }
-.base {
+.base-icon {
     background-image: url(media/navigation/libo-base.svg);
 }
-.chart {
+.chart-icon {
     background-image: url(media/navigation/libo-chart.svg);
 }
-.basic {
+.basic-icon {
     background-image: url(media/navigation/libo-basic.svg);
 }
 /* tree view */
diff --git a/help3xsl/get_bookmark.xsl b/help3xsl/get_bookmark.xsl
index d0fd8f19a..6e8d4aff3 100644
--- a/help3xsl/get_bookmark.xsl
+++ b/help3xsl/get_bookmark.xsl
@@ -55,9 +55,11 @@ xsltproc get_bookmark.xsl <file.xhp>
         <xsl:variable name="hrefhtml" 
select="substring-before($filename,'xhp')"/>
         <xsl:variable name="href" 
select="concat($productversion,'/',$Language,'/',$hrefhtml,'html?DbPAR=',$app,'#',@id)"/>
         <xsl:for-each select="bookmark_value">
-            <xsl:text disable-output-escaping="yes"><![CDATA[<li><a 
target="_top" href="]]></xsl:text>
-            <xsl:value-of select="$href"/>
-            <xsl:text disable-output-escaping="yes"><![CDATA[">]]></xsl:text>
+        <xsl:text disable-output-escaping="yes"><![CDATA[<li><a target="_top" 
href="]]></xsl:text>
+        <xsl:value-of select="$href"/>
+        <xsl:text disable-output-escaping="yes"><![CDATA[" 
class="]]></xsl:text>
+        <xsl:value-of select="$app"/>
+        <xsl:text disable-output-escaping="yes"><![CDATA[">]]></xsl:text>
             <xsl:call-template name="replace"><xsl:with-param name="text" 
select="."/></xsl:call-template>
             <xsl:text 
disable-output-escaping="yes"><![CDATA[</a></li>\]]>&#xA;</xsl:text>
         </xsl:for-each>
diff --git a/help3xsl/get_media.sh b/help3xsl/get_media.sh
index 12f636b2b..bb1bf8034 100755
--- a/help3xsl/get_media.sh
+++ b/help3xsl/get_media.sh
@@ -33,6 +33,7 @@ cp help.html $outDir
 cp index2.html $outDir'/'$productVersion'/index.html'
 cp help.js $outDir'/'$productVersion'/'
 cp jquery-3.1.1.min.js $outDir'/'$productVersion'/'
+cp list.min.js $outDir'/'$productVersion'/'
 cp normalize.css $outDir'/'$productVersion'/'
 cp default.css $outDir'/'$productVersion'/'
 
diff --git a/help3xsl/help.js b/help3xsl/help.js
index 5ad90e765..999af538b 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -90,37 +90,4 @@ function getParameterByName(name, url) {
     return decodeURIComponent(results[2].replace(/\+/g, " "));
 }
 
-var debouncer = null;
-$(document).ready(function() {
-    $('#search-bar').keyup(function() {
-        if (debouncer) {
-            clearTimeout(debouncer);
-        }
-        debouncer = setTimeout(function(){
-            if ($('#search-bar').val().length > 2) {
-                var toShow = $('#Index ul a').filter(function(){
-                    return 
$(this).text().toLowerCase().indexOf($('#search-bar').val().toLowerCase()) > -1;
-                });
-                toShow.parent().show();
-                $("#Index ul a").not(toShow).parent().hide();
-                $("#Bookmarks").show();
-
-                var listToShow = $('');
-                $('#Index ul li').filter(':visible').each(function(){
-                    //add all module labels that have results in search
-                    listToShow = listToShow.add($(this).parent().prev());
-                });
-                $(listToShow).show();
-                //hide all labels with 0 results
-                $('#Bookmarks > p').not(listToShow).hide();
-            }
-            else {
-                $("#Bookmarks").hide();
-            }
-        }, 200);
-    });
-
-    //prevent all results to be shown
-    $("#Bookmarks").toggle($('#search-bar').val().length > 2);
-});
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/help3xsl/list.min.js b/help3xsl/list.min.js
new file mode 100644
index 000000000..3cb273731
--- /dev/null
+++ b/help3xsl/list.min.js
@@ -0,0 +1,2 @@
+/*! List.js v1.5.0 (http://listjs.com) by Jonny Strömberg (http://javve.com) */
+var List=function(t){function e(n){if(r[n])return r[n].exports;var 
i=r[n]={i:n,l:!1,exports:{}};return 
t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return 
e.m=t,e.c=r,e.i=function(t){return 
t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var
 r=t&&t.__esModule?function(){return t.default}:function(){return t};return 
e.d(r,"a",r),r},e.o=function(t,e){return 
Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,r){function
 n(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is 
required");this.el=t,this.list=t.classList}var 
i=r(4),s=/\s+/;Object.prototype.toString;t.exports=function(t){return new 
n(t)},n.prototype.add=function(t){if(this.list)return this.list.add(t),this;var 
e=this.array(),r=i(e,t);return~r||e.push(t),this.el.className=e.join(" 
"),this},n.prototype.remove=function(t){if(this.list)return 
this.list.remove(t),this;var e=this.array(),r=i(e,t);return~r&&e.spli
 ce(r,1),this.el.className=e.join(" 
"),this},n.prototype.toggle=function(t,e){return this.list?("undefined"!=typeof 
e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):("undefined"!=typeof
 
e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},n.prototype.array=function(){var
 
t=this.el.getAttribute("class")||"",e=t.replace(/^\s+|\s+$/g,""),r=e.split(s);return""===r[0]&&r.shift(),r},n.prototype.has=n.prototype.contains=function(t){return
 this.list?this.list.contains(t):!!~i(this.array(),t)}},function(t,e,r){var 
n=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",s="addEventListener"!==n?"on":"",a=r(5);e.bind=function(t,e,r,i){t=a(t);for(var
 
o=0;o<t.length;o++)t[o][n](s+e,r,i||!1)},e.unbind=function(t,e,r,n){t=a(t);for(var
 
o=0;o<t.length;o++)t[o][i](s+e,r,n||!1)}},function(t,e){t.exports=function(t){return
 function(e,r,n){var i=this;this._values={},this.found=!1,this.fil
 tered=!1;var s=function(e,r,n){if(void 
0===r)n?i.values(e,n):i.values(e);else{i.elm=r;var 
s=t.templater.get(i,e);i.values(s)}};this.values=function(e,r){if(void 
0===e)return i._values;for(var n in 
e)i._values[n]=e[n];r!==!0&&t.templater.set(i,i.values())},this.show=function(){t.templater.show(i)},this.hide=function(){t.templater.hide(i)},this.matching=function(){return
 
t.filtered&&t.searched&&i.found&&i.filtered||t.filtered&&!t.searched&&i.filtered||!t.filtered&&t.searched&&i.found||!t.filtered&&!t.searched},this.visible=function(){return!(!i.elm||i.elm.parentNode!=t.list)},s(e,r,n)}}},function(t,e){var
 r=function(t,e,r){return 
r?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)},n=function(t,e,r){return
 e="."+e,r?t.querySelector(e):t.querySelectorAll(e)},i=function(t,e,r){for(var 
n=[],i="*",s=t.getElementsByTagName(i),a=s.length,o=new 
RegExp("(^|\\s)"+e+"(\\s|$)"),l=0,u=0;l<a;l++)if(o.test(s[l].className)){if(r)return
 s[l];n[u]=s[l],u++}return n};t.exports=function(){retur
 n function(t,e,s,a){return 
a=a||{},a.test&&a.getElementsByClassName||!a.test&&document.getElementsByClassName?r(t,e,s):a.test&&a.querySelector||!a.test&&document.querySelector?n(t,e,s):i(t,e,s)}}()},function(t,e){var
 r=[].indexOf;t.exports=function(t,e){if(r)return t.indexOf(e);for(var 
n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e){function 
r(t){return"[object 
Array]"===Object.prototype.toString.call(t)}t.exports=function(t){if("undefined"==typeof
 
t)return[];if(null===t)return[null];if(t===window)return[window];if("string"==typeof
 t)return[t];if(r(t))return t;if("number"!=typeof 
t.length)return[t];if("function"==typeof t&&t instanceof 
Function)return[t];for(var 
e=[],n=0;n<t.length;n++)(Object.prototype.hasOwnProperty.call(t,n)||n in 
t)&&e.push(t[n]);return 
e.length?e:[]}},function(t,e){t.exports=function(t){return t=void 
0===t?"":t,t=null===t?"":t,t=t.toString()}},function(t,e){t.exports=function(t){for(var
 e,r=Array.prototype.slice.call(arguments,1),n=0;e=r[n];n++
 )if(e)for(var i in e)t[i]=e[i];return 
t}},function(t,e){t.exports=function(t){var e=function(r,n,i){var 
s=r.splice(0,50);i=i||[],i=i.concat(t.add(s)),r.length>0?setTimeout(function(){e(r,n,i)},1):(t.update(),n(i))};return
 e}},function(t,e){t.exports=function(t){return 
t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void
 0===e)t.filtered=!1;else{t.filtered=!0;for(var 
r=t.items,n=0,i=r.length;n<i;n++){var 
s=r[n];e(s)?s.filtered=!0:s.filtered=!1}}return 
t.update(),t.trigger("filterComplete"),t.visibleItems}}},function(t,e,r){var 
n=(r(0),r(1)),i=r(7),s=r(6),a=r(3),o=r(19);t.exports=function(t,e){e=e||{},e=i({location:0,distance:100,threshold:.4,multiSearch:!0,searchClass:"fuzzy-search"},e);var
 r={search:function(n,i){for(var s=e.multiSearch?n.replace(/ +$/,"").split(/ 
+/):[n],a=0,o=t.items.length;a<o;a++)r.item(t.items[a],i,s)},item:function(t,e,n){for(var
 i=!0,s=0;s<
 n.length;s++){for(var 
a=!1,o=0,l=e.length;o<l;o++)r.values(t.values(),e[o],n[s])&&(a=!0);a||(i=!1)}t.found=i},values:function(t,r,n){if(t.hasOwnProperty(r)){var
 i=s(t[r]).toLowerCase();if(o(i,n,e))return!0}return!1}};return 
n.bind(a(t.listContainer,e.searchClass),"keyup",function(e){var 
n=e.target||e.srcElement;t.search(n.value,r.search)}),function(e,n){t.search(e,n,r.search)}}},function(t,e,r){var
 
n=r(18),i=r(3),s=r(7),a=r(4),o=r(1),l=r(6),u=r(0),c=r(17),f=r(5);t.exports=function(t,e,h){var
 
d,v=this,m=r(2)(v),g=r(8)(v),p=r(12)(v);d={start:function(){v.listClass="list",v.searchClass="search",v.sortClass="sort",v.page=1e4,v.i=1,v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.searchColumns=void
 
0,v.handlers={updated:[]},v.valueNames=[],v.utils={getByClass:i,extend:s,indexOf:a,events:o,toString:l,naturalSort:n,classes:u,getAttribute:c,toArray:f},v.utils.extend(v,e),v.listContainer="string"==typeof
 t?document.getElementById(t):t,v.listContainer&&(v.list=i(v
 
.listContainer,v.listClass,!0),v.parse=r(13)(v),v.templater=r(16)(v),v.search=r(14)(v),v.filter=r(9)(v),v.sort=r(15)(v),v.fuzzySearch=r(10)(v,e.fuzzySearch),this.handlers(),this.items(),this.pagination(),v.update())},handlers:function(){for(var
 t in v.handlers)v[t]&&v.on(t,v[t])},items:function(){v.parse(v.list),void 
0!==h&&v.add(h)},pagination:function(){if(void 
0!==e.pagination){e.pagination===!0&&(e.pagination=[{}]),void 
0===e.pagination[0]&&(e.pagination=[e.pagination]);for(var 
t=0,r=e.pagination.length;t<r;t++)p(e.pagination[t])}}},this.reIndex=function(){v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.parse(v.list)},this.toJSON=function(){for(var
 t=[],e=0,r=v.items.length;e<r;e++)t.push(v.items[e].values());return 
t},this.add=function(t,e){if(0!==t.length){if(e)return void g(t,e);var 
r=[],n=!1;void 0===t[0]&&(t=[t]);for(var i=0,s=t.length;i<s;i++){var 
a=null;n=v.items.length>v.page,a=new m(t[i],void 
0,n),v.items.push(a),r.push(a)}return v.update()
 ,r}},this.show=function(t,e){return 
this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var 
n=0,i=0,s=v.items.length;i<s;i++)v.items[i].values()[t]==e&&(v.templater.remove(v.items[i],r),v.items.splice(i,1),s--,i--,n++);return
 v.update(),n},this.get=function(t,e){for(var 
r=[],n=0,i=v.items.length;n<i;n++){var 
s=v.items[n];s.values()[t]==e&&r.push(s)}return r},this.size=function(){return 
v.items.length},this.clear=function(){return 
v.templater.clear(),v.items=[],v},this.on=function(t,e){return 
v.handlers[t].push(e),v},this.off=function(t,e){var 
r=v.handlers[t],n=a(r,e);return 
n>-1&&r.splice(n,1),v},this.trigger=function(t){for(var 
e=v.handlers[t].length;e--;)v.handlers[t][e](v);return 
v},this.reset={filter:function(){for(var 
t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var 
t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var 
t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var
 r=0;r<
 
e;r++)t[r].matching()&&v.matchingItems.length+1>=v.i&&v.visibleItems.length<v.page?(t[r].show(),v.visibleItems.push(t[r]),v.matchingItems.push(t[r])):t[r].matching()?(v.matchingItems.push(t[r]),t[r].hide()):t[r].hide();return
 v.trigger("updated"),v},d.start()}},function(t,e,r){var 
n=r(0),i=r(1),s=r(11);t.exports=function(t){var e=function(e,i){var 
s,o=t.matchingItems.length,l=t.i,u=t.page,c=Math.ceil(o/u),f=Math.ceil(l/u),h=i.innerWindow||2,d=i.left||i.outerWindow||0,v=i.right||i.outerWindow||0;v=c-v,e.clear();for(var
 m=1;m<=c;m++){var 
g=f===m?"active":"";r.number(m,d,v,f,h)?(s=e.add({page:m,dotted:!1})[0],g&&n(s.elm).add(g),a(s.elm,m,u)):r.dotted(e,m,d,v,f,h,e.size())&&(s=e.add({page:"...",dotted:!0})[0],n(s.elm).add("disabled"))}},r={number:function(t,e,r,n,i){return
 
this.left(t,e)||this.right(t,r)||this.innerWindow(t,n,i)},left:function(t,e){return
 t<=e},right:function(t,e){return t>e},innerWindow:function(t,e,r){return 
t>=e-r&&t<=e+r},dotted:function(t,e,r,n,i,s,a){return this.d
 
ottedLeft(t,e,r,n,i,s)||this.dottedRight(t,e,r,n,i,s,a)},dottedLeft:function(t,e,r,n,i,s){return
 
e==r+1&&!this.innerWindow(e,i,s)&&!this.right(e,n)},dottedRight:function(t,e,r,n,i,s,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,i,s)&&!this.right(e,n))}},a=function(e,r,n){i.bind(e,"click",function(){t.show((r-1)*n+1,n)})};return
 function(r){var n=new 
s(t.listContainer.id,{listClass:r.paginationClass||"pagination",item:"<li><a 
class='page' href='javascript:function 
Z(){Z=\"\"}Z()'></a></li>",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});t.on("updated",function(){e(n,r)}),e(n,r)}}},function(t,e,r){t.exports=function(t){var
 e=r(2)(t),n=function(t){for(var 
e=t.childNodes,r=[],n=0,i=e.length;n<i;n++)void 
0===e[n].data&&r.push(e[n]);return r},i=function(r,n){for(var 
i=0,s=r.length;i<s;i++)t.items.push(new e(n,r[i]))},s=function(e,r){var 
n=e.splice(0,50);i(n,r),e.len
 
gth>0?setTimeout(function(){s(e,r)},1):(t.update(),t.trigger("parseComplete"))};return
 t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var 
e=n(t.list),r=t.valueNames;t.indexAsync?s(e,r):i(e,r)}}},function(t,e){t.exports=function(t){var
 e,r,n,i,s={resetList:function(){t.i=1,t.templater.clear(),i=void 
0},setOptions:function(t){2==t.length&&t[1]instanceof 
Array?r=t[1]:2==t.length&&"function"==typeof t[1]?(r=void 
0,i=t[1]):3==t.length?(r=t[1],i=t[2]):r=void 
0},setColumns:function(){0!==t.items.length&&void 0===r&&(r=void 
0===t.searchColumns?s.toArray(t.items[0].values()):t.searchColumns)},setSearchString:function(e){e=t.utils.toString(e).toLowerCase(),e=e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),n=e},toArray:function(t){var
 e=[];for(var r in t)e.push(r);return e}},a={list:function(){for(var 
e=0,r=t.items.length;e<r;e++)a.item(t.items[e])},item:function(t){t.found=!1;for(var
 e=0,n=r.length;e<n;e++)if(a.values(t.values(),r[e]))return 
void(t.found=!0)},values:function(r,i)
 
{return!!(r.hasOwnProperty(i)&&(e=t.utils.toString(r[i]).toLowerCase(),""!==n&&e.search(n)>-1))},reset:function(){t.reset.search(),t.searched=!1}},o=function(e){return
 
t.trigger("searchStart"),s.resetList(),s.setSearchString(e),s.setOptions(arguments),s.setColumns(),""===n?a.reset():(t.searched=!0,i?i(n,r):a.list()),t.update(),t.trigger("searchComplete"),t.visibleItems};return
 
t.handlers.searchStart=t.handlers.searchStart||[],t.handlers.searchComplete=t.handlers.searchComplete||[],t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"keyup",function(e){var
 
r=e.target||e.srcElement,n=""===r.value&&!t.searched;n||o(r.value)}),t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"input",function(t){var
 
e=t.target||t.srcElement;""===e.value&&o("")}),o}},function(t,e){t.exports=function(t){var
 e={els:void 0,clear:function(){for(var 
r=0,n=e.els.length;r<n;r++)t.utils.classes(e.els[r]).remove("asc"),t.utils.classes(e.els[r]).remove("desc")},getOrder:functi
 on(e){var 
r=t.utils.getAttribute(e,"data-order");return"asc"==r||"desc"==r?r:t.utils.classes(e).has("desc")?"asc":t.utils.classes(e).has("asc")?"desc":"asc"},getInSensitive:function(e,r){var
 
n=t.utils.getAttribute(e,"data-insensitive");"false"===n?r.insensitive=!1:r.insensitive=!0},setOrder:function(r){for(var
 n=0,i=e.els.length;n<i;n++){var 
s=e.els[n];if(t.utils.getAttribute(s,"data-sort")===r.valueName){var 
a=t.utils.getAttribute(s,"data-order");"asc"==a||"desc"==a?a==r.order&&t.utils.classes(s).add(r.order):t.utils.classes(s).add(r.order)}}}},r=function(){t.trigger("sortStart");var
 r={},n=arguments[0].currentTarget||arguments[0].srcElement||void 
0;n?(r.valueName=t.utils.getAttribute(n,"data-sort"),e.getInSensitive(n,r),r.order=e.getOrder(n)):(r=arguments[1]||r,r.valueName=arguments[0],r.order=r.order||"asc",r.insensitive="undefined"==typeof
 r.insensitive||r.insensitive),e.clear(),e.setOrder(r);var 
i,s=r.sortFunction||t.sortFunction||null,a="desc"===r.order?-1:1;i=s?function(t,e){
 return s(t,e,r)*a}:function(e,n){var i=t.utils.naturalSort;return 
i.alphabet=t.alphabet||r.alphabet||void 
0,!i.alphabet&&r.insensitive&&(i=t.utils.naturalSort.caseInsensitive),i(e.values()[r.valueName],n.values()[r.valueName])*a},t.items.sort(i),t.update(),t.trigger("sortComplete")};return
 
t.handlers.sortStart=t.handlers.sortStart||[],t.handlers.sortComplete=t.handlers.sortComplete||[],e.els=t.utils.getByClass(t.listContainer,t.sortClass),t.utils.events.bind(e.els,"click",r),t.on("searchStart",e.clear),t.on("filterStart",e.clear),r}},function(t,e){var
 r=function(t){var 
e,r=this,n=function(){e=r.getItemSource(t.item),e&&(e=r.clearSourceItem(e,t.valueNames))};this.clearSourceItem=function(e,r){for(var
 n=0,i=r.length;n<i;n++){var s;if(r[n].data)for(var 
a=0,o=r[n].data.length;a<o;a++)e.setAttribute("data-"+r[n].data[a],"");else 
r[n].attr&&r[n].name?(s=t.utils.getByClass(e,r[n].name,!0),s&&s.setAttribute(r[n].attr,"")):(s=t.utils.getByClass(e,r[n],!0),s&&(s.innerHTML=""));s=void
 0}return
  e},this.getItemSource=function(e){if(void 0===e){for(var 
r=t.list.childNodes,n=0,i=r.length;n<i;n++)if(void 0===r[n].data)return 
r[n].cloneNode(!0)}else{if(/<tr[\s>]/g.exec(e)){var 
s=document.createElement("tbody");return 
s.innerHTML=e,s.firstChild}if(e.indexOf("<")!==-1){var 
a=document.createElement("div");return a.innerHTML=e,a.firstChild}var 
o=document.getElementById(t.item);if(o)return 
o}},this.get=function(e,n){r.create(e);for(var i={},s=0,a=n.length;s<a;s++){var 
o;if(n[s].data)for(var 
l=0,u=n[s].data.length;l<u;l++)i[n[s].data[l]]=t.utils.getAttribute(e.elm,"data-"+n[s].data[l]);else
 
n[s].attr&&n[s].name?(o=t.utils.getByClass(e.elm,n[s].name,!0),i[n[s].name]=o?t.utils.getAttribute(o,n[s].attr):""):(o=t.utils.getByClass(e.elm,n[s],!0),i[n[s]]=o?o.innerHTML:"");o=void
 0}return i},this.set=function(e,n){var i=function(e){for(var 
r=0,n=t.valueNames.length;r<n;r++)if(t.valueNames[r].data){for(var 
i=t.valueNames[r].data,s=0,a=i.length;s<a;s++)if(i[s]===e)return{data:e}}else{if(t.va
 lueNames[r].attr&&t.valueNames[r].name&&t.valueNames[r].name==e)return 
t.valueNames[r];if(t.valueNames[r]===e)return e}},s=function(r,n){var 
s,a=i(r);a&&(a.data?e.elm.setAttribute("data-"+a.data,n):a.attr&&a.name?(s=t.utils.getByClass(e.elm,a.name,!0),s&&s.setAttribute(a.attr,n)):(s=t.utils.getByClass(e.elm,a,!0),s&&(s.innerHTML=n)),s=void
 0)};if(!r.create(e))for(var a in 
n)n.hasOwnProperty(a)&&s(a,n[a])},this.create=function(t){if(void 
0!==t.elm)return!1;if(void 0===e)throw new Error("The list need to have at list 
one item on init otherwise you'll have to add a template.");var 
n=e.cloneNode(!0);return 
n.removeAttribute("id"),t.elm=n,r.set(t,t.values()),!0},this.remove=function(e){e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.show=function(e){r.create(e),t.list.appendChild(e.elm)},this.hide=function(e){void
 
0!==e.elm&&e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.clear=function(){if(t.list.hasChildNodes())for(;t.list.childNodes.length>=1;)t.list.removeChild
 (t.list.firstChild)},n()};t.exports=function(t){return new 
r(t)}},function(t,e){t.exports=function(t,e){var 
r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var 
n=t.attributes,i=n.length,s=0;s<i;s++)void 
0!==e[s]&&e[s].nodeName===e&&(r=e[s].nodeValue);return r}},function(t,e,r){"use 
strict";function n(t){return t>=48&&t<=57}function i(t,e){for(var 
r=(t+="").length,i=(e+="").length,s=0,l=0;s<r&&l<i;){var 
u=t.charCodeAt(s),c=e.charCodeAt(l);if(n(u)){if(!n(c))return u-c;for(var 
f=s,h=l;48===u&&++f<r;)u=t.charCodeAt(f);for(;48===c&&++h<i;)c=e.charCodeAt(h);for(var
 d=f,v=h;d<r&&n(t.charCodeAt(d));)++d;for(;v<i&&n(e.charCodeAt(v));)++v;var 
m=d-f-v+h;if(m)return 
m;for(;f<d;)if(m=t.charCodeAt(f++)-e.charCodeAt(h++))return 
m;s=d,l=v}else{if(u!==c)return 
u<o&&c<o&&a[u]!==-1&&a[c]!==-1?a[u]-a[c]:u-c;++s,++l}}return r-i}var 
s,a,o=0;i.caseInsensitive=i.i=function(t,e){return 
i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return
 s},set:functio
 n(t){s=t,a=[];var 
e=0;if(s)for(;e<s.length;e++)a[s.charCodeAt(e)]=e;for(o=a.length,e=0;e<o;e++)void
 
0===a[e]&&(a[e]=-1)}}}),t.exports=i},function(t,e){t.exports=function(t,e,r){function
 n(t,r){var n=t/e.length,i=Math.abs(o-r);return s?n+i/s:i?1:n}var 
i=r.location||0,s=r.distance||100,a=r.threshold||.4;if(e===t)return!0;if(e.length>32)return!1;var
 o=i,l=function(){var 
t,r={};for(t=0;t<e.length;t++)r[e.charAt(t)]=0;for(t=0;t<e.length;t++)r[e.charAt(t)]|=1<<e.length-t-1;return
 
r}(),u=a,c=t.indexOf(e,o);c!=-1&&(u=Math.min(n(0,c),u),c=t.lastIndexOf(e,o+e.length),c!=-1&&(u=Math.min(n(0,c),u)));var
 f=1<<e.length-1;c=-1;for(var 
h,d,v,m=e.length+t.length,g=0;g<e.length;g++){for(h=0,d=m;h<d;)n(g,o+d)<=u?h=d:m=d,d=Math.floor((m-h)/2+h);m=d;var
 
p=Math.max(1,o-d+1),C=Math.min(o+d,t.length)+e.length,y=Array(C+2);y[C+1]=(1<<g)-1;for(var
 b=C;b>=p;b--){var 
w=l[t.charAt(b-1)];if(0===g?y[b]=(y[b+1]<<1|1)&w:y[b]=(y[b+1]<<1|1)&w|((v[b+1]|v[b])<<1|1)|v[b+1],y[b]&f){var
 x=n(g,b-1);if(x<=u){if(u=x,c=b-1,!(
 c>o))break;p=Math.max(1,2*o-c)}}}if(n(g+1,o)>u)break;v=y}return!(c<0)}}]);
\ No newline at end of file
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 3ba532578..c1764e573 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -129,6 +129,7 @@
         <link  type="text/css" href="{$productversion}/default.css" 
rel="Stylesheet" />
         <script type="text/javascript" 
src="{$productversion}/jquery-3.1.1.min.js"></script>
         <script type="text/javascript" 
src="{$productversion}/help.js"></script>
+        <script type="text/javascript" 
src="{$productversion}/list.min.js"></script>
         <meta name="viewport" content="width=device-width,initial-scale=1"/>
     </head>
     <body itemscope="true" itemtype="http://schema.org/TechArticle";>
@@ -153,14 +154,14 @@
             <input id="modules" name="modules" type="checkbox"/>
             <label for="modules"><xsl:call-template 
name="getModules"><xsl:with-param name="lang" 
select="$lang"/></xsl:call-template></label>
             <nav>
-                <a 
href="{$productversion}/{$lang}/text/swriter/main0000.html?DbPAR=WRITER"><div 
class="writer"></div>Writer</a>
-                <a 
href="{$productversion}/{$lang}/text/scalc/main0000.html?DbPAR=CALC"><div 
class="calc"></div>Calc</a>
-                <a 
href="{$productversion}/{$lang}/text/simpress/main0000.html?DbPAR=IMPRESS"><div 
class="impress"></div>Impress</a>
-                <a 
href="{$productversion}/{$lang}/text/sdraw/main0000.html?DbPAR=DRAW"><div 
class="draw"></div>Draw</a>
-                <a 
href="{$productversion}/{$lang}/text/shared/explorer/database/main.html?DbPAR=BASE"><div
 class="base"></div>Base</a>
-                <a 
href="{$productversion}/{$lang}/text/smath/main0000.html?DbPAR=MATH"><div 
class="math"></div>Math</a>
-                <a 
href="{$productversion}/{$lang}/text/schart/main0000.html?DbPAR=CHART"><div 
class="chart"></div>Chart</a>
-                <a 
href="{$productversion}/{$lang}/text/sbasic/shared/main0601.html?DbPAR=BASIC"><div
 class="basic"></div>Basic</a>
+                <a 
href="{$productversion}/{$lang}/text/swriter/main0000.html?DbPAR=WRITER"><div 
class="writer-icon"></div>Writer</a>
+                <a 
href="{$productversion}/{$lang}/text/scalc/main0000.html?DbPAR=CALC"><div 
class="calc-icon"></div>Calc</a>
+                <a 
href="{$productversion}/{$lang}/text/simpress/main0000.html?DbPAR=IMPRESS"><div 
class="impress-icon"></div>Impress</a>
+                <a 
href="{$productversion}/{$lang}/text/sdraw/main0000.html?DbPAR=DRAW"><div 
class="draw-icon"></div>Draw</a>
+                <a 
href="{$productversion}/{$lang}/text/shared/explorer/database/main.html?DbPAR=BASE"><div
 class="base-icon"></div>Base</a>
+                <a 
href="{$productversion}/{$lang}/text/smath/main0000.html?DbPAR=MATH"><div 
class="math-icon"></div>Math</a>
+                <a 
href="{$productversion}/{$lang}/text/schart/main0000.html?DbPAR=CHART"><div 
class="chart-icon"></div>Chart</a>
+                <a 
href="{$productversion}/{$lang}/text/sbasic/shared/main0601.html?DbPAR=BASIC"><div
 class="basic-icon"></div>Basic</a>
             </nav>
         </div>
         <xsl:if test="$online">
@@ -242,21 +243,11 @@
         <label for="accordion-1"><xsl:call-template 
name="getContents"><xsl:with-param name="lang" 
select="$lang"/></xsl:call-template></label>
         <div id="Contents" class="contents-treeview"></div>
         <div id="Index">
-            <div id="SearchBox">
-                <div class="index-label"><xsl:call-template 
name="getIndex"><xsl:with-param name="lang" 
select="$lang"/></xsl:call-template></div>
-                <p> &#32;&#x1f50e;&#32; </p>
-                <input id="search-bar" type="text"/>
-            </div>
+            <div class="index-label"><xsl:call-template 
name="getIndex"><xsl:with-param name="lang" 
select="$lang"/></xsl:call-template> &#32;&#x1f50e;&#32;</div>
             <div id="Bookmarks">
-                <p>WRITER</p><ul id="bookmarkWRITER"></ul>
-                <p>CALC</p><ul id="bookmarkCALC"></ul>
-                <p>IMPRESS</p><ul id="bookmarkIMPRESS"></ul>
-                <p>DRAW</p><ul id="bookmarkDRAW" ></ul>
-                <p>BASE</p><ul id="bookmarkBASE"></ul>
-                <p>MATH</p><ul id="bookmarkMATH"></ul>
-                <p>CHART</p><ul id="bookmarkCHART"></ul>
-                <p>BASIC</p><ul id="bookmarkBASIC"></ul>
-                <p>GLOBAL</p><ul id="bookmarkSHARED"></ul>
+                <input id="search-bar" type="text" class="search" />
+                <ul class="list"></ul>
+                <ul class="pagination"></ul>
             </div>
         </div>
     </aside>
@@ -294,6 +285,79 @@
     </div>
     <script type="text/javascript" 
src="{$productversion}/{$lang}/bookmarks.js"/>
     <script type="text/javascript" 
src="{$productversion}/{$lang}/contents.js"/>
+    <!-- for list.js -->
+    <script type="text/javascript">
+        <![CDATA[
+        // Polyfill for 
https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
+        if (!Array.prototype.findIndex) {
+        Object.defineProperty(Array.prototype, 'findIndex', {
+            value: function(predicate) {
+            // 1. Let O be ? ToObject(this value).
+            if (this == null) {
+                throw new TypeError('"this" is null or not defined');
+            }
+
+            var o = Object(this);
+
+            // 2. Let len be ? ToLength(? Get(O, "length")).
+            var len = o.length >>> 0;
+
+            // 3. If IsCallable(predicate) is false, throw a TypeError 
exception.
+            if (typeof predicate !== 'function') {
+                throw new TypeError('predicate must be a function');
+            }
+
+            // 4. If thisArg was supplied, let T be thisArg; else let T be 
undefined.
+            var thisArg = arguments[1];
+
+            // 5. Let k be 0.
+            var k = 0;
+
+            // 6. Repeat, while k < len
+            while (k < len) {
+                // a. Let Pk be ! ToString(k).
+                // b. Let kValue be ? Get(O, Pk).
+                // c. Let testResult be ToBoolean(? Call(predicate, T, « 
kValue, k, O »)).
+                // d. If testResult is true, return k.
+                var kValue = o[k];
+                if (predicate.call(thisArg, kValue, k, o)) {
+                return k;
+                }
+                // e. Increase k by 1.
+                k++;
+            }
+
+            // 7. Return -1.
+            return -1;
+            }
+        });
+        }
+        var modules = [ 'calc', 'writer', 'impress', 'draw', 'base', 'math', 
'chart', 'basic', 'shared' ];
+        // options for List.js http://listjs.com/
+        var options = {
+            valueNames: modules,
+            page: 10,
+            pagination: true,
+            indexAsync: true
+        };
+        var bookmarkList = new List('Bookmarks', options);
+        // the module ids have CSS rules to create ::before elements 
containing their names
+        function addIds() {
+            var visibleArray = bookmarkList.visibleItems;
+            visibleArray.forEach(function(element) {
+                element.elm.removeAttribute("id");
+            });
+            modules.forEach(function(module) {
+                function matchClass(element) {
+                    return element.elm.childNodes[0].className === module;
+                }
+                var index = visibleArray.findIndex(matchClass);
+                if(typeof visibleArray[index] !== 'undefined') { 
visibleArray[index].elm.setAttribute("id", module); };
+            });
+        }
+        bookmarkList.on('updated', addIds);
+        ]]>
+    </script>
     <xsl:choose>
         <xsl:when test="$online">
             <script type="text/javascript">
diff --git a/help3xsl/xhp2html.sh b/help3xsl/xhp2html.sh
index 28631cf51..d196625f2 100755
--- a/help3xsl/xhp2html.sh
+++ b/help3xsl/xhp2html.sh
@@ -178,6 +178,7 @@ cp help.html $here'/html/'
 cp index2.html $here'/html/'$productversion'/index.html'
 cp help.js $here'/html/'$productversion'/'
 cp jquery-3.1.1.min.js $here'/html/'$productversion'/'
+cp list.min.js $here'/html/'$productversion'/'
 cp normalize.css $here'/html/'$productversion'/'
 cp default.css $here'/html/'$productversion'/'
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to