diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2022-02-09 12:57:37 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2022-02-09 16:24:41 +0100 |
commit | 751aa416e5aa4fdb6faf5be273aa8d999e1630e4 (patch) | |
tree | 9de656ce180488ac9c7b51638bb545abcc8d75f9 /help3xsl/help.js | |
parent | 5e2cb8e64fbd008ab9e1372575f5b96f0f27e728 (diff) |
Add YouTube consent click
Change-Id: I60d64e1becbc7ea33301d4a8073f0b550998b87d
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/129716
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help.js')
-rw-r--r-- | help3xsl/help.js | 11 |
1 files changed, 11 insertions, 0 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 = `<iframe width="${width}" height="${height}" src="https://www.youtube-nocookie.com/embed/${ytId}?version=3" allowfullscreen="true" frameborder="0"></iframe>`; + 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: */ |