Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
2d054878
Commit
2d054878
authored
Aug 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code reuse between chatboxview and chatroomview
parent
2600372a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
22 deletions
+12
-22
mockup/chatroom.html
mockup/chatroom.html
+4
-0
sass/_chatbox.scss
sass/_chatbox.scss
+1
-1
sass/_chatrooms.scss
sass/_chatrooms.scss
+1
-1
spec/chatbox.js
spec/chatbox.js
+1
-1
spec/messages.js
spec/messages.js
+2
-2
src/converse-muc-views.js
src/converse-muc-views.js
+2
-6
src/templates/chatarea.html
src/templates/chatarea.html
+1
-11
No files found.
mockup/chatroom.html
View file @
2d054878
...
@@ -283,6 +283,10 @@
...
@@ -283,6 +283,10 @@
</div>
</div>
</div>
</div>
<div
class=
"message chat-info chat-state-notification"
data-isodate=
"2018-04-36T18:21:36+02:00"
data-csn=
"romeo@capulet.lit"
>
Romeo Montague is typing
</div>
</div>
</div>
<div
class=
"new-msgs-indicator"
>
▼ You have unread messages ▼
</div>
<div
class=
"new-msgs-indicator"
>
▼ You have unread messages ▼
</div>
<form
class=
"sendXMPPMessage"
>
<form
class=
"sendXMPPMessage"
>
...
...
sass/_chatbox.scss
View file @
2d054878
...
@@ -272,7 +272,7 @@
...
@@ -272,7 +272,7 @@
margin
:
0
;
margin
:
0
;
padding
:
0
.25em
;
padding
:
0
.25em
;
display
:
block
;
display
:
block
;
border-top
:
8
px
solid
$chat-head-color
;
border-top
:
4
px
solid
$chat-head-color
;
background-color
:
white
;
background-color
:
white
;
color
:
$chat-head-color
;
color
:
$chat-head-color
;
.fa
,
.fa
:hover
{
.fa
,
.fa
:hover
{
...
...
sass/_chatrooms.scss
View file @
2d054878
...
@@ -263,7 +263,7 @@
...
@@ -263,7 +263,7 @@
.sendXMPPMessage
{
.sendXMPPMessage
{
.chat-toolbar
{
.chat-toolbar
{
background-color
:
white
;
background-color
:
white
;
border-top
:
8
px
solid
$chatroom-head-color
;
border-top
:
4
px
solid
$chatroom-head-color
;
color
:
$chatroom-head-color
;
color
:
$chatroom-head-color
;
.fa
,
.fa
:hover
{
.fa
,
.fa
:hover
{
color
:
$chatroom-head-color
;
color
:
$chatroom-head-color
;
...
...
spec/chatbox.js
View file @
2d054878
...
@@ -707,7 +707,7 @@
...
@@ -707,7 +707,7 @@
.
then
(
function
()
{
.
then
(
function
()
{
var
view
=
_converse
.
chatboxviews
.
get
(
sender_jid
);
var
view
=
_converse
.
chatboxviews
.
get
(
sender_jid
);
// Check that the notification appears inside the chatbox in the DOM
// Check that the notification appears inside the chatbox in the DOM
var
events
=
view
.
el
.
querySelectorAll
(
'
.chat-state-notification
'
);
let
events
=
view
.
el
.
querySelectorAll
(
'
.chat-state-notification
'
);
expect
(
events
.
length
).
toBe
(
1
);
expect
(
events
.
length
).
toBe
(
1
);
expect
(
events
[
0
].
textContent
).
toEqual
(
mock
.
cur_names
[
1
]
+
'
is typing
'
);
expect
(
events
[
0
].
textContent
).
toEqual
(
mock
.
cur_names
[
1
]
+
'
is typing
'
);
...
...
spec/messages.js
View file @
2d054878
...
@@ -1864,7 +1864,7 @@
...
@@ -1864,7 +1864,7 @@
it
(
"
is specially marked when you are mentioned in it
"
,
it
(
"
is specially marked when you are mentioned in it
"
,
mock
.
initConverseWithPromises
(
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
null
,
[
'
rosterGroupsFetched
'
,
'
chatBoxesFetched
'
],
{},
function
(
done
,
_converse
)
{
function
(
done
,
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
createContacts
(
_converse
,
'
current
'
);
...
@@ -1882,7 +1882,7 @@
...
@@ -1882,7 +1882,7 @@
view
.
model
.
onMessage
(
msg
);
view
.
model
.
onMessage
(
msg
);
expect
(
$
(
view
.
el
).
find
(
'
.chat-msg
'
).
hasClass
(
'
mentioned
'
)).
toBeTruthy
();
expect
(
$
(
view
.
el
).
find
(
'
.chat-msg
'
).
hasClass
(
'
mentioned
'
)).
toBeTruthy
();
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
...
...
src/converse-muc-views.js
View file @
2d054878
...
@@ -583,6 +583,7 @@
...
@@ -583,6 +583,7 @@
this
.
el
.
innerHTML
=
tpl_chatroom
();
this
.
el
.
innerHTML
=
tpl_chatroom
();
this
.
renderHeading
();
this
.
renderHeading
();
this
.
renderChatArea
();
this
.
renderChatArea
();
this
.
renderMessageForm
();
if
(
this
.
model
.
get
(
'
connection_status
'
)
!==
converse
.
ROOMSTATUS
.
ENTERED
)
{
if
(
this
.
model
.
get
(
'
connection_status
'
)
!==
converse
.
ROOMSTATUS
.
ENTERED
)
{
this
.
showSpinner
();
this
.
showSpinner
();
}
}
...
@@ -600,14 +601,9 @@
...
@@ -600,14 +601,9 @@
if
(
_
.
isNull
(
this
.
el
.
querySelector
(
'
.chat-area
'
)))
{
if
(
_
.
isNull
(
this
.
el
.
querySelector
(
'
.chat-area
'
)))
{
const
container_el
=
this
.
el
.
querySelector
(
'
.chatroom-body
'
);
const
container_el
=
this
.
el
.
querySelector
(
'
.chatroom-body
'
);
container_el
.
insertAdjacentHTML
(
'
beforeend
'
,
tpl_chatarea
({
container_el
.
insertAdjacentHTML
(
'
beforeend
'
,
tpl_chatarea
({
'
label_message
'
:
__
(
'
Message
'
),
'
show_send_button
'
:
_converse
.
show_send_button
'
label_send
'
:
__
(
'
Send
'
),
'
show_send_button
'
:
_converse
.
show_send_button
,
'
show_toolbar
'
:
_converse
.
show_toolbar
,
'
unread_msgs
'
:
__
(
'
You have unread messages
'
)
}));
}));
container_el
.
insertAdjacentElement
(
'
beforeend
'
,
this
.
occupantsview
.
el
);
container_el
.
insertAdjacentElement
(
'
beforeend
'
,
this
.
occupantsview
.
el
);
this
.
renderToolbar
(
tpl_chatroom_toolbar
);
this
.
content
=
this
.
el
.
querySelector
(
'
.chat-content
'
);
this
.
content
=
this
.
el
.
querySelector
(
'
.chat-content
'
);
this
.
toggleOccupants
(
null
,
true
);
this
.
toggleOccupants
(
null
,
true
);
}
}
...
...
src/templates/chatarea.html
View file @
2d054878
<div
class=
"chat-area col"
>
<div
class=
"chat-area col"
>
<div
class=
"chat-content {[ if (o.show_send_button) { ]}chat-content-sendbutton{[ } ]}"
></div>
<div
class=
"chat-content {[ if (o.show_send_button) { ]}chat-content-sendbutton{[ } ]}"
></div>
<div
class=
"new-msgs-indicator hidden"
>
▼ {{{ o.unread_msgs }}} ▼
</div>
<div
class=
"message-form-container"
/>
<form
class=
"sendXMPPMessage"
>
{[ if (o.show_toolbar) { ]}
<ul
class=
"chat-toolbar no-text-select"
></ul>
{[ } ]}
<textarea
type=
"text"
class=
"chat-textarea {[ if (o.show_send_button) { ]}chat-textarea-send-button{[ } ]}"
placeholder=
"{{{o.label_message}}}"
></textarea>
{[ if (o.show_send_button) { ]}
<button
type=
"submit"
class=
"pure-button send-button"
>
{{{ o.label_send }}}
</button>
{[ } ]}
</form>
</div>
</div>
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