From b6bc8c1cfecc55bebff8dc64fddb63e3edc109b5 Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Thu, 8 Feb 2018 13:18:55 +0200 Subject: 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 Tested-by: Olivier Hallot --- CustomTarget_html.mk | 2 +- help3xsl/default.css | 109 +++++++++++++++++--------------- help3xsl/get_bookmark.xsl | 6 +- help3xsl/help.js | 144 ++++++++++++++++++++++++++++++++++++++++-- help3xsl/localized.xsl | 8 +++ help3xsl/online_transform.xsl | 87 +++++++------------------ help3xsl/paginathing.js | 22 +++---- help3xsl/xhp2html.sh | 2 +- 8 files changed, 243 insertions(+), 137 deletions(-) diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk index e39c8384eb..ae56ebd07a 100644 --- a/CustomTarget_html.mk +++ b/CustomTarget_html.mk @@ -114,7 +114,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.js : $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,2) $(call gb_Helper_abbreviate_dirs,\ ( \ - echo 'document.getElementsByClassName( "list" )[0].innerHTML='"'"'\' \ + echo 'document.getElementsByClassName( "index" )[0].innerHTML='"'"'\' \ && cat $(filter %.part,$^) \ && echo "'" \ ) > $@ \ diff --git a/help3xsl/default.css b/help3xsl/default.css index debcf99aa2..dc2a19972a 100644 --- a/help3xsl/default.css +++ b/help3xsl/default.css @@ -40,9 +40,49 @@ h6, .listitem, .listitemintable, .tablecontent, -.tablecontentintable { +.input { font-family: "Segoe UI", Ubuntu, Cantarell, "Noto Sans", "DejaVu Sans", "Lucida Sans Unicode", "Helvetica Neue", Helvetica, Tahoma, sans-serif; } +.input { + transition-property: background-color; + transition-duration: 150ms; +} +[data-tooltip]{ + position:relative; +} +[data-tooltip]::before { + content: ""; + position: absolute; + top:-6px; + left:50%; + transform: translateX(-50%); + border-width: 4px 6px 0 6px; + border-style: solid; + border-color: rgba(0,0,0,0.7) transparent transparent transparent; + z-index: 100; + opacity: 0; + pointer-events: none; +} +[data-tooltip]::after { + content: attr(data-tooltip); + position: absolute; + left:50%; + top:-6px; + transform: translateX(-50%) translateY(-100%); + background: rgba(0,0,0,0.7); + text-align: center; + color: #fff; + padding:4px 2px; + font-size: 12px; + min-width: 80px; + border-radius: 5px; + opacity: 0; + pointer-events: none; +} +[data-tooltip]:hover:before, [data-tooltip]:hover:after { + opacity: 1; + pointer-events: auto; +} body { margin: 0; line-height: normal; @@ -108,6 +148,9 @@ h1 { border-bottom: 3px solid #18A303; padding-bottom: 6px; } +h1 a { + text-decoration: none; +} h2 { font-size: 1.5rem; } @@ -282,41 +325,6 @@ footer { footer p { font-size: 1rem; } -.breadcrumbs ul { - list-style-type: none; - margin: 0; - padding: 0; - color: #333; -} -.breadcrumbs li { - display: inline-block; - position: relative; - padding-right: 24px; - margin: 0; -} -.breadcrumbs li:after { - content: '>'; - position: absolute; - display: inline-block; - right: 0; - width: 24px; - text-align: center; -} -.breadcrumbs li:last-child { - font-weight: bold; -} -.breadcrumbs li:last-child:after { - content: ''; -} -.breadcrumbs a { - text-decoration: none; - display: inline-block; - color: #333; - white-space: nowrap; -} -.breadcrumbs a:hover { - text-decoration: underline; -} .gsc-control-cse { border-color: transparent !important; background-color: transparent !important; @@ -356,14 +364,13 @@ aside input[type=checkbox]:checked ~ .contents-treeview { padding-left: 20px; margin: 20px 0 0 0; } -#Index { +#Index, .index { margin-top: 10px; } -.list { +.index { padding-left: 15px; } -.list li { - list-style: none; +.index a { font-size: 16px; margin-bottom: 5px; } @@ -375,63 +382,63 @@ aside input[type=checkbox]:checked ~ .contents-treeview { font-weight: bold; color: #18A303; } -#writer::before { +#WRITER::before { content: "WRITER"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#calc::before { +#CALC::before { content: "CALC"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#impress::before { +#IMPRESS::before { content: "IMPRESS"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#draw::before { +#DRAW::before { content: "DRAW"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#base::before { +#BASE::before { content: "BASE"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#math::before { +#MATH::before { content: "MATH"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#chart::before { +#CHART::before { content: "CHART"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#basic::before { +#BASIC::before { content: "BASIC"; display: block; font-size: 22px; font-weight: bold; color: #18A303; } -#shared::before { +#GLOBAL::before { content: "GLOBAL"; display: block; font-size: 22px; @@ -541,10 +548,10 @@ li.disabled a { -webkit-user-select: none; user-select: none; } -.contents-treeview a, .list a { +.contents-treeview a, .index a { text-decoration: none; } -.contents-treeview a:hover, .list a:hover { +.contents-treeview a:hover, .index a:hover { text-decoration: underline; } .contents-treeview input + label + ul { diff --git a/help3xsl/get_bookmark.xsl b/help3xsl/get_bookmark.xsl index 10f1e69e92..3614d4cbed 100644 --- a/help3xsl/get_bookmark.xsl +++ b/help3xsl/get_bookmark.xsl @@ -55,13 +55,13 @@ xsltproc get_bookmark.xsl - - + ]]> - \]]> + \]]> diff --git a/help3xsl/help.js b/help3xsl/help.js index 999af538b0..53d9cda4c3 100644 --- a/help3xsl/help.js +++ b/help3xsl/help.js @@ -9,7 +9,7 @@ // Used to set Application in caseinline=APP function setModule(module){ - if (module == null){module="WRITER"} + if (module === null){module="WRITER";} var itemspan = document.getElementsByTagName("span"); var n = itemspan.length; for (var i = 0; i < n; i++){ @@ -22,7 +22,7 @@ function setModule(module){ // Used to set system in caseinline=SYSTEM function setSystem(system){ var itemspan = document.getElementsByTagName("span"); - if (system == null){system="WIN"} + if (system=== null){system="WIN";} var n = itemspan.length; for (var i = 0; i < n; i++){ if (itemspan[i].getAttribute("value") == system){ @@ -33,19 +33,19 @@ function setSystem(system){ /* add &DbPAR= and &System= to the links in DisplayArea div */ function fixURL(module, system){ var itemlink = document.getElementById("DisplayArea").getElementsByTagName("a"); - var pSystem = (system == null) ? "WIN" : system; - var pAppl = (module == null) ? "WRITER" : module; + var pSystem = (system=== null) ? "WIN" : system; + var pAppl = (module=== null) ? "WRITER" : module; var n = itemlink.length; for (var i = 0; i input'); + document.getElementById(input[0].id).checked = true; + } + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/help3xsl/localized.xsl b/help3xsl/localized.xsl index a52474b1bf..9549eb9f1a 100644 --- a/help3xsl/localized.xsl +++ b/help3xsl/localized.xsl @@ -290,5 +290,13 @@ Stylesheet map language-dependent parameters and translation + + + + Klikkaa kopioidaksesi leikepöydälle + Click on text to copy to clipboard + + + diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl index 2feda208ac..db296cbf6c 100644 --- a/help3xsl/online_transform.xsl +++ b/help3xsl/online_transform.xsl @@ -133,7 +133,6 @@ - @@ -257,7 +256,7 @@
🔎
-
    +
    @@ -300,66 +299,7 @@ +