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
59fc3182
Commit
59fc3182
authored
Sep 13, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The xa chat state wasn't being handled properly
parent
f6884d90
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
12 deletions
+32
-12
converse.js
converse.js
+3
-1
fonticons/style.css
fonticons/style.css
+2
-1
spec/MainSpec.js
spec/MainSpec.js
+27
-10
No files found.
converse.js
View file @
59fc3182
...
@@ -2264,6 +2264,7 @@
...
@@ -2264,6 +2264,7 @@
'
online
'
:
__
(
'
This contact is online
'
),
'
online
'
:
__
(
'
This contact is online
'
),
'
offline
'
:
__
(
'
This contact is offline
'
),
'
offline
'
:
__
(
'
This contact is offline
'
),
'
unavailable
'
:
__
(
'
This contact is unavailable
'
),
'
unavailable
'
:
__
(
'
This contact is unavailable
'
),
'
xa
'
:
__
(
'
This contact is away for an extended period
'
),
'
away
'
:
__
(
'
This contact is away
'
)
'
away
'
:
__
(
'
This contact is away
'
)
}[
item
.
get
(
'
chat_status
'
)
||
'
offline
'
];
}[
item
.
get
(
'
chat_status
'
)
||
'
offline
'
];
this
.
$el
.
html
(
this
.
template
(
this
.
$el
.
html
(
this
.
template
(
...
@@ -2650,7 +2651,7 @@
...
@@ -2650,7 +2651,7 @@
}
}
changed_presence
=
view
.
model
.
changed
.
chat_status
;
changed_presence
=
view
.
model
.
changed
.
chat_status
;
if
(
changed_presence
)
{
if
(
changed_presence
)
{
this
.
sortRoster
(
changed_presence
)
this
.
sortRoster
(
changed_presence
)
;
sorted
=
true
;
sorted
=
true
;
}
}
if
(
item
.
get
(
'
is_last
'
))
{
if
(
item
.
get
(
'
is_last
'
))
{
...
@@ -2689,6 +2690,7 @@
...
@@ -2689,6 +2690,7 @@
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.
'
+
chat_status
).
tsort
(
'
a
'
,
{
order
:
'
asc
'
});
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.
'
+
chat_status
).
tsort
(
'
a
'
,
{
order
:
'
asc
'
});
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.offline
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.offline
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.unavailable
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.unavailable
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.xa
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.away
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.away
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.dnd
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.dnd
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.online
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.online
'
));
...
...
fonticons/style.css
View file @
59fc3182
...
@@ -28,7 +28,7 @@ Instead of a list of all class selectors,
...
@@ -28,7 +28,7 @@ Instead of a list of all class selectors,
you can use the generic selector below, but it's slower:
you can use the generic selector below, but it's slower:
[class*="icon-"] {
[class*="icon-"] {
*/
*/
.icon-home
,
.icon-pencil
,
.icon-camera
,
.icon-camera-2
,
.icon-play
,
.icon-music
,
.icon-headphones
,
.icon-phone
,
.icon-phone-hang-up
,
.icon-address-book
,
.icon-notebook
,
.icon-envelop
,
.icon-pushpin
,
.icon-online
,
.icon-away
,
.icon-bubbles
,
.icon-bubbles-2
,
.icon-bubbles-3
,
.icon-user
,
.icon-users
,
.icon-quotes-left
,
.icon-spinner
,
.icon-search
,
.icon-cogs
,
.icon-wrench
,
.icon-unlocked
,
.icon-lock
,
.icon-lock-2
,
.icon-key
,
.icon-key-2
,
.icon-zoom-out
,
.icon-zoom-in
,
.icon-cog
,
.icon-remove
,
.icon-remove-2
,
.icon-eye
,
.icon-eye-blocked
,
.icon-attachment
,
.icon-globe
,
.icon-heart
,
.icon-happy
,
.icon-thumbs-up
,
.icon-smiley
,
.icon-tongue
,
.icon-sad
,
.icon-wink
,
.icon-wondering
,
.icon-confused
,
.icon-shocked
,
.icon-evil
,
.icon-angry
,
.icon-cool
,
.icon-grin
,
.icon-info
,
.icon-notification
,
.icon-warning
,
.icon-spell-check
,
.icon-volume-high
,
.icon-volume-medium
,
.icon-volume-low
,
.icon-volume-mute
,
.icon-volume-mute-2
,
.icon-volume-decrease
,
.icon-volume-increase
,
.icon-bold
,
.icon-underline
,
.icon-italic
,
.icon-strikethrough
,
.icon-new-tab
,
.icon-youtube
,
.icon-close
,
.icon-blocked
,
.icon-cancel-circle
,
.icon-minus
,
.icon-plus
,
.icon-checkbox-checked
,
.icon-checkbox-unchecked
,
.icon-checkbox-partial
,
.icon-radio-checked
,
.icon-radio-unchecked
,
.icon-room-info
,
.icon-newspaper
,
.icon-image
,
.icon-offline
,
.icon-unavailable
,
.icon-dnd
{
.icon-home
,
.icon-pencil
,
.icon-camera
,
.icon-camera-2
,
.icon-play
,
.icon-music
,
.icon-headphones
,
.icon-phone
,
.icon-phone-hang-up
,
.icon-address-book
,
.icon-notebook
,
.icon-envelop
,
.icon-pushpin
,
.icon-online
,
.icon-away
,
.icon-
xa
,
.icon-
bubbles
,
.icon-bubbles-2
,
.icon-bubbles-3
,
.icon-user
,
.icon-users
,
.icon-quotes-left
,
.icon-spinner
,
.icon-search
,
.icon-cogs
,
.icon-wrench
,
.icon-unlocked
,
.icon-lock
,
.icon-lock-2
,
.icon-key
,
.icon-key-2
,
.icon-zoom-out
,
.icon-zoom-in
,
.icon-cog
,
.icon-remove
,
.icon-remove-2
,
.icon-eye
,
.icon-eye-blocked
,
.icon-attachment
,
.icon-globe
,
.icon-heart
,
.icon-happy
,
.icon-thumbs-up
,
.icon-smiley
,
.icon-tongue
,
.icon-sad
,
.icon-wink
,
.icon-wondering
,
.icon-confused
,
.icon-shocked
,
.icon-evil
,
.icon-angry
,
.icon-cool
,
.icon-grin
,
.icon-info
,
.icon-notification
,
.icon-warning
,
.icon-spell-check
,
.icon-volume-high
,
.icon-volume-medium
,
.icon-volume-low
,
.icon-volume-mute
,
.icon-volume-mute-2
,
.icon-volume-decrease
,
.icon-volume-increase
,
.icon-bold
,
.icon-underline
,
.icon-italic
,
.icon-strikethrough
,
.icon-new-tab
,
.icon-youtube
,
.icon-close
,
.icon-blocked
,
.icon-cancel-circle
,
.icon-minus
,
.icon-plus
,
.icon-checkbox-checked
,
.icon-checkbox-unchecked
,
.icon-checkbox-partial
,
.icon-radio-checked
,
.icon-radio-unchecked
,
.icon-room-info
,
.icon-newspaper
,
.icon-image
,
.icon-offline
,
.icon-unavailable
,
.icon-dnd
{
font-family
:
'Converse-js'
;
font-family
:
'Converse-js'
;
speak
:
none
;
speak
:
none
;
font-style
:
normal
;
font-style
:
normal
;
...
@@ -287,6 +287,7 @@ you can use the generic selector below, but it's slower:
...
@@ -287,6 +287,7 @@ you can use the generic selector below, but it's slower:
.icon-image
:before
{
.icon-image
:before
{
content
:
"\2b14"
;
content
:
"\2b14"
;
}
}
.icon-xa
:before
,
.icon-unavailable
:before
,
.icon-unavailable
:before
,
.icon-offline
:before
{
.icon-offline
:before
{
content
:
"\e002"
;
content
:
"\e002"
;
...
...
spec/MainSpec.js
View file @
59fc3182
...
@@ -17,7 +17,8 @@
...
@@ -17,7 +17,8 @@
var
cur_names
=
[
var
cur_names
=
[
'
Max Frankfurter
'
,
'
Candice van der Knijff
'
,
'
Irini Vlastuin
'
,
'
Rinse Sommer
'
,
'
Annegreet Gomez
'
,
'
Max Frankfurter
'
,
'
Candice van der Knijff
'
,
'
Irini Vlastuin
'
,
'
Rinse Sommer
'
,
'
Annegreet Gomez
'
,
'
Robin Schook
'
,
'
Marcel Eberhardt
'
,
'
Simone Brauer
'
,
'
Asmaa Haakman
'
,
'
Felix Amsel
'
,
'
Robin Schook
'
,
'
Marcel Eberhardt
'
,
'
Simone Brauer
'
,
'
Asmaa Haakman
'
,
'
Felix Amsel
'
,
'
Lena Grunewald
'
,
'
Laura Grunewald
'
,
'
Mandy Seiler
'
,
'
Sven Bosch
'
,
'
Nuriye Cuypers
'
'
Lena Grunewald
'
,
'
Laura Grunewald
'
,
'
Mandy Seiler
'
,
'
Sven Bosch
'
,
'
Nuriye Cuypers
'
,
'
Staal Burger
'
,
'
Brenner Brand
'
,
'
Vleis Visagie
'
];
];
var
num_contacts
=
req_names
.
length
+
pend_names
.
length
+
cur_names
.
length
;
var
num_contacts
=
req_names
.
length
+
pend_names
.
length
+
cur_names
.
length
;
var
open_controlbox
;
var
open_controlbox
;
...
@@ -280,10 +281,28 @@
...
@@ -280,10 +281,28 @@
}
}
},
converse
));
},
converse
));
it
(
"
can change their status to
unavailable
and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
it
(
"
can change their status to
xa
and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
,
t
;
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
9
;
i
<
12
;
i
++
)
{
for
(
i
=
9
;
i
<
12
;
i
++
)
{
jid
=
cur_names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
view
=
this
.
rosterview
.
rosteritemviews
[
jid
];
spyOn
(
view
,
'
render
'
).
andCallThrough
();
item
=
view
.
model
;
item
.
set
(
'
chat_status
'
,
'
xa
'
);
expect
(
view
.
render
).
toHaveBeenCalled
();
expect
(
this
.
rosterview
.
render
).
toHaveBeenCalled
();
// Check that they are sorted alphabetically
t
=
this
.
rosterview
.
$el
.
find
(
'
dt#xmpp-contacts
'
).
siblings
(
'
dd.current-xmpp-contact.xa
'
).
find
(
'
a.open-chat
'
).
text
();
expect
(
t
).
toEqual
(
cur_names
.
slice
(
9
,
i
+
1
).
sort
().
join
(
''
));
}
},
converse
));
it
(
"
can change their status to unavailable and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
12
;
i
<
15
;
i
++
)
{
jid
=
cur_names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
jid
=
cur_names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
view
=
this
.
rosterview
.
rosteritemviews
[
jid
];
view
=
this
.
rosterview
.
rosteritemviews
[
jid
];
spyOn
(
view
,
'
render
'
).
andCallThrough
();
spyOn
(
view
,
'
render
'
).
andCallThrough
();
...
@@ -294,31 +313,29 @@
...
@@ -294,31 +313,29 @@
// Check that they are sorted alphabetically
// Check that they are sorted alphabetically
t
=
this
.
rosterview
.
$el
.
find
(
'
dt#xmpp-contacts
'
).
siblings
(
'
dd.current-xmpp-contact.unavailable
'
).
find
(
'
a.open-chat
'
).
text
();
t
=
this
.
rosterview
.
$el
.
find
(
'
dt#xmpp-contacts
'
).
siblings
(
'
dd.current-xmpp-contact.unavailable
'
).
find
(
'
a.open-chat
'
).
text
();
expect
(
t
).
toEqual
(
cur_names
.
slice
(
9
,
i
+
1
).
sort
().
join
(
''
));
expect
(
t
).
toEqual
(
cur_names
.
slice
(
12
,
i
+
1
).
sort
().
join
(
''
));
}
}
},
converse
));
},
converse
));
it
(
"
are ordered according to status: online, busy, away, unavailable, offline
"
,
$
.
proxy
(
function
()
{
it
(
"
are ordered according to status: online, busy, away,
xa,
unavailable, offline
"
,
$
.
proxy
(
function
()
{
var
contacts
=
this
.
rosterview
.
$el
.
find
(
'
dd.current-xmpp-contact
'
);
var
contacts
=
this
.
rosterview
.
$el
.
find
(
'
dd.current-xmpp-contact
'
);
var
i
;
var
i
;
// The first five contacts are online.
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
online
'
);
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
online
'
);
}
}
// The next five are busy
for
(
i
=
3
;
i
<
6
;
i
++
)
{
for
(
i
=
3
;
i
<
6
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
dnd
'
);
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
dnd
'
);
}
}
// The next five are away
for
(
i
=
6
;
i
<
9
;
i
++
)
{
for
(
i
=
6
;
i
<
9
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
away
'
);
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
away
'
);
}
}
// The next five are unavailable
for
(
i
=
9
;
i
<
12
;
i
++
)
{
for
(
i
=
9
;
i
<
12
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
xa
'
);
}
for
(
i
=
12
;
i
<
15
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
unavailable
'
);
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
unavailable
'
);
}
}
// The next 20 are offline
for
(
i
=
15
;
i
<
cur_names
.
length
;
i
++
)
{
for
(
i
=
12
;
i
<
cur_names
.
length
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
offline
'
);
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
offline
'
);
}
}
},
converse
));
},
converse
));
...
...
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