From 4387c9083da04c465e2bed3bf786c9d33ceb3bfc Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 11:09:45 +0800 Subject: [PATCH] css --- public/react/src/modules/comment/Comment.css | 1 + .../src/modules/courses/boards/TopicDetail.js | 8 +++- .../modules/courses/common/CommentsHelper.js | 4 +- .../courses/common/comments/CommonReply.js | 2 +- .../tasks/GraduationTaskssettingReply.js | 2 +- .../graduation/topics/GraduateTopicReply.js | 2 +- .../src/modules/forums/MemoDetailMDEditor.js | 6 +-- public/react/src/scripts/concat.js | 48 +++++++++++++++++++ 8 files changed, 63 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/comment/Comment.css b/public/react/src/modules/comment/Comment.css index 2f85846b6..f21a9c8cf 100644 --- a/public/react/src/modules/comment/Comment.css +++ b/public/react/src/modules/comment/Comment.css @@ -238,6 +238,7 @@ width: 100%; word-wrap: break-word; margin-bottom: 4px; + margin-top: 4px; } .childComment .break_word_comments{ line-height: 22px; diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index e333c17ee..325bbde0d 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -416,7 +416,7 @@ class TopicDetail extends Component { const user = this._getUser(); this.setState({ - comments: addNewComment(comments, _id, content, user) + comments: addNewComment(comments, _id, content, user, this) }) const newMemo2 = Object.assign({}, this.state.memo); newMemo2.total_replies_count = newMemo2.total_replies_count + 1; @@ -531,6 +531,10 @@ class TopicDetail extends Component { .topicDetail #forum_list .return_btn.no_mr { margin-right: 1px; } + /* 有内容时,编辑器下方的边框*/ + .topicDetail .borderBottom.commentInputs { + border-bottom: 1px solid rgb(238, 238, 238); + } .independent { background: rgb(250, 250, 250); padding-bottom: 20px; @@ -661,7 +665,7 @@ class TopicDetail extends Component { + height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}> {/* onClick={ this.createNewComment } enableReplyTo={true} diff --git a/public/react/src/modules/courses/common/CommentsHelper.js b/public/react/src/modules/courses/common/CommentsHelper.js index b4254445d..e513263bc 100644 --- a/public/react/src/modules/courses/common/CommentsHelper.js +++ b/public/react/src/modules/courses/common/CommentsHelper.js @@ -64,13 +64,13 @@ export function handleContentBeforeCreateNew(argContent) { return content } -export function addNewComment(comments, _id, content, user, isSuperAdmin) { +export function addNewComment(comments, _id, content, user, isSuperAdmin, parentComponent) { if (!comments) { comments = []; } comments.unshift( { "can_delete": true, - "admin": user.admin, + "admin": parentComponent ? parentComponent.props.isAdmin() : user.admin , isSuperAdmin: isSuperAdmin, "content": content, diff --git a/public/react/src/modules/courses/common/comments/CommonReply.js b/public/react/src/modules/courses/common/comments/CommonReply.js index 739e62c97..dae21949c 100644 --- a/public/react/src/modules/courses/common/comments/CommonReply.js +++ b/public/react/src/modules/courses/common/comments/CommonReply.js @@ -76,7 +76,7 @@ class CommonReply extends Component{ const isSuperAdmin = this.props.isSuperAdmin() this.setState({ - comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin), + comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin, this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js index 664c4a629..4281d0ec6 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js @@ -73,7 +73,7 @@ class GraduationTaskssettingReply extends Component{ const user = this._getUser(); this.setState({ - comments: addNewComment(this.state.comments, _id, content, user), + comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js index 114efa213..4e318a0c1 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js @@ -67,7 +67,7 @@ class GraduateTopicReply extends Component{ const user = this._getUser(); this.setState({ - comments: addNewComment(this.state.comments, _id, content, user), + comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); diff --git a/public/react/src/modules/forums/MemoDetailMDEditor.js b/public/react/src/modules/forums/MemoDetailMDEditor.js index 6fd650cea..68445b0d7 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditor.js +++ b/public/react/src/modules/forums/MemoDetailMDEditor.js @@ -117,7 +117,7 @@ class MemoDetailMDEditor extends Component { this.initMDEditor() } render() { - const { match, history, memo, placeholder } = this.props + const { match, history, memo, placeholder, className } = this.props const { isInited, errorMsg } = this.state if (!memo) { return
@@ -154,7 +154,7 @@ class MemoDetailMDEditor extends Component { } `}
+ className={`mockInputWrapper commentInput ${className}`} > @@ -172,7 +172,7 @@ class MemoDetailMDEditor extends Component { ` } */} -
diff --git a/public/react/src/scripts/concat.js b/public/react/src/scripts/concat.js index 3a40eef91..67e8d4836 100644 --- a/public/react/src/scripts/concat.js +++ b/public/react/src/scripts/concat.js @@ -97,3 +97,51 @@ return; // var uglified = uglify.minify(['file1.js', 'file2.js', 'file3.js']); + + +/** + 优化 + underscore被单独加载了,去掉'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\underscore.min.js', + marked + raphaeljs sequence diagrams 1.0.4 + + + 统计 js_min_all加载的js: + https://github.com/paulmillr/es6-shim + jQuery v1.8.3 jquery.com + Underscore.js 1.8.2 + marked v0.3.3 + ??? + Raphaël 2.1.3 - JavaScript Vector Library + flowchart, v1.3.4 + editormd.js + CodeMirror + cm active-line.js + cm mode javascript + cm merge.js + CodeMirror addon hint + cm showHint + cm anyword-hint + CodeMirror python + CodeMirror c-like(java) + CodeMirror matchbrackets + + + + ???——> + // Copyright (C) 2006 Google Inc. + // + // 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. + + + */ \ No newline at end of file