help3xsl/default.css                    |   48 ++++++++++++++++++++++++++++++++
 help3xsl/online_transform.xsl           |   10 +++++-
 source/text/shared/06/youtubevideos.xhp |    2 -
 source/text/shared/help/browserhelp.xhp |    4 ++
 4 files changed, 60 insertions(+), 4 deletions(-)

New commits:
commit d9880014fd80f412d10b2f7536c45941552c4760
Author:     Olivier Hallot <olivier.hal...@libreoffice.org>
AuthorDate: Wed May 11 14:07:02 2022 -0300
Commit:     Olivier Hallot <olivier.hal...@libreoffice.org>
CommitDate: Fri May 13 18:46:34 2022 +0200

    Fix YouTube display for Help online/offline
    
    + Enhance button CSS display
    + Refactor XSLT
    + Refactor XHP
    
    Change-Id: I58e46c31a97ad49eb25a4489994aae5dac62dbc3
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/134207
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org>

diff --git a/help3xsl/default.css b/help3xsl/default.css
index bc053cc70..69d86fb2c 100644
--- a/help3xsl/default.css
+++ b/help3xsl/default.css
@@ -397,6 +397,54 @@ h6 {
 [data-a11y-toggle]:not([aria-controls]) {
   display: none;
 }
+/* You Tube matters */
+.youtube_placeholder{
+    border: 1px solid #eee;
+    max-width:700px;
+    padding: 10px;
+    background-color: #eee;
+    text-align: center;
+}
+.youtube_button {
+  appearance: none;
+  backface-visibility: hidden;
+  background-color: #27ae60;
+  border-radius: 8px;
+  border-style: none;
+  box-shadow: rgba(39, 174, 96, .15) 0 4px 9px;
+  box-sizing: border-box;
+  color: #fff;
+  cursor: pointer;
+  display: inline-block;
+  font-size: 16px;
+  font-weight: 600;
+  letter-spacing: normal;
+  line-height: 1.5;
+  outline: none;
+  overflow: hidden;
+  padding: 13px 20px;
+  position: relative;
+  text-align: center;
+  text-decoration: none;
+  transform: translate3d(0, 0, 0);
+  transition: all .3s;
+  user-select: none;
+  -webkit-user-select: none;
+  touch-action: manipulation;
+  vertical-align: top;
+  white-space: nowrap;
+}
+.youtube_button:hover {
+  background-color: #1e8449;
+  opacity: 1;
+  transform: translateY(0);
+  transition-duration: .35s;
+  box-shadow: rgba(39, 174, 96, .2) 0 6px 12px;
+}
+.youtube_button:active {
+  transform: translateY(2px);
+  transition-duration: .35s;
+}
 
 #langs-nav:not([aria-hidden='true']), #modules-nav:not([aria-hidden='true']) {
     z-index: 100;
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index a9c47ae1e..a9de0d4f5 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -109,6 +109,9 @@
 <xsl:variable name ="ui_search"><xsl:apply-templates 
select="$tmp_doc_ui//variable[@id='searchhelpcontents']"/></xsl:variable>
 <xsl:variable name ="ui_copyclip"><xsl:apply-templates 
select="$tmp_doc_ui//variable[@id='copyclip']"/></xsl:variable>
 <xsl:variable name ="ytvideobutton"><xsl:apply-templates 
select="$tmp_doc_ui//variable[@id='ytbutton']"/></xsl:variable>
+<xsl:variable name ="ytaccept"><xsl:apply-templates 
select="$tmp_doc_ui//variable[@id='ytaccept']"/></xsl:variable>
+<xsl:variable name ="ytpromovideoH2"><xsl:apply-templates 
select="$tmp_doc_ui//variable[@id='externalvideo']"/></xsl:variable>
+<xsl:variable name ="ytprivacy"><xsl:apply-templates 
select="$tmp_doc_ui//variable[@id='ytprivacy']"/></xsl:variable>
 <!--
 #############
 # Templates #
@@ -1281,8 +1284,11 @@
     <xsl:variable name="auxID" select="concat('obj',generate-id())"/>
     <xsl:choose>
         <xsl:when test="starts-with(@type,'video/youtube')">
-            <div id="{@id}" class="youtube_placeholder" style="border: 1px 
solid #eee; max-width:500px; padding: 10px;">
-                <button style="background-color: red;" 
onClick="youtubeLoader('{@id}', 700, 394)" >
+            <div id="{@id}" class="youtube_placeholder">
+                <h2 id="promovideoH2"><xsl:value-of 
select="$ytpromovideoH2"/></h2>
+                <p><xsl:value-of select="$ytaccept"/></p>
+                <p><a href="https://policies.google.com/privacy"; 
target="_blank"><xsl:value-of select="$ytprivacy"/></a></p>
+                <button class="youtube_button" onClick="youtubeLoader('{@id}', 
700, 394)" >
                     <xsl:value-of select="$ytvideobutton"/>
                 </button>
             </div>
diff --git a/source/text/shared/06/youtubevideos.xhp 
b/source/text/shared/06/youtubevideos.xhp
index cce736e36..f21c009ac 100644
--- a/source/text/shared/06/youtubevideos.xhp
+++ b/source/text/shared/06/youtubevideos.xhp
@@ -17,8 +17,6 @@
 </meta>
 <body>
 <section id="whatisit">
-    <paragraph role="youtube_consent" id="par_id311644338760624">Please accept 
this video. By accepting you will be accessing content from YouTube, a service 
provided by an external third party.</paragraph>
-    <paragraph role="youtube_consent" id="par_id91644338793051"><link 
href="https://policies.google.com/privacy"; name="linkname">YouTube Privacy 
Policy</link></paragraph>
     <paragraph role="paragraph" id="par_ytvideosample" localize="false" 
xml-lang="en-US"><object data="" id="Raw0LIxyoRU" type="video/youtube" 
width="700" height="394"/>
     </paragraph>
 </section>
diff --git a/source/text/shared/help/browserhelp.xhp 
b/source/text/shared/help/browserhelp.xhp
index af7eee765..c14ea4a62 100644
--- a/source/text/shared/help/browserhelp.xhp
+++ b/source/text/shared/help/browserhelp.xhp
@@ -112,6 +112,10 @@
     <paragraph role="paragraph" id="par_id901568266092266"><variable 
id="xap_matching">matching:</variable></paragraph>
     <paragraph role="paragraph" id="par_id511568266279483"><variable 
id="xap_relevant">Mark this document as relevant</variable></paragraph>
     <paragraph role="paragraph" id="par_id841569449577334"><variable 
id="xap_didyoumean">Did you mean:</variable></paragraph>
+    <h2 id="hd_id471652287598699"><variable id="externalvideo">External 
video</variable></h2>
+    <paragraph role="youtube_consent" id="par_id311644338760624"><variable 
id="ytaccept">Please accept this video. By accepting you will be accessing 
content from YouTube, a service provided by an external third 
party.</variable></paragraph>
+
     <paragraph role="paragraph" id="par_id501644407795954"><variable 
id="ytbutton">Accept YouTube Content</variable></paragraph>
+    <paragraph role="youtube_consent" id="par_id91644338793051"><variable 
id="ytprivacy">YouTube Privacy Policy</variable></paragraph>
 </body>
 </helpdocument>

Reply via email to