dev_forum
hjm 5 years ago
parent ce5dfa17ce
commit 4387c9083d

@ -238,6 +238,7 @@
width: 100%;
word-wrap: break-word;
margin-bottom: 4px;
margin-top: 4px;
}
.childComment .break_word_comments{
line-height: 22px;

@ -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 {
</div>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} buttonText={'发表'}></MemoDetailMDEditor>
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>
{/* onClick={ this.createNewComment }
enableReplyTo={true}

@ -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,

@ -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();

@ -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();

@ -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();

@ -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 <div></div>
@ -154,7 +154,7 @@ class MemoDetailMDEditor extends Component {
}
`}</style>
<div style={{ display: isInited ? 'none' : '', borderBottom: `${this.props.commentsLength == 0 ? 'none' : '1px solid #EEEEEE'}`}}
className="mockInputWrapper commentInput" >
className={`mockInputWrapper commentInput ${className}`} >
<input onClick={this.onMockInputClick} placeholder={placeholder || '我要回复'}></input>
<a href="javascript:void(0)"
onClick={this.onMockInputClick} className="commentsbtn task-btn task-btn-blue">
@ -172,7 +172,7 @@ class MemoDetailMDEditor extends Component {
`
} */}
</style>
<div nhname={`new_message_${memo.id}`} className="commentInput commentInputs"
<div nhname={`new_message_${memo.id}`} className={`commentInput commentInputs ${className}`}
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} >
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>

@ -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.
*/
Loading…
Cancel
Save