diff --git a/conf/wide.go b/conf/wide.go
index 420f10d..d56d76c 100644
--- a/conf/wide.go
+++ b/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,13 +41,16 @@ 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 {
- FontSize string
+type Editor struct {
+ FontFamily string
+ FontSize string
}
// Configuration.
@@ -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)
diff --git a/conf/wide.json b/conf/wide.json
index ba27c0c..d3068a2 100644
--- a/conf/wide.json
+++ b/conf/wide.json
@@ -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": [],
diff --git a/main.go b/main.go
index 747255d..1557f73 100644
--- a/main.go
+++ b/main.go
@@ -28,6 +28,8 @@ func init() {
flag.Set("v", "3")
flag.Parse()
+ i18n.Load()
+
event.Load()
conf.Load()
diff --git a/session/users.go b/session/users.go
index 2bd8a14..c8f3188 100644
--- a/session/users.go
+++ b/session/users.go
@@ -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() {
diff --git a/static/css/base-en_US.css b/static/css/base-en_US.css
deleted file mode 100644
index e69de29..0000000
diff --git a/static/css/base-ja_JP.css b/static/css/base-ja_JP.css
deleted file mode 100644
index 1ec0f2b..0000000
--- a/static/css/base-ja_JP.css
+++ /dev/null
@@ -1,8 +0,0 @@
-body {
- font-family: Helvetica, 'MS Gothic';
-}
-
-input,
-button {
- font-family: Helvetica, 'MS Gothic';
-}
diff --git a/static/css/base-zh_CN.css b/static/css/base-zh_CN.css
deleted file mode 100644
index 9bfc42a..0000000
--- a/static/css/base-zh_CN.css
+++ /dev/null
@@ -1,8 +0,0 @@
-body {
- font-family: Helvetica, 'Microsoft Yahei';
-}
-
-input,
-button {
- font-family: Helvetica, 'Microsoft Yahei';
-}
diff --git a/static/css/wide.css b/static/css/wide.css
index f292708..5b498a6 100644
--- a/static/css/wide.css
+++ b/static/css/wide.css
@@ -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 {
diff --git a/static/user/admin/style.css b/static/user/admin/style.css
index ad31a3a..1617aab 100644
--- a/static/user/admin/style.css
+++ b/static/user/admin/style.css
@@ -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;
}
\ No newline at end of file
diff --git a/static/user/style.css.tmpl b/static/user/style.css.tmpl
index 3ecb22b..1e74c53 100644
--- a/static/user/style.css.tmpl
+++ b/static/user/style.css.tmpl
@@ -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}};
}
\ No newline at end of file
diff --git a/views/index.html b/views/index.html
index 9a3c43d..5254633 100644
--- a/views/index.html
+++ b/views/index.html
@@ -14,12 +14,13 @@
-
+
+