Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Milan
diaspora
Commits
473cc251
Unverified
Commit
473cc251
authored
Aug 30, 2017
by
Steffen van Bergerem
Committed by
Benjamin Neff
Aug 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace comment_box with comment-box
parent
7457f254
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
16 deletions
+16
-16
app/assets/javascripts/app/views/comment_stream_view.js
app/assets/javascripts/app/views/comment_stream_view.js
+3
-3
app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js
...ripts/app/views/single-post-viewer/single_post_actions.js
+2
-2
app/assets/javascripts/app/views/stream_post_views.js
app/assets/javascripts/app/views/stream_post_views.js
+1
-1
app/assets/javascripts/mobile/mobile_comments.js
app/assets/javascripts/mobile/mobile_comments.js
+3
-3
app/assets/stylesheets/comments.scss
app/assets/stylesheets/comments.scss
+2
-2
app/assets/templates/comment-stream_tpl.jst.hbs
app/assets/templates/comment-stream_tpl.jst.hbs
+1
-1
app/views/comments/_new_comment.mobile.haml
app/views/comments/_new_comment.mobile.haml
+1
-1
features/step_definitions/comment_steps.rb
features/step_definitions/comment_steps.rb
+1
-1
spec/javascripts/app/views/comment_stream_view_spec.js
spec/javascripts/app/views/comment_stream_view_spec.js
+2
-2
No files found.
app/assets/javascripts/app/views/comment_stream_view.js
View file @
473cc251
...
...
@@ -7,7 +7,7 @@ app.views.CommentStream = app.views.Base.extend({
className
:
"
comment_stream
"
,
events
:
{
"
keydown .comment
_
box
"
:
"
keyDownOnCommentBox
"
,
"
keydown .comment
-
box
"
:
"
keyDownOnCommentBox
"
,
"
submit form
"
:
"
createComment
"
,
"
click .toggle_post_comments
"
:
"
expandComments
"
,
"
click form
"
:
"
openForm
"
...
...
@@ -26,11 +26,11 @@ app.views.CommentStream = app.views.Base.extend({
postRenderTemplate
:
function
()
{
this
.
model
.
comments
.
each
(
this
.
appendComment
,
this
);
this
.
commentBox
=
this
.
$
(
"
.comment
_
box
"
);
this
.
commentBox
=
this
.
$
(
"
.comment
-
box
"
);
this
.
commentSubmitButton
=
this
.
$
(
"
input[name='commit']
"
);
this
.
mentions
=
new
app
.
views
.
CommentMention
({
el
:
this
.
$el
,
postId
:
this
.
model
.
get
(
"
id
"
)});
this
.
mdEditor
=
new
Diaspora
.
MarkdownEditor
(
this
.
$
(
"
.comment
_
box
"
),
{
this
.
mdEditor
=
new
Diaspora
.
MarkdownEditor
(
this
.
$
(
"
.comment
-
box
"
),
{
onPreview
:
function
(
$mdInstance
)
{
var
renderedText
=
app
.
helpers
.
textFormatter
(
$mdInstance
.
getContent
(),
this
.
mentions
.
getMentionedPeople
());
return
"
<div class='preview-content'>
"
+
renderedText
+
"
</div>
"
;
...
...
app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js
View file @
473cc251
...
...
@@ -26,8 +26,8 @@ app.views.SinglePostActions = app.views.Feedback.extend({
},
focusComment
:
function
()
{
$
(
'
.comment_stream .comment
_
box
'
).
focus
();
$
(
'
html,body
'
).
animate
({
scrollTop
:
$
(
'
.comment_stream .comment
_box
'
).
offset
().
top
-
(
$
(
'
.comment_stream .comment_
box
'
).
height
()
+
20
)});
$
(
'
.comment_stream .comment
-
box
'
).
focus
();
$
(
'
html,body
'
).
animate
({
scrollTop
:
$
(
'
.comment_stream .comment
-box
'
).
offset
().
top
-
(
$
(
'
.comment_stream .comment-
box
'
).
height
()
+
20
)});
return
false
;
},
...
...
app/assets/javascripts/app/views/stream_post_views.js
View file @
473cc251
...
...
@@ -88,7 +88,7 @@ app.views.StreamPost = app.views.Post.extend({
focusCommentTextarea
:
function
(
evt
){
evt
.
preventDefault
();
this
.
$
(
"
.new-comment-form-wrapper
"
).
removeClass
(
"
hidden
"
);
this
.
$
(
"
.comment
_
box
"
).
focus
();
this
.
$
(
"
.comment
-
box
"
).
focus
();
return
this
;
}
...
...
app/assets/javascripts/mobile/mobile_comments.js
View file @
473cc251
...
...
@@ -11,7 +11,7 @@
initialize
:
function
()
{
var
self
=
this
;
new
Diaspora
.
MarkdownEditor
(
"
.comment
_
box
"
);
new
Diaspora
.
MarkdownEditor
(
"
.comment
-
box
"
);
this
.
stream
().
on
(
"
tap click
"
,
"
a.show-comments
"
,
function
(
evt
){
evt
.
preventDefault
();
...
...
@@ -43,7 +43,7 @@
submitComment
:
function
(
evt
){
evt
.
preventDefault
();
var
form
=
$
(
this
);
var
commentBox
=
form
.
find
(
"
.comment
_
box
"
);
var
commentBox
=
form
.
find
(
"
.comment
-
box
"
);
var
commentText
=
$
.
trim
(
commentBox
.
val
());
if
(
!
commentText
){
commentBox
.
focus
();
...
...
@@ -169,7 +169,7 @@
showCommentBox
:
function
(
link
){
var
bottomBar
=
link
.
closest
(
"
.bottom-bar
"
).
first
();
var
textArea
=
bottomBar
.
find
(
"
textarea.comment
_
box
"
).
first
()[
0
];
var
textArea
=
bottomBar
.
find
(
"
textarea.comment
-
box
"
).
first
()[
0
];
bottomBar
.
find
(
"
.add-comment-switcher
"
).
removeClass
(
"
hidden
"
);
autosize
(
textArea
);
},
...
...
app/assets/stylesheets/comments.scss
View file @
473cc251
...
...
@@ -53,11 +53,11 @@
}
padding-left
:
12px
;
}
.comment
_
box
{
.comment
-
box
{
height
:
35px
;
resize
:
none
;
}
textarea
.comment
_box
:focus
,
textarea
.comment_box
:valid
,
textarea
.comment_
box
:active
{
textarea
.comment
-box
:focus
,
textarea
.comment-box
:valid
,
textarea
.comment-
box
:active
{
border-color
:
$border-dark-grey
;
box-shadow
:
none
;
}
...
...
app/assets/templates/comment-stream_tpl.jst.hbs
View file @
473cc251
...
...
@@ -28,7 +28,7 @@
<form
accept-charset=
"UTF-8"
action=
"/posts/
{{
id
}}
/comments"
class=
"new-comment"
id=
"new-comment-on-
{{
id
}}
"
method=
"post"
>
<textarea
class=
"comment
_
box form-control mention-textarea"
<textarea
class=
"comment
-
box form-control mention-textarea"
id=
"comment_text_on_
{{
id
}}
"
name=
"text"
rows=
"1"
required
placeholder=
"
{{
t
"stream.comment"
}}
"
/>
<div
class=
"typeahead-mention-box-wrap"
>
<input
class=
"typeahead-mention-box hidden"
type=
"text"
>
...
...
app/views/comments/_new_comment.mobile.haml
View file @
473cc251
...
...
@@ -9,7 +9,7 @@
%fieldset
=
hidden_field_tag
:post_id
,
post_id
,
id:
"post-id-on-
#{
post_id
}
"
.form-group.clearfix
=
text_area_tag
:text
,
nil
,
class:
"col-md-12 comment
_
box form-control"
,
=
text_area_tag
:text
,
nil
,
class:
"col-md-12 comment
-
box form-control"
,
id:
"comment-text-on-
#{
post_id
}
"
,
placeholder:
t
(
".comment"
)
=
submit_tag
t
(
".comment"
),
:id
=>
"comment-submit-
#{
post_id
}
"
,
"data-disable-with"
=>
t
(
".commenting"
),
"data-reset-with"
=>
t
(
".comment"
),
:class
=>
"btn btn-primary btn-block comment-button"
features/step_definitions/comment_steps.rb
View file @
473cc251
...
...
@@ -40,5 +40,5 @@ Given /^"([^"]*)" has commented a lot on "([^"]*)"$/ do |email, post_text|
end
When
/^I enter "([^"]*)" in the comment field$/
do
|
comment_text
|
find
(
"textarea.comment
_
box.mention-textarea"
).
native
.
send_keys
(
comment_text
)
find
(
"textarea.comment
-
box.mention-textarea"
).
native
.
send_keys
(
comment_text
)
end
spec/javascripts/app/views/comment_stream_view_spec.js
View file @
473cc251
...
...
@@ -51,7 +51,7 @@ describe("app.views.CommentStream", function(){
this
.
view
.
commentBox
=
undefined
;
this
.
view
.
postRenderTemplate
();
expect
(
this
.
view
.
commentBox
).
toBeDefined
();
expect
(
this
.
view
.
commentBox
).
toEqual
(
this
.
view
.
$
(
"
.comment
_
box
"
));
expect
(
this
.
view
.
commentBox
).
toEqual
(
this
.
view
.
$
(
"
.comment
-
box
"
));
});
it
(
"
sets commentSubmitButton
"
,
function
()
{
...
...
@@ -124,7 +124,7 @@ describe("app.views.CommentStream", function(){
context
(
"
submission
"
,
function
()
{
beforeEach
(
function
()
{
this
.
view
.
$
(
"
.comment
_
box
"
).
val
(
'
a new comment
'
);
this
.
view
.
$
(
"
.comment
-
box
"
).
val
(
'
a new comment
'
);
this
.
view
.
createComment
();
this
.
request
=
jasmine
.
Ajax
.
requests
.
mostRecent
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment