help3/html/default.css | 830 -------------------------------------------- help3/html/ed_transform.xsl | 59 +-- help3/html/index.php | 1 help3/html/test.xhp | 57 --- help3/html/xhp2html.js | 19 - help3/html/xhpeditor.css | 268 ++++++++++++++ 6 files changed, 308 insertions(+), 926 deletions(-)
New commits: commit fffb77190091587eadde0c7b73eef0e8571af99c Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Tue Dec 25 16:54:34 2018 -0200 Commit: Olivier Hallot <olivier.hal...@libreoffice.org> CommitDate: Wed Dec 26 13:07:51 2018 +0100 Help online editor: More on page rendering (WIP) * Pick #DisplayArea only from transformed page, drop other divs * Changes in XSLT to access core/icon-themes/colibre_svg * Changes in XSLT to access helcontent2 cloned git * Changes in JS to pass parameters to XSLT (wip) * added fragments of original CSS to render transformed page (wip) Necessary setup: + provide a symbolic link between: hc2/ -> <git>/core/helpcontent2/ core/ -> <git>/core/ URL to open: /ed/index.php Change-Id: I5616ccf718906addeae4921fb8c39b3bfd7f376f Reviewed-on: https://gerrit.libreoffice.org/65607 Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> Tested-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/help3/html/default.css b/help3/html/default.css deleted file mode 100644 index 6cb76ce..0000000 --- a/help3/html/default.css +++ /dev/null @@ -1,830 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -/* -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -+ LIBREOFFICE HELP IN BROWSER + -+ DEFAULT STYLESHEET + -+ WESTERN LANGUAGES + -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -We use px as the unit for navigation elements and fonts because we do -not want them to scale with browser-set font size. -We use rem as the unit for article and footer contents because they -do not break anything related to layout by scaling. - -*/ - -body, -p, -h1, -h2, -h3, -h4, -h5, -h6, -.listitem, -.listitemintable, -.tablecontent, -.input { - font-family: -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "DejaVu Sans", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, sans-serif, FreeSerif, NanumGothic, "Noto Sans Tibetan", Taprom; -} -.input { - transition-property: background-color; - transition-duration: 150ms; - border-bottom: 1px dashed rgba(0,0,0,0.1); -} -[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 { - background-color: #F4F7F7; - margin: 0; - line-height: normal; -} -::selection { - background: #BFFFB7; -} -a { - text-decoration: none; - color: #0369AE; -} -a:hover { - text-decoration: underline; - color: #1C99E0; -} -pre, -.code, -.codeintable, -.example, -.exampleintable, -.literal, -.literalintable, -.path, -.pathintable { - background-color: rgba(0,0,0,0.04); - border-radius: 2px; - display: inline; - padding: 1px 3px; - font-family: Menlo, Consolas, "DejaVu Sans Mono", "Nimbus Mono L", "Lucida Sans Typewriter", "Courier New", Courier, Monaco, monospace; -} -.acronym { - font-weight: bold; -} -.related { - font-weight: bold; - margin-top: 1.67rem; - border-top: 1px solid black; -} -.emph, -.menuitem { - font-weight: bold; -} -.keycode { - /*font-weight: bold;*/ - font-family: Menlo, Consolas, "DejaVu Sans Mono", "Nimbus Mono L", "Lucida Sans Typewriter", "Courier New", Courier, Monaco, monospace; -} -.widget{ - padding: 1px 10px; - background: #f0f0f0; - background: linear-gradient(to bottom,#f0f0f0,#fcfcfc); - border-radius: 3px; - color: #303030; - border: 1px solid #a0a0a0; - border-bottom-width: 2px; - white-space: nowrap; -} -/* div's for warning, tip and note */ -.note, -.tip, -.warning { - display:flex; - align-items: center; - border-radius: 0 4px 4px 0; - box-shadow: 0 2px 2px -2px rgba(0,0,0,0.2); - padding: 0.2em; - margin-top: 15px; -} -.note { - border-left: 4px solid #FFDE09; - background-color: #FFF4D0; -} -.tip { - border-left: 4px solid #38618C; - background-color: #DAE2EA; -} -.warning { - border-left: 4px solid #FF5964; - background-color: #FFE0E2; -} -.noteicon { - padding:0.3em; - transition: transform .2s; /* Animation */ -} -.noteicon:hover { - transform: scale(2.0); /* (200% zoom - Note: if the zoom is too large, it will go outside of the viewport) */ -} -.notetext { - padding:0.3em; -} - -/* Table related classes */ - -/* Special case of table with one cell*/ -.onecell{ - box-shadow: rgba(0,0,0,0.1) 0px 1px 3px 0px; - border-bottom: 1px solid #E8E8E8; -} -/* Special case of icon table*/ -.icontable { - display:flex; - align-items:center; -} -.iconcell { - padding:0.3em; -} -.imageicon { - transition: transform .2s; /* Animation */ -} -.imageicon:hover{ - transform: scale(2.0); /* (200% zoom - Note: if the zoom is too large, it will go outside of the viewport) */ -} - -table { - box-shadow: rgba(0,0,0,0.1) 0px 1px 3px 0px; - border-collapse: collapse; - background: #fefefe; -} -table, th, td { - border-top: 0; - border-bottom: 1px solid #E8E8E8; - border-left: 0; - border-right: 0; - padding: 0.3em; -} -.tablehead, -.tableheadintable { - font-weight: bold; - margin-top: 0px; -} -.tableheadcell { - background: #148603; - color: white; - vertical-align:top; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - margin-bottom: 0.67rem; - color: #148603; -} -p, -ol, -td { - font-size: 1.17rem; - margin: 2px 2px 2px 2px; -} -h1 { - font-size: 1.83rem; - font-weight: 300; - border-bottom: 2px solid #148603; - padding-bottom: 6px; -} -h1 a { - text-decoration: none; -} -h2 { - font-size: 1.55rem; -} -h3 { - font-size: 1.33rem; -} -h4, -h5, -h6 { - font-size: 1.17rem; -} -.avis { - /* background-color: #EEEEEE;*/ -} -.relatedtopics { - font-weight: normal; -} -.relatedbody { - margin-top: 2px; - margin-bottom: 2px; - margin-left: 5px; -} -.howtoget { - background: #CCF4C6; - border-left: 4px solid #148603; - border-radius: 0 4px 4px 0; - box-shadow: 0 2px 2px -2px rgba(0,0,0,0.2); - padding: 0.3em; - display: flex; - flex-direction: column; -} -.howtogetheader { - background: #FFF; - border-radius: 2px; - box-shadow: 0 2px 2px -2px rgba(0,0,0,0.2); - display: inline-block; - font-weight: bold; - padding: 0.3em; -} -.howtogetbody { -} -.samplefilesection{ -} -.wide { - width: 100%; -} -.topalign { - vertical-align: top; - border: 1px; -} -.bug { - color: red; -} -.debug { - border: 1px solid black; - padding: 3px; - display: none; - background-color: #222; - color: red; - text-align: left; -} -.donation { - padding: 0 0 10px 0; - margin-bottom: 1em; - border-bottom: 1px dashed rgba(0,0,0,0.1); -} -.donation p{ - font-size:1.2rem; -} -.bascode { - margin-top:15px; - margin-bottom: 15px; -} - -.infopage { - color: green; - font-size: 1.33rem; - font-weight: bold; -} -.topmenu { - font-size: 1rem; - font-weight: bold; - padding: 1px; - border: solid 1px #148603; -} -#DisplayArea { - background-color: #FCFCFC; - overflow: auto; - padding: 10px; - grid-area: main; -} -#DisplayArea > p { - margin-bottom: 10px; -} -.mediabutton { - background-color: cyan; -} -.mediadiv{ - padding-bottom:5%; - height:0; - display:inline-block; - border:none; -} -.switch, -.switchinline {} - -.tintro { - color: white; - background-color: green; - font-family: Arial; - font-weight: bold; - font-size: 2rem; - border: 1px solid black; - padding-bottom: 6px; - margin-bottom: 6px; -} -.embedded {} -.header-extrawurst { - grid-area: header; -} -header { - background-color: #18A303; - color: #fff; - height: 64px; - padding: 8px 8px 8px 16px; -} -.logo-container { - display: flex; - justify-content: space-between; -} -.logo { - color: #fff; - text-decoration: none; - display: flex; -} -.logo p { - font-size: 24px; -} -.logo .symbol { - background-image: url(media/navigation/libo-symbol-white.svg); - background-repeat: no-repeat; - background-size: contain; - width: 52px; - height: 60px; - margin-right: 10px; -} -.lang nav, .modules nav { - z-index: 100; - /* line them up horizontally */ - display: flex; - flex-direction: row; - /* allow for scrolling */ - overflow-x: auto; - overflow-y: hidden; - /* make it smooth on iOS */ - -webkit-overflow-scrolling: touch; - text-align: center; -} -.lang nav a, .modules nav a { - color: #fff; - background-color: #233336; - display: block; - line-height: 1.5; - padding: 3px 6px; - text-decoration: none; - font-size: 24px; - flex-shrink: 0; - z-index: 100; - white-space: nowrap; -} -footer { - border-top: 2px solid #148603; - padding: 15px 10px 0 10px; - margin: 40px 0; -} -footer p { - font-size: 0.98rem; -} -.gsc-control-cse { - border-color: transparent !important; - background-color: transparent !important; - padding: 3px 0 0 0 !important; -} -.modules input[type=checkbox], .lang input[type=checkbox], -.contents-treeview input[type=checkbox], aside input[type=checkbox] { - position: absolute; - opacity: 0; -} -label[for=accordion-1] { - color: #148603; - display: block; - padding: 10px 0 10px 20px; - font-size: 22px; - line-height: .6; -} -label[for=accordion-1]:after { - font-size: 44px; - content:"⌄"; -} -aside input[type=checkbox] ~ .contents-treeview { - display: none; -} -aside input[type=checkbox]:checked ~ .contents-treeview { - color: #333; - z-index: 6; - display: block; - margin: 0 20px 0 20px; -} -.index-label { - font-size: 22px; - color: #148603; - padding-left: 20px; - margin: 20px 0 0 0; -} -#Index, .index { - margin-top: 10px; -} -.index { - padding-left: 15px; -} -.index a { - font-size: 16px; - margin-bottom: 5px; -} -#Bookmarks { - padding: 0 20px; -} -#Bookmarks p { - font-size: 22px; - font-weight: bold; - color: #148603; -} -#WRITER::before { - content: "WRITER"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#CALC::before { - content: "CALC"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#IMPRESS::before { - content: "IMPRESS"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#DRAW::before { - content: "DRAW"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#BASE::before { - content: "BASE"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#MATH::before { - content: "MATH"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#CHART::before { - content: "CHART"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#BASIC::before { - content: "BASIC"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -#SHARED::before { - content: "GLOBAL"; - display: block; - font-size: 22px; - font-weight: bold; - color: #148603; -} -.pagination { - padding: 0; -} -.pagination li { - display: inline-block; - padding: 4px; -} -.pagination a { - text-decoration: none; -} -.index a { - display: block; -} -.index .hidden { - display: none; -} -li.active { - background-color: #0369A3; -} -li.active a { - color: #fff; -} -li.disabled a { - color: #90C0E6; -} -#search-bar { - margin-top: 10px; - width: 100%; - caret-color: #148603; -} -#search-bar::placeholder { - font-style: italic; -} -.google-search { - max-width: 300px; - margin: 0 auto; -} -.modules { - border-bottom: 2px solid #f3f3f3; -} -.modules label:after, .lang label:after { - font-size: 30px; - color: #fff; - content:"⌄"; -} -.lang label, .modules label { - display: none; -} -.modules nav div { - background-repeat: no-repeat; - background-size: contain; - float: left; - display: none; -} -.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-icon { - background-image: url(media/navigation/libo-calc.svg); -} -.writer-icon { - background-image: url(media/navigation/libo-writer.svg); -} -.impress-icon { - background-image: url(media/navigation/libo-impress.svg); -} -.draw-icon { - background-image: url(media/navigation/libo-draw.svg); -} -.math-icon { - background-image: url(media/navigation/libo-math.svg); -} -.base-icon { - background-image: url(media/navigation/libo-base.svg); -} -.chart-icon { - background-image: url(media/navigation/libo-chart.svg); -} -.basic-icon { - background-image: url(media/navigation/libo-basic.svg); -} -/* tree view */ - -.contents-treeview ul, -.contents-treeview li { - padding: 0; - margin: 0; - list-style: none; - font-size: 16px; -} -.contents-treeview { - -moz-user-select: none; - -webkit-user-select: none; - user-select: none; -} -.contents-treeview a, .index a { - text-decoration: none; -} -.contents-treeview a:hover, .index a:hover { - text-decoration: underline; -} -.contents-treeview input + label + ul { - margin: 0 0 0 22px; -} -.contents-treeview input ~ ul { - display: none; -} -.contents-treeview label, -.contents-treeview label:before { - cursor: pointer; - color: #111; -} -.contents-treeview input:disabled + label { - cursor: default; - opacity: .6; -} -.contents-treeview input:checked:not(:disabled) ~ ul { - display: block; -} -.contents-treeview label, -.contents-treeview a, -.contents-treeview label::before { - height: 16px; - line-height: 16px; - vertical-align: middle; -} -.contents-treeview label:before { - content: "⊞"; - color: #148603; - width: 16px; - margin: 0 5px 0 0; - display: inline-block; -} -.contents-treeview input:checked + label::before { - content: "⊟"; -} -.contents-current { - background-color: #0369A3; - color: #FFF; - padding-right: 1px; -} -.contents-current:hover { - color: #FFF; -} -/* webkit adjacent element selector bugfix */ - -@media screen and (-webkit-min-device-pixel-ratio: 0) { - .contents-treeview { - -webkit-animation: webkit-adjacent-element-selector-bugfix infinite 1s; - } - @-webkit-keyframes webkit-adjacent-element-selector-bugfix { - from { - padding: 0; - } - to { - padding: 0; - } - } -} -@media screen and (min-width: 960px) { - .lang nav { - display: none; - } - .lang nav a { - font-size: 19px; - white-space: normal; - } - .lang label, .modules label { - cursor: pointer; - color: #fff; - font-size: 19px; - position: relative; - top: 40px; - display: block; - } - /* change the menu direction to stacked */ - - .lang input[type="checkbox"]:checked ~ nav, .modules input[type="checkbox"]:checked ~ nav { - display: flex; - flex-direction: column; - max-width: 120px; - overflow-y: auto; - overflow-x: hidden; - max-height: 480px; - position: absolute; - top: 80px; - } - .modules input[type="checkbox"]:checked ~ nav { - background-color: #101820; - text-align: left; - } - .modules nav { - display: none; - } - .modules nav div { - display: block; - } - .modules nav a { - font-size: 19px; - } - aside { - background-color: #F4F7F7; - float: left; - width: 320px; - } - .leftside { - grid-area: leftside; - } - .rightside { - grid-area: rightside; - } - .google-search { - margin: 0; - position: absolute; - top: 19px; - left: 860px; - } - .lang { - position: absolute; - top: 0; - left: 200px; - } - .modules { - width: 120px; - position: absolute; - top: 0; - left: 80px; - border: none; - } - #DisplayArea { - background-color: #FCFCFC; - box-shadow: 0 2px 8px 0 rgba(0,0,0,.05); - padding: 10px 50px; - width: 800px; - } -} -@media screen and (min-width: 1440px) { - #Contents { - color: #333; - z-index: 6; - display: block; - margin: 0 20px 0 20px; - } - label[for=accordion-1] { - background-color: transparent; - text-decoration: none; - } - label[for=accordion-1]:hover { - background-color: transparent; - } - label[for=accordion-1]:after { - content: ""; - } -} -@supports (grid-area: auto) { - @media screen and (min-width: 960px) { - body { - display: grid; - grid-template-columns: 320px 1fr; - grid-template-rows: minmax(1em, auto) minmax(1em, auto) 1fr; - grid-template-areas: "header header" - "rightside main" - "leftside main" - } - } - @media screen and (min-width: 1440px) { - body { - display: grid; - grid-template-columns: 320px 900px 1fr; - grid-template-rows: 1fr minmax(1em, auto); - grid-template-areas: "header header header" - "leftside main rightside" - } - .rightside { - width: auto; - border-right: none; - } - } -} diff --git a/help3/html/ed_transform.xsl b/help3/html/ed_transform.xsl index d423c72..d2223d1 100644 --- a/help3/html/ed_transform.xsl +++ b/help3/html/ed_transform.xsl @@ -21,8 +21,8 @@ <xsl:output indent="yes" method="html" doctype-system= "about:legacy-compat"/> -<xsl:include href="localized.xsl"/> -<xsl:include href="links.txt.xsl"/> +<xsl:include href="hc2/help3xsl/localized.xsl"/> +<xsl:include href="hc2/help3xsl/links.txt.xsl"/> <!-- ############################ # Variables and Parameters # @@ -36,7 +36,7 @@ <xsl:param name="productversion"/> <xsl:param name="System" select="'WIN'"/> -<xsl:param name="imgtheme" select="''"/> +<xsl:param name="imgtheme" select="'colibre_svg'"/> <xsl:param name="Id" /> <!-- General Usage --> @@ -57,17 +57,13 @@ <!-- Installation --> <xsl:variable name="online" select="$local!='yes'"/> -<xsl:variable name="target" select="'ed/'"/> +<xsl:variable name="target" select="'/ed/'"/> +<xsl:variable name="source" select="'/hc2/'"/> <!-- meta data variables from the help file --> <xsl:variable name="filename" select="/helpdocument/meta/topic/filename"/> <xsl:variable name="title" select="/helpdocument/meta/topic/title"/> -<!-- Module and the corresponding switching values--> -<xsl:param name="Database" select="'swriter'"/> -<xsl:variable name="module" select="$Database"/> -<xsl:variable name="appl"/> - <!-- the other parameters given by the help caller --> <xsl:variable name="pversion"> @@ -84,7 +80,7 @@ <!-- parts of help and image urls --> -<xsl:variable name="img_url_prefix" select="concat($target,'media',$imgtheme,'/')"/> +<xsl:variable name="img_url_prefix" select="concat($target,'core/icon-themes/',$imgtheme,'/')"/> <xsl:variable name="urlpost" select="concat('?Language=',$lang,$am,'System=',$System,$am,'UseDB=no')"/> @@ -94,9 +90,9 @@ <xsl:variable name="linkpostfix" select="''"/> <!-- images for notes, tips and warnings --> -<xsl:variable name="note_img" select="concat($img_url_prefix,'icon-themes/help/note.svg')"/> -<xsl:variable name="tip_img" select="concat($img_url_prefix,'icon-themes/help/tip.svg')"/> -<xsl:variable name="warning_img" select="concat($img_url_prefix,'icon-themes/help/warning.svg')"/> +<xsl:variable name="note_img" select="concat($img_url_prefix,'help/note.svg')"/> +<xsl:variable name="tip_img" select="concat($img_url_prefix,'help/tip.svg')"/> +<xsl:variable name="warning_img" select="concat($img_url_prefix,'help/warning.svg')"/> <!-- Strings for the help UI page --> <xsl:variable name="tmp_href_ui"><xsl:value-of select="concat($urlpre,'text/shared/help/browserhelp.xhp')"/></xsl:variable> @@ -139,32 +135,21 @@ <html lang="{$lang}"> <head> <base href="{$install}"/> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <xsl:if test="$online"> - <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/> - </xsl:if> - <title><xsl:value-of select="$titleL10N"/></title> - <link rel="shortcut icon" href="{$target}media/navigation/favicon.ico" /> - <link type="text/css" href="{$target}normalize.css" rel="Stylesheet" /> - <link type="text/css" href="{$target}default.css" rel="Stylesheet" /> - <link type="text/css" href="{$target}prism.css" rel="Stylesheet" /> - <script type="text/javascript" src="{$target}help2.js"></script> - <script type="text/javascript" src="{$target}languages.js"></script> - <script type="text/javascript" src="{$target}{$lang}/langnames.js"></script> - <script type="text/javascript" src="{$target}fuzzysort.js"></script> - <script type="text/javascript" src="{$target}paginathing.js"></script> - <script type="text/javascript" src="{$target}prism.js"></script> + <link rel="shortcut icon" href="{$source}media/navigation/favicon.ico" /> + <link type="text/css" href="{$source}help3xsl/normalize.css" rel="Stylesheet" /> + <link type="text/css" href="{$source}help3xsl/default.css" rel="Stylesheet" /> + <link type="text/css" href="{$source}help3xsl/prism.css" rel="Stylesheet" /> + <script type="text/javascript" src="{$source}help3xsl/help2.js"></script> + + <script type="text/javascript" src="{$source}help3xsl/fuzzysort.js"></script> + <script type="text/javascript" src="{$source}help3xsl/paginathing.js"></script> + <script type="text/javascript" src="{$source}help3xsl/prism.js"></script> <meta name="viewport" content="width=device-width,initial-scale=1"/> </head> <body itemscope="true" itemtype="http://schema.org/TechArticle"> - <xsl:if test="$online"> - <meta itemprop="version" content="{$productversion}"/> - <meta itemprop="inLanguage" content="{$lang}"/> - <meta itemprop="datePublished" content="2017"/> - <meta itemprop="headline" content="{$titleL10N}"/> - </xsl:if> <div id="DisplayArea" itemprop="articleBody"> <xsl:apply-templates select="/helpdocument/body"/> + <footer> <xsl:if test="$online"> <div class="donation"> @@ -1051,16 +1036,16 @@ <xsl:variable name="tmp1" select="substring-after(@src, '/ui/')"/> <xsl:variable name="tmp2" select="substring-before($tmp1,'/')"/> <xsl:variable name="tmp3" select="substring-after($tmp1,'/')"/> - <xsl:value-of select="concat($target,$tmp0,'/ui/', $tmp2, '/',$lang,'/',$tmp3)"/> + <xsl:value-of select="concat($source,'source/',$tmp0,'/ui/', $tmp2, '/',$lang,'/',$tmp3)"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="concat($target,@src)"/> + <xsl:value-of select="concat($source,'source/',@src)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- generic media file --> <xsl:when test="starts-with(@src,'media/')"> - <xsl:value-of select="concat($target,@src)"/> + <xsl:value-of select="concat($source,'/source/',@src)"/> </xsl:when> <!-- handle icons --> <xsl:when test="not(starts-with(@src,'media/'))"> diff --git a/help3/html/index.php b/help3/html/index.php index a34c3b0..1c549cb 100644 --- a/help3/html/index.php +++ b/help3/html/index.php @@ -20,6 +20,7 @@ <script type="text/javascript" src="addon/hint/xml-hint.js"></script> <script type="text/javascript" src="mode/xml/xml.js"></script> <script type="text/javascript" src="xhp2html.js"></script> + <script type="text/javascript" src="/ed/hc2/help3xsl/help2.js"></script> </head> <body style="font-family:sans-serif;"> diff --git a/help3/html/test.xhp b/help3/html/test.xhp deleted file mode 100644 index 0a75152..0000000 --- a/help3/html/test.xhp +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<helpdocument version="1.0"> -<!-- - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * ---> - -<meta> - <topic id="CHANGE ME" indexer="include" status="PUBLISH"> - <title id="tit" xml-lang="en-US">TITLE ME</title> - <filename>FILE NAME ME</filename> - </topic> -</meta> -<body> -<h1 id="hd_id471545060217269">Heading 1</h1> -<paragraph role="paragraph" id="par_id431545082820565">This file is for test only and will be deleted later</paragraph> -<h2 id="hd_id961545060221996">Heading 2</h2> -<h3 id="hd_id721545060227600">Heading 3</h3> - -<paragraph role="paragraph" id="par_id101545060233293">Paragraph</paragraph> - -<h2 id="hd_id961545065221996">Table</h2> -<table id="tab_id751545060242350"> - <tablerow> - <tablecell> - <paragraph id="par_id381545060242351" role="tablehead" xml-lang="en-US" localize="false">AAAAA</paragraph> - </tablecell> - <tablecell> - <paragraph id="par_id831545060242351" role="tablehead" xml-lang="en-US" localize="false">BBBBB</paragraph> - </tablecell> - <tablecell> - <paragraph id="par_id251545060242352" role="tablehead" xml-lang="en-US" localize="false">CCCCC</paragraph> - </tablecell> - </tablerow> - <tablerow> - <tablecell> - <paragraph id="par_id311545060242352" role="paragraph" xml-lang="en-US">nononon nononon nonon nonono nonon no non nonononono no</paragraph> - </tablecell> - <tablecell> - <paragraph id="par_id181545060242352" role="paragraph" xml-lang="en-US">nononon nononon nonon nonono nonon no non nonononono no</paragraph> - </tablecell> - <tablecell> - <paragraph id="par_id191545060242353" role="paragraph" xml-lang="en-US">nononon nononon nonon nonono nonon no non nonononono no</paragraph> - </tablecell> - </tablerow> -</table> - -<paragraph role="note" id="par_id501545057936792" xml-lang="en-US">This is a Note</paragraph> -<tip id="par_id501545057936792" xml-lang="en-US">This is a Tip</tip> -<warning id="par_id501545057936792" xml-lang="en-US">This is a Warning</warning> - -</body> -</helpdocument> diff --git a/help3/html/xhp2html.js b/help3/html/xhp2html.js index dad665b..c8fb04f 100644 --- a/help3/html/xhp2html.js +++ b/help3/html/xhp2html.js @@ -7,6 +7,14 @@ * */ +var helpcontent2 = "/hc2/"; +var productname = "LibreOffice"; +var productversion = "6.3"; +var root = helpcontent2 + "source/"; +var language = "en-US"; +var local = "no"; +var xhttp; + function loadDoc(filename, isXML) { if (window.ActiveXObject) @@ -55,12 +63,19 @@ function displayResult() { var xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); + xsltProcessor.setParameter("", "root", root) + xsltProcessor.setParameter("", "local", local) + xsltProcessor.setParameter("", "language", language) + xsltProcessor.setParameter("", "productname", productname) + xsltProcessor.setParameter("", "productversion", productversion) +// document.getElementById("renderedpage").innerHTML('<link type="text/css" href="/ed/hc2/help3xsl/default.css" rel="Stylesheet" />"'); var resultDocument = xsltProcessor.transformToFragment(xml, document); - document.getElementById("renderedpage").appendChild(resultDocument); + + document.getElementById("renderedpage").appendChild(resultDocument.getElementById("DisplayArea")); } } function loadText(filename){ - var text = loadDoc(filename,false); + var text = loadDoc(helpcontent2 + filename,false); editor.doc.setValue(text); } function saveFile(){ diff --git a/help3/html/xhpeditor.css b/help3/html/xhpeditor.css index 40583b5..bff63de 100644 --- a/help3/html/xhpeditor.css +++ b/help3/html/xhpeditor.css @@ -39,3 +39,271 @@ border:1px solid grey; } +// Imported from default.css for DisplayArea + +#DisplayArea { + background-color: #FCFCFC; + overflow: auto; + padding: 10px; + grid-area: main; +} + +#renderedpage, +#DisplayArea p, +#DisplayArea h1, +#DisplayArea h2, +#DisplayArea h3, +#DisplayArea h4, +#DisplayArea h5, +#DisplayArea h6, +.listitem, +.listitemintable, +.paragraph, +.tablecontent, +.input { + font-family: -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "DejaVu Sans", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, sans-serif, FreeSerif, NanumGothic, "Noto Sans Tibetan", Taprom; +} +.input { + transition-property: background-color; + transition-duration: 150ms; + border-bottom: 1px dashed rgba(0,0,0,0.1); +} +#renderedpage { + background-color: #F4F7F7; + margin: 10px; + line-height: normal; +} +#DisplayArea ::selection { + background: #BFFFB7; +} +#DisplayArea a { + text-decoration: none; + color: #0369AE; +} +#DisplayArea a:hover { + text-decoration: underline; + color: #1C99E0; +} +#DisplayArea pre, +.code, +.codeintable, +.example, +.exampleintable, +.literal, +.literalintable, +.path, +.pathintable { + background-color: rgba(0,0,0,0.04); + border-radius: 2px; + display: inline; + padding: 1px 3px; + font-family: Menlo, Consolas, "DejaVu Sans Mono", "Nimbus Mono L", "Lucida Sans Typewriter", "Courier New", Courier, Monaco, monospace; +} +.acronym { + font-weight: bold; +} +.related { + font-weight: bold; + margin-top: 1.67rem; + border-top: 1px solid black; +} +.emph, +.menuitem { + font-weight: bold; +} +.keycode { + /*font-weight: bold;*/ + font-family: Menlo, Consolas, "DejaVu Sans Mono", "Nimbus Mono L", "Lucida Sans Typewriter", "Courier New", Courier, Monaco, monospace; +} +.widget{ + padding: 1px 10px; + background: #f0f0f0; + background: linear-gradient(to bottom,#f0f0f0,#fcfcfc); + border-radius: 3px; + color: #303030; + border: 1px solid #a0a0a0; + border-bottom-width: 2px; + white-space: nowrap; +} +/* div's for warning, tip and note */ +.note, +.tip, +.warning { + display:flex; + align-items: center; + border-radius: 0 4px 4px 0; + box-shadow: 0 2px 2px -2px rgba(0,0,0,0.2); + padding: 0.2em; + margin-top: 15px; +} +.note { + border-left: 4px solid #FFDE09; + background-color: #FFF4D0; +} +.tip { + border-left: 4px solid #38618C; + background-color: #DAE2EA; +} +.warning { + border-left: 4px solid #FF5964; + background-color: #FFE0E2; +} +.noteicon { + padding:0.3em; + transition: transform .2s; /* Animation */ +} +.noteicon:hover { + transform: scale(2.0); /* (200% zoom - Note: if the zoom is too large, it will go outside of the viewport) */ +} +.notetext { + padding:0.3em; +} +#DisplayArea h1, +#DisplayArea h2, +#DisplayArea h3, +#DisplayArea h4, +#DisplayArea h5, +#DisplayArea h6 { + margin-bottom: 0.67rem; + color: #148603; +} + +#DisplayArea p, +#DisplayArea ol, +#DisplayArea td { + font-size: 1.17rem; + margin: 2px 2px 2px 2px; +} +#DisplayArea p { + margin-bottom: 10px; +} + +#DisplayArea h1 { + font-size: 1.83rem; + font-weight: 300; + border-bottom: 2px solid #148603; + padding-bottom: 6px; +} +#DisplayArea h1 a { + text-decoration: none; +} +#DisplayArea h2 { + font-size: 1.55rem; +} +#DisplayArea h3 { + font-size: 1.33rem; +} +#DisplayArea h4, +#DisplayArea h5, +#DisplayArea h6 { + font-size: 1.17rem; +} +.avis { + /* background-color: #EEEEEE;*/ +} +.relatedtopics { + font-weight: normal; +} +.relatedbody { + margin-top: 2px; + margin-bottom: 2px; + margin-left: 5px; +} +.howtoget { + background: #CCF4C6; + border-left: 4px solid #148603; + border-radius: 0 4px 4px 0; + box-shadow: 0 2px 2px -2px rgba(0,0,0,0.2); + padding: 0.3em; + display: flex; + flex-direction: column; +} +.howtogetheader { + background: #FFF; + border-radius: 2px; + box-shadow: 0 2px 2px -2px rgba(0,0,0,0.2); + display: inline-block; + font-weight: bold; + padding: 0.3em; +} +.howtogetbody { +} +.samplefilesection{ +} +.wide { + width: 100%; +} +.onecell{ + box-shadow: rgba(0,0,0,0.1) 0px 1px 3px 0px; + border-bottom: 1px solid #E8E8E8; +} +/* Special case of icon table*/ +icontable { + display:flex; + align-items:center; +} +.iconcell { + padding:0.3em; +} +.imageicon { + transition: transform .2s; /* Animation */ +} +.imageicon:hover{ + transform: scale(2.0); /* (200% zoom - Note: if the zoom is too large, it will go outside of the viewport) */ +} + +#DisplayArea table { + box-shadow: rgba(0,0,0,0.1) 0px 1px 3px 0px; + border-collapse: collapse; + background: #fefefe; +} +#DisplayArea table, +#DisplayArea th, +#DisplayArea td { + border-top: 0; + border-bottom: 1px solid #E8E8E8; + border-left: 0; + border-right: 0; + padding: 0.3em; +} +.tablehead, +.tableheadintable { + font-weight: bold; + margin-top: 0px; +} +.tableheadcell { + background: #148603; + color: white; + vertical-align:top; +} +#DisplayArea footer { + border-top: 2px solid #148603; + padding: 15px 10px 0 10px; + margin: 40px 0; +} +#DisplayArea footer p { + font-size: 0.98rem; +} +.bug { + color: red; +} +.debug { + border: 1px solid black; + padding: 3px; + display: none; + background-color: #222; + color: red; + text-align: left; +} +.donation { + padding: 0 0 10px 0; + margin-bottom: 1em; + border-bottom: 1px dashed rgba(0,0,0,0.1); +} +.donation p{ + font-size:1.2rem; +} +.bascode { + margin-top:15px; + margin-bottom: 15px; +} _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits