]> Cypherpunks repositories - gostls13.git/commitdiff
doc: hide playground on front page if playground disabled
authorAndrew Gerrand <adg@golang.org>
Thu, 22 Aug 2013 01:12:44 +0000 (11:12 +1000)
committerAndrew Gerrand <adg@golang.org>
Thu, 22 Aug 2013 01:12:44 +0000 (11:12 +1000)
Fixes #5630.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12884046

doc/root.html

index e952a76bb3dca7275e7a3ad2d99c0724de304533..8e69eea998b1996dd10db5eea0f334d6f52514e1 100644 (file)
@@ -117,15 +117,19 @@ function feedLoaded(result) {
 }
 
 window.initFuncs.push(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"
-       });
+       // 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')