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
3dfcd3c0
Commit
3dfcd3c0
authored
Sep 26, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old classes before adding new ones. Updates #38
parent
b36e6bbc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
converse.js
converse.js
+23
-15
No files found.
converse.js
View file @
3dfcd3c0
...
...
@@ -1865,6 +1865,28 @@
var
item
=
this
.
model
,
ask
=
item
.
get
(
'
ask
'
),
subscription
=
item
.
get
(
'
subscription
'
);
var
statuses
=
{
'
dnd
'
:
__
(
'
This contact is busy
'
),
'
online
'
:
__
(
'
This contact is online
'
),
'
offline
'
:
__
(
'
This contact is offline
'
),
'
unavailable
'
:
__
(
'
This contact is unavailable
'
),
'
xa
'
:
__
(
'
This contact is away for an extended period
'
),
'
away
'
:
__
(
'
This contact is away
'
)
}
var
classes_to_remove
=
[
'
current-xmpp-contact
'
,
'
pending-xmpp-contact
'
,
'
requesting-xmpp-contact
'
].
concat
(
_
.
keys
(
statuses
));
_
.
each
(
classes_to_remove
,
function
(
cls
)
{
if
(
this
.
el
.
className
.
indexOf
(
cls
)
!==
-
1
)
{
this
.
$el
.
removeClass
(
cls
);
}
},
this
);
this
.
$el
.
addClass
(
item
.
get
(
'
chat_status
'
));
if
(
ask
===
'
subscribe
'
)
{
...
...
@@ -1875,23 +1897,9 @@
this
.
$el
.
html
(
this
.
request_template
(
item
.
toJSON
()));
converse
.
showControlBox
();
}
else
if
(
subscription
===
'
both
'
||
subscription
===
'
to
'
)
{
_
.
each
([
'
pending-xmpp-contact
'
,
'
requesting-xmpp-contact
'
],
function
(
cls
)
{
if
(
this
.
el
.
className
.
indexOf
(
cls
)
!==
-
1
)
{
this
.
$el
.
removeClass
(
cls
);
}
},
this
);
this
.
$el
.
addClass
(
'
current-xmpp-contact
'
);
var
status_desc
=
{
'
dnd
'
:
__
(
'
This contact is busy
'
),
'
online
'
:
__
(
'
This contact is online
'
),
'
offline
'
:
__
(
'
This contact is offline
'
),
'
unavailable
'
:
__
(
'
This contact is unavailable
'
),
'
xa
'
:
__
(
'
This contact is away for an extended period
'
),
'
away
'
:
__
(
'
This contact is away
'
)
}[
item
.
get
(
'
chat_status
'
)
||
'
offline
'
];
this
.
$el
.
html
(
this
.
template
(
_
.
extend
(
item
.
toJSON
(),
{
'
status_desc
'
:
status
_desc
})
_
.
extend
(
item
.
toJSON
(),
{
'
status_desc
'
:
status
es
[
item
.
get
(
'
chat_status
'
)
||
'
offline
'
]
})
));
}
return
this
;
...
...
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