From ed1fd23759f88b5ae196a96a4a5b768e77d226e6 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 13 Feb 2015 12:57:12 +0800 Subject: [PATCH] #212 --- playground/playgrounds.go | 2 +- static/js/playground.js | 4 ++++ views/playground/index.html | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/playground/playgrounds.go b/playground/playgrounds.go index 16368d7..c150ed0 100644 --- a/playground/playgrounds.go +++ b/playground/playgrounds.go @@ -43,9 +43,9 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) { // create a HTTP session httpSession, _ := session.HTTPSession.Get(r, "wide-session") - httpSession.Values["username"] = username if httpSession.IsNew { httpSession.Values["id"] = strconv.Itoa(rand.Int()) + httpSession.Values["username"] = username } httpSession.Options.MaxAge = conf.Wide.HTTPSessionMaxAge diff --git a/static/js/playground.js b/static/js/playground.js index 0d4c960..ed6f810 100644 --- a/static/js/playground.js +++ b/static/js/playground.js @@ -35,6 +35,10 @@ var playground = { foldGutter: true, cursorHeight: 1, }); + + playground.editor.on('changes', function (cm) { + $("#url").html(""); + }); this._initWS(); }, diff --git a/views/playground/index.html b/views/playground/index.html index 6ac66cd..bf0b64b 100644 --- a/views/playground/index.html +++ b/views/playground/index.html @@ -48,7 +48,6 @@ -