From: Andrew Gerrand Date: Thu, 22 Aug 2013 01:12:44 +0000 (+1000) Subject: doc: hide playground on front page if playground disabled X-Git-Tag: go1.2rc2~458 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a48702eb390325300ecc6222005e5a040d90d58f;p=gostls13.git doc: hide playground on front page if playground disabled Fixes #5630. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12884046 --- 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. $('