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
c7abf543
Commit
c7abf543
authored
Oct 15, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'private-jquery' of github.com:jcbrand/converse.js into private-jquery
parents
bfc747b4
5b17becf
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
566 additions
and
401 deletions
+566
-401
bower.json
bower.json
+2
-3
converse.js
converse.js
+126
-100
docs/CHANGES.rst
docs/CHANGES.rst
+1
-0
docs/source/index.rst
docs/source/index.rst
+335
-280
main.js
main.js
+2
-2
spec/converse.js
spec/converse.js
+37
-4
src/deps-full.js
src/deps-full.js
+4
-3
src/deps-no-otr.js
src/deps-no-otr.js
+4
-3
src/deps-website-no-otr.js
src/deps-website-no-otr.js
+4
-3
src/deps-website.js
src/deps-website.js
+4
-3
src/utils.js
src/utils.js
+47
-0
No files found.
bower.json
View file @
c7abf543
...
...
@@ -17,9 +17,7 @@
"backbone.overview"
:
"*"
,
"strophe"
:
"~1.1.3"
,
"strophe.roster"
:
"https://raw.github.com/strophe/strophejs-plugins/b1f364eb6e854ffe844c57add38e885cfeb9b498/roster/strophe.roster.js"
,
"strophe.vcard"
:
"https://raw.github.com/strophe/strophejs-plugins/f5c9e16b463610d501591452cded0359f53aae48/vcard/strophe.vcard.js"
,
"strophe.disco"
:
"https://raw.github.com/jcbrand/strophejs-plugins/75c8693992bc357c699b6d615eeb396e799f5c02/disco/strophe.disco.js"
,
"strophe.muc"
:
"https://raw.githubusercontent.com/strophe/strophejs-plugins/8056cbca4dcd69700c44e1e3341a9ce387a6af0c/muc/strophe.muc.js"
,
"strophe.muc"
:
"https://raw.githubusercontent.com/strophe/strophejs-plugins/master/muc/strophe.muc.js"
,
"otr"
:
"0.2.12"
,
"crypto-js-evanvosberg"
:
"~3.1.2"
,
"almond"
:
"~0.2.9"
,
...
...
@@ -32,6 +30,7 @@
"bootstrapJS"
:
"https://raw.githubusercontent.com/jcbrand/bootstrap/7d96a5f60d26c67b5348b270a775518b96a702c8/dist/js/bootstrap.js"
,
"fontawesome"
:
"~4.1.0"
,
"typeahead.js"
:
"https://raw.githubusercontent.com/jcbrand/typeahead.js/eedfb10505dd3a20123d1fafc07c1352d83f0ab3/dist/typeahead.jquery.js"
"strophejs-plugins"
:
"~0.0.4"
},
"exportsOverride"
:
{}
}
converse.js
View file @
c7abf543
This diff is collapsed.
Click to expand it.
docs/CHANGES.rst
View file @
c7abf543
...
...
@@ -8,6 +8,7 @@ Changelog
* Bugfix. Cannot read property "top" of undefined. [jcbrand]
* Add new event, noResumeableSession, for when keepalive=true and there aren't
any prebind session tokens. [jcbrand]
* Add 2 new API methods, getChatBox and openChatBox. [jcbrand]
0.8.3 (2014-09-22)
------------------
...
...
docs/source/index.rst
View file @
c7abf543
This diff is collapsed.
Click to expand it.
main.js
View file @
c7abf543
...
...
@@ -15,10 +15,10 @@ config = {
"
jquery.easing
"
:
"
components/jquery-easing-original/index
"
,
// XXX: Only required for https://conversejs.org website
"
moment
"
:
"
components/momentjs/moment
"
,
"
strophe
"
:
"
components/strophe/strophe
"
,
"
strophe.disco
"
:
"
components/strophe
.disco/index
"
,
"
strophe.disco
"
:
"
components/strophe
js-plugins/disco/strophe.disco
"
,
"
strophe.muc
"
:
"
components/strophe.muc/index
"
,
"
strophe.roster
"
:
"
components/strophe.roster/index
"
,
"
strophe.vcard
"
:
"
components/strophe
.vcard/index
"
,
"
strophe.vcard
"
:
"
components/strophe
js-plugins/vcard/strophe.vcard
"
,
"
text
"
:
'
components/requirejs-text/text
'
,
"
tpl
"
:
'
components/requirejs-tpl-jcbrand/tpl
'
,
"
typeahead
"
:
"
components/typeahead.js/index
"
,
...
...
spec/converse.js
View file @
c7abf543
...
...
@@ -10,8 +10,10 @@
return
describe
(
"
Converse
"
,
$
.
proxy
(
function
(
mock
,
test_utils
)
{
beforeEach
(
$
.
proxy
(
function
()
{
window
.
localStorage
.
clear
();
window
.
sessionStorage
.
clear
();
test_utils
.
closeAllChatBoxes
();
test_utils
.
clearBrowserStorage
();
converse
.
rosterview
.
model
.
reset
();
test_utils
.
createContacts
(
'
current
'
);
},
converse
));
it
(
"
has an API method for retrieving the next RID
"
,
$
.
proxy
(
function
()
{
...
...
@@ -46,12 +48,43 @@
it
(
"
has an API method for retrieving a buddy's attributes
"
,
$
.
proxy
(
function
()
{
var
jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
expect
(
converse_api
.
getBuddy
(
jid
)).
toBeFalsy
();
test_utils
.
createContacts
(
'
current
'
);
expect
(
converse_api
.
getBuddy
(
'
non-existing@jabber.org
'
)).
toBeFalsy
();
var
attrs
=
converse_api
.
getBuddy
(
jid
);
expect
(
typeof
attrs
).
toBe
(
'
object
'
);
expect
(
attrs
.
fullname
).
toBe
(
mock
.
cur_names
[
0
]);
expect
(
attrs
.
jid
).
toBe
(
jid
);
},
converse
));
it
(
"
has an API method, openChatBox, for opening a chat box for a buddy
"
,
$
.
proxy
(
function
()
{
expect
(
converse_api
.
openChatBox
(
'
non-existing@jabber.org
'
)).
toBeFalsy
();
// test on user that doesn't exist.
var
jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
var
box
=
converse_api
.
openChatBox
(
jid
);
expect
(
box
instanceof
Object
).
toBeTruthy
();
expect
(
box
.
get
(
'
box_id
'
)).
toBe
(
b64_sha1
(
jid
));
var
chatboxview
=
this
.
chatboxviews
.
get
(
jid
);
expect
(
chatboxview
.
$el
.
is
(
'
:visible
'
)).
toBeTruthy
();
},
converse
));
it
(
"
will focus an already open chat box, if the openChatBox API method is called for it.
"
,
$
.
proxy
(
function
()
{
// Calling openChatBox on an already open chat will focus it.
var
jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
var
chatboxview
=
this
.
chatboxviews
.
get
(
jid
);
spyOn
(
chatboxview
,
'
focus
'
);
test_utils
.
openChatBoxFor
(
jid
);
box
=
converse_api
.
openChatBox
(
jid
);
expect
(
chatboxview
.
focus
).
toHaveBeenCalled
();
expect
(
box
.
get
(
'
box_id
'
)).
toBe
(
b64_sha1
(
jid
));
},
converse
));
it
(
"
has an API method, getChatBox, for retrieving chat box
"
,
$
.
proxy
(
function
()
{
var
jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
expect
(
converse_api
.
getChatBox
(
jid
)).
toBeFalsy
();
test_utils
.
openChatBoxFor
(
jid
);
var
box
=
converse_api
.
getChatBox
(
jid
);
expect
(
box
instanceof
Object
).
toBeTruthy
();
expect
(
box
.
get
(
'
box_id
'
)).
toBe
(
b64_sha1
(
jid
));
},
converse
));
},
converse
,
mock
,
test_utils
));
}));
src/deps-full.js
View file @
c7abf543
define
(
"
converse-dependencies
"
,
[
"
jquery
"
,
"
utils
"
,
"
otr
"
,
"
moment
"
,
"
locales
"
,
...
...
@@ -7,16 +8,16 @@ define("converse-dependencies", [
"
backbone.overview
"
,
"
jquery.browser
"
,
"
typeahead
"
,
"
utils
"
,
"
strophe
"
,
"
strophe.muc
"
,
"
strophe.roster
"
,
"
strophe.vcard
"
,
"
strophe.disco
"
],
function
(
$
,
otr
,
moment
)
{
],
function
(
$
,
utils
,
otr
,
moment
)
{
return
{
'
jQuery
'
:
$
,
'
moment
'
:
moment
,
'
otr
'
:
otr
,
'
moment
'
:
moment
'
utils
'
:
utils
};
});
src/deps-no-otr.js
View file @
c7abf543
define
(
"
converse-dependencies
"
,
[
"
jquery
"
,
"
utils
"
,
"
moment
"
,
"
locales
"
,
"
backbone.browserStorage
"
,
"
backbone.overview
"
,
"
jquery.browser
"
,
"
typeahead
"
,
"
utils
"
,
"
strophe
"
,
"
strophe.muc
"
,
"
strophe.roster
"
,
"
strophe.vcard
"
,
"
strophe.disco
"
],
function
(
$
,
moment
)
{
],
function
(
$
,
utils
,
moment
)
{
return
{
'
jQuery
'
:
$
,
'
otr
'
:
undefined
,
'
moment
'
:
moment
'
moment
'
:
moment
,
'
utils
'
:
utils
};
});
src/deps-website-no-otr.js
View file @
c7abf543
define
(
"
converse-dependencies
"
,
[
"
jquery
"
,
"
utils
"
,
"
moment
"
,
"
locales
"
,
"
bootstrapJS
"
,
// XXX: Can be removed, only for https://conversejs.org
...
...
@@ -8,16 +9,16 @@ define("converse-dependencies", [
"
jquery.browser
"
,
"
jquery.easing
"
,
// XXX: Can be removed, only for https://conversejs.org
"
typeahead
"
,
"
utils
"
,
"
strophe
"
,
"
strophe.muc
"
,
"
strophe.roster
"
,
"
strophe.vcard
"
,
"
strophe.disco
"
],
function
(
$
,
moment
)
{
],
function
(
$
,
utils
,
moment
)
{
return
{
'
jQuery
'
:
$
,
'
otr
'
:
undefined
,
'
moment
'
:
moment
'
moment
'
:
moment
,
'
utils
'
:
utils
};
});
src/deps-website.js
View file @
c7abf543
define
(
"
converse-dependencies
"
,
[
"
jquery
"
,
"
utils
"
,
"
otr
"
,
"
moment
"
,
"
locales
"
,
...
...
@@ -9,16 +10,16 @@ define("converse-dependencies", [
"
jquery.browser
"
,
"
jquery.easing
"
,
// XXX: Only for https://conversejs.org
"
typeahead
"
,
"
utils
"
,
"
strophe
"
,
"
strophe.muc
"
,
"
strophe.roster
"
,
"
strophe.vcard
"
,
"
strophe.disco
"
],
function
(
$
,
otr
,
moment
)
{
],
function
(
$
,
utils
,
otr
,
moment
)
{
return
{
'
jQuery
'
:
$
,
'
otr
'
:
otr
,
'
moment
'
:
moment
'
moment
'
:
moment
,
'
utils
'
:
utils
};
});
src/utils.js
View file @
c7abf543
...
...
@@ -8,4 +8,51 @@ define(["jquery"], function ($) {
}
return
false
;
};
$
.
fn
.
addHyperlinks
=
function
()
{
if
(
this
.
length
>
0
)
{
this
.
each
(
function
(
i
,
obj
)
{
var
x
=
$
(
obj
).
html
();
var
list
=
x
.
match
(
/
\b(
https
?
:
\/\/
|www
\.
|https
?
:
\/\/
www
\.)[^\s
<
]{2,200}\b
/g
);
if
(
list
)
{
for
(
i
=
0
;
i
<
list
.
length
;
i
++
)
{
var
prot
=
list
[
i
].
indexOf
(
'
http://
'
)
===
0
||
list
[
i
].
indexOf
(
'
https://
'
)
===
0
?
''
:
'
http://
'
;
var
escaped_url
=
encodeURI
(
decodeURI
(
list
[
i
])).
replace
(
/
[
!'()
]
/g
,
escape
).
replace
(
/
\*
/g
,
"
%2A
"
);
x
=
x
.
replace
(
list
[
i
],
"
<a target='_blank' href='
"
+
prot
+
escaped_url
+
"
'>
"
+
list
[
i
]
+
"
</a>
"
);
}
}
$
(
obj
).
html
(
x
);
});
}
return
this
;
};
var
utils
=
{
// Translation machinery
// ---------------------
__
:
$
.
proxy
(
function
(
str
)
{
// Translation factory
if
(
this
.
i18n
===
undefined
)
{
this
.
i18n
=
locales
.
en
;
}
var
t
=
this
.
i18n
.
translate
(
str
);
if
(
arguments
.
length
>
1
)
{
return
t
.
fetch
.
apply
(
t
,
[].
slice
.
call
(
arguments
,
1
));
}
else
{
return
t
.
fetch
();
}
},
this
),
___
:
function
(
str
)
{
/* XXX: This is part of a hack to get gettext to scan strings to be
* translated. Strings we cannot send to the function above because
* they require variable interpolation and we don't yet have the
* variables at scan time.
*
* See actionInfoMessages
*/
return
str
;
}
};
return
utils
;
});
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