From 8e05e433de111b2ef5ceac4516c3a4f34985662d Mon Sep 17 00:00:00 2001
From: life <lifephp@gmail.com>
Date: Tue, 24 Jun 2014 21:14:17 +0800
Subject: [PATCH] blog

---
 app/controllers/BlogController.go             | 2 ++
 app/views/Blog/set.html                       | 2 +-
 messages/msg.en                               | 1 +
 messages/msg.zh                               | 1 +
 public/tinymce/plugins/leanote_code/plugin.js | 4 ++--
 5 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/controllers/BlogController.go b/app/controllers/BlogController.go
index e14c89b..163b4e9 100644
--- a/app/controllers/BlogController.go
+++ b/app/controllers/BlogController.go
@@ -173,6 +173,8 @@ func (c Blog) Set() revel.Result {
 	
 	c.getRecentBlogs(userId)
 	
+	c.SetLocale();
+	
 	return c.RenderTemplate("blog/set.html")
 }
 
diff --git a/app/views/Blog/set.html b/app/views/Blog/set.html
index 64a70e7..9f3308f 100644
--- a/app/views/Blog/set.html
+++ b/app/views/Blog/set.html
@@ -168,7 +168,7 @@ $(function() {
 		selector : "#AboutMe",
 		content_css : [ "/css/bootstrap.css", "/css/editor/editor.css" ],
 		skin : "custom",
-		language : "zh",
+		language : "{{.locale}}",
 		height : 300,
 		width : "100%",
 		skin : "custom",
diff --git a/messages/msg.en b/messages/msg.en
index e3630bd..0e7ca99 100644
--- a/messages/msg.en
+++ b/messages/msg.en
@@ -76,6 +76,7 @@ myNotebook=My notebook
 addNotebook=Add notebook
 all=Newest
 trash=Trash
+delete=Delete
 unTitled=UnTitled
 defaultShare=Default sharing
 leftHidden=Hidden slide bar
diff --git a/messages/msg.zh b/messages/msg.zh
index 0898182..fc0ebfb 100644
--- a/messages/msg.zh
+++ b/messages/msg.zh
@@ -77,6 +77,7 @@ myNotebook=我的笔记本
 addNotebook=添加笔记本
 all=最新
 trash=废纸篓
+delete=删除
 unTitled=无标题
 defaultShare=默认共享
 leftHidden=隐藏左侧
diff --git a/public/tinymce/plugins/leanote_code/plugin.js b/public/tinymce/plugins/leanote_code/plugin.js
index 18903c8..5cd3703 100644
--- a/public/tinymce/plugins/leanote_code/plugin.js
+++ b/public/tinymce/plugins/leanote_code/plugin.js
@@ -28,9 +28,9 @@ tinymce.PluginManager.add('leanote_code', function(editor, url) {
 			}
 			if(!text) {
 				text = $(node).text();
-				$(node).replaceWith('<pre class="brush:' + value + '"> '+ text + "</pre>");
+				$(node).replaceWith('<pre class="brush:' + value + '">'+ text + "</pre>");
 			} else {
-				ed.insertContent('<pre class="brush:' + value + '"> ' + text + "</pre>");
+				ed.insertContent('<pre class="brush:' + value + '">' + text + "</pre>");
 			}
 		}
 		ed.selection.moveToBookmark(everBookmark);