MINOR: Redesign of Streams page to include video & logos

guozhangwang Please review.

Author: Manjula K <manjula@kafka-summit.org>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #4059 from manjuapu/redesign-streams-page
This commit is contained in:
Manjula K 2017-10-11 15:16:12 -07:00 committed by Guozhang Wang
parent 7d6ca52a27
commit f6e724b127
1 changed files with 328 additions and 266 deletions

View File

@ -1,276 +1,338 @@
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership. this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0 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 not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
distributed under the License is distributed on an "AS IS" BASIS, See the License for the specific language governing permissions and
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. limitations under the License.
See the License for the specific language governing permissions and -->
limitations under the License. <script>
--> <!--#include virtual="../js/templateData.js" -->
</script>
<script><!--#include virtual="../js/templateData.js" --></script> <script id="streams-template" type="text/x-handlebars-template">
<h1>Kafka Streams API</h1>
<script id="streams-template" type="text/x-handlebars-template"> <div class="sub-nav-sticky">
<h1>Kafka Streams API</h1> <div class="sticky-top">
<div style="height:35px">
<h3 style="max-width: 75rem;">The easiest way to write mission-critical real-time applications and microservices with all the benefits of Kafka's server-side cluster technology.</h3> <a class="active-menu-item" href="#">Introduction</a>
<a href="/{{version}}/documentation/streams/developer-guide">Developers Guide</a>
<div class="hero"> <a href="/{{version}}/documentation/streams/core-concepts">Concepts</a>
<div class="hero__diagram"> <a href="/{{version}}/documentation/streams/quickstart">Run Demo App</a>
<img src="/{{version}}/images/streams-welcome.png" /> <a href="/{{version}}/documentation/streams/tutorial">Tutorial: Write App</a>
</div> </div>
<div class="hero__cta"> </div>
<a href="/{{version}}/documentation/streams/tutorial" class="btn">Write your first app</a> </div>
<a href="/{{version}}/documentation/streams/quickstart" class="btn">Play with demo app</a> <h3 class="streams_intro">The easiest way to write mission-critical real-time applications and microservices</h3>
</div> <p class="streams__description">Kafka Streams is a client library for building applications and microservices, where the input and output data are stored in Kafka clusters. It combines the simplicity of writing and deploying standard Java and Scala applications on the client side with the benefits of Kafka's server-side cluster technology.</p>
</div> <div class="video__series__grid">
<div class="yt__video__block">
<ul class="feature-list"> <div class="yt__video__inner__block">
<li>Write standard Java applications</li> <iframe class="yt_series video_1 active" style="display:block" src="https://www.youtube.com/embed/Z3JKCLG3VP4?rel=0&showinfo=0&end=602" frameborder="0" allowfullscreen></iframe>
<li>Exactly-once processing semantics</li> <iframe class="yt_series video_2" src="https://www.youtube.com/embed/LxxeXI1mPKo?rel=0&showinfo=0&end=622" frameborder="0" allowfullscreen></iframe>
<li>No seperate processing cluster required</li> <iframe class="yt_series video_3" src="https://www.youtube.com/embed/7JYEEx7SBuE?rel=0&showinfo=0end=557" frameborder="0" allowfullscreen></iframe>
<li>Develop on Mac, Linux, Windows</li> <iframe class="yt_series video_4" src="https://www.youtube.com/embed/3kJgYIkAeHs?rel=0&showinfo=0&end=564" frameborder="0" allowfullscreen></iframe>
<li>Elastic, highly scalable, fault-tolerant</li> </div>
<li>Deploy to containers, VMs, bare metal, cloud</li> </div>
<li>Equally viable for small, medium, &amp; large use cases</li> <div class="video__block">
<li>Fully integrated with Kafka security</li> <h3>TOUR OF THE STREAMS API</h3>
</ul> <div class="video__list">
<p class="video__item video_list_1 active" onclick="$('.video__item').removeClass('active'); $(this).addClass('active');$('.yt_series').hide();$('.video_1').show();">
<div class="cards"> <span class="number">1</span><span class="video__text">Intro to Streams</span>
<a class="card" href="/{{version}}/documentation/streams/developer-guide"> </p>
<img class="card__icon" src="/{{version}}/images/icons/documentation.png" /> <p class="video__item video_list_2" onclick="$('.video__item').removeClass('active'); $(this).addClass('active');$('.yt_series').hide();$('.video_2').show();">
<img class="card__icon card__icon--hover" src="/{{version}}/images/icons/documentation--white.png" /> <span class="number">2</span><span class="video__text">Creating a Streams Application</span>
<span class="card__label">Developer manual</span> </p>
</a> <p class="video__item video_list_3" onclick="$('.video__item').removeClass('active'); $(this).addClass('active');$('.yt_series').hide();$('.video_3').show();">
<a class="card" href="/{{version}}/documentation/streams/tutorial"> <span class="number">3</span><span class="video__text">Transforming Data Pt. 1</span>
<img class="card__icon" src="/{{version}}/images/icons/tutorials.png" /> </p>
<img class="card__icon card__icon--hover" src="/{{version}}/images/icons/tutorials--white.png" /> <p class="video__item video_list_4" onclick="$('.video__item').removeClass('active'); $(this).addClass('active');$('.yt_series').hide();$('.video_4').show();">
<span class="card__label">Tutorials</span> <span class="number">4</span><span class="video__text">Transforming Data Pt. 11</span>
</a> </p>
<a class="card" href="/{{version}}/documentation/streams/core-concepts"> </div>
<img class="card__icon" src="/{{version}}/images/icons/architecture.png" /> </div>
<img class="card__icon card__icon--hover" src="/{{version}}/images/icons/architecture--white.png" /> </div>
<span class="card__label">Concepts</span> <hr class="separator">
</a> <div class="use-item-section">
</div> <div class="use__list__sec">
<h3>Why you'll love using Kafka Streams!</h3>
<h3>Hello Kafka Streams</h3> <ul class="use-feature-list">
<p>The code example below implements a WordCount application that is elastic, highly scalable, fault-tolerant, stateful, and ready to run in production at large scale</p> <li>Elastic, highly scalable, fault-tolerant</li>
<li>Deploy to containers, VMs, bare metal, cloud</li>
<div class="code-example"> <li>Equally viable for small, medium, &amp; large use cases</li>
<div class="btn-group"> <li>Fully integrated with Kafka security</li>
<a class="selected b-java-8" data-section="java-8">Java 8+</a> <li>Write standard Java applications</li>
<a class="b-java-7" data-section="java-7">Java 7</a> <li>Exactly-once processing semantics</li>
<a class="b-scala" data-section="scala">Scala</a> <li>No seperate processing cluster required</li>
</div> <li>Develop on Mac, Linux, Windows</li>
<div class="code-example__snippet b-java-8 selected"> </ul>
<pre class="brush: java;"> </div>
import org.apache.kafka.common.serialization.Serdes; <div class="first__app__cta">
import org.apache.kafka.streams.KafkaStreams; <a href="/{{version}}/documentation/streams/tutorial" class="first__app__btn">Write your first app</a>
import org.apache.kafka.streams.StreamsBuilder; </div>
import org.apache.kafka.streams.StreamsConfig; </div>
import org.apache.kafka.streams.kstream.KStream; <hr class="separator">
import org.apache.kafka.streams.kstream.KTable; <h3 class="stream__text">Streams API use cases</h3>
<div class="customers__grid">
import java.util.Arrays; <div class="customer__grid">
import java.util.Properties; <div class="customer__item streams_logo_grid streams__ny__grid">
<a href="https://www.nytimes.com" target="_blank" class="grid__logo__link">
public class WordCountApplication { <span class="grid__item__logo" style="background-image: url('/images/powered-by/NYT.jpg');"></span>
</a>
public static void main(final String[] args) throws Exception { <p class="grid__item__customer__description">
Properties config = new Properties(); <a href="https://www.confluent.io/blog/publishing-apache-kafka-new-york-times/">The New York Times uses Apache Kafka </a>and the Kafka Streams API to store and distribute, in real-time, published content to the various applications and systems that make it available to the readers.
config.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-application"); </p>
config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092"); </div>
config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass()); </div>
config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass()); <div class="customer__grid">
<div class="customer__item streams_logo_grid streams__line__grid">
KStreamBuilder builder = new KStreamBuilder(); <a href="https://linecorp.com/" target="_blank" class="grid__logo__link">
KStream&lt;String, String&gt; textLines = builder.stream("TextLinesTopic"); <span class="grid__item__logo" style="background-image: url('/images/powered-by/line.svg');width:9rem"></span>
KTable&lt;String, Long&gt; wordCounts = textLines </a>
.flatMapValues(textLine -> Arrays.asList(textLine.toLowerCase().split("\\W+"))) <p class="grid__item__customer__description">LINE uses Apache Kafka as a central datahub for our services to communicate to one another. Hundreds of billions of messages are produced daily and are used to execute various business logic, threat detection, search indexing and data analysis. LINE leverages Kafka Streams to reliably transform and filter topics enabling sub topics consumers can efficiently consume, meanwhile retaining easy maintainability thanks to its sophisticated yet minimal code base.</p>
.groupBy((key, word) -> word) </div>
.count("Counts"); </div>
wordCounts.to(Serdes.String(), Serdes.Long(), "WordsWithCountsTopic"); <div class="customer__grid">
<div class="customer__item streams_logo_grid streams__zalando__grid">
KafkaStreams streams = new KafkaStreams(builder.build(), config); <a href="http://www.zalando.com" target="_blank" class="grid__logo__link">
streams.start(); <span class="grid__item__logo" style="background-image: url('/images/powered-by/zalando.jpg');"></span>
} </a>
<p class="grid__item__customer__description">As the leading online fashion retailer in Europe, Zalando uses Kafka as an ESB (Enterprise Service Bus), which helps us in transitioning from a monolithic to a micro services architecture. Using Kafka for processing
} <a href="" 'https:="" kafka-summit.org="" sessions="" using-kstreams-ktables-calculate-real-time-domain-rankings="" '="" target="blank'"> event streams</a> enables our technical team to do near-real time business intelligence.
</pre> </p>
</div> </div>
</div>
<div class="code-example__snippet b-java-7"> <div class="customer__grid">
<pre class="brush: java;"> <div class="customer__item streams_logo_grid streams__rabobank__grid">
import org.apache.kafka.common.serialization.Serdes; <a href="https://www.rabobank.com" target="_blank" class="grid__logo__link">
import org.apache.kafka.streams.KafkaStreams; <span class="grid__item__logo" style="background-image: url('/images/powered-by/rabobank.jpg');"></span>
import org.apache.kafka.streams.StreamsBuilder; </a>
import org.apache.kafka.streams.StreamsConfig; <p class="grid__item__customer__description">Rabobank is one of the 3 largest banks in the Netherlands. Its digital nervous system, the Business Event Bus, is powered by Apache Kafka. It is used by an increasing amount of financial processes and services, one of which is Rabo Alerts. This service alerts customers in real-time upon financial events and is built using Kafka Streams.</p>
import org.apache.kafka.streams.kstream.KStream; </div>
import org.apache.kafka.streams.kstream.KTable; </div>
import org.apache.kafka.streams.kstream.KeyValueMapper; </div>
import org.apache.kafka.streams.kstream.ValueMapper; <h3 style="margin-top: 5.3rem;">Hello Kafka Streams</h3>
<p>The code example below implements a WordCount application that is elastic, highly scalable, fault-tolerant, stateful, and ready to run in production at large scale</p>
import java.util.Arrays;
import java.util.Properties; <div class="code-example">
<div class="btn-group">
public class WordCountApplication { <a class="selected b-java-8" data-section="java-8">Java 8+</a>
<a class="b-java-7" data-section="java-7">Java 7</a>
public static void main(final String[] args) throws Exception { <a class="b-scala" data-section="scala">Scala</a>
Properties config = new Properties(); </div>
config.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-application");
config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092"); <div class="code-example__snippet b-java-8 selected">
config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass()); <pre class="brush: java;">
config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass()); import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.KafkaStreams;
KStreamBuilder builder = new KStreamBuilder(); import org.apache.kafka.streams.StreamsConfig;
KStream&lt;String, String&gt; textLines = builder.stream("TextLinesTopic"); import org.apache.kafka.streams.kstream.KStream;
KTable&lt;String, Long&gt; wordCounts = textLines import org.apache.kafka.streams.kstream.KStreamBuilder;
.flatMapValues(new ValueMapper&lt;String, Iterable&lt;String&gt;&gt;() { import org.apache.kafka.streams.kstream.KTable;
@Override
public Iterable&lt;String&gt; apply(String textLine) { import java.util.Arrays;
return Arrays.asList(textLine.toLowerCase().split("\\W+")); import java.util.Properties;
}
}) public class WordCountApplication {
.groupBy(new KeyValueMapper&lt;String, String, String&gt;() {
@Override public static void main(final String[] args) throws Exception {
public String apply(String key, String word) { Properties config = new Properties();
return word; config.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-application");
} config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092");
}) config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());
.count("Counts"); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass());
wordCounts.to(Serdes.String(), Serdes.Long(), "WordsWithCountsTopic");
KStreamBuilder builder = new KStreamBuilder();
KafkaStreams streams = new KafkaStreams(builder, config); KStream&lt;String, String&gt; textLines = builder.stream("TextLinesTopic");
streams.start(); KTable&lt;String, Long&gt; wordCounts = textLines
} .flatMapValues(textLine -> Arrays.asList(textLine.toLowerCase().split("\\W+")))
.groupBy((key, word) -> word)
} .count("Counts");
</pre> wordCounts.to(Serdes.String(), Serdes.Long(), "WordsWithCountsTopic");
</div>
KafkaStreams streams = new KafkaStreams(builder, config);
<div class="code-example__snippet b-scala"> streams.start();
<pre class="brush: scala;"> }
import java.lang.Long
import java.util.Properties }
import java.util.concurrent.TimeUnit </pre>
</div>
import org.apache.kafka.common.serialization._
import org.apache.kafka.streams._ <div class="code-example__snippet b-java-7">
import org.apache.kafka.streams.kstream.{KStream, KStreamBuilder, KTable} <pre class="brush: java;">
import org.apache.kafka.common.serialization.Serdes;
import scala.collection.JavaConverters.asJavaIterableConverter import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StreamsConfig;
object WordCountApplication { import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KStreamBuilder;
def main(args: Array[String]) { import org.apache.kafka.streams.kstream.KTable;
val config: Properties = { import org.apache.kafka.streams.kstream.KeyValueMapper;
val p = new Properties() import org.apache.kafka.streams.kstream.ValueMapper;
p.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-application")
p.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092") import java.util.Arrays;
p.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass) import java.util.Properties;
p.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass)
p public class WordCountApplication {
}
public static void main(final String[] args) throws Exception {
val builder: KStreamBuilder = new KStreamBuilder() Properties config = new Properties();
val textLines: KStream[String, String] = builder.stream("TextLinesTopic") config.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-application");
val wordCounts: KTable[String, Long] = textLines config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092");
.flatMapValues(textLine => textLine.toLowerCase.split("\\W+").toIterable.asJava) config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());
.groupBy((_, word) => word) config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass());
.count("Counts")
wordCounts.to(Serdes.String(), Serdes.Long(), "WordsWithCountsTopic") KStreamBuilder builder = new KStreamBuilder();
KStream&lt;String, String&gt; textLines = builder.stream("TextLinesTopic");
val streams: KafkaStreams = new KafkaStreams(builder, config) KTable&lt;String, Long&gt; wordCounts = textLines
streams.start() .flatMapValues(new ValueMapper&lt;String, Iterable&lt;String&gt;&gt;() {
@Override
Runtime.getRuntime.addShutdownHook(new Thread(() => { public Iterable&lt;String&gt; apply(String textLine) {
streams.close(10, TimeUnit.SECONDS) return Arrays.asList(textLine.toLowerCase().split("\\W+"));
})) }
} })
.groupBy(new KeyValueMapper&lt;String, String, String&gt;() {
} @Override
</pre> public String apply(String key, String word) {
</div> return word;
</div> }
<h3 class="customer-title">See how Kafka Streams is being used</h3> })
<div class="customer__cards"> .count("Counts");
<div class="customer__card"> wordCounts.to(Serdes.String(), Serdes.Long(), "WordsWithCountsTopic");
<div class="customer__card__icon">
<img src="/{{version}}/images/icons/NYT.jpg" style="max-width:35%"> KafkaStreams streams = new KafkaStreams(builder, config);
</div> streams.start();
<span class="customer__card__label">The New York Times uses Apache Kafka and the Kafka Streams API to store and distribute, in real-time, published content to the various applications and systems that make it available to the readers.</span> }
<a href="https://www.confluent.io/blog/publishing-apache-kafka-new-york-times/">Learn More</a>
}
</div> </pre>
<div class="customer__card customer-right" > </div>
<div class="customer__card__icon">
<img style="max-width:60%" src="../../images/powered-by/rabobank.jpg"> <div class="code-example__snippet b-scala">
</div> <pre class="brush: scala;">
<span class="customer__card__label">Rabobank is one of the 3 largest banks in the Netherlands. Its digital nervous system, the Business Event Bus, is powered by Apache Kafka. It is used by an increasing amount of financial processes and services, one which is Rabo Alerts. This service alerts customers in real-time upon financial events and is built using Kafka Streams. import java.lang.Long
</span> import java.util.Properties
<a href="https://www.confluent.io/blog/real-time-financial-alerts-rabobank-apache-kafkas-streams-api/">Learn More</a> import java.util.concurrent.TimeUnit
</div>
</div> import org.apache.kafka.common.serialization._
<div class="customer_cards_2"> import org.apache.kafka.streams._
<div class="customer__card customer_z"> import org.apache.kafka.streams.kstream.{KStream, KStreamBuilder, KTable}
<div class="customer__card__icon" >
<img style="max-width:60%" src="../../images/powered-by/zalando.jpg"> import scala.collection.JavaConverters.asJavaIterableConverter
</div>
<span class="customer__card__label">As the leading online fashion retailer in Europe, Zalando uses Apache Kafka as an ESB (Enterprise Service Bus), which helps us in transitioning from a monolithic to a micro services architecture. Using Kafka for processing event streams enables our technical team to do near-real time business intelligence.</span> object WordCountApplication {
<a href="https://kafka-summit.org/sessions/using-kstreams-ktables-calculate-real-time-domain-rankings/">Learn More</a>
</div> def main(args: Array[String]) {
<div class="customer__card"> val config: Properties = {
<div class="customer__card__icon green_card"> val p = new Properties()
<img src="/{{version}}/images/icons/line.png"> p.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-application")
</div> p.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092")
<span class="customer__card__label">LINE uses Apache Kafka as a central datahub for our services to communicate to one another. Hundreds of billions of messages are produced daily and are used to execute various business logic, threat detection, search indexing and data analysis. LINE leverages Kafka Streams to reliably transform and filter topics enabling sub topics consumers can efficiently consume, meanwhile retaining easy maintainability thanks to its sophisticated yet minimal code base.</span> p.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass)
<a href="https://engineering.linecorp.com/en/blog/detail/80">Learn More</a> p.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass)
</div> p
}
</div>
val builder: KStreamBuilder = new KStreamBuilder()
<div class="pagination"> val textLines: KStream[String, String] = builder.stream("TextLinesTopic")
<a href="#" class="pagination__btn pagination__btn__prev pagination__btn--disabled">Previous</a> val wordCounts: KTable[String, Long] = textLines
<a href="/{{version}}/documentation/streams/quickstart" class="pagination__btn pagination__btn__next">Next</a> .flatMapValues(textLine => textLine.toLowerCase.split("\\W+").toIterable.asJava)
</div> .groupBy((_, word) => word)
.count("Counts")
wordCounts.to(Serdes.String(), Serdes.Long(), "WordsWithCountsTopic")
val streams: KafkaStreams = new KafkaStreams(builder, config)
streams.start()
Runtime.getRuntime.addShutdownHook(new Thread(() => {
streams.close(10, TimeUnit.SECONDS)
}))
}
}
</pre>
</div>
</div>
<div class="pagination">
<a href="#" class="pagination__btn pagination__btn__prev pagination__btn--disabled">Previous</a>
<a href="/{{version}}/documentation/streams/quickstart" class="pagination__btn pagination__btn__next">Next</a>
</div>
</script> </script>
<!--#include virtual="../../includes/_header.htm" --> <!--#include virtual="../../includes/_header.htm" -->
<!--#include virtual="../../includes/_top.htm" --> <!--#include virtual="../../includes/_top.htm" -->
<div class="content documentation documentation--current"> <div class="content documentation documentation--current">
<!--#include virtual="../../includes/_nav.htm" --> <!--#include virtual="../../includes/_nav.htm" -->
<div class="right"> <div class="right">
<!--#include virtual="../../includes/_docs_banner.htm" --> <!--#include virtual="../../includes/_docs_banner.htm" -->
<ul class="breadcrumbs"> <ul class="breadcrumbs">
<li><a href="/documentation">Documentation</a></li> <li><a href="/documentation">Documentation</a>
</ul> </li>
<div class="p-streams"></div> </ul>
</div> <div class="p-streams"></div>
</div>
</div> </div>
<!--#include virtual="../../includes/_footer.htm" --> <!--#include virtual="../../includes/_footer.htm" -->
<script> <script>
$(function() { $(function() {
// Show selected style on nav item
$('.b-nav__streams').addClass('selected'); // Show selected style on nav item
$('.b-nav__streams').addClass('selected');
$('.video_list_1').click(function(){
$('.video_2').attr('src', $('.video_2').attr('src'));
$('.video_3').attr('src', $('.video_3').attr('src'));
$('.video_4').attr('src', $('.video_4').attr('src'));
// Display docs subnav items });
$('.b-nav__docs').parent().toggleClass('nav__item__with__subs--expanded');
// Show selected code example $('.video_list_2').click(function(){
$('.btn-group a').click(function(){ $('.video_1').attr('src', $('.video_1').attr('src'));
var targetClass = '.b-' + $(this).data().section; $('.video_3').attr('src', $('.video_3').attr('src'));
$('.code-example__snippet, .btn-group a').removeClass('selected'); $('.video_4').attr('src', $('.video_4').attr('src'));
$(targetClass).addClass('selected');
}); });
});
</script> $('.video_list_3').click(function(){
$('.video_1').attr('src', $('.video_1').attr('src'));
$('.video_2').attr('src', $('.video_2').attr('src'));
$('.video_4').attr('src', $('.video_4').attr('src'));
});
$('.video_list_4').click(function(){
$('.video_1').attr('src', $('.video_1').attr('src'));
$('.video_2').attr('src', $('.video_2').attr('src'));
$('.video_3').attr('src', $('.video_3').attr('src'));
});
//sticky secondary nav
var $navbar = $(".sub-nav-sticky"),
y_pos = $navbar.offset().top,
height = $navbar.height();
$(window).scroll(function() {
var scrollTop = $(window).scrollTop();
if (scrollTop > y_pos - height) {
$navbar.addClass("navbar-fixed")
} else if (scrollTop <= y_pos) {
$navbar.removeClass("navbar-fixed")
}
});
// Display docs subnav items
$('.b-nav__docs').parent().toggleClass('nav__item__with__subs--expanded');
// Show selected code example
$('.btn-group a').click(function(){
var targetClass = '.b-' + $(this).data().section;
$('.code-example__snippet, .btn-group a').removeClass('selected');
$(targetClass).addClass('selected');
});
});
</script>