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
a338ede0
Commit
a338ede0
authored
Jul 19, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace accept/decline buttons with font icons
parent
9bf4eba3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
68 deletions
+80
-68
converse.js
converse.js
+10
-6
css/converse.css
css/converse.css
+25
-25
less/converse.less
less/converse.less
+30
-28
mockup/index.html
mockup/index.html
+10
-6
src/templates/requesting_contact.html
src/templates/requesting_contact.html
+5
-3
No files found.
converse.js
View file @
a338ede0
...
@@ -2841,18 +2841,22 @@
...
@@ -2841,18 +2841,22 @@
},
},
acceptRequest
:
function
(
ev
)
{
acceptRequest
:
function
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
jid
=
this
.
model
.
get
(
'
jid
'
);
var
jid
=
this
.
model
.
get
(
'
jid
'
);
converse
.
connection
.
roster
.
authorize
(
jid
);
converse
.
connection
.
roster
.
authorize
(
jid
);
converse
.
connection
.
roster
.
add
(
jid
,
this
.
model
.
get
(
'
fullname
'
),
[],
function
(
iq
)
{
converse
.
connection
.
roster
.
add
(
jid
,
this
.
model
.
get
(
'
fullname
'
),
[],
function
(
iq
)
{
converse
.
connection
.
roster
.
subscribe
(
jid
,
null
,
converse
.
xmppstatus
.
get
(
'
fullname
'
));
converse
.
connection
.
roster
.
subscribe
(
jid
,
null
,
converse
.
xmppstatus
.
get
(
'
fullname
'
));
});
});
ev
.
preventDefault
();
},
},
declineRequest
:
function
(
ev
)
{
declineRequest
:
function
(
ev
)
{
ev
.
preventDefault
();
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
converse
.
connection
.
roster
.
unauthorize
(
this
.
model
.
get
(
'
jid
'
));
var
result
=
confirm
(
__
(
"
Are you sure you want to decline this contact request?
"
));
this
.
model
.
destroy
();
if
(
result
===
true
)
{
converse
.
connection
.
roster
.
unauthorize
(
this
.
model
.
get
(
'
jid
'
));
this
.
model
.
destroy
();
}
return
this
;
},
},
render
:
function
()
{
render
:
function
()
{
...
@@ -2887,8 +2891,8 @@
...
@@ -2887,8 +2891,8 @@
this
.
$el
.
addClass
(
'
requesting-xmpp-contact
'
);
this
.
$el
.
addClass
(
'
requesting-xmpp-contact
'
);
this
.
$el
.
html
(
converse
.
templates
.
requesting_contact
(
this
.
$el
.
html
(
converse
.
templates
.
requesting_contact
(
_
.
extend
(
item
.
toJSON
(),
{
_
.
extend
(
item
.
toJSON
(),
{
'
label_accept
'
:
__
(
'
Accept
'
),
'
desc_accept
'
:
__
(
"
Click to accept this contact request
"
),
'
label_decline
'
:
__
(
'
Decline
'
)
'
desc_decline
'
:
__
(
"
Click to decline this contact request
"
),
})
})
));
));
converse
.
controlboxtoggle
.
showControlBox
();
converse
.
controlboxtoggle
.
showControlBox
();
...
...
css/converse.css
View file @
a338ede0
...
@@ -851,16 +851,14 @@ dl.add-converse-contact {
...
@@ -851,16 +851,14 @@ dl.add-converse-contact {
background-color
:
#DCEAC5
;
background-color
:
#DCEAC5
;
/* Make this difference */
/* Make this difference */
}
}
#conversejs
#converse-roster
dd
.current-xmpp-contact
{
clear
:
both
;
}
#conversejs
#converse-roster
dd
.current-xmpp-contact
span
{
#conversejs
#converse-roster
dd
.current-xmpp-contact
span
{
font-size
:
16px
;
font-size
:
16px
;
float
:
left
;
float
:
left
;
color
:
#4f4f4f
;
color
:
#4f4f4f
;
}
}
#conversejs
#converse-roster
dd
.requesting-xmpp-contact
button
{
#conversejs
.requesting-xmpp-contact
.request-actions
{
margin-left
:
0.5em
;
margin-left
:
0.5em
;
float
:
right
;
}
}
#conversejs
#converse-roster
dd
a
,
#conversejs
#converse-roster
dd
a
,
#conversejs
#converse-roster
dd
span
{
#conversejs
#converse-roster
dd
span
{
...
@@ -871,7 +869,7 @@ dl.add-converse-contact {
...
@@ -871,7 +869,7 @@ dl.add-converse-contact {
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
}
}
#conversejs
#converse-roster
dd
span
{
#conversejs
#converse-roster
dd
span
{
padding
:
2px
5px
0
0
;
padding
:
0
5px
0
0
;
}
}
#conversejs
#converse-roster
{
#conversejs
#converse-roster
{
overflow-y
:
auto
;
overflow-y
:
auto
;
...
@@ -887,7 +885,6 @@ dl.add-converse-contact {
...
@@ -887,7 +885,6 @@ dl.add-converse-contact {
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
white-space
:
nowrap
;
display
:
inline-block
;
display
:
inline-block
;
width
:
175px
;
}
}
#conversejs
dd
.available-chatroom
a
.open-room
{
#conversejs
dd
.available-chatroom
a
.open-room
{
width
:
148px
;
width
:
148px
;
...
@@ -898,21 +895,12 @@ dl.add-converse-contact {
...
@@ -898,21 +895,12 @@ dl.add-converse-contact {
font-size
:
13px
;
font-size
:
13px
;
color
:
#666
;
color
:
#666
;
border
:
none
;
border
:
none
;
padding
:
0.3em
0
em
0em
0.5em
;
padding
:
0.3em
0
0
0.5em
;
text-shadow
:
0
1px
0
#fafafa
;
text-shadow
:
0
1px
0
#fafafa
;
}
}
#conversejs
#converse-roster
dt
{
#conversejs
#converse-roster
dt
{
display
:
none
;
display
:
none
;
}
}
#conversejs
dd
.available-chatroom
,
#conversejs
#converse-roster
dd
{
font-weight
:
bold
;
border
:
none
;
display
:
block
;
padding
:
0
0em
0
0.5em
;
color
:
#666
;
text-shadow
:
0
1px
0
#fafafa
;
}
#conversejs
.room-info
{
#conversejs
.room-info
{
font-size
:
11px
;
font-size
:
11px
;
font-style
:
normal
;
font-style
:
normal
;
...
@@ -949,8 +937,27 @@ dl.add-converse-contact {
...
@@ -949,8 +937,27 @@ dl.add-converse-contact {
margin-top
:
3px
;
margin-top
:
3px
;
font-size
:
15px
;
font-size
:
15px
;
}
}
#conversejs
dd
.available-chatroom
,
#conversejs
#converse-roster
dd
{
font-weight
:
bold
;
border
:
none
;
display
:
block
;
padding
:
1px
0
0
0.5em
;
color
:
#666
;
text-shadow
:
0
1px
0
#fafafa
;
clear
:
both
;
}
#conversejs
#converse-roster
dd
{
line-height
:
16px
;
}
#conversejs
dd
.available-chatroom
:hover
,
#conversejs
#converse-roster
dd
:hover
{
background-color
:
#eee
;
}
#conversejs
#converse-roster
dd
a
.decline-xmpp-request
{
margin-left
:
5px
;
}
#conversejs
#converse-roster
dd
a
.remove-xmpp-contact
{
#conversejs
#converse-roster
dd
a
.remove-xmpp-contact
{
line-height
:
21px
;
float
:
right
;
float
:
right
;
width
:
22px
;
width
:
22px
;
margin
:
0
;
margin
:
0
;
...
@@ -961,14 +968,7 @@ dl.add-converse-contact {
...
@@ -961,14 +968,7 @@ dl.add-converse-contact {
display
:
inline-block
;
display
:
inline-block
;
}
}
#conversejs
#converse-roster
a
.open-chat
{
#conversejs
#converse-roster
a
.open-chat
{
line-height
:
21px
;
width
:
80%
;
width
:
85%
;
}
#conversejs
#converse-roster
dd
:hover
a
.open-chat
{
width
:
70%
;
}
#conversejs
#converse-roster
dd
.pending-xmpp-contact
:hover
span
{
width
:
70%
;
}
}
#conversejs
.chatbox
,
#conversejs
.chatbox
,
#conversejs
.chatroom
{
#conversejs
.chatroom
{
...
...
less/converse.less
View file @
a338ede0
...
@@ -943,18 +943,15 @@ dl.add-converse-contact {
...
@@ -943,18 +943,15 @@ dl.add-converse-contact {
background-color: #DCEAC5; /* Make this difference */
background-color: #DCEAC5; /* Make this difference */
}
}
#conversejs #converse-roster dd.current-xmpp-contact {
clear: both;
}
#conversejs #converse-roster dd.current-xmpp-contact span {
#conversejs #converse-roster dd.current-xmpp-contact span {
font-size: 16px;
font-size: 16px;
float: left;
float: left;
color: rgb(79, 79, 79);
color: rgb(79, 79, 79);
}
}
#conversejs
#converse-roster dd.requesting-xmpp-contact button
{
#conversejs
.requesting-xmpp-contact .request-actions
{
margin-left: 0.5em;
margin-left: 0.5em;
float: right;
}
}
#conversejs #converse-roster dd a,
#conversejs #converse-roster dd a,
...
@@ -967,7 +964,7 @@ dl.add-converse-contact {
...
@@ -967,7 +964,7 @@ dl.add-converse-contact {
}
}
#conversejs #converse-roster dd span {
#conversejs #converse-roster dd span {
padding:
2px
5px 0 0;
padding:
0
5px 0 0;
}
}
#conversejs #converse-roster {
#conversejs #converse-roster {
...
@@ -985,7 +982,6 @@ dl.add-converse-contact {
...
@@ -985,7 +982,6 @@ dl.add-converse-contact {
text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
white-space: nowrap;
display: inline-block;
display: inline-block;
width: 175px;
}
}
#conversejs dd.available-chatroom a.open-room {
#conversejs dd.available-chatroom a.open-room {
...
@@ -998,7 +994,7 @@ dl.add-converse-contact {
...
@@ -998,7 +994,7 @@ dl.add-converse-contact {
font-size: 13px;
font-size: 13px;
color: #666;
color: #666;
border: none;
border: none;
padding: 0.3em 0
em 0em
0.5em;
padding: 0.3em 0
0
0.5em;
text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
}
}
...
@@ -1006,16 +1002,6 @@ dl.add-converse-contact {
...
@@ -1006,16 +1002,6 @@ dl.add-converse-contact {
display: none;
display: none;
}
}
#conversejs dd.available-chatroom,
#conversejs #converse-roster dd {
font-weight: bold;
border: none;
display: block;
padding: 0 0em 0 0.5em;
color: #666;
text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
}
#conversejs .room-info {
#conversejs .room-info {
font-size: 11px;
font-size: 11px;
font-style: normal;
font-style: normal;
...
@@ -1059,8 +1045,31 @@ dl.add-converse-contact {
...
@@ -1059,8 +1045,31 @@ dl.add-converse-contact {
font-size: 15px;
font-size: 15px;
}
}
#conversejs dd.available-chatroom,
#conversejs #converse-roster dd {
font-weight: bold;
border: none;
display: block;
padding: 1px 0 0 0.5em;
color: #666;
text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
clear: both;
}
#conversejs #converse-roster dd {
line-height: 16px;
}
#conversejs dd.available-chatroom:hover,
#conversejs #converse-roster dd:hover {
background-color: #eee;
}
#conversejs #converse-roster dd a.decline-xmpp-request {
margin-left: 5px;
}
#conversejs #converse-roster dd a.remove-xmpp-contact {
#conversejs #converse-roster dd a.remove-xmpp-contact {
line-height: 21px;
float: right;
float: right;
width: 22px;
width: 22px;
margin: 0;
margin: 0;
...
@@ -1073,14 +1082,7 @@ dl.add-converse-contact {
...
@@ -1073,14 +1082,7 @@ dl.add-converse-contact {
}
}
#conversejs #converse-roster a.open-chat {
#conversejs #converse-roster a.open-chat {
line-height: 21px;
width: 80%;
width: 85%;
}
#conversejs #converse-roster dd:hover a.open-chat {
width: 70%;
}
#conversejs #converse-roster dd.pending-xmpp-contact:hover span {
width: 70%;
}
}
#conversejs .chatbox,
#conversejs .chatbox,
...
@@ -1427,7 +1429,7 @@ input.custom-xmpp-status {
...
@@ -1427,7 +1429,7 @@ input.custom-xmpp-status {
}
}
#conversejs .chatbox .dropdown dt a span {
#conversejs .chatbox .dropdown dt a span {
cursor:pointer;
cursor:
pointer;
display:block;
display:block;
padding: 4px 7px 0 5px;
padding: 4px 7px 0 5px;
color: rgb(79, 79, 79);
color: rgb(79, 79, 79);
...
...
mockup/index.html
View file @
a338ede0
...
@@ -143,14 +143,18 @@
...
@@ -143,14 +143,18 @@
<dt
id=
"xmpp-contact-requests"
style=
"display: block;"
>
Contact requests
</dt>
<dt
id=
"xmpp-contact-requests"
style=
"display: block;"
>
Contact requests
</dt>
<dd
class=
"offline requesting-xmpp-contact"
>
<dd
class=
"offline requesting-xmpp-contact"
>
<div>
Bob Skinstad
</div>
<span>
Bob Skinstad
</span>
<button
type=
"button"
class=
"accept-xmpp-request"
>
Accept
</button>
<span
class=
"request-actions"
>
<button
type=
"button"
class=
"decline-xmpp-request"
>
Decline
</button>
<a
class=
"accept-xmpp-request icon-checkmark"
title=
"Click here to accept this contact's request"
href=
"#"
></a>
<a
class=
"decline-xmpp-request icon-close"
title=
"Click here to decline this contact's request"
href=
"#"
></a>
</span>
</dd>
</dd>
<dd
class=
"offline requesting-xmpp-contact"
>
<dd
class=
"offline requesting-xmpp-contact"
>
<div>
André Vos
</div>
<span>
André Vos
</span>
<button
type=
"button"
class=
"accept-xmpp-request"
>
Accept
</button>
<span
class=
"request-actions"
>
<button
type=
"button"
class=
"decline-xmpp-request"
>
Decline
</button>
<a
class=
"accept-xmpp-request icon-checkmark"
title=
"Click here to accept this contact's request"
href=
"#"
></a>
<a
class=
"decline-xmpp-request icon-close"
title=
"Click here to decline this contact's request"
href=
"#"
></a>
</span>
</dd>
</dd>
<dt
id=
"pending-xmpp-contacts"
style=
"display: block;"
>
Pending contacts
</dt>
<dt
id=
"pending-xmpp-contacts"
style=
"display: block;"
>
Pending contacts
</dt>
...
...
src/templates/requesting_contact.html
View file @
a338ede0
<div>
{{fullname}}
</div>
<span>
{{fullname}}
</span>
<button
type=
"button"
class=
"accept-xmpp-request"
>
{{label_accept}}
</button>
<span
class=
"request-actions"
>
<button
type=
"button"
class=
"decline-xmpp-request"
>
{{label_decline}}
</button>
<a
class=
"accept-xmpp-request icon-checkmark"
title=
"{{desc_accept}}"
href=
"#"
></a>
<a
class=
"decline-xmpp-request icon-close"
title=
"{{desc_decline}}"
href=
"#"
></a>
</span>
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