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
10a85336
Commit
10a85336
authored
Feb 18, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the description in the heading, not the subject
parent
0a99b9f2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
11 deletions
+58
-11
css/converse.css
css/converse.css
+3
-3
docs/CHANGES.md
docs/CHANGES.md
+2
-0
sass/_chatbox.scss
sass/_chatbox.scss
+1
-1
sass/_chatrooms.scss
sass/_chatrooms.scss
+1
-1
spec/chatroom.js
spec/chatroom.js
+41
-0
src/converse-muc.js
src/converse-muc.js
+9
-5
src/templates/chatroom_head.html
src/templates/chatroom_head.html
+1
-1
No files found.
css/converse.css
View file @
10a85336
...
...
@@ -1415,7 +1415,7 @@
font-size
:
100%
;
height
:
55px
;
margin
:
0
;
padding
:
5px
;
padding
:
0.5em
;
position
:
relative
;
}
@media
screen
and
(
max-height
:
450px
)
{
#converse-embedded-chat
.chat-head
,
...
...
@@ -2241,8 +2241,8 @@
#conversejs
.chat-head-chatroom
.chatbox-btn.button-on
{
background-color
:
white
;
color
:
#E76F51
;
}
#converse-embedded-chat
.chat-head-chatroom
.chatroom-
topic
,
#conversejs
.chat-head-chatroom
.chatroom-
topic
{
#converse-embedded-chat
.chat-head-chatroom
.chatroom-
description
,
#conversejs
.chat-head-chatroom
.chatroom-
description
{
color
:
white
;
font-size
:
80%
;
font-style
:
italic
;
...
...
docs/CHANGES.md
View file @
10a85336
...
...
@@ -14,6 +14,8 @@
The public API is accessible via a global
`converse`
object.
*
The
`keepalive`
and
`roster_groups`
options are now set to
`true`
by default.
-
The chat room
`description`
is now shown in the heading, not the
`subject`
.
[jcbrand]
-
Created a new non-core plugin
`converse-muc-embedded`
which embeds a single
chat room into a page. An example can be found at https://conversejs.org/demo/embedded.html
[jcbrand]
...
...
sass/_chatbox.scss
View file @
10a85336
...
...
@@ -33,7 +33,7 @@
font-size
:
100%
;
height
:
$chat-head-height
;
margin
:
0
;
padding
:
5px
;
padding
:
0
.5em
;
position
:
relative
;
.avatar
{
margin-right
:
0
.5em
;
...
...
sass/_chatrooms.scss
View file @
10a85336
...
...
@@ -20,7 +20,7 @@
}
}
.chatroom-
topic
{
.chatroom-
description
{
color
:
white
;
font-size
:
80%
;
font-style
:
italic
;
...
...
spec/chatroom.js
View file @
10a85336
...
...
@@ -345,6 +345,47 @@
describe
(
"
A Chat Room
"
,
function
()
{
it
(
"
shows its description in the chat heading
"
,
mock
.
initConverse
(
function
(
_converse
)
{
var
sent_IQ
,
IQ_id
;
var
sendIQ
=
_converse
.
connection
.
sendIQ
;
spyOn
(
_converse
.
connection
,
'
sendIQ
'
).
andCallFake
(
function
(
iq
,
callback
,
errback
)
{
sent_IQ
=
iq
;
IQ_id
=
sendIQ
.
bind
(
this
)(
iq
,
callback
,
errback
);
});
var
view
=
_converse
.
api
.
rooms
.
open
(
'
coven@chat.shakespeare.lit
'
,
{
'
nick
'
:
'
some1
'
});
spyOn
(
view
,
'
generateHeadingHTML
'
).
andCallThrough
();
var
features_stanza
=
$iq
({
from
:
'
coven@chat.shakespeare.lit
'
,
'
id
'
:
IQ_id
,
'
to
'
:
'
dummy@localhost/desktop
'
,
'
type
'
:
'
result
'
})
.
c
(
'
query
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/disco#info
'
})
.
c
(
'
identity
'
,
{
'
category
'
:
'
conference
'
,
'
name
'
:
'
A Dark Cave
'
,
'
type
'
:
'
text
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
http://jabber.org/protocol/muc
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
muc_passwordprotected
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
muc_hidden
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
muc_temporary
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
muc_open
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
muc_unmoderated
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
muc_nonanonymous
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
urn:xmpp:mam:0
'
}).
up
()
.
c
(
'
x
'
,
{
'
xmlns
'
:
'
jabber:x:data
'
,
'
type
'
:
'
result
'
})
.
c
(
'
field
'
,
{
'
var
'
:
'
FORM_TYPE
'
,
'
type
'
:
'
hidden
'
})
.
c
(
'
value
'
).
t
(
'
http://jabber.org/protocol/muc#roominfo
'
).
up
().
up
()
.
c
(
'
field
'
,
{
'
type
'
:
'
text-single
'
,
'
var
'
:
'
muc#roominfo_description
'
,
'
label
'
:
'
Description
'
})
.
c
(
'
value
'
).
t
(
'
This is the description
'
).
up
().
up
()
.
c
(
'
field
'
,
{
'
type
'
:
'
text-single
'
,
'
var
'
:
'
muc#roominfo_occupants
'
,
'
label
'
:
'
Number of occupants
'
})
.
c
(
'
value
'
).
t
(
0
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
features_stanza
));
expect
(
view
.
generateHeadingHTML
).
toHaveBeenCalled
();
expect
(
view
.
$
(
'
.chatroom-description
'
).
text
()).
toBe
(
'
This is the description
'
);
}));
it
(
"
will specially mark messages in which you are mentioned
"
,
mock
.
initConverse
(
function
(
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
...
...
src/converse-muc.js
View file @
10a85336
...
...
@@ -345,8 +345,9 @@
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
hide
,
this
);
this
.
model
.
on
(
'
change:connection_status
'
,
this
.
afterConnected
,
this
);
this
.
model
.
on
(
'
change:chat_state
'
,
this
.
sendChatState
,
this
);
this
.
model
.
on
(
'
change:affiliation
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:chat_state
'
,
this
.
sendChatState
,
this
);
this
.
model
.
on
(
'
change:description
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:name
'
,
this
.
renderHeading
,
this
);
this
.
createOccupantsView
();
...
...
@@ -435,6 +436,7 @@
_
.
extend
(
this
.
model
.
toJSON
(),
{
info_close
:
__
(
'
Close and leave this room
'
),
info_configure
:
__
(
'
Configure this room
'
),
description
:
this
.
model
.
get
(
'
description
'
)
||
''
}));
},
...
...
@@ -1268,7 +1270,7 @@
autoConfigureChatRoom
:
function
(
stanza
)
{
/* Automatically configure room based on the
* 'roomconfig
ure
' data on this view's model.
* 'roomconfig' data on this view's model.
*
* Returns a promise which resolves once a response IQ has
* been received.
...
...
@@ -1354,8 +1356,7 @@
var
that
=
this
;
_converse
.
connection
.
disco
.
info
(
this
.
model
.
get
(
'
jid
'
),
null
,
function
(
iq
)
{
/*
* See http://xmpp.org/extensions/xep-0045.html#disco-roominfo
/* See http://xmpp.org/extensions/xep-0045.html#disco-roominfo
*
* <identity
* category='conference'
...
...
@@ -1379,6 +1380,10 @@
}
features
[
fieldname
.
replace
(
'
muc_
'
,
''
)]
=
true
;
});
var
desc_field
=
iq
.
querySelector
(
'
field[var="muc#roominfo_description"] value
'
);
if
(
!
_
.
isNull
(
desc_field
))
{
features
.
description
=
desc_field
.
textContent
;
}
that
.
model
.
save
(
features
);
return
deferred
.
resolve
();
},
...
...
@@ -1830,7 +1835,6 @@
},
setChatRoomSubject
:
function
(
sender
,
subject
)
{
this
.
$el
.
find
(
'
.chatroom-topic
'
).
text
(
subject
).
attr
(
'
title
'
,
subject
);
// For translators: the %1$s and %2$s parts will get replaced by the user and topic text respectively
// Example: Topic set by JC Brand to: Hello World!
this
.
$content
.
append
(
...
...
src/templates/chatroom_head.html
View file @
10a85336
...
...
@@ -4,5 +4,5 @@
{[ } ]}
<div
class=
"chat-title"
>
{{{ name }}}
<p
class=
"chatroom-
topic"
>
<p/>
<p
class=
"chatroom-
description"
>
{{{ description }}}
<p/>
</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