New defaults

This commit is contained in:
JC Brand 2017-02-27 10:09:15 +00:00
parent ac867c9524
commit cfb0cd0970
6 changed files with 10 additions and 11 deletions

View File

@ -166,9 +166,9 @@ dist/converse-no-dependencies.min.js: src locale node_modules *.js
dist/converse-no-dependencies.js: src locale node_modules *.js
$(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.js
dist/converse-mobile.min.js: src locale node_modules *.js
$(RJS) -o src/build.js include=converse-mobile out=dist/converse-mobile.min.js
$(RJS) -o src/build.js paths.converse=src/converse-mobile include=converse out=dist/converse-mobile.min.js
dist/converse-mobile.js: src locale node_modules *.js
$(RJS) -o src/build.js optimize=none include=converse-mobile out=dist/converse-mobile.js
$(RJS) -o src/build.js paths.converse=src/converse-mobile include=converse out=dist/converse-mobile.js optimize=none
.PHONY: jsmin
jsmin: $(BUILDS)

View File

@ -33,7 +33,7 @@
- Use lodash instead of underscore.js [jcbrand]
- Case insensitive matching of moderation commands. [jcbrand]
- Add `/subject` as alias to `/topic` [jcbrand]
- `allow_chat_pending_contacts` now defaults to `true` [jcbrand]
- `message_carbons`, `play_sounds` and `allow_chat_pending_contacts` now default to `true` [jcbrand]
- Improved roster filter UX. [jcbrand]
- Render the login form again upon authfail. [jcbrand]
- New promises API: [waitUntil](https://conversejs.org/docs/html/developer_api.html#waituntil)

View File

@ -324,11 +324,11 @@
describe("The \"settings\" API", function() {
it("has methods 'get' and 'set' to set configuration settings", mock.initConverse(function (_converse) {
expect(_.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});
_converse.api.settings.set("play_sounds", false);
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);
// Only whitelisted settings allowed.
expect(typeof _converse.api.settings.get("non_existing")).toBe("undefined");
_converse.api.settings.set("non_existing", true);

View File

@ -19,7 +19,6 @@ require.config({
"backbone": "node_modules/backbone/backbone",
"backbone.browserStorage": "node_modules/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "node_modules/backbone.overview/backbone.overview",
"converse": "src/converse",
"eventemitter": "node_modules/otr/build/dep/eventemitter",
"jquery": "node_modules/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
@ -42,7 +41,7 @@ require.config({
"utils": "src/utils",
// Converse
"converse-mobile": "src/converse-mobile",
"converse": "src/converse",
"converse-core": "src/converse-core",
"converse-bookmarks": "src/converse-bookmarks",

View File

@ -242,7 +242,7 @@
jid: undefined,
keepalive: true,
locked_domain: undefined,
message_carbons: false,
message_carbons: true,
message_storage: 'session',
password: undefined,
prebind_url: null,

View File

@ -34,7 +34,7 @@
show_chatstate_notifications: false,
chatstate_notification_blacklist: [],
// ^ a list of JIDs to ignore concerning chat state notifications
play_sounds: false,
play_sounds: true,
sounds_path: '/sounds/',
notification_icon: '/logo/conversejs128.png'
});
@ -104,7 +104,7 @@
// feature, but no browser currently supports it.
// https://developer.mozilla.org/en-US/docs/Web/API/notification/sound
var audio;
if (_converse.play_sounds && !_.isUndefined(Audio)) {
if (_converse.play_sounds && !_.isUndefined(window.Audio)) {
audio = new Audio(_converse.sounds_path+"msg_received.ogg");
if (audio.canPlayType('/audio/ogg')) {
audio.play();