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
4b48e8ac
Commit
4b48e8ac
authored
Aug 05, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into gh-pages
parents
c62a4ae5
2d4a14ac
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
155 additions
and
128 deletions
+155
-128
CHANGES.rst
CHANGES.rst
+5
-0
converse.js
converse.js
+14
-6
converse.min.js
converse.min.js
+1
-1
index.html
index.html
+3
-3
spec/ChatRoomSpec.js
spec/ChatRoomSpec.js
+3
-4
spec/MainSpec.js
spec/MainSpec.js
+5
-6
test_minified.html
test_minified.html
+84
-76
tests_main.js
tests_main.js
+40
-32
No files found.
CHANGES.rst
View file @
4b48e8ac
Changelog
Changelog
=========
=========
0.5.2 (Unreleased)
------------------
- Important security update. Don't expose the Strophe connection object globally. [jcbrand]
0.5.1 (2013-08-04)
0.5.1 (2013-08-04)
------------------
------------------
...
...
converse.js
View file @
4b48e8ac
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
var
converse
=
{};
var
converse
=
{};
converse
.
initialize
=
function
(
settings
)
{
converse
.
initialize
=
function
(
settings
)
{
// Default values
// Default values
var
converse
=
this
;
this
.
animate
=
true
;
this
.
animate
=
true
;
this
.
auto_list_rooms
=
false
;
this
.
auto_list_rooms
=
false
;
this
.
auto_subscribe
=
false
;
this
.
auto_subscribe
=
false
;
...
@@ -54,15 +55,14 @@
...
@@ -54,15 +55,14 @@
this
.
xhr_user_search
=
false
;
this
.
xhr_user_search
=
false
;
_
.
extend
(
this
,
settings
);
_
.
extend
(
this
,
settings
);
var
__
=
$
.
proxy
(
function
(
str
)
{
var
__
=
function
(
str
)
{
var
t
=
this
.
i18n
.
translate
(
str
);
var
t
=
converse
.
i18n
.
translate
(
str
);
if
(
arguments
.
length
>
1
)
{
if
(
arguments
.
length
>
1
)
{
return
t
.
fetch
.
apply
(
t
,
[].
slice
.
call
(
arguments
,
1
));
return
t
.
fetch
.
apply
(
t
,
[].
slice
.
call
(
arguments
,
1
));
}
else
{
}
else
{
return
t
.
fetch
();
return
t
.
fetch
();
}
}
};
}
,
this
)
;
this
.
msg_counter
=
0
;
this
.
msg_counter
=
0
;
this
.
autoLink
=
function
(
text
)
{
this
.
autoLink
=
function
(
text
)
{
// Convert URLs into hyperlinks
// Convert URLs into hyperlinks
...
@@ -2646,7 +2646,7 @@
...
@@ -2646,7 +2646,7 @@
},
this
));
},
this
));
this
.
giveFeedback
(
__
(
'
Online Contacts
'
));
this
.
giveFeedback
(
__
(
'
Online Contacts
'
));
if
(
callback
)
{
if
(
callback
)
{
callback
();
callback
(
this
);
}
}
},
this
));
},
this
));
};
};
...
@@ -2664,5 +2664,13 @@
...
@@ -2664,5 +2664,13 @@
this
.
toggleControlBox
();
this
.
toggleControlBox
();
}
}
};
};
return
converse
;
return
{
'
initialize
'
:
function
(
settings
)
{
converse
.
initialize
(
settings
);
},
'
onConnected
'
:
function
(
connection
,
callback
)
{
// onConnected can only be called after initialize has been called.
converse
.
onConnected
(
connection
,
callback
);
}
};
}));
}));
converse.min.js
View file @
4b48e8ac
This source diff could not be displayed because it is too large. You can
view the blob
instead.
index.html
View file @
4b48e8ac
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
<h1
id=
"project_title"
><a
href=
"http://conversejs.org"
>
Converse.js
</a></h1>
<h1
id=
"project_title"
><a
href=
"http://conversejs.org"
>
Converse.js
</a></h1>
<h2
id=
"project_tagline"
>
An XMPP chat client for your website
</h2>
<h2
id=
"project_tagline"
>
An XMPP chat client for your website
</h2>
<section
id=
"downloads"
>
<section
id=
"downloads"
>
<a
class=
"zip_download_link"
href=
"https://github.com/jcbrand/converse.js/archive/v0.5.
1
.zip"
>
Download the latest release as a .zip file
</a>
<a
class=
"zip_download_link"
href=
"https://github.com/jcbrand/converse.js/archive/v0.5.
2
.zip"
>
Download the latest release as a .zip file
</a>
<a
class=
"tar_download_link"
href=
"https://github.com/jcbrand/converse.js/archive/v0.5.
1
.tar.gz"
>
Download the latest release as a tar.gz file
</a>
<a
class=
"tar_download_link"
href=
"https://github.com/jcbrand/converse.js/archive/v0.5.
2
.tar.gz"
>
Download the latest release as a tar.gz file
</a>
</section>
</section>
</header>
</header>
</div>
</div>
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<div
id=
"main_content_wrap"
class=
"outer"
>
<div
id=
"main_content_wrap"
class=
"outer"
>
<section
id=
"main_content"
class=
"inner"
>
<section
id=
"main_content"
class=
"inner"
>
<p><strong>
Converse.js
</strong>
is an open source
,
webchat client, that
<p><strong>
Converse.js
</strong>
is an open source webchat client, that
runs in the browser and can be integrated into any website.
</p>
runs in the browser and can be integrated into any website.
</p>
<p>
It's similar to
<a
href=
"https://www.facebook.com/sitetour/chat.php"
target=
"_blank"
>
Facebook chat
</a>
, but also supports multi-user chatrooms.
</p>
<p>
It's similar to
<a
href=
"https://www.facebook.com/sitetour/chat.php"
target=
"_blank"
>
Facebook chat
</a>
, but also supports multi-user chatrooms.
</p>
...
...
spec/ChatRoomSpec.js
View file @
4b48e8ac
(
function
(
root
,
factory
)
{
(
function
(
root
,
factory
)
{
define
([
define
([
"
converse
"
,
"
mock
"
"
mock
"
],
function
(
converse
,
mock_connection
)
{
],
function
(
mock_connection
)
{
return
factory
(
converse
,
mock_connection
);
return
factory
(
mock_connection
);
}
}
);
);
}
(
this
,
function
(
converse
,
mock_connection
)
{
}
(
this
,
function
(
mock_connection
)
{
return
describe
(
"
ChatRooms
"
,
$
.
proxy
(
function
()
{
return
describe
(
"
ChatRooms
"
,
$
.
proxy
(
function
()
{
var
chatroom_names
=
[
var
chatroom_names
=
[
'
Dyon van de Wege
'
,
'
Thomas Kalb
'
,
'
Dirk Theissen
'
,
'
Felix Hofmann
'
,
'
Ka Lek
'
,
'
Anne Ebersbacher
'
'
Dyon van de Wege
'
,
'
Thomas Kalb
'
,
'
Dirk Theissen
'
,
'
Felix Hofmann
'
,
'
Ka Lek
'
,
'
Anne Ebersbacher
'
...
...
spec/MainSpec.js
View file @
4b48e8ac
(
function
(
root
,
factory
)
{
(
function
(
root
,
factory
)
{
define
([
define
([
"
converse
"
,
"
mock
"
"
mock
"
],
function
(
converse
,
mock_connection
)
{
],
function
(
mock_connection
)
{
return
factory
(
converse
,
mock_connection
);
return
factory
(
mock_connection
);
}
}
);
);
}
(
this
,
function
(
converse
,
mock_connection
)
{
}
(
this
,
function
(
mock_connection
)
{
return
describe
(
"
Converse.js
"
,
$
.
proxy
(
function
()
{
return
describe
(
"
Converse.js
"
,
function
()
{
// Names from http://www.fakenamegenerator.com/
// Names from http://www.fakenamegenerator.com/
var
req_names
=
[
var
req_names
=
[
'
Louw Spekman
'
,
'
Mohamad Stet
'
,
'
Dominik Beyer
'
'
Louw Spekman
'
,
'
Mohamad Stet
'
,
'
Dominik Beyer
'
...
@@ -651,5 +650,5 @@
...
@@ -651,5 +650,5 @@
},
converse
));
},
converse
));
},
converse
));
},
converse
));
},
converse
));
},
converse
));
}
,
converse
)
);
});
}));
}));
test_minified.html
View file @
4b48e8ac
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
<link
rel=
"shortcut icon"
type=
"image/png"
href=
"components/jasmine/images/jasmine_favicon.png"
>
<link
rel=
"shortcut icon"
type=
"image/png"
href=
"components/jasmine/images/jasmine_favicon.png"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"components/jasmine/src/html/jasmine.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"components/jasmine/src/html/jasmine.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"stylesheets/stylesheet.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"stylesheets/stylesheet.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"converse
-0.5.0
.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"converse.min.css"
>
<script
src=
"converse
-0.5.0
.min.js"
></script>
<script
src=
"converse.min.js"
></script>
<script
src=
"components/jasmine/lib/jasmine-core/jasmine.js"
></script>
<script
src=
"components/jasmine/lib/jasmine-core/jasmine.js"
></script>
<script
src=
"components/jasmine/lib/jasmine-core/jasmine-html.js"
></script>
<script
src=
"components/jasmine/lib/jasmine-core/jasmine-html.js"
></script>
<script
src=
"node_modules/jasmine-reporters/src/jasmine.console_reporter.js"
></script>
<script
src=
"node_modules/jasmine-reporters/src/jasmine.console_reporter.js"
></script>
...
@@ -33,83 +33,91 @@
...
@@ -33,83 +33,91 @@
</div>
</div>
<script>
<script>
require
([
var
mock_connection
=
{
'
converse
'
,
'
muc
'
:
{
"
spec/MainSpec
"
,
'
listRooms
'
:
function
()
{},
"
spec/ChatRoomSpec
"
],
'
join
'
:
function
()
{},
function
(
converse
)
{
'
leave
'
:
function
()
{},
var
mock_connection
=
{
'
removeRoom
'
:
function
()
{},
'
muc
'
:
{
'
rooms
'
:
{}
'
listRooms
'
:
function
()
{},
},
'
join
'
:
function
()
{},
'
jid
'
:
'
dummy@localhost
'
,
'
leave
'
:
function
()
{},
'
addHandler
'
:
function
(
handler
,
ns
,
name
,
type
,
id
,
from
,
options
)
{
'
removeRoom
'
:
function
()
{},
return
function
()
{};
'
rooms
'
:
{}
},
},
'
send
'
:
function
()
{},
'
jid
'
:
'
dummy@localhost
'
,
'
roster
'
:
{
'
addHandler
'
:
function
(
handler
,
ns
,
name
,
type
,
id
,
from
,
options
)
{
'
add
'
:
function
()
{},
return
function
()
{};
'
authorize
'
:
function
()
{},
},
'
unauthorize
'
:
function
()
{},
'
send
'
:
function
()
{},
'
get
'
:
function
()
{},
'
roster
'
:
{
'
subscribe
'
:
function
()
{},
'
add
'
:
function
()
{},
'
registerCallback
'
:
function
()
{}
'
authorize
'
:
function
()
{},
},
'
unauthorize
'
:
function
()
{},
'
vcard
'
:
{
'
get
'
:
function
()
{},
'
get
'
:
function
(
callback
,
jid
)
{
'
subscribe
'
:
function
()
{},
var
firstname
,
lastname
;
'
registerCallback
'
:
function
()
{}
if
(
!
jid
)
{
},
jid
=
'
dummy@localhost
'
;
'
vcard
'
:
{
firstname
=
'
Max
'
;
'
get
'
:
function
(
callback
,
jid
)
{
lastname
=
'
Mustermann
'
;
var
firstname
,
lastname
;
}
else
{
if
(
!
jid
)
{
var
name
=
jid
.
split
(
'
@
'
)[
0
].
replace
(
'
.
'
,
'
'
).
split
(
'
'
);
jid
=
'
dummy@localhost
'
;
firstname
=
name
[
0
].
charAt
(
0
).
toUpperCase
()
+
name
[
0
].
slice
(
1
);
firstname
=
'
Max
'
;
lastname
=
name
[
1
].
charAt
(
0
).
toUpperCase
()
+
name
[
1
].
slice
(
1
);
lastname
=
'
Mustermann
'
;
}
else
{
var
name
=
jid
.
split
(
'
@
'
)[
0
].
replace
(
'
.
'
,
'
'
).
split
(
'
'
);
firstname
=
name
[
0
].
charAt
(
0
).
toUpperCase
()
+
name
[
0
].
slice
(
1
);
lastname
=
name
[
1
].
charAt
(
0
).
toUpperCase
()
+
name
[
1
].
slice
(
1
);
}
var
fullname
=
firstname
+
'
'
+
lastname
;
var
vcard
=
$iq
().
c
(
'
vCard
'
).
c
(
'
FN
'
).
t
(
fullname
);
callback
(
vcard
.
tree
());
}
}
},
var
fullname
=
firstname
+
'
'
+
lastname
;
'
disco
'
:
{
var
vcard
=
$iq
().
c
(
'
vCard
'
).
c
(
'
FN
'
).
t
(
fullname
);
'
info
'
:
function
()
{},
callback
(
vcard
.
tree
());
'
items
'
:
function
()
{}
}
}
};
},
'
disco
'
:
{
// Set up converse.js
'
info
'
:
function
()
{},
window
.
localStorage
.
clear
();
'
items
'
:
function
()
{}
converse
.
initialize
({
}
prebind
:
false
,
};
xhr_user_search
:
false
,
require
([
auto_subscribe
:
false
,
"
jquery
"
,
animate
:
false
"
converse
"
,
});
],
function
(
$
,
converse
)
{
converse
.
onConnected
(
mock_connection
);
// Set up converse.js
window
.
localStorage
.
clear
();
// Jasmine stuff
converse
.
initialize
({
var
jasmineEnv
=
jasmine
.
getEnv
();
prebind
:
false
,
if
(
/PhantomJS/
.
test
(
navigator
.
userAgent
))
{
xhr_user_search
:
false
,
jasmineEnv
.
addReporter
(
new
jasmine
.
TrivialReporter
());
auto_subscribe
:
false
,
jasmineEnv
.
addReporter
(
new
jasmine
.
JUnitXmlReporter
(
'
./test-reports/
'
));
animate
:
false
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
});
jasmineEnv
.
updateInterval
=
0
;
converse
.
onConnected
(
}
else
{
mock_connection
,
var
htmlReporter
=
new
jasmine
.
HtmlReporter
();
function
(
converse
)
{
jasmineEnv
.
addReporter
(
htmlReporter
);
window
.
converse
=
converse
;
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
require
([
jasmineEnv
.
specFilter
=
function
(
spec
)
{
"
spec/MainSpec
"
,
return
htmlReporter
.
specFilter
(
spec
);
"
spec/ChatRoomSpec
"
};
],
function
()
{
jasmineEnv
.
updateInterval
=
200
;
// Jasmine stuff
var
jasmineEnv
=
jasmine
.
getEnv
();
if
(
/PhantomJS/
.
test
(
navigator
.
userAgent
))
{
jasmineEnv
.
addReporter
(
new
jasmine
.
TrivialReporter
());
jasmineEnv
.
addReporter
(
new
jasmine
.
JUnitXmlReporter
(
'
./test-reports/
'
));
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
jasmineEnv
.
updateInterval
=
0
;
}
else
{
var
htmlReporter
=
new
jasmine
.
HtmlReporter
();
jasmineEnv
.
addReporter
(
htmlReporter
);
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
jasmineEnv
.
specFilter
=
function
(
spec
)
{
return
htmlReporter
.
specFilter
(
spec
);
};
jasmineEnv
.
updateInterval
=
200
;
}
jasmineEnv
.
execute
();
});
}
);
}
}
jasmineEnv
.
execute
();
);
});
</script>
</script>
</body>
</body>
</html>
</html>
tests_main.js
View file @
4b48e8ac
...
@@ -60,37 +60,45 @@ require([
...
@@ -60,37 +60,45 @@ require([
"
jquery
"
,
"
jquery
"
,
"
converse
"
,
"
converse
"
,
"
mock
"
,
"
mock
"
,
"
jasmine-html
"
,
"
jasmine-html
"
"
jasmine-console-reporter
"
,
"
jasmine-junit-reporter
"
,
"
spec/MainSpec
"
,
"
spec/ChatRoomSpec
"
],
function
(
$
,
converse
,
mock_connection
,
jasmine
)
{
],
function
(
$
,
converse
,
mock_connection
,
jasmine
)
{
// Set up converse.js
// Set up converse.js
window
.
localStorage
.
clear
();
window
.
localStorage
.
clear
();
converse
.
initialize
({
converse
.
initialize
({
prebind
:
false
,
prebind
:
false
,
xhr_user_search
:
false
,
xhr_user_search
:
false
,
auto_subscribe
:
false
,
auto_subscribe
:
false
,
animate
:
false
animate
:
false
});
});
converse
.
onConnected
(
mock_connection
,
// Jasmine stuff
function
(
converse
)
{
var
jasmineEnv
=
jasmine
.
getEnv
();
window
.
converse
=
converse
;
if
(
/PhantomJS/
.
test
(
navigator
.
userAgent
))
{
require
([
jasmineEnv
.
addReporter
(
new
jasmine
.
TrivialReporter
());
"
jasmine-console-reporter
"
,
jasmineEnv
.
addReporter
(
new
jasmine
.
JUnitXmlReporter
(
'
./test-reports/
'
));
"
jasmine-junit-reporter
"
,
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
"
spec/MainSpec
"
,
jasmineEnv
.
updateInterval
=
0
;
"
spec/ChatRoomSpec
"
}
else
{
],
function
()
{
var
htmlReporter
=
new
jasmine
.
HtmlReporter
();
// Jasmine stuff
jasmineEnv
.
addReporter
(
htmlReporter
);
var
jasmineEnv
=
jasmine
.
getEnv
();
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
if
(
/PhantomJS/
.
test
(
navigator
.
userAgent
))
{
jasmineEnv
.
specFilter
=
function
(
spec
)
{
jasmineEnv
.
addReporter
(
new
jasmine
.
TrivialReporter
());
return
htmlReporter
.
specFilter
(
spec
);
jasmineEnv
.
addReporter
(
new
jasmine
.
JUnitXmlReporter
(
'
./test-reports/
'
));
};
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
jasmineEnv
.
updateInterval
=
200
;
jasmineEnv
.
updateInterval
=
0
;
}
else
{
var
htmlReporter
=
new
jasmine
.
HtmlReporter
();
jasmineEnv
.
addReporter
(
htmlReporter
);
jasmineEnv
.
addReporter
(
new
jasmine
.
ConsoleReporter
());
jasmineEnv
.
specFilter
=
function
(
spec
)
{
return
htmlReporter
.
specFilter
(
spec
);
};
jasmineEnv
.
updateInterval
=
200
;
}
jasmineEnv
.
execute
();
});
}
);
}
}
converse
.
onConnected
(
mock_connection
,
$
.
proxy
(
jasmineEnv
.
execute
,
jasmineEnv
));
);
});
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