This commit is contained in:
Liang Ding 2015-02-13 12:57:12 +08:00
parent 6e1ae805e9
commit ed1fd23759
3 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -36,6 +36,10 @@ var playground = {
cursorHeight: 1,
});
playground.editor.on('changes', function (cm) {
$("#url").html("");
});
this._initWS();
},
_initWS: function () {

View File

@ -48,7 +48,6 @@
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/reconnecting-websocket.js"></script>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/ztree/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/codemirror-{{.codeMirrorVer}}/codemirror.js"></script>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/codemirror-{{.codeMirrorVer}}/addon/selection/active-line.js"></script>