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
04912c5c
Commit
04912c5c
authored
Feb 22, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into amd-strophe
Conflicts: docs/CHANGES.rst
parents
5839e38f
b31261f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
9 deletions
+79
-9
converse.js
converse.js
+19
-3
docs/.gitattributes
docs/.gitattributes
+1
-0
docs/CHANGES.rst
docs/CHANGES.rst
+6
-5
docs/source/configuration.rst
docs/source/configuration.rst
+1
-1
docs/source/development.rst
docs/source/development.rst
+30
-0
spec/converse.js
spec/converse.js
+22
-0
No files found.
converse.js
View file @
04912c5c
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
// Default configuration values
// Default configuration values
// ----------------------------
// ----------------------------
var
default_settings
=
{
this
.
default_settings
=
{
allow_contact_requests
:
true
,
allow_contact_requests
:
true
,
allow_dragresize
:
true
,
allow_dragresize
:
true
,
allow_logout
:
true
,
allow_logout
:
true
,
...
@@ -286,9 +286,9 @@
...
@@ -286,9 +286,9 @@
xhr_user_search
:
false
,
xhr_user_search
:
false
,
xhr_user_search_url
:
''
xhr_user_search_url
:
''
};
};
_
.
extend
(
this
,
default_settings
);
_
.
extend
(
this
,
this
.
default_settings
);
// Allow only whitelisted configuration attributes to be overwritten
// Allow only whitelisted configuration attributes to be overwritten
_
.
extend
(
this
,
_
.
pick
(
settings
,
Object
.
keys
(
default_settings
)));
_
.
extend
(
this
,
_
.
pick
(
settings
,
Object
.
keys
(
this
.
default_settings
)));
if
(
settings
.
visible_toolbar_buttons
)
{
if
(
settings
.
visible_toolbar_buttons
)
{
_
.
extend
(
_
.
extend
(
...
@@ -5205,6 +5205,22 @@
...
@@ -5205,6 +5205,22 @@
'
initialize
'
:
function
(
settings
,
callback
)
{
'
initialize
'
:
function
(
settings
,
callback
)
{
converse
.
initialize
(
settings
,
callback
);
converse
.
initialize
(
settings
,
callback
);
},
},
'
settings
'
:
{
'
get
'
:
function
(
key
)
{
if
(
_
.
contains
(
Object
.
keys
(
converse
.
default_settings
),
key
))
{
return
converse
[
key
];
}
},
'
set
'
:
function
(
key
,
val
)
{
var
o
=
{};
if
(
typeof
key
===
"
object
"
)
{
_
.
extend
(
converse
,
_
.
pick
(
key
,
Object
.
keys
(
converse
.
default_settings
)));
}
else
if
(
typeof
key
===
"
string
"
)
{
o
[
key
]
=
val
;
_
.
extend
(
converse
,
_
.
pick
(
o
,
Object
.
keys
(
converse
.
default_settings
)));
}
}
},
'
contacts
'
:
{
'
contacts
'
:
{
'
get
'
:
function
(
jids
)
{
'
get
'
:
function
(
jids
)
{
var
_transform
=
function
(
jid
)
{
var
_transform
=
function
(
jid
)
{
...
...
docs/.gitattributes
0 → 100644
View file @
04912c5c
CHANGES.rst merge=union
docs/CHANGES.rst
View file @
04912c5c
Changelog
Changelog
=========
=========
0.8.
8
(Unreleased)
0.8.
7
(Unreleased)
------------------
------------------
* Norwegian Bokmål translations. [Andreas Lorentsen]
* Add new API method to set and get configuration settings. [jcbrand]
* Updated Afrikaans translations. [jcbrand]
* Add responsiveness to CSS. We now use Sass preprocessor for generating CSS. [jcbrand]
* Add responsiveness to CSS. We now use Sass preprocessor for generating CSS. [jcbrand]
* Don't send out the message carbons IQ stanza on each page load. [jcbrand]
* Don't send out the message carbons IQ stanza on each page load. [jcbrand]
* New Makefile.win to build in Windows environments. [gbonvehi]
* Norwegian Bokmål translations. [Andreas Lorentsen]
* Strophe.log and Strophe.error now uses converse.log to output messages. [gbonvehi]
* Updated Afrikaans translations. [jcbrand]
* #204 Support websocket connections. [jcbrand]
* #204 Support websocket connections. [jcbrand]
* #252, 253 Add fullname and jid to contact's tooltip in roster. [gbonvehi]
* #252, 253 Add fullname and jid to contact's tooltip in roster. [gbonvehi]
* #292 Better support for XEP-0085 Chat State Notifications. [jcbrand]
* #292 Better support for XEP-0085 Chat State Notifications. [jcbrand]
* #295 Document "allow_registration". [gbonvehi]
* #295 Document "allow_registration". [gbonvehi]
* #304 Added Polish translations. [ser]
* #304 Added Polish translations. [ser]
* New Makefile.win to build in Windows environments. [gbonvehi]
* Strophe.log and Strophe.error now uses converse.log to output messages. [gbonvehi]
* #305 presence/show text in XMPP request isn't allowed by specification. [gbonvehi]
* #305 presence/show text in XMPP request isn't allowed by specification. [gbonvehi]
0.8.6 (2014-12-07)
0.8.6 (2014-12-07)
...
...
docs/source/configuration.rst
View file @
04912c5c
...
@@ -54,7 +54,7 @@ Default: ``true``
...
@@ -54,7 +54,7 @@ Default: ``true``
Allow Off-the-record encryption of single-user chat messages.
Allow Off-the-record encryption of single-user chat messages.
allow_registration
allow_registration
---------
---------
---------
Default: ``true``
Default: ``true``
...
...
docs/source/development.rst
View file @
04912c5c
...
@@ -301,6 +301,36 @@ Example::
...
@@ -301,6 +301,36 @@ Example::
| url | The URL of the chat box heading. |
| url | The URL of the chat box heading. |
+-------------+-----------------------------------------------------+
+-------------+-----------------------------------------------------+
"settings" grouping
-------------------
This grouping allows you to get or set the configuration settings of converse.js.
get(key)
~~~~~~~~
Returns the value of a configuration settings. For example::
converse.settings.get("play_sounds"); // default value returned would be false;
set(key, value) or set(object)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set one or many configuration settings. For example::
converse.settings.set("play_sounds", true);
or ::
converse.settings.set({
"play_sounds", true,
"hide_offline_users" true
});
Note, this is not an alternative to calling ``converse.initialize``, which still needs
to be called. Generally, you'd use this method after converse.js is already
running and you want to change the configuration on-the-fly.
"tokens" grouping
"tokens" grouping
-----------------
-----------------
...
...
spec/converse.js
View file @
04912c5c
...
@@ -87,6 +87,28 @@
...
@@ -87,6 +87,28 @@
},
converse
));
},
converse
));
},
converse
));
},
converse
));
describe
(
"
The
\"
settings
\"
API
"
,
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
test_utils
.
closeAllChatBoxes
();
test_utils
.
clearBrowserStorage
();
converse
.
rosterview
.
model
.
reset
();
test_utils
.
createContacts
(
'
current
'
);
},
converse
));
it
(
"
has methods 'get' and 'set' to set configuration settings
"
,
$
.
proxy
(
function
()
{
expect
(
Object
.
keys
(
converse_api
.
settings
)).
toEqual
([
"
get
"
,
"
set
"
]);
expect
(
converse_api
.
settings
.
get
(
"
play_sounds
"
)).
toBe
(
false
);
converse_api
.
settings
.
set
(
"
play_sounds
"
,
true
);
expect
(
converse_api
.
settings
.
get
(
"
play_sounds
"
)).
toBe
(
true
);
converse_api
.
settings
.
set
({
"
play_sounds
"
:
false
});
expect
(
converse_api
.
settings
.
get
(
"
play_sounds
"
)).
toBe
(
false
);
// Only whitelisted settings allowed.
expect
(
typeof
converse_api
.
settings
.
get
(
"
non_existing
"
)).
toBe
(
"
undefined
"
);
converse_api
.
settings
.
set
(
"
non_existing
"
,
true
);
expect
(
typeof
converse_api
.
settings
.
get
(
"
non_existing
"
)).
toBe
(
"
undefined
"
);
},
converse
));
},
converse
));
describe
(
"
The DEPRECATED API
"
,
$
.
proxy
(
function
()
{
describe
(
"
The DEPRECATED API
"
,
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
test_utils
.
closeAllChatBoxes
();
test_utils
.
closeAllChatBoxes
();
...
...
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