diff options
author | Matei Alexandru Zaharia <matei@apache.org> | 2014-01-22 20:33:24 +0000 |
---|---|---|
committer | Matei Alexandru Zaharia <matei@apache.org> | 2014-01-22 20:33:24 +0000 |
commit | 673dcddb721241a6d7eef2d773a170a1e1a38202 (patch) | |
tree | 95e99582a87f471bea589487965b639323a0e05d /js/lang-tabs.js | |
parent | e42e6e2bef38ca1d6fb92c27a7556f30be940574 (diff) | |
download | spark-website-673dcddb721241a6d7eef2d773a170a1e1a38202.tar.gz spark-website-673dcddb721241a6d7eef2d773a170a1e1a38202.tar.bz2 spark-website-673dcddb721241a6d7eef2d773a170a1e1a38202.zip |
Update site look and add pages for Streaming and MLlib
This monster commit does a variety of things:
- Update the site look and feel to be cleaner
- Add top-level points to front page
- Add a listing of related projects, and pages for those included in Spark
- Reorganize docs and community pages
- Make sure the site scales properly on mobile devices
- Add tabs to let users view the examples in any programming language
It's just a start, but should be a step towards a better web presence.
Diffstat (limited to 'js/lang-tabs.js')
-rw-r--r-- | js/lang-tabs.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/lang-tabs.js b/js/lang-tabs.js new file mode 100644 index 000000000..bf9efe068 --- /dev/null +++ b/js/lang-tabs.js @@ -0,0 +1,22 @@ +// Switch all Spark code examples on the page to a particular language when a +// tab for that language is clicked. + +function changeLanguage(lang) { + return function(e) { + e.preventDefault(); + var scrollOffset = $(this).offset().top - $(document).scrollTop(); + $(".tab-pane").removeClass("active"); + $(".tab-pane-" + lang).addClass("active"); + $(".lang-tab").removeClass("active"); + $(".lang-tab-" + lang).addClass("active"); + $(document).scrollTop($(this).offset().top - scrollOffset); + } +} + +$(function() { + var languages = ["scala", "java", "python"]; + for (var i = 0; i < languages.length; i++) { + var lang = languages[i]; + $(".lang-tab-" + lang).click(changeLanguage(lang)); + } +}); |