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
65ac3896
Commit
65ac3896
authored
May 10, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a way to show a user's vcard
parent
270c9b7c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
3 deletions
+73
-3
src/converse-chatboxes.js
src/converse-chatboxes.js
+4
-0
src/converse-chatview.js
src/converse-chatview.js
+32
-2
src/templates/chatbox_head.html
src/templates/chatbox_head.html
+1
-1
src/templates/user_details_modal.html
src/templates/user_details_modal.html
+36
-0
No files found.
src/converse-chatboxes.js
View file @
65ac3896
...
...
@@ -261,6 +261,10 @@
});
},
getDisplayName
()
{
return
this
.
vcard
.
get
(
'
fullname
'
)
||
this
.
get
(
'
jid
'
);
},
createMessageStanza
(
message
)
{
/* Given a _converse.Message Backbone.Model, return the XML
* stanza that represents it.
...
...
src/converse-chatview.js
View file @
65ac3896
...
...
@@ -19,11 +19,13 @@
"
tpl!help_message
"
,
"
tpl!info
"
,
"
tpl!new_day
"
,
"
tpl!user_details_modal
"
,
"
tpl!toolbar_fileupload
"
,
"
tpl!spinner
"
,
"
tpl!spoiler_button
"
,
"
tpl!status_message
"
,
"
tpl!toolbar
"
,
"
converse-modal
"
,
"
converse-chatboxes
"
,
"
converse-message-view
"
],
factory
);
...
...
@@ -41,6 +43,7 @@
tpl_help_message
,
tpl_info
,
tpl_new_day
,
tpl_user_details_modal
,
tpl_toolbar_fileupload
,
tpl_spinner
,
tpl_spoiler_button
,
...
...
@@ -66,7 +69,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies
:
[
"
converse-chatboxes
"
,
"
converse-disco
"
,
"
converse-message-view
"
],
dependencies
:
[
"
converse-chatboxes
"
,
"
converse-disco
"
,
"
converse-message-view
"
,
"
converse-modal
"
],
overrides
:
{
// Overrides mentioned here will be picked up by converse.js's
...
...
@@ -200,8 +203,8 @@
}
});
_converse
.
ChatBoxHeading
=
_converse
.
ViewWithAvatar
.
extend
({
_converse
.
ChatBoxHeading
=
_converse
.
ViewWithAvatar
.
extend
({
initialize
()
{
this
.
model
.
on
(
'
change:status
'
,
this
.
onStatusMessageChanged
,
this
);
this
.
model
.
vcard
.
on
(
'
change
'
,
this
.
render
,
this
);
...
...
@@ -231,6 +234,25 @@
});
_converse
.
UserDetailsModal
=
_converse
.
BootstrapModal
.
extend
({
toHTML
()
{
return
tpl_user_details_modal
(
_
.
extend
(
this
.
model
.
toJSON
(),
this
.
model
.
vcard
.
toJSON
(),
{
'
alt_profile_image
'
:
__
(
"
The User's Profile Image
"
),
'
display_name
'
:
this
.
model
.
getDisplayName
(),
'
label_close
'
:
__
(
'
Close
'
),
'
label_email
'
:
__
(
'
Email
'
),
'
label_fullname
'
:
__
(
'
Full Name
'
),
'
label_nickname
'
:
__
(
'
Nickname
'
),
'
label_role
'
:
__
(
'
Role
'
),
'
label_save
'
:
__
(
'
Save
'
),
'
label_url
'
:
__
(
'
URL
'
),
}));
}
});
_converse
.
ChatBoxView
=
Backbone
.
NativeView
.
extend
({
length
:
200
,
className
:
'
chatbox hidden
'
,
...
...
@@ -239,6 +261,7 @@
events
:
{
'
change input.fileupload
'
:
'
onFileSelection
'
,
'
click .close-chatbox-button
'
:
'
close
'
,
'
click .show-user-details-modal
'
:
'
showUserDetailsModal
'
,
'
click .new-msgs-indicator
'
:
'
viewUnreadMessages
'
,
'
click .send-button
'
:
'
onFormSubmitted
'
,
'
click .toggle-call
'
:
'
toggleCall
'
,
...
...
@@ -328,6 +351,13 @@
this
.
renderToolbar
();
},
showUserDetailsModal
(
ev
)
{
if
(
_
.
isUndefined
(
this
.
user_details_modal
))
{
this
.
user_details_modal
=
new
_converse
.
UserDetailsModal
({
model
:
this
.
model
});
}
this
.
user_details_modal
.
show
(
ev
);
},
toggleFileUpload
(
ev
)
{
this
.
el
.
querySelector
(
'
input.fileupload
'
).
click
();
},
...
...
src/templates/chatbox_head.html
View file @
65ac3896
...
...
@@ -16,6 +16,6 @@
</div>
<div
class=
"chatbox-buttons row no-gutters"
>
<a
class=
"chatbox-btn close-chatbox-button fa fa-close"
title=
{{{o.info_close}}}
></a>
<
!-- <a class="chatbox-btn fa fa-vcard" title="Contact profile" data-toggle="modal" data-target="#contactProfileModal"></a> --
>
<
a
class=
"chatbox-btn show-user-details-modal fa fa-vcard"
title=
"{{{o.info_details}}}"
></a
>
</div>
</div>
src/templates/user_details_modal.html
0 → 100644
View file @
65ac3896
<div
class=
"modal fade"
id=
"user-profile-modal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"user-profile-modal-label"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"user-profile-modal-label"
>
{{{o.display_name}}}
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"{{{o.label_close}}}"
><span
aria-hidden=
"true"
>
×
</span></button>
</div>
<div
class=
"modal-body"
>
{[ if (o.image) { ]}
<img
alt=
"{{{o.alt_profile_image}}}"
class=
"img-thumbnail avatar align-self-center"
height=
"100"
width=
"100"
src=
"data:{{{o.image_type}}};base64,{{{o.image}}}"
/>
{[ } ]}
{[ if (o.fullname) { ]}
<p><label>
{{{o.label_fullname}}}:
</label>
{{{o.fullname}}}
</p>
{[ } ]}
{[ if (o.nickname) { ]}
<p><label>
{{{o.label_nickname}}}:
</label>
{{{o.nickname}}}
</p>
{[ } ]}
{[ if (o.url) { ]}
<p><label>
{{{o.label_url}}}:
</label>
<a
target=
"_blank"
rel=
"noopener"
href=
"{{{o.url}}}"
>
{{{o.url}}}
</a></p>
{[ } ]}
{[ if (o.email) { ]}
<p><label>
{{{o.label_email}}}:
</label>
<a
href=
"mailto:{{{o.email}}}"
>
{{{o.email}}}
</a></p>
{[ } ]}
{[ if (o.role) { ]}
<p><label>
{{{o.label_role}}}:
</label>
{{{o.role}}}
</p>
{[ } ]}
</div>
<div
class=
"modal-footer"
>
<button
type=
"submit"
class=
"save-form btn btn-primary"
>
{{{o.label_save}}}
</button>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
{{{o.label_close}}}
</button>
</div>
</div>
</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