From a48702eb390325300ecc6222005e5a040d90d58f Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 22 Aug 2013 11:12:44 +1000 Subject: [PATCH] doc: hide playground on front page if playground disabled Fixes #5630. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12884046 --- doc/root.html | 22 +++++++++++++--------- 1 file 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. $('