From 011e2212ed5838ea85571fda9cd6de21bb7649ce Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 7 Jul 2017 15:38:27 +0800 Subject: [PATCH] feat(forums): add bootstrap-markdown editor into post new topic page --- modules/core/client/app/trans-string-en.js | 4 +++- modules/core/client/app/trans-string-zh.js | 4 +++- .../controllers/forums-post.client.controller.js | 7 +++++++ modules/forums/client/less/forum.less | 15 +++++++++++++++ modules/forums/client/views/post.client.view.html | 12 +++++++++++- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 486fb611..65241d87 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -658,7 +658,9 @@ TOPICS: 'Topics', REPLIES: 'Replies', VIEWS: 'Views', - LAST_REPLY: 'Last Reply' + LAST_REPLY: 'Last Reply', + TITLE: 'Title', + CONTENT: 'Content' } }, diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index ebf82ce7..44e44cdf 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -658,7 +658,9 @@ TOPICS: '主题数', REPLIES: '回贴数', VIEWS: '查看数', - LAST_REPLY: '最近回复' + LAST_REPLY: '最近回复', + TITLE: '标题', + CONTENT: '内容' } }, diff --git a/modules/forums/client/controllers/forums-post.client.controller.js b/modules/forums/client/controllers/forums-post.client.controller.js index c7669ba8..09c178c5 100644 --- a/modules/forums/client/controllers/forums-post.client.controller.js +++ b/modules/forums/client/controllers/forums-post.client.controller.js @@ -18,6 +18,13 @@ * init */ vm.init = function () { + $("#postContent").markdown({ + autofocus:false, + savable:false, + iconlibrary: 'fa', + resize: 'vertical' + }); + // get forum info by state params ForumsService.get({ forumId: $stateParams.forumId diff --git a/modules/forums/client/less/forum.less b/modules/forums/client/less/forum.less index d16f8172..e0c1b2ce 100644 --- a/modules/forums/client/less/forum.less +++ b/modules/forums/client/less/forum.less @@ -126,3 +126,18 @@ border-bottom: none; } } + +.md-editor { + textarea { + border-bottom: none; + background-color: #fff; + min-height: 250px; + padding: 5px; + } + .md-preview { + padding: 5px; + } +} + +.post-view { +} \ No newline at end of file diff --git a/modules/forums/client/views/post.client.view.html b/modules/forums/client/views/post.client.view.html index 9875aa8c..3ae75070 100644 --- a/modules/forums/client/views/post.client.view.html +++ b/modules/forums/client/views/post.client.view.html @@ -28,9 +28,19 @@
+ +
+
+
+ + +
+
\ No newline at end of file