diff options
| author | Andrew Gerrand <adg@golang.org> | 2013-08-22 11:12:44 +1000 |
|---|---|---|
| committer | Andrew Gerrand <adg@golang.org> | 2013-08-22 11:12:44 +1000 |
| commit | a48702eb390325300ecc6222005e5a040d90d58f (patch) | |
| tree | 6d86fa0ac889ae7c46cd77946e08c9f5cc371f01 /doc/root.html | |
| parent | 4a7a72b8c1146cd84a869f61a77331a6de89b962 (diff) | |
| download | go-a48702eb390325300ecc6222005e5a040d90d58f.tar.xz | |
doc: hide playground on front page if playground disabled
Fixes #5630.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12884046
Diffstat (limited to 'doc/root.html')
| -rw-r--r-- | doc/root.html | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/doc/root.html b/doc/root.html index e952a76bb3..8e69eea998 100644 --- a/doc/root.html +++ b/doc/root.html @@ -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') |
