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
b6af624b
Commit
b6af624b
authored
Feb 22, 2013
by
Alexandru Ghica
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code clean up
Cleaned up unnecessary spaces, replaced tabs with spaces and fixed line terminators.
parent
ffbacad9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
25 deletions
+25
-25
LICENSE_MIT.txt
LICENSE_MIT.txt
+1
-1
README.rst
README.rst
+2
-2
converse.js
converse.js
+13
-13
index.html
index.html
+1
-1
spec/RosterSpec.js
spec/RosterSpec.js
+2
-2
spec/StorageSpec.js
spec/StorageSpec.js
+4
-4
tests_main.js
tests_main.js
+2
-2
No files found.
LICENSE_MIT.txt
View file @
b6af624b
...
@@ -8,7 +8,7 @@ Permission is hereby granted, free of charge, to any person obtaining
...
@@ -8,7 +8,7 @@ Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
The above copyright notice and this permission notice shall be included
...
...
README.rst
View file @
b6af624b
...
@@ -12,7 +12,7 @@ Features
...
@@ -12,7 +12,7 @@ Features
It has the following features:
It has the following features:
* Manually or automically subscribe to other users.
* Manually or automically subscribe to other users.
* With manual roster subscriptions, you can accept or decline contact requests.
* With manual roster subscriptions, you can accept or decline contact requests.
* Chat statuses (online, busy, away, offline)
* Chat statuses (online, busy, away, offline)
* Custom status message
* Custom status message
...
@@ -20,7 +20,7 @@ It has the following features:
...
@@ -20,7 +20,7 @@ It has the following features:
* Third person messages (/me )
* Third person messages (/me )
* Multi-user chat in chatrooms
* Multi-user chat in chatrooms
* Topics can be set for chatrooms
* Topics can be set for chatrooms
* Full name and profile picture support
* Full name and profile picture support
Converse.js is used by collective.xmpp.chat_, which is a Plone_ instant
Converse.js is used by collective.xmpp.chat_, which is a Plone_ instant
messaging add-on.
messaging add-on.
...
...
converse.js
View file @
b6af624b
...
@@ -460,8 +460,8 @@
...
@@ -460,8 +460,8 @@
}
}
else
if
(
match
[
1
]
===
"
help
"
)
{
else
if
(
match
[
1
]
===
"
help
"
)
{
msgs
=
[
msgs
=
[
'
<strong>/help</strong>: Show this menu
'
,
'
<strong>/help</strong>: Show this menu
'
,
'
<strong>/clear</strong>: Remove messages
'
'
<strong>/clear</strong>: Remove messages
'
];
];
this
.
addHelpMessages
(
msgs
);
this
.
addHelpMessages
(
msgs
);
return
;
return
;
...
@@ -501,7 +501,7 @@
...
@@ -501,7 +501,7 @@
this
.
$el
.
data
(
'
composing
'
,
false
);
this
.
$el
.
data
(
'
composing
'
,
false
);
}
else
{
}
else
{
composing
=
this
.
$el
.
data
(
'
composing
'
);
composing
=
this
.
$el
.
data
(
'
composing
'
);
if
(
!
composing
)
{
if
(
!
composing
)
{
if
(
ev
.
keyCode
!=
47
)
{
if
(
ev
.
keyCode
!=
47
)
{
// We don't send composing messages if the message
// We don't send composing messages if the message
// starts with forward-slash.
// starts with forward-slash.
...
@@ -931,10 +931,10 @@
...
@@ -931,10 +931,10 @@
initialize
:
function
()
{
initialize
:
function
()
{
xmppchat
.
connection
.
muc
.
join
(
xmppchat
.
connection
.
muc
.
join
(
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
nick
'
),
this
.
model
.
get
(
'
nick
'
),
$
.
proxy
(
this
.
onChatRoomMessage
,
this
),
$
.
proxy
(
this
.
onChatRoomMessage
,
this
),
$
.
proxy
(
this
.
onChatRoomPresence
,
this
),
$
.
proxy
(
this
.
onChatRoomPresence
,
this
),
$
.
proxy
(
this
.
onChatRoomRoster
,
this
));
$
.
proxy
(
this
.
onChatRoomRoster
,
this
));
},
},
...
@@ -978,7 +978,7 @@
...
@@ -978,7 +978,7 @@
}
}
}
else
{
}
else
{
if
(
sender
===
this
.
model
.
get
(
'
nick
'
))
{
if
(
sender
===
this
.
model
.
get
(
'
nick
'
))
{
// Our own message which is already appended
// Our own message which is already appended
return
true
;
return
true
;
}
else
{
}
else
{
$chat_content
.
find
(
'
div.chat-event
'
).
remove
();
$chat_content
.
find
(
'
div.chat-event
'
).
remove
();
...
@@ -1292,7 +1292,7 @@
...
@@ -1292,7 +1292,7 @@
that
=
this
,
that
=
this
,
subscription
=
item
.
get
(
'
subscription
'
);
subscription
=
item
.
get
(
'
subscription
'
);
this
.
$el
.
addClass
(
item
.
get
(
'
presence_type
'
));
this
.
$el
.
addClass
(
item
.
get
(
'
presence_type
'
));
if
(
ask
===
'
subscribe
'
)
{
if
(
ask
===
'
subscribe
'
)
{
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
html
(
this
.
pending_template
(
item
.
toJSON
()));
this
.
$el
.
html
(
this
.
pending_template
(
item
.
toJSON
()));
...
@@ -1678,14 +1678,14 @@
...
@@ -1678,14 +1678,14 @@
store
.
set
(
xmppchat
.
connection
.
bare_jid
+
'
-xmpp-status
'
,
value
);
store
.
set
(
xmppchat
.
connection
.
bare_jid
+
'
-xmpp-status
'
,
value
);
},
},
getStatusMessage
:
function
()
{
return
store
.
get
(
xmppchat
.
connection
.
bare_jid
+
'
-xmpp-custom-status
'
);
},
setStatusMessage
:
function
(
status_message
)
{
setStatusMessage
:
function
(
status_message
)
{
xmppchat
.
connection
.
send
(
$pres
({
'
type
'
:
this
.
getStatus
()}).
c
(
'
status
'
).
t
(
status_message
));
xmppchat
.
connection
.
send
(
$pres
({
'
type
'
:
this
.
getStatus
()}).
c
(
'
status
'
).
t
(
status_message
));
this
.
set
({
'
status_message
'
:
status_message
});
this
.
set
({
'
status_message
'
:
status_message
});
store
.
set
(
xmppchat
.
connection
.
bare_jid
+
'
-xmpp-custom-status
'
,
status_message
);
store
.
set
(
xmppchat
.
connection
.
bare_jid
+
'
-xmpp-custom-status
'
,
status_message
);
},
getStatusMessage
:
function
()
{
return
store
.
get
(
xmppchat
.
connection
.
bare_jid
+
'
-xmpp-custom-status
'
);
}
}
});
});
...
...
index.html
View file @
b6af624b
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
</head>
</head>
<body>
<body>
<h1>
Converse.js Demo Page
</h1>
<h1>
Converse.js Demo Page
</h1>
Log in with your Jabber/XMPP ID and password.
Log in with your Jabber/XMPP ID and password.
<!-- login dialog -->
<!-- login dialog -->
<div
id=
'login_dialog'
class=
'hidden'
>
<div
id=
'login_dialog'
class=
'hidden'
>
<label>
Login ID:
</label>
<label>
Login ID:
</label>
...
...
spec/RosterSpec.js
View file @
b6af624b
...
@@ -192,11 +192,11 @@
...
@@ -192,11 +192,11 @@
for
(
i
=
10
;
i
<
15
;
i
++
)
{
for
(
i
=
10
;
i
<
15
;
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
// The next five are unavailable
for
(
i
=
15
;
i
<
20
;
i
++
)
{
for
(
i
=
15
;
i
<
20
;
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
// The next 20 are offline
for
(
i
=
20
;
i
<
40
;
i
++
)
{
for
(
i
=
20
;
i
<
40
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
offline
'
);
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
offline
'
);
}
}
...
...
spec/StorageSpec.js
View file @
b6af624b
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
'
chat2@localhost
'
]);
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
'
chat2@localhost
'
]);
this
.
storage
.
addOpenChat
(
'
chat3@localhost
'
);
this
.
storage
.
addOpenChat
(
'
chat3@localhost
'
);
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
'
chat2@localhost
'
,
'
chat2@localhost
'
,
'
chat3@localhost
'
]);
'
chat3@localhost
'
]);
});
});
...
@@ -47,12 +47,12 @@
...
@@ -47,12 +47,12 @@
this
.
storage
.
addOpenChat
(
'
chat1@localhost
'
);
this
.
storage
.
addOpenChat
(
'
chat1@localhost
'
);
this
.
storage
.
addOpenChat
(
'
chat2@localhost
'
);
this
.
storage
.
addOpenChat
(
'
chat2@localhost
'
);
this
.
storage
.
addOpenChat
(
'
chat3@localhost
'
);
this
.
storage
.
addOpenChat
(
'
chat3@localhost
'
);
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
'
chat2@localhost
'
,
'
chat2@localhost
'
,
'
chat3@localhost
'
]);
'
chat3@localhost
'
]);
this
.
storage
.
removeOpenChat
(
'
chat2@localhost
'
);
this
.
storage
.
removeOpenChat
(
'
chat2@localhost
'
);
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
expect
(
this
.
storage
.
getOpenChats
()).
toEqual
([
'
chat1@localhost
'
,
'
chat3@localhost
'
]);
'
chat3@localhost
'
]);
this
.
storage
.
removeOpenChat
(
'
chat1@localhost
'
);
this
.
storage
.
removeOpenChat
(
'
chat1@localhost
'
);
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
expect
(
msgs
.
length
).
toEqual
(
i
+
1
);
expect
(
msgs
.
length
).
toEqual
(
i
+
1
);
expect
(
msgs
[
i
]).
toEqual
(
jasmine
.
any
(
String
));
expect
(
msgs
[
i
]).
toEqual
(
jasmine
.
any
(
String
));
// First two space separated strings are ISO date and direction
// First two space separated strings are ISO date and direction
var
msg_arr
=
msgs
[
i
].
split
(
'
'
,
2
);
var
msg_arr
=
msgs
[
i
].
split
(
'
'
,
2
);
// Check that first string is ISO format
// Check that first string is ISO format
expect
(
msg_arr
[
0
]).
toMatch
(
iso_regex
);
expect
(
msg_arr
[
0
]).
toMatch
(
iso_regex
);
...
...
tests_main.js
View file @
b6af624b
require
([
"
jquery
"
,
require
([
"
jquery
"
,
"
spec/StorageSpec
"
,
"
spec/StorageSpec
"
,
"
spec/RosterSpec
"
],
function
(
$
)
{
"
spec/RosterSpec
"
],
function
(
$
)
{
$
(
function
(
$
)
{
$
(
function
(
$
)
{
...
...
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