diff options
Diffstat (limited to 'doc/root.html')
-rw-r--r-- | doc/root.html | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/doc/root.html b/doc/root.html index 81792671b..48280ac35 100644 --- a/doc/root.html +++ b/doc/root.html @@ -5,7 +5,7 @@ <div class="left"> <div id="learn"> -<img class="icon share" src="/doc/share.png" alt="View full screen" title="View full screen"> +<a class="popout share">Pop-out</a> <div class="rootHeading">Try Go</div> <div class="input"> <textarea spellcheck="false" class="code">// You can edit this code! @@ -31,6 +31,7 @@ Hello, 世界 <div class="toys"> <select> <option value="hello.go">Hello, World!</option> + <option value="life.go">Conway's Game of Life</option> <option value="fib.go">Fibonacci Closure</option> <option value="peano.go">Peano Integers</option> <option value="pi.go">Concurrent pi</option> @@ -46,7 +47,7 @@ Hello, 世界 <div class="right"> <div id="about"> -Go is an open source programming environment that makes it easy to build +Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. </div> @@ -68,7 +69,7 @@ Linux, Mac OS X, Windows, and more. <div id="video"> <div class="rootHeading">Featured video</div> -<iframe width="415" height="241" src="http://www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe> +<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe> </div> </div> @@ -115,21 +116,35 @@ function feedLoaded(result) { } } -$(function() { - // Set up playground. - playground({ - "codeEl": "#learn .code", - "outputEl": "#learn .output", - "runEl": "#learn .run", - "shareEl": "#learn .share", - "shareRedirect": "http://play.golang.org/p/", - "toysEl": "#learn .toys select" - }); +window.initFuncs.push(function() { + // Set up playground if enabled. + if (window.playground) { + window.playground({ + "codeEl": "#learn .code", + "outputEl": "#learn .output", + "runEl": "#learn .run", + "shareEl": "#learn .share", + "shareRedirect": "http://play.golang.org/p/", + "toysEl": "#learn .toys select" + }); + } else { + $('#learn').hide() + } // Load blog feed. $('<script/>').attr('text', 'text/javascript') .attr('src', 'http://blog.golang.org/.json?jsonp=feedLoaded') .appendTo('body'); + + // Set the video at random. + var videos = [ + {h: 241, s: "//www.youtube.com/embed/ytEkHepK08c"}, // Tour of Go + {h: 241, s: "//www.youtube.com/embed/f6kdp27TYZs"}, // Concurrency Patterns + {h: 233, s: "//player.vimeo.com/video/53221560"}, // Grows with grace + {h: 233, s: "//player.vimeo.com/video/69237265"} // Simple environment + ]; + var v = videos[Math.floor(Math.random()*videos.length)]; + $('#video iframe').attr('height', v.h).attr('src', v.s); }); </script> |