From c7f8920ce05127708e3a0cf22e3bf2419e402616 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 3 Jun 2017 03:27:09 +0800 Subject: [PATCH] Play YouTube Getting Started Tutorials inside the JavaFX WebView (BETA) --- website/getting-started/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/website/getting-started/index.js b/website/getting-started/index.js index 52a482cc..ad1283c2 100644 --- a/website/getting-started/index.js +++ b/website/getting-started/index.js @@ -48,10 +48,10 @@ function getData() { thumb: 'images/node.screenshot.thumb.png' }] - var links = false + var embed = location.hash.length > 0 var youtube = !(/zh(.CN)?/i).test(navigator.locale ? navigator.locale : navigator.language) // YouTube is blocked in China (mainland) - if (links) { + if (embed) { data = data.slice(0, 5) // use only tutorial images if (location.hash == '#mas') { @@ -66,14 +66,13 @@ function getData() { } } - if (!links) { - data.forEach(function(it) { - it.video = it[youtube ? 'link' : 'video'] - }) - } + data.forEach(function(it) { + it.video = it[youtube ? 'link' : 'video'] + }) + if (!youtube) { data.forEach(function(it) { - it[links ? 'link' : 'iframe'] = it.video + it['iframe'] = it.video delete it.video }) }