From 751aa416e5aa4fdb6faf5be273aa8d999e1630e4 Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Wed, 9 Feb 2022 12:57:37 +0200 Subject: Add YouTube consent click Change-Id: I60d64e1becbc7ea33301d4a8073f0b550998b87d Reviewed-on: https://gerrit.libreoffice.org/c/help/+/129716 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- help3xsl/help.js | 11 +++++++++++ help3xsl/online_transform.xsl | 9 ++++++--- source/text/shared/06/youtubevideos.xhp | 5 ++++- source/text/shared/help/browserhelp.xhp | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/help3xsl/help.js b/help3xsl/help.js index 0a7563e3f8..dcf0dd365f 100644 --- a/help3xsl/help.js +++ b/help3xsl/help.js @@ -246,4 +246,15 @@ document.addEventListener('click', function(event) { }); } }); +// YouTube consent click. This only works for a single video. +let youtubePlaceholder = document.querySelector(".youtube_placeholder"); +if (youtubePlaceholder) { + youtubePlaceholder.prepend(...document.querySelectorAll(".youtube_consent")); +} +function youtubeLoader(ytId, width, height) { + let iframeMarkup = ``; + let placeholder = document.getElementById(ytId); + placeholder.innerHTML = iframeMarkup; + placeholder.removeAttribute("style"); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl index a6ce8255bf..ac6337d7ec 100644 --- a/help3xsl/online_transform.xsl +++ b/help3xsl/online_transform.xsl @@ -108,6 +108,7 @@ +