This commit is contained in:
Liang Ding 2015-02-15 15:15:14 +08:00
parent 2565035b54
commit 9591345bfc
3 changed files with 77 additions and 2 deletions

View File

@ -75,9 +75,15 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
code = string(bytes)
}
embed := false
embedArg, ok := r.URL.Query()["embed"]
if ok && "true" == embedArg[0] {
embed = true
}
model := map[string]interface{}{"conf": conf.Wide, "i18n": i18n.GetAll(locale), "locale": locale,
"session": wideSession, "pathSeparator": conf.PathSeparator, "codeMirrorVer": conf.CodeMirrorVer,
"code": template.HTML(code), "ver": conf.WideVersion, "year": time.Now().Year()}
"code": template.HTML(code), "ver": conf.WideVersion, "year": time.Now().Year(), "embed": embed}
wideSessions := session.WideSessions.GetByUsername(username)

View File

@ -0,0 +1,69 @@
/*
* Copyright (c) 2014-2015, b3log.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.font-ico {
font-size: 26px;
}
.header {
margin: 0;
padding: 10px;
}
.header .gravatar {
width: 26px;
border-radius: 13px;
}
.header > .fn-right {
margin-top: 10px;
}
.header .logo {
height: 36px;
margin-top: -4px;
}
.share-panel {
position: absolute;
z-index: 20;
width: 258px;
padding: 10px 10px;
right: 0px;
line-height: normal;
top: 57px;
}
.share-panel .font-ico {
transition: all .2s ease-out 0s;
margin: 0 5px;
width: 24px;
}
.share-panel .font-ico:hover {
transform:rotate(360deg);
}
#editorDiv {
width: 60%;
float: left;
}
#output {
width: 40%;
float: right;
border-width: 0;
border-left: 1px solid #919191;
}

View File

@ -14,7 +14,7 @@
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/about.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/sign.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/side.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/playground.css?{{.conf.StaticResourceVersion}}">
{{if .embed}}<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/playground-embed.css?{{.conf.StaticResourceVersion}}">{{else}}<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/playground.css?{{.conf.StaticResourceVersion}}">{{end}}
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/themes/default.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/js/lib/codemirror-{{.codeMirrorVer}}/codemirror.css?{{.conf.StaticResourceVersion}}">