diff --git a/static/js/playground.js b/static/js/playground.js index 6447d1d..405eb89 100644 --- a/static/js/playground.js +++ b/static/js/playground.js @@ -332,6 +332,21 @@ var playground = { } }); }, + disqus: function () { + var url = window.location.href; + if (url.indexOf("?") >= 0) { + if (url.indexOf("disqus=") >= 0) { + url = url.replace("disqus=false", "disqus=true"); + console.log(url); + } else { + url += "&disqus=true"; + } + } else { + url += "?disqus=true"; + } + + window.location.href = url; + }, stop: function () { if (!playground.editor) { return; diff --git a/views/playground/index.html b/views/playground/index.html index 49aa607..0a36da3 100644 --- a/views/playground/index.html +++ b/views/playground/index.html @@ -15,7 +15,7 @@ - {{if .embed}}{{else}}{{end}} + @@ -40,6 +40,9 @@
  • +
  • + +
  • @@ -75,9 +78,7 @@ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); - })(); - - + })(); {{end}}