Fix #128
This commit is contained in:
parent
c4ce4b6f7f
commit
bb58dad40c
13
conf/wide.go
13
conf/wide.go
|
@ -13,7 +13,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/b3log/wide/event"
|
||||
_ "github.com/b3log/wide/i18n"
|
||||
"github.com/b3log/wide/util"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
@ -42,12 +41,15 @@ type User struct {
|
|||
Workspace string // the GOPATH of this user
|
||||
Locale string
|
||||
GoFormat string
|
||||
Editor editor
|
||||
FontFamily string
|
||||
FontSize string
|
||||
Editor *Editor
|
||||
LatestSessionContent *LatestSessionContent
|
||||
}
|
||||
|
||||
// Editor configuration of a user.
|
||||
type editor struct {
|
||||
type Editor struct {
|
||||
FontFamily string
|
||||
FontSize string
|
||||
}
|
||||
|
||||
|
@ -309,12 +311,9 @@ func UpdateCustomizedConf(username string) {
|
|||
return
|
||||
}
|
||||
|
||||
editor := u.Editor
|
||||
|
||||
model := map[string]interface{}{"font_family": "Helvetica, 'Microsoft Yahei'", "font_size": editor.FontSize}
|
||||
model := map[string]interface{}{"user": u}
|
||||
|
||||
t, err := template.ParseFiles("static/user/style.css.tmpl")
|
||||
|
||||
if nil != err {
|
||||
glog.Error(err)
|
||||
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
"Workspace": "{pwd}/data/user_workspaces/admin",
|
||||
"Locale": "en_US",
|
||||
"GoFormat": "gofmt",
|
||||
"FontFamily": "Helvetica",
|
||||
"FontSize": "inherit",
|
||||
"Editor": {
|
||||
"FontSize": "9"
|
||||
"FontFamily": "Consolas, 'Courier New', monospace",
|
||||
"FontSize": "inherit"
|
||||
},
|
||||
"LatestSessionContent": {
|
||||
"FileTree": [],
|
||||
|
|
2
main.go
2
main.go
|
@ -28,6 +28,8 @@ func init() {
|
|||
flag.Set("v", "3")
|
||||
flag.Parse()
|
||||
|
||||
i18n.Load()
|
||||
|
||||
event.Load()
|
||||
|
||||
conf.Load()
|
||||
|
|
|
@ -156,7 +156,7 @@ func addUser(username, password string) string {
|
|||
workspace := filepath.Join(dir, username)
|
||||
|
||||
newUser := &conf.User{Name: username, Password: password, Workspace: workspace,
|
||||
Locale: conf.Wide.Locale, GoFormat: "gofmt"}
|
||||
Locale: conf.Wide.Locale, GoFormat: "gofmt", Editor: &conf.Editor{FontSize: "10px"}}
|
||||
conf.Wide.Users = append(conf.Wide.Users, newUser)
|
||||
|
||||
if !conf.Save() {
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
body {
|
||||
font-family: Helvetica, 'MS Gothic';
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
font-family: Helvetica, 'MS Gothic';
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
body {
|
||||
font-family: Helvetica, 'Microsoft Yahei';
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
font-family: Helvetica, 'Microsoft Yahei';
|
||||
}
|
|
@ -222,7 +222,6 @@
|
|||
|
||||
background: white;
|
||||
font-size: 90%;
|
||||
font-family: Consolas, Courier New, monospace;
|
||||
|
||||
max-height: 20em;
|
||||
overflow-y: auto;
|
||||
|
@ -230,7 +229,6 @@
|
|||
|
||||
.CodeMirror,
|
||||
.CodeMirror-hints {
|
||||
font-family: Consolas, Courier New, monospace;
|
||||
}
|
||||
|
||||
.CodeMirror-focused .cm-matchhighlight {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
body {
|
||||
font-family: Helvetica, 'Microsoft Yahei';
|
||||
}
|
||||
|
||||
body,
|
||||
input,
|
||||
button {
|
||||
font-family: Helvetica, 'Microsoft Yahei';
|
||||
font-family: Helvetica;
|
||||
}
|
||||
|
||||
.edit-exprinfo, .CodeMirror, .CodeMirror-hints {
|
||||
font-size: ;
|
||||
.edit-exprinfo,
|
||||
.CodeMirror,
|
||||
.CodeMirror-hints {
|
||||
font-family: Consolas, 'Courier New', monospace;
|
||||
font-size: inherit;
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
body {
|
||||
font-family: {{.font_family}};
|
||||
}
|
||||
|
||||
body,
|
||||
input,
|
||||
button {
|
||||
font-family: {{.font_family}};
|
||||
font-family: {{.user.FontFamily}};
|
||||
}
|
||||
|
||||
.edit-exprinfo, .CodeMirror, .CodeMirror-hints {
|
||||
font-size: {{.font_size}};
|
||||
.edit-exprinfo,
|
||||
.CodeMirror,
|
||||
.CodeMirror-hints {
|
||||
font-family: {{.user.Editor.FontFamily}};
|
||||
font-size: {{.user.Editor.FontSize}};
|
||||
}
|
|
@ -14,12 +14,13 @@
|
|||
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/dialog.css?{{.conf.StaticResourceVersion}}">
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/base.css?{{.conf.StaticResourceVersion}}">
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/base-{{.conf.Locale}}.css?{{.conf.StaticResourceVersion}}">
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/wide.css?{{.conf.StaticResourceVersion}}">
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/side.css?{{.conf.StaticResourceVersion}}">
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/start.css?{{.conf.StaticResourceVersion}}">
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/about.css?{{.conf.StaticResourceVersion}}">
|
||||
|
||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/user/{{.session.Username}}/style.css?{{.conf.StaticResourceVersion}}">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue