Commit 4d06228d authored by JC Brand's avatar JC Brand

Various changes around making builds.

- Update build scripts to use transpiled versions of newly added modules
- Stop building locales.js and remove locales stuff from build scripts
- No need for Grunt anymore since we don't need to make locales.js
parent 042a26d0
module.exports = function(grunt) {
grunt.initConfig({
json: {
main: {
options: {
namespace: 'locales',
includePath: true,
processName: function(filename) {
return filename.toLowerCase().match(/^locale\/(.*)\/lc_messages/)[1];
}
},
src: ['locale/**/LC_MESSAGES/*.json'],
dest: 'dist/locales.js'
}
}
});
grunt.loadNpmTasks('grunt-json');
};
...@@ -7,7 +7,6 @@ BUNDLE ?= ./.bundle/bin/bundle ...@@ -7,7 +7,6 @@ BUNDLE ?= ./.bundle/bin/bundle
CHROMIUM ?= ./node_modules/.bin/run-headless-chromium CHROMIUM ?= ./node_modules/.bin/run-headless-chromium
CLEANCSS ?= ./node_modules/clean-css-cli/bin/cleancss --skip-rebase CLEANCSS ?= ./node_modules/clean-css-cli/bin/cleancss --skip-rebase
ESLINT ?= ./node_modules/.bin/eslint ESLINT ?= ./node_modules/.bin/eslint
GRUNT ?= ./node_modules/.bin/grunt
HTTPSERVE ?= ./node_modules/.bin/http-server HTTPSERVE ?= ./node_modules/.bin/http-server
PAPER = PAPER =
PO2JSON ?= ./node_modules/.bin/po2json PO2JSON ?= ./node_modules/.bin/po2json
...@@ -167,37 +166,32 @@ BUILDS = dist/converse.js \ ...@@ -167,37 +166,32 @@ BUILDS = dist/converse.js \
dist/converse-no-dependencies.min.js \ dist/converse-no-dependencies.min.js \
dist/converse-no-dependencies.js dist/converse-no-dependencies.js
dist/converse.js: transpile src node_modules *.js dist/converse.js: transpile src node_modules
$(RJS) -o src/build.js include=converse out=dist/converse.js optimize=none $(RJS) -o src/build.js include=converse out=dist/converse.js optimize=none
dist/converse.min.js: transpile src node_modules *.js dist/converse.min.js: transpile src node_modules
$(RJS) -o src/build.js include=converse out=dist/converse.min.js $(RJS) -o src/build.js include=converse out=dist/converse.min.js
dist/converse-esnext.js: src node_modules *.js dist/converse-esnext.js: src node_modules
$(RJS) -o src/build-esnext.js include=converse out=dist/converse-esnext.js optimize=none $(RJS) -o src/build-esnext.js include=converse out=dist/converse-esnext.js optimize=none
dist/converse-esnext.min.js: src node_modules *.js dist/converse-esnext.min.js: src node_modules
$(RJS) -o src/build-esnext.js include=converse out=dist/converse-esnext.min.js $(RJS) -o src/build-esnext.js include=converse out=dist/converse-esnext.min.js
dist/converse-no-jquery.js: transpile src node_modules *.js dist/converse-no-jquery.js: transpile src node_modules
$(RJS) -o src/build.js include=converse wrap.endFile=end-no-jquery.frag exclude=jquery exclude=jquery.noconflict out=dist/converse-no-jquery.js optimize=none $(RJS) -o src/build.js include=converse wrap.endFile=end-no-jquery.frag exclude=jquery exclude=jquery.noconflict out=dist/converse-no-jquery.js optimize=none
dist/converse-no-jquery.min.js: transpile src node_modules *.js transpile dist/converse-no-jquery.min.js: transpile src node_modules transpile
$(RJS) -o src/build.js include=converse wrap.endFile=end-no-jquery.frag exclude=jquery exclude=jquery.noconflict out=dist/converse-no-jquery.min.js $(RJS) -o src/build.js include=converse wrap.endFile=end-no-jquery.frag exclude=jquery exclude=jquery.noconflict out=dist/converse-no-jquery.min.js
dist/converse-no-dependencies.js: transpile src node_modules *.js dist/converse-no-dependencies.js: transpile src node_modules
$(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.js $(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.js
dist/converse-no-dependencies.min.js: transpile src node_modules *.js dist/converse-no-dependencies.min.js: transpile src node_modules
$(RJS) -o src/build-no-dependencies.js out=dist/converse-no-dependencies.min.js $(RJS) -o src/build-no-dependencies.js out=dist/converse-no-dependencies.min.js
dist/converse-muc-embedded.js: transpile src node_modules *.js dist/converse-muc-embedded.js: transpile src node_modules
$(RJS) -o src/build.js paths.converse=src/converse-embedded include=converse out=dist/converse-muc-embedded.js optimize=none $(RJS) -o src/build.js paths.converse=src/converse-embedded include=converse out=dist/converse-muc-embedded.js optimize=none
dist/converse-muc-embedded.min.js: transpile src node_modules *.js dist/converse-muc-embedded.min.js: transpile src node_modules
$(RJS) -o src/build.js paths.converse=src/converse-embedded include=converse out=dist/converse-muc-embedded.min.js $(RJS) -o src/build.js paths.converse=src/converse-embedded include=converse out=dist/converse-muc-embedded.min.js
.PHONY: jsmin
jsmin: $(BUILDS)
.PHONY: dist .PHONY: dist
dist:: build dist:: build
.PHONY: build .PHONY: build
build:: dev css transpile build:: dev css transpile $(BUILDS)
$(GRUNT) json
make jsmin
######################################################################## ########################################################################
## Tests ## Tests
......
...@@ -6333,6 +6333,8 @@ return uk; ...@@ -6333,6 +6333,8 @@ return uk;
}))); })));
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -6344,32 +6346,11 @@ return uk; ...@@ -6344,32 +6346,11 @@ return uk;
/*global define */ /*global define */
(function (root, factory) { (function (root, factory) {
define('i18n',[ define('i18n',["es6-promise", "jed", "lodash.noconflict", "moment", 'moment/locale/af', 'moment/locale/ca', 'moment/locale/de', 'moment/locale/es', 'moment/locale/fr', 'moment/locale/he', 'moment/locale/hu', 'moment/locale/id', 'moment/locale/it', 'moment/locale/ja', 'moment/locale/nb', 'moment/locale/nl', 'moment/locale/pl', 'moment/locale/pt-br', 'moment/locale/ru', 'moment/locale/uk'], factory);
"es6-promise", })(undefined, function (Promise, Jed, _, moment) {
"jed",
"lodash.noconflict",
"moment",
'moment/locale/af',
'moment/locale/ca',
'moment/locale/de',
'moment/locale/es',
'moment/locale/fr',
'moment/locale/he',
'moment/locale/hu',
'moment/locale/id',
'moment/locale/it',
'moment/locale/ja',
'moment/locale/nb',
'moment/locale/nl',
'moment/locale/pl',
'moment/locale/pt-br',
'moment/locale/ru',
'moment/locale/uk',
], factory);
}(this, function (Promise, Jed, _, moment) {
'use strict'; 'use strict';
function detectLocale (library_check) { function detectLocale(library_check) {
/* Determine which locale is supported by the user's system as well /* Determine which locale is supported by the user's system as well
* as by the relevant library (e.g. converse.js or moment.js). * as by the relevant library (e.g. converse.js or moment.js).
* *
...@@ -6382,7 +6363,7 @@ return uk; ...@@ -6382,7 +6363,7 @@ return uk;
locale = isLocaleAvailable(window.navigator.userLanguage, library_check); locale = isLocaleAvailable(window.navigator.userLanguage, library_check);
} }
if (window.navigator.languages && !locale) { if (window.navigator.languages && !locale) {
for (i=0; i<window.navigator.languages.length && !locale; i++) { for (i = 0; i < window.navigator.languages.length && !locale; i++) {
locale = isLocaleAvailable(window.navigator.languages[i], library_check); locale = isLocaleAvailable(window.navigator.languages[i], library_check);
} }
} }
...@@ -6398,15 +6379,15 @@ return uk; ...@@ -6398,15 +6379,15 @@ return uk;
return locale || 'en'; return locale || 'en';
} }
function isMomentLocale (locale) { function isMomentLocale(locale) {
return _.isString(locale) && moment.locale() === moment.locale(locale); return _.isString(locale) && moment.locale() === moment.locale(locale);
} }
function isConverseLocale (locale, supported_locales) { function isConverseLocale(locale, supported_locales) {
return _.isString(locale) && _.includes(supported_locales, locale); return _.isString(locale) && _.includes(supported_locales, locale);
} }
function getLocale (preferred_locale, isSupportedByLibrary) { function getLocale(preferred_locale, isSupportedByLibrary) {
if (_.isString(preferred_locale)) { if (_.isString(preferred_locale)) {
if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) { if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
return preferred_locale; return preferred_locale;
...@@ -6415,7 +6396,7 @@ return uk; ...@@ -6415,7 +6396,7 @@ return uk;
return detectLocale(isSupportedByLibrary) || 'en'; return detectLocale(isSupportedByLibrary) || 'en';
} }
function isLocaleAvailable (locale, available) { function isLocaleAvailable(locale, available) {
/* Check whether the locale or sub locale (e.g. en-US, en) is supported. /* Check whether the locale or sub locale (e.g. en-US, en) is supported.
* *
* Parameters: * Parameters:
...@@ -6432,31 +6413,25 @@ return uk; ...@@ -6432,31 +6413,25 @@ return uk;
} }
} }
let jed_instance; var jed_instance = void 0;
return { return {
setLocales: function setLocales(preferred_locale, _converse) {
setLocales (preferred_locale, _converse) { _converse.locale = getLocale(preferred_locale, _.partial(isConverseLocale, _, _converse.locales));
_converse.locale = getLocale(
preferred_locale,
_.partial(isConverseLocale, _, _converse.locales)
);
moment.locale(getLocale(preferred_locale, isMomentLocale)); moment.locale(getLocale(preferred_locale, isMomentLocale));
}, },
translate: function translate(str) {
translate (str) {
if (_.isNil(jed_instance)) { if (_.isNil(jed_instance)) {
return Jed.sprintf.apply(Jed, arguments); return Jed.sprintf.apply(Jed, arguments);
} }
var t = jed_instance.translate(str); var t = jed_instance.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();
} }
}, },
fetchTranslations: function fetchTranslations(locale, supported_locales, locale_url) {
fetchTranslations (locale, supported_locales, locale_url) {
/* Fetch the translations for the given local at the given URL. /* Fetch the translations for the given local at the given URL.
* *
* Parameters: * Parameters:
...@@ -6465,16 +6440,13 @@ return uk; ...@@ -6465,16 +6440,13 @@ return uk;
* (String) locale_url: The URL from which the translations * (String) locale_url: The URL from which the translations
* should be fetched. * should be fetched.
*/ */
return new Promise((resolve, reject) => { return new Promise(function (resolve, reject) {
if (!isConverseLocale(locale, supported_locales) || locale === 'en') { if (!isConverseLocale(locale, supported_locales) || locale === 'en') {
return resolve(); return resolve();
} }
const xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('GET', locale_url, true); xhr.open('GET', locale_url, true);
xhr.setRequestHeader( xhr.setRequestHeader('Accept', "application/json, text/javascript");
'Accept',
"application/json, text/javascript"
);
xhr.onload = function () { xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 400) { if (xhr.status >= 200 && xhr.status < 400) {
jed_instance = new Jed(window.JSON.parse(xhr.responseText)); jed_instance = new Jed(window.JSON.parse(xhr.responseText));
...@@ -6490,8 +6462,8 @@ return uk; ...@@ -6490,8 +6462,8 @@ return uk;
}); });
} }
}; };
})); });
//# sourceMappingURL=i18n.js.map;
/*! /*!
* jQuery Browser Plugin 0.1.0 * jQuery Browser Plugin 0.1.0
* https://github.com/gabceb/jquery-browser-plugin * https://github.com/gabceb/jquery-browser-plugin
...@@ -9457,6 +9429,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9457,6 +9429,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
}; };
}); });
//# sourceMappingURL=converse-core.js.map; //# sourceMappingURL=converse-core.js.map;
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -9467,9 +9441,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9467,9 +9441,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
(function (root, factory) { (function (root, factory) {
define('converse-chatboxes',["converse-core"], factory); define('converse-chatboxes',["converse-core"], factory);
}(this, function (converse) { })(undefined, function (converse) {
"use strict"; "use strict";
const { Backbone, Promise, Strophe, b64_sha1, utils, _ } = converse.env;
var _converse$env = converse.env,
Backbone = _converse$env.Backbone,
Promise = _converse$env.Promise,
Strophe = _converse$env.Strophe,
b64_sha1 = _converse$env.b64_sha1,
utils = _converse$env.utils,
_ = _converse$env._;
converse.plugins.add('converse-chatboxes', { converse.plugins.add('converse-chatboxes', {
...@@ -9478,152 +9460,134 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9478,152 +9460,134 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
// plugin architecture they will replace existing methods on the // plugin architecture they will replace existing methods on the
// relevant objects or classes. // relevant objects or classes.
disconnect: function () { disconnect: function disconnect() {
const { _converse } = this.__super__; var _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes(); _converse.chatboxviews.closeAllChatBoxes();
return this.__super__.disconnect.apply(this, arguments); return this.__super__.disconnect.apply(this, arguments);
}, },
logOut: function () { logOut: function logOut() {
const { _converse } = this.__super__; var _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes(); _converse.chatboxviews.closeAllChatBoxes();
return this.__super__.logOut.apply(this, arguments); return this.__super__.logOut.apply(this, arguments);
}, },
initStatus: function () { initStatus: function initStatus() {
const { _converse } = this.__super__; var _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes(); _converse.chatboxviews.closeAllChatBoxes();
return this.__super__.initStatus.apply(this, arguments); return this.__super__.initStatus.apply(this, arguments);
}, },
onStatusInitialized: function () { onStatusInitialized: function onStatusInitialized() {
const { _converse } = this.__super__; var _converse = this.__super__._converse;
_converse.chatboxes.onConnected(); _converse.chatboxes.onConnected();
return this.__super__.onStatusInitialized.apply(this, arguments); return this.__super__.onStatusInitialized.apply(this, arguments);
} }
}, },
initialize () { initialize: function initialize() {
/* The initialize function gets called as soon as the plugin is /* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery. * loaded by converse.js's plugin machinery.
*/ */
const { _converse } = this; var _converse = this._converse;
_converse.api.promises.add([ _converse.api.promises.add(['chatBoxesFetched', 'chatBoxesInitialized']);
'chatBoxesFetched',
'chatBoxesInitialized'
]);
function openChat (jid) { function openChat(jid) {
if (!utils.isValidJID(jid)) { if (!utils.isValidJID(jid)) {
return converse.log( return converse.log("Invalid JID \"" + jid + "\" provided in URL fragment", Strophe.LogLevel.WARN);
`Invalid JID "${jid}" provided in URL fragment`,
Strophe.LogLevel.WARN
);
} }
Promise.all([ Promise.all([_converse.api.waitUntil('rosterContactsFetched'), _converse.api.waitUntil('chatBoxesFetched')]).then(function () {
_converse.api.waitUntil('rosterContactsFetched'),
_converse.api.waitUntil('chatBoxesFetched')
]).then(() => {
_converse.api.chats.open(jid); _converse.api.chats.open(jid);
}); });
} }
_converse.router.route('converse/chat?jid=:jid', openChat); _converse.router.route('converse/chat?jid=:jid', openChat);
_converse.ChatBoxes = Backbone.Collection.extend({ _converse.ChatBoxes = Backbone.Collection.extend({
comparator: 'time_opened', comparator: 'time_opened',
model (attrs, options) { model: function model(attrs, options) {
return new _converse.ChatBox(attrs, options); return new _converse.ChatBox(attrs, options);
}, },
registerMessageHandler: function registerMessageHandler() {
registerMessageHandler () { _converse.connection.addHandler(this.onMessage.bind(this), null, 'message', 'chat');
_converse.connection.addHandler( _converse.connection.addHandler(this.onErrorMessage.bind(this), null, 'message', 'error');
this.onMessage.bind(this), null, 'message', 'chat'
);
_converse.connection.addHandler(
this.onErrorMessage.bind(this), null, 'message', 'error'
);
}, },
chatBoxMayBeShown: function chatBoxMayBeShown(chatbox) {
chatBoxMayBeShown (chatbox) {
return true; return true;
}, },
onChatBoxesFetched: function onChatBoxesFetched(collection) {
var _this = this;
onChatBoxesFetched (collection) {
/* Show chat boxes upon receiving them from sessionStorage /* Show chat boxes upon receiving them from sessionStorage
* *
* This method gets overridden entirely in src/converse-controlbox.js * This method gets overridden entirely in src/converse-controlbox.js
* if the controlbox plugin is active. * if the controlbox plugin is active.
*/ */
collection.each((chatbox) => { collection.each(function (chatbox) {
if (this.chatBoxMayBeShown(chatbox)) { if (_this.chatBoxMayBeShown(chatbox)) {
chatbox.trigger('show'); chatbox.trigger('show');
} }
}); });
_converse.emit('chatBoxesFetched'); _converse.emit('chatBoxesFetched');
}, },
onConnected: function onConnected() {
onConnected () { this.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.chatboxes-" + _converse.bare_jid));
this.browserStorage = new Backbone.BrowserStorage[_converse.storage](
b64_sha1(`converse.chatboxes-${_converse.bare_jid}`));
this.registerMessageHandler(); this.registerMessageHandler();
this.fetch({ this.fetch({
add: true, add: true,
success: this.onChatBoxesFetched.bind(this) success: this.onChatBoxesFetched.bind(this)
}); });
}, },
onErrorMessage: function onErrorMessage(message) {
onErrorMessage (message) {
/* Handler method for all incoming error message stanzas /* Handler method for all incoming error message stanzas
*/ */
// TODO: we can likely just reuse "onMessage" below // TODO: we can likely just reuse "onMessage" below
const from_jid = Strophe.getBareJidFromJid(message.getAttribute('from')); var from_jid = Strophe.getBareJidFromJid(message.getAttribute('from'));
if (utils.isSameBareJID(from_jid, _converse.bare_jid)) { if (utils.isSameBareJID(from_jid, _converse.bare_jid)) {
return true; return true;
} }
// Get chat box, but only create a new one when the message has a body. // Get chat box, but only create a new one when the message has a body.
const chatbox = this.getChatBox(from_jid); var chatbox = this.getChatBox(from_jid);
if (!chatbox) { if (!chatbox) {
return true; return true;
} }
chatbox.createMessage(message, null, message); chatbox.createMessage(message, null, message);
return true; return true;
}, },
onMessage: function onMessage(message) {
onMessage (message) {
/* Handler method for all incoming single-user chat "message" /* Handler method for all incoming single-user chat "message"
* stanzas. * stanzas.
*/ */
let contact_jid, delay, resource, var contact_jid = void 0,
delay = void 0,
resource = void 0,
from_jid = message.getAttribute('from'), from_jid = message.getAttribute('from'),
to_jid = message.getAttribute('to'); to_jid = message.getAttribute('to');
const original_stanza = message, var original_stanza = message,
to_resource = Strophe.getResourceFromJid(to_jid), to_resource = Strophe.getResourceFromJid(to_jid),
is_carbon = !_.isNull(message.querySelector(`received[xmlns="${Strophe.NS.CARBONS}"]`)); is_carbon = !_.isNull(message.querySelector("received[xmlns=\"" + Strophe.NS.CARBONS + "\"]"));
if (_converse.filter_by_resource && (to_resource && to_resource !== _converse.resource)) { if (_converse.filter_by_resource && to_resource && to_resource !== _converse.resource) {
_converse.log( _converse.log("onMessage: Ignoring incoming message intended for a different resource: " + to_jid, Strophe.LogLevel.INFO);
`onMessage: Ignoring incoming message intended for a different resource: ${to_jid}`,
Strophe.LogLevel.INFO
);
return true; return true;
} else if (utils.isHeadlineMessage(message)) { } else if (utils.isHeadlineMessage(message)) {
// XXX: Ideally we wouldn't have to check for headline // XXX: Ideally we wouldn't have to check for headline
// messages, but Prosody sends headline messages with the // messages, but Prosody sends headline messages with the
// wrong type ('chat'), so we need to filter them out here. // wrong type ('chat'), so we need to filter them out here.
_converse.log( _converse.log("onMessage: Ignoring incoming headline message sent with type 'chat' from JID: " + from_jid, Strophe.LogLevel.INFO);
`onMessage: Ignoring incoming headline message sent with type 'chat' from JID: ${from_jid}`,
Strophe.LogLevel.INFO
);
return true; return true;
} }
const forwarded = message.querySelector('forwarded'); var forwarded = message.querySelector('forwarded');
if (!_.isNull(forwarded)) { if (!_.isNull(forwarded)) {
const forwarded_message = forwarded.querySelector('message'); var forwarded_message = forwarded.querySelector('message');
const forwarded_from = forwarded_message.getAttribute('from'); var forwarded_from = forwarded_message.getAttribute('from');
if (is_carbon && Strophe.getBareJidFromJid(forwarded_from) !== from_jid) { if (is_carbon && Strophe.getBareJidFromJid(forwarded_from) !== from_jid) {
// Prevent message forging via carbons // Prevent message forging via carbons
// //
...@@ -9636,7 +9600,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9636,7 +9600,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
to_jid = message.getAttribute('to'); to_jid = message.getAttribute('to');
} }
const from_bare_jid = Strophe.getBareJidFromJid(from_jid), var from_bare_jid = Strophe.getBareJidFromJid(from_jid),
from_resource = Strophe.getResourceFromJid(from_jid), from_resource = Strophe.getResourceFromJid(from_jid),
is_me = from_bare_jid === _converse.bare_jid; is_me = from_bare_jid === _converse.bare_jid;
...@@ -9649,11 +9613,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9649,11 +9613,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
resource = from_resource; resource = from_resource;
} }
// Get chat box, but only create a new one when the message has a body. // Get chat box, but only create a new one when the message has a body.
const chatbox = this.getChatBox(contact_jid, !_.isNull(message.querySelector('body'))), var chatbox = this.getChatBox(contact_jid, !_.isNull(message.querySelector('body'))),
msgid = message.getAttribute('id'); msgid = message.getAttribute('id');
if (chatbox) { if (chatbox) {
const messages = msgid && chatbox.messages.findWhere({msgid}) || []; var messages = msgid && chatbox.messages.findWhere({ msgid: msgid }) || [];
if (_.isEmpty(messages)) { if (_.isEmpty(messages)) {
// Only create the message when we're sure it's not a // Only create the message when we're sure it's not a
// duplicate // duplicate
...@@ -9661,11 +9625,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9661,11 +9625,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
chatbox.createMessage(message, delay, original_stanza); chatbox.createMessage(message, delay, original_stanza);
} }
} }
_converse.emit('message', {'stanza': original_stanza, 'chatbox': chatbox}); _converse.emit('message', { 'stanza': original_stanza, 'chatbox': chatbox });
return true; return true;
}, },
createChatBox: function createChatBox(jid, attrs) {
createChatBox (jid, attrs) {
/* Creates a chat box /* Creates a chat box
* *
* Parameters: * Parameters:
...@@ -9673,34 +9636,31 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9673,34 +9636,31 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
* gets created. * gets created.
* (Object) attrs - Optional chat box atributes. * (Object) attrs - Optional chat box atributes.
*/ */
const bare_jid = Strophe.getBareJidFromJid(jid), var bare_jid = Strophe.getBareJidFromJid(jid),
roster_item = _converse.roster.get(bare_jid); roster_item = _converse.roster.get(bare_jid);
let roster_info = {}; var roster_info = {};
if (! _.isUndefined(roster_item)) { if (!_.isUndefined(roster_item)) {
roster_info = { roster_info = {
'fullname': _.isEmpty(roster_item.get('fullname'))? jid: roster_item.get('fullname'), 'fullname': _.isEmpty(roster_item.get('fullname')) ? jid : roster_item.get('fullname'),
'image_type': roster_item.get('image_type'), 'image_type': roster_item.get('image_type'),
'image': roster_item.get('image'), 'image': roster_item.get('image'),
'url': roster_item.get('url'), 'url': roster_item.get('url')
}; };
} else if (!_converse.allow_non_roster_messaging) { } else if (!_converse.allow_non_roster_messaging) {
_converse.log(`Could not get roster item for JID ${bare_jid}`+ _converse.log("Could not get roster item for JID " + bare_jid + ' and allow_non_roster_messaging is set to false', Strophe.LogLevel.ERROR);
' and allow_non_roster_messaging is set to false',
Strophe.LogLevel.ERROR);
return; return;
} }
return this.create(_.assignIn({ return this.create(_.assignIn({
'id': bare_jid, 'id': bare_jid,
'jid': bare_jid, 'jid': bare_jid,
'fullname': jid, 'fullname': jid,
'image_type': _converse.DEFAULT_IMAGE_TYPE, 'image_type': _converse.DEFAULT_IMAGE_TYPE,
'image': _converse.DEFAULT_IMAGE, 'image': _converse.DEFAULT_IMAGE,
'url': '', 'url': ''
}, roster_info, attrs || {})); }, roster_info, attrs || {}));
}, },
getChatBox: function getChatBox(jid, create, attrs) {
getChatBox (jid, create, attrs) {
/* Returns a chat box or optionally return a newly /* Returns a chat box or optionally return a newly
* created one if one doesn't exist. * created one if one doesn't exist.
* *
...@@ -9710,7 +9670,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9710,7 +9670,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
* (Object) attrs - Optional chat box atributes. * (Object) attrs - Optional chat box atributes.
*/ */
jid = jid.toLowerCase(); jid = jid.toLowerCase();
let chatbox = this.get(Strophe.getBareJidFromJid(jid)); var chatbox = this.get(Strophe.getBareJidFromJid(jid));
if (!chatbox && create) { if (!chatbox && create) {
chatbox = this.createChatBox(jid, attrs); chatbox = this.createChatBox(jid, attrs);
} }
...@@ -9719,18 +9679,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9719,18 +9679,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
}); });
_converse.ChatBoxViews = Backbone.Overview.extend({ _converse.ChatBoxViews = Backbone.Overview.extend({
initialize: function initialize() {
initialize () {
this.model.on("add", this.onChatBoxAdded, this); this.model.on("add", this.onChatBoxAdded, this);
this.model.on("destroy", this.removeChat, this); this.model.on("destroy", this.removeChat, this);
}, },
_ensureElement: function _ensureElement() {
_ensureElement () {
/* Override method from backbone.js /* Override method from backbone.js
* If the #conversejs element doesn't exist, create it. * If the #conversejs element doesn't exist, create it.
*/ */
if (!this.el) { if (!this.el) {
let el = document.querySelector('#conversejs'); var el = document.querySelector('#conversejs');
if (_.isNull(el)) { if (_.isNull(el)) {
el = document.createElement('div'); el = document.createElement('div');
el.setAttribute('id', 'conversejs'); el.setAttribute('id', 'conversejs');
...@@ -9743,47 +9701,43 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9743,47 +9701,43 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
this.setElement(_.result(this, 'el'), false); this.setElement(_.result(this, 'el'), false);
} }
}, },
onChatBoxAdded: function onChatBoxAdded(item) {
onChatBoxAdded (item) {
// Views aren't created here, since the core code doesn't // Views aren't created here, since the core code doesn't
// contain any views. Instead, they're created in overrides in // contain any views. Instead, they're created in overrides in
// plugins, such as in converse-chatview.js and converse-muc.js // plugins, such as in converse-chatview.js and converse-muc.js
return this.get(item.get('id')); return this.get(item.get('id'));
}, },
removeChat: function removeChat(item) {
removeChat (item) {
this.remove(item.get('id')); this.remove(item.get('id'));
}, },
closeAllChatBoxes: function closeAllChatBoxes() {
closeAllChatBoxes () {
/* This method gets overridden in src/converse-controlbox.js if /* This method gets overridden in src/converse-controlbox.js if
* the controlbox plugin is active. * the controlbox plugin is active.
*/ */
this.each(function (view) { view.close(); }); this.each(function (view) {
view.close();
});
return this; return this;
}, },
chatBoxMayBeShown: function chatBoxMayBeShown(chatbox) {
chatBoxMayBeShown (chatbox) {
return this.model.chatBoxMayBeShown(chatbox); return this.model.chatBoxMayBeShown(chatbox);
}, },
getChatBox: function getChatBox(attrs, create) {
getChatBox (attrs, create) { var chatbox = this.model.get(attrs.jid);
let chatbox = this.model.get(attrs.jid);
if (!chatbox && create) { if (!chatbox && create) {
chatbox = this.model.create(attrs, { chatbox = this.model.create(attrs, {
'error' (model, response) { 'error': function error(model, response) {
_converse.log(response.responseText); _converse.log(response.responseText);
} }
}); });
} }
return chatbox; return chatbox;
}, },
showChat: function showChat(attrs) {
showChat (attrs) {
/* Find the chat box and show it (if it may be shown). /* Find the chat box and show it (if it may be shown).
* If it doesn't exist, create it. * If it doesn't exist, create it.
*/ */
const chatbox = this.getChatBox(attrs, true); var chatbox = this.getChatBox(attrs, true);
if (this.chatBoxMayBeShown(chatbox)) { if (this.chatBoxMayBeShown(chatbox)) {
chatbox.trigger('show', true); chatbox.trigger('show', true);
} }
...@@ -9792,7 +9746,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9792,7 +9746,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
}); });
// BEGIN: Event handlers // BEGIN: Event handlers
_converse.api.listen.on('pluginsInitialized', () => { _converse.api.listen.on('pluginsInitialized', function () {
_converse.chatboxes = new _converse.ChatBoxes(); _converse.chatboxes = new _converse.ChatBoxes();
_converse.chatboxviews = new _converse.ChatBoxViews({ _converse.chatboxviews = new _converse.ChatBoxViews({
'model': _converse.chatboxes 'model': _converse.chatboxes
...@@ -9800,41 +9754,41 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9800,41 +9754,41 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
_converse.emit('chatBoxesInitialized'); _converse.emit('chatBoxesInitialized');
}); });
_converse.api.listen.on('beforeTearDown', () => { _converse.api.listen.on('beforeTearDown', function () {
_converse.chatboxes.remove(); // Don't call off(), events won't get re-registered upon reconnect. _converse.chatboxes.remove(); // Don't call off(), events won't get re-registered upon reconnect.
delete _converse.chatboxes.browserStorage; delete _converse.chatboxes.browserStorage;
}); });
// END: Event handlers // END: Event handlers
_converse.getViewForChatBox = function (chatbox) { _converse.getViewForChatBox = function (chatbox) {
if (!chatbox) { return; } if (!chatbox) {
return;
}
return _converse.chatboxviews.get(chatbox.get('id')); return _converse.chatboxviews.get(chatbox.get('id'));
}; };
/* We extend the default converse.js API */ /* We extend the default converse.js API */
_.extend(_converse.api, { _.extend(_converse.api, {
'chats': { 'chats': {
'open' (jids, attrs) { 'open': function open(jids, attrs) {
if (_.isUndefined(jids)) { if (_.isUndefined(jids)) {
_converse.log("chats.open: You need to provide at least one JID", Strophe.LogLevel.ERROR); _converse.log("chats.open: You need to provide at least one JID", Strophe.LogLevel.ERROR);
return null; return null;
} else if (_.isString(jids)) { } else if (_.isString(jids)) {
const chatbox = _converse.chatboxes.getChatBox(jids, true, attrs); var chatbox = _converse.chatboxes.getChatBox(jids, true, attrs);
if (_.isNil(chatbox)) { if (_.isNil(chatbox)) {
_converse.log("Could not open chatbox for JID: "+jids); _converse.log("Could not open chatbox for JID: " + jids);
return; return;
} }
return _converse.getViewForChatBox(chatbox.trigger('show')); return _converse.getViewForChatBox(chatbox.trigger('show'));
} }
return _.map(jids, (jid) => return _.map(jids, function (jid) {
_converse.getViewForChatBox( return _converse.getViewForChatBox(_converse.chatboxes.getChatBox(jid, true, attrs).trigger('show'));
_converse.chatboxes.getChatBox(jid, true, attrs).trigger('show') });
)
);
}, },
'get' (jids) { 'get': function get(jids) {
if (_.isUndefined(jids)) { if (_.isUndefined(jids)) {
const result = []; var result = [];
_converse.chatboxes.each(function (chatbox) { _converse.chatboxes.each(function (chatbox) {
// FIXME: Leaky abstraction from MUC. We need to add a // FIXME: Leaky abstraction from MUC. We need to add a
// base type for chat boxes, and check for that. // base type for chat boxes, and check for that.
...@@ -9846,22 +9800,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol ...@@ -9846,22 +9800,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
} else if (_.isString(jids)) { } else if (_.isString(jids)) {
return _converse.getViewForChatBox(_converse.chatboxes.getChatBox(jids)); return _converse.getViewForChatBox(_converse.chatboxes.getChatBox(jids));
} }
return _.map(jids, return _.map(jids, _.partial(_.flow(_converse.chatboxes.getChatBox.bind(_converse.chatboxes), _converse.getViewForChatBox.bind(_converse)), _, true));
_.partial(
_.flow(
_converse.chatboxes.getChatBox.bind(_converse.chatboxes),
_converse.getViewForChatBox.bind(_converse)
), _, true
)
);
} }
} }
}); });
} }
}); });
return converse; return converse;
})); });
//# sourceMappingURL=converse-chatboxes.js.map;
/* jshint maxerr: 10000 */ /* jshint maxerr: 10000 */
/* jslint unused: true */ /* jslint unused: true */
/* jshint shadow: true */ /* jshint shadow: true */
...@@ -18313,6 +18260,8 @@ __e(value) + ...@@ -18313,6 +18260,8 @@ __e(value) +
return __p return __p
};}); };});
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -18321,36 +18270,10 @@ return __p ...@@ -18321,36 +18270,10 @@ return __p
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com> // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2) // Licensed under the Mozilla Public License (MPLv2)
// //
/*global define, escape, locales, Jed */ /*global define, escape, Jed */
(function (root, factory) { (function (root, factory) {
define('form-utils',[ define('form-utils',["sizzle", "lodash.noconflict", "utils", "tpl!field", "tpl!select_option", "tpl!form_select", "tpl!form_textarea", "tpl!form_checkbox", "tpl!form_username", "tpl!form_input", "tpl!form_captcha", "tpl!form_url"], factory);
"sizzle", })(undefined, function (sizzle, _, u, tpl_field, tpl_select_option, tpl_form_select, tpl_form_textarea, tpl_form_checkbox, tpl_form_username, tpl_form_input, tpl_form_captcha, tpl_form_url) {
"lodash.noconflict",
"utils",
"tpl!field",
"tpl!select_option",
"tpl!form_select",
"tpl!form_textarea",
"tpl!form_checkbox",
"tpl!form_username",
"tpl!form_input",
"tpl!form_captcha",
"tpl!form_url",
], factory);
}(this, function (
sizzle,
_,
u,
tpl_field,
tpl_select_option,
tpl_form_select,
tpl_form_textarea,
tpl_form_checkbox,
tpl_form_username,
tpl_form_input,
tpl_form_captcha,
tpl_form_url
) {
"use strict"; "use strict";
var XFORM_TYPE_MAP = { var XFORM_TYPE_MAP = {
...@@ -18370,7 +18293,7 @@ return __p ...@@ -18370,7 +18293,7 @@ return __p
* Parameters: * Parameters:
* (DOMElement) field - the field to convert * (DOMElement) field - the field to convert
*/ */
let value; var value = void 0;
if (field.getAttribute('type') === 'checkbox') { if (field.getAttribute('type') === 'checkbox') {
value = field.checked && 1 || 0; value = field.checked && 1 || 0;
} else if (field.tagName == "textarea") { } else if (field.tagName == "textarea") {
...@@ -18378,12 +18301,10 @@ return __p ...@@ -18378,12 +18301,10 @@ return __p
} else { } else {
value = field.value; value = field.value;
} }
return u.stringToDOM( return u.stringToDOM(tpl_field({
tpl_field({ name: field.getAttribute('name'),
name: field.getAttribute('name'), value: value
value: value }))[0];
})
)[0];
}; };
u.xForm2webForm = function (field, stanza, domain) { u.xForm2webForm = function (field, stanza, domain) {
...@@ -18397,35 +18318,28 @@ return __p ...@@ -18397,35 +18318,28 @@ return __p
* (XMLElement) field - the field to convert * (XMLElement) field - the field to convert
*/ */
if (field.getAttribute('type')) { if (field.getAttribute('type')) {
if (field.getAttribute('type') === 'list-single' || if (field.getAttribute('type') === 'list-single' || field.getAttribute('type') === 'list-multi') {
field.getAttribute('type') === 'list-multi') {
var values = _.map(u.queryChildren(field, 'value'), _.partial(_.get, _, 'textContent'));
const values = _.map( var options = _.map(u.queryChildren(field, 'option'), function (option) {
u.queryChildren(field, 'value'), var value = _.get(option.querySelector('value'), 'textContent');
_.partial(_.get, _, 'textContent') return tpl_select_option({
); 'value': value,
const options = _.map( 'label': option.getAttribute('label'),
u.queryChildren(field, 'option'), 'selected': _.startsWith(values, value),
function (option) { 'required': !_.isNil(field.querySelector('required'))
const value = _.get(option.querySelector('value'), 'textContent'); });
return tpl_select_option({ });
'value': value,
'label': option.getAttribute('label'),
'selected': _.startsWith(values, value),
'required': !_.isNil(field.querySelector('required'))
})
}
);
return tpl_form_select({ return tpl_form_select({
'name': field.getAttribute('var'), 'name': field.getAttribute('var'),
'label': field.getAttribute('label'), 'label': field.getAttribute('label'),
'options': options.join(''), 'options': options.join(''),
'multiple': (field.getAttribute('type') === 'list-multi'), 'multiple': field.getAttribute('type') === 'list-multi',
'required': !_.isNil(field.querySelector('required')) 'required': !_.isNil(field.querySelector('required'))
}); });
} else if (field.getAttribute('type') === 'fixed') { } else if (field.getAttribute('type') === 'fixed') {
const text = _.get(field.querySelector('value'), 'textContent'); var text = _.get(field.querySelector('value'), 'textContent');
return '<p class="form-help">'+text+'</p>'; return '<p class="form-help">' + text + '</p>';
} else if (field.getAttribute('type') === 'jid-multi') { } else if (field.getAttribute('type') === 'jid-multi') {
return tpl_form_textarea({ return tpl_form_textarea({
'name': field.getAttribute('var'), 'name': field.getAttribute('var'),
...@@ -18448,7 +18362,7 @@ return __p ...@@ -18448,7 +18362,7 @@ return __p
}); });
} else if (field.getAttribute('var') === 'username') { } else if (field.getAttribute('var') === 'username') {
return tpl_form_username({ return tpl_form_username({
'domain': ' @'+domain, 'domain': ' @' + domain,
'name': field.getAttribute('var'), 'name': field.getAttribute('var'),
'type': XFORM_TYPE_MAP[field.getAttribute('type')], 'type': XFORM_TYPE_MAP[field.getAttribute('type')],
'label': field.getAttribute('label') || '', 'label': field.getAttribute('label') || '',
...@@ -18466,9 +18380,10 @@ return __p ...@@ -18466,9 +18380,10 @@ return __p
}); });
} }
} else { } else {
if (field.getAttribute('var') === 'ocr') { // Captcha if (field.getAttribute('var') === 'ocr') {
const uri = field.querySelector('uri'); // Captcha
const el = sizzle('data[cid="'+uri.textContent.replace(/^cid:/, '')+'"]', stanza)[0]; var uri = field.querySelector('uri');
var el = sizzle('data[cid="' + uri.textContent.replace(/^cid:/, '') + '"]', stanza)[0];
return tpl_form_captcha({ return tpl_form_captcha({
'label': field.getAttribute('label'), 'label': field.getAttribute('label'),
'name': field.getAttribute('var'), 'name': field.getAttribute('var'),
...@@ -18478,10 +18393,10 @@ return __p ...@@ -18478,10 +18393,10 @@ return __p
}); });
} }
} }
} };
return u; return u;
})); });
//# sourceMappingURL=form-utils.js.map;
define('tpl!chatarea', ['lodash'], function(_) {return function(obj) { define('tpl!chatarea', ['lodash'], function(_) {return function(obj) {
obj || (obj = {}); obj || (obj = {});
...@@ -19060,6 +18975,8 @@ __p += '\n <input type="' + ...@@ -19060,6 +18975,8 @@ __p += '\n <input type="' +
return __p return __p
};}); };});
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -19072,29 +18989,34 @@ return __p ...@@ -19072,29 +18989,34 @@ return __p
/*global Backbone, define, window, document */ /*global Backbone, define, window, document */
(function (root, factory) { (function (root, factory) {
define('converse-disco',["converse-core", "sizzle", "strophe.disco"], factory); define('converse-disco',["converse-core", "sizzle", "strophe.disco"], factory);
}(this, function (converse, sizzle) { })(undefined, function (converse, sizzle) {
var _converse$env = converse.env,
Backbone = _converse$env.Backbone,
Promise = _converse$env.Promise,
Strophe = _converse$env.Strophe,
b64_sha1 = _converse$env.b64_sha1,
_ = _converse$env._;
const { Backbone, Promise, Strophe, b64_sha1, _ } = converse.env;
converse.plugins.add('converse-disco', { converse.plugins.add('converse-disco', {
initialize: function initialize() {
initialize () {
/* The initialize function gets called as soon as the plugin is /* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery. * loaded by converse.js's plugin machinery.
*/ */
const { _converse } = this; var _converse = this._converse;
function onDiscoItems (stanza) { function onDiscoItems(stanza) {
_.each(stanza.querySelectorAll('query item'), (item) => { _.each(stanza.querySelectorAll('query item'), function (item) {
if (item.getAttribute("node")) { if (item.getAttribute("node")) {
// XXX: ignore nodes for now. // XXX: ignore nodes for now.
// See: https://xmpp.org/extensions/xep-0030.html#items-nodes // See: https://xmpp.org/extensions/xep-0030.html#items-nodes
return; return;
} }
const jid = item.getAttribute('jid'); var jid = item.getAttribute('jid');
const entities = _converse.disco_entities; var entities = _converse.disco_entities;
if (_.isUndefined(entities.get(jid))) { if (_.isUndefined(entities.get(jid))) {
entities.create({'jid': jid}); entities.create({ 'jid': jid });
} }
}); });
} }
...@@ -19104,65 +19026,58 @@ return __p ...@@ -19104,65 +19026,58 @@ return __p
_converse.DiscoEntity = Backbone.Model.extend({ _converse.DiscoEntity = Backbone.Model.extend({
/* A Disco Entity is a JID addressable entity that can be queried /* A Disco Entity is a JID addressable entity that can be queried
* for features. * for features.
* *
* See XEP-0030: https://xmpp.org/extensions/xep-0030.html * See XEP-0030: https://xmpp.org/extensions/xep-0030.html
*/ */
idAttribute: 'jid', idAttribute: 'jid',
initialize () { initialize: function initialize() {
this.features = new Backbone.Collection(); this.features = new Backbone.Collection();
this.features.browserStorage = new Backbone.BrowserStorage[_converse.storage]( this.features.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.features-" + this.get('jid')));
b64_sha1(`converse.features-${this.get('jid')}`)
);
this.features.on('add', this.onFeatureAdded); this.features.on('add', this.onFeatureAdded);
this.identities = new Backbone.Collection(); this.identities = new Backbone.Collection();
this.identities.browserStorage = new Backbone.BrowserStorage[_converse.storage]( this.identities.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.identities-" + this.get('jid')));
b64_sha1(`converse.identities-${this.get('jid')}`)
);
this.fetchFeatures(); this.fetchFeatures();
}, },
onFeatureAdded: function onFeatureAdded(feature) {
onFeatureAdded (feature) {
_converse.emit('serviceDiscovered', feature); _converse.emit('serviceDiscovered', feature);
}, },
fetchFeatures: function fetchFeatures() {
fetchFeatures () {
if (this.features.browserStorage.records.length === 0) { if (this.features.browserStorage.records.length === 0) {
this.queryInfo(); this.queryInfo();
} else { } else {
this.features.fetch({add: true}); this.features.fetch({ add: true });
this.identities.fetch({add: true}); this.identities.fetch({ add: true });
} }
}, },
queryInfo: function queryInfo() {
queryInfo () {
_converse.connection.disco.info(this.get('jid'), null, this.onInfo.bind(this)); _converse.connection.disco.info(this.get('jid'), null, this.onInfo.bind(this));
}, },
queryForItems: function queryForItems() {
queryForItems () { if (_.isEmpty(this.identities.where({ 'category': 'server' }))) {
if (_.isEmpty(this.identities.where({'category': 'server'}))) {
// Don't fetch features and items if this is not a // Don't fetch features and items if this is not a
// server or a conference component. // server or a conference component.
return; return;
} }
_converse.connection.disco.items(this.get('jid'), null, onDiscoItems); _converse.connection.disco.items(this.get('jid'), null, onDiscoItems);
}, },
onInfo: function onInfo(stanza) {
var _this = this;
onInfo (stanza) { _.forEach(stanza.querySelectorAll('identity'), function (identity) {
_.forEach(stanza.querySelectorAll('identity'), (identity) => { _this.identities.create({
this.identities.create({
'category': identity.getAttribute('category'), 'category': identity.getAttribute('category'),
'type': stanza.getAttribute('type'), 'type': stanza.getAttribute('type'),
'name': stanza.getAttribute('name') 'name': stanza.getAttribute('name')
}); });
}); });
if (stanza.querySelector('feature[var="'+Strophe.NS.DISCO_ITEMS+'"]')) { if (stanza.querySelector('feature[var="' + Strophe.NS.DISCO_ITEMS + '"]')) {
this.queryForItems(); this.queryForItems();
} }
_.forEach(stanza.querySelectorAll('feature'), (feature) => { _.forEach(stanza.querySelectorAll('feature'), function (feature) {
this.features.create({ _this.features.create({
'var': feature.getAttribute('var'), 'var': feature.getAttribute('var'),
'from': stanza.getAttribute('from') 'from': stanza.getAttribute('from')
}); });
...@@ -19174,35 +19089,31 @@ return __p ...@@ -19174,35 +19089,31 @@ return __p
_converse.DiscoEntities = Backbone.Collection.extend({ _converse.DiscoEntities = Backbone.Collection.extend({
model: _converse.DiscoEntity, model: _converse.DiscoEntity,
initialize () { initialize: function initialize() {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage]( this.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.disco-entities-" + _converse.bare_jid));
b64_sha1(`converse.disco-entities-${_converse.bare_jid}`) this.fetchEntities().then(_.partial(_converse.emit, 'discoInitialized'), _.partial(_converse.emit, 'discoInitialized')).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
);
this.fetchEntities().then(
_.partial(_converse.emit, 'discoInitialized'),
_.partial(_converse.emit, 'discoInitialized')
).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
}, },
fetchEntities: function fetchEntities() {
var _this2 = this;
fetchEntities () { return new Promise(function (resolve, reject) {
return new Promise((resolve, reject) => { _this2.fetch({
this.fetch({
add: true, add: true,
success: function (collection) { success: function (collection) {
if (collection.length === 0 || !collection.get(_converse.domain)) { if (collection.length === 0 || !collection.get(_converse.domain)) {
this.create({'jid': _converse.domain}); this.create({ 'jid': _converse.domain });
} }
resolve(); resolve();
}.bind(this), }.bind(_this2),
error () { error: function error() {
reject (new Error("Could not fetch disco entities")); reject(new Error("Could not fetch disco entities"));
} }
}); });
}); });
} }
}); });
function addClientFeatures () { function addClientFeatures() {
/* The strophe.disco.js plugin keeps a list of features which /* The strophe.disco.js plugin keeps a list of features which
* it will advertise to any #info queries made to it. * it will advertise to any #info queries made to it.
* *
...@@ -19223,16 +19134,16 @@ return __p ...@@ -19223,16 +19134,16 @@ return __p
return this; return this;
} }
function initializeDisco () { function initializeDisco() {
addClientFeatures(); addClientFeatures();
_converse.disco_entities = new _converse.DiscoEntities(); _converse.disco_entities = new _converse.DiscoEntities();
} }
_converse.api.listen.on('reconnected', initializeDisco); _converse.api.listen.on('reconnected', initializeDisco);
_converse.api.listen.on('connected', initializeDisco); _converse.api.listen.on('connected', initializeDisco);
_converse.api.listen.on('beforeTearDown', () => { _converse.api.listen.on('beforeTearDown', function () {
if (_converse.disco_entities) { if (_converse.disco_entities) {
_converse.disco_entities.each((entity) => { _converse.disco_entities.each(function (entity) {
entity.features.reset(); entity.features.reset();
entity.features.browserStorage._clear(); entity.features.browserStorage._clear();
}); });
...@@ -19240,10 +19151,47 @@ return __p ...@@ -19240,10 +19151,47 @@ return __p
_converse.disco_entities.browserStorage._clear(); _converse.disco_entities.browserStorage._clear();
} }
}); });
/* We extend the default converse.js API to add methods specific to service discovery */
_.extend(_converse.api, {
'disco': {
'supports': function supports(entity_jid, feature) {
/* Returns a Promise which returns a boolean indicating
* whether the feature is supported or by the given
* entity or not.
*
* Parameters:
* (String) entity_jid - The JID of the entity which might support the feature.
* (String) feature - The feature that might be
* supported. In the XML stanza, this is the `var`
* attribute of the `<feature>` element. For
* example: 'http://jabber.org/protocol/muc'
*/
return _converse.api.waitUntil('discoInitialized').then(function () {
return new Promise(function (resolve, reject) {
function fulfillPromise(entity) {
if (entity.features.findWhere({ 'var': feature })) {
resolve(true);
} else {
resolve(false);
}
}
var entity = _converse.disco_entities.get(entity_jid);
if (_.isUndefined(entity)) {
entity = _converse.disco_entities.create({ 'jid': entity_jid });
entity.on('featuresDiscovered', _.partial(fulfillPromise, entity));
} else {
fulfillPromise(entity);
}
});
});
}
}
});
} }
}); });
})); });
//# sourceMappingURL=converse-disco.js.map;
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
...@@ -22766,31 +22714,6 @@ return __p ...@@ -22766,31 +22714,6 @@ return __p
// XEP-0313 Message Archive Management // XEP-0313 Message Archive Management
var MAM_ATTRIBUTES = ['with', 'start', 'end']; var MAM_ATTRIBUTES = ['with', 'start', 'end'];
function checkMAMSupport(_converse) {
/* Returns a promise which resolves when MAM is supported
* for this user, or which rejects if not.
*/
return _converse.api.waitUntil('discoInitialized').then(function () {
return new Promise(function (resolve, reject) {
function fulfillPromise(entity) {
if (entity.features.findWhere({ 'var': Strophe.NS.MAM })) {
resolve(true);
} else {
resolve(false);
}
}
var entity = _converse.disco_entities.get(_converse.bare_jid);
if (_.isUndefined(entity)) {
entity = _converse.disco_entities.create({ 'jid': _converse.bare_jid });
entity.on('featuresDiscovered', _.partial(fulfillPromise, entity));
} else {
fulfillPromise(entity);
}
});
});
}
converse.plugins.add('converse-mam', { converse.plugins.add('converse-mam', {
overrides: { overrides: {
...@@ -22826,7 +22749,7 @@ return __p ...@@ -22826,7 +22749,7 @@ return __p
this.addSpinner(); this.addSpinner();
checkMAMSupport(_converse).then(function (supported) { _converse.api.disco.supports(_converse.bare_jid, Strophe.NS.MAM).then(function (supported) {
// Success // Success
if (supported) { if (supported) {
_this.fetchArchivedMessages(); _this.fetchArchivedMessages();
...@@ -23046,19 +22969,6 @@ return __p ...@@ -23046,19 +22969,6 @@ return __p
}, _converse.message_archiving_timeout); }, _converse.message_archiving_timeout);
}; };
_.extend(_converse.api, {
/* Extend default converse.js API to add methods specific to MAM
*/
'archive': {
'query': function query() {
if (!_converse.api.connection.connected()) {
throw new Error('Can\'t call `api.archive.query` before having established an XMPP session');
}
return _converse.queryForArchivedMessages.apply(this, arguments);
}
}
});
_converse.onMAMError = function (iq) { _converse.onMAMError = function (iq) {
if ($(iq).find('feature-not-implemented').length) { if ($(iq).find('feature-not-implemented').length) {
_converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN); _converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN);
...@@ -23115,6 +23025,19 @@ return __p ...@@ -23115,6 +23025,19 @@ return __p
_converse.on('afterMessagesFetched', function (chatboxview) { _converse.on('afterMessagesFetched', function (chatboxview) {
chatboxview.fetchArchivedMessagesIfNecessary(); chatboxview.fetchArchivedMessagesIfNecessary();
}); });
_.extend(_converse.api, {
/* Extend default converse.js API to add methods specific to MAM
*/
'archive': {
'query': function query() {
if (!_converse.api.connection.connected()) {
throw new Error('Can\'t call `api.archive.query` before having established an XMPP session');
}
return _converse.queryForArchivedMessages.apply(this, arguments);
}
}
});
} }
}); });
}); });
...@@ -26129,6 +26052,8 @@ return __p ...@@ -26129,6 +26052,8 @@ return __p
}); });
}); });
//# sourceMappingURL=converse-singleton.js.map; //# sourceMappingURL=converse-singleton.js.map;
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -26138,23 +26063,21 @@ return __p ...@@ -26138,23 +26063,21 @@ return __p
/*global define */ /*global define */
(function (root, factory) { (function (root, factory) {
define('converse-fullscreen',["converse-core", define('converse-fullscreen',["converse-core", "tpl!inverse_brand_heading", "converse-chatview", "converse-controlbox", "converse-muc", "converse-singleton"], factory);
"tpl!inverse_brand_heading", })(undefined, function (converse, tpl_brand_heading) {
"converse-chatview",
"converse-controlbox",
"converse-muc",
"converse-singleton"
], factory);
}(this, function (converse, tpl_brand_heading) {
"use strict"; "use strict";
const { Strophe, _ } = converse.env;
converse.plugins.add('converse-fullscreen', { var _converse$env = converse.env,
Strophe = _converse$env.Strophe,
_ = _converse$env._;
enabled (_converse) { converse.plugins.add('converse-fullscreen', {
enabled: function enabled(_converse) {
return _.includes(['mobile', 'fullscreen'], _converse.view_mode); return _.includes(['mobile', 'fullscreen'], _converse.view_mode);
}, },
overrides: { overrides: {
// overrides mentioned here will be picked up by converse.js's // overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the // plugin architecture they will replace existing methods on the
...@@ -26163,21 +26086,17 @@ return __p ...@@ -26163,21 +26086,17 @@ return __p
// new functions which don't exist yet can also be added. // new functions which don't exist yet can also be added.
ControlBoxView: { ControlBoxView: {
createBrandHeadingHTML() { createBrandHeadingHTML: function createBrandHeadingHTML() {
return tpl_brand_heading(); return tpl_brand_heading();
}, },
insertBrandHeading: function insertBrandHeading() {
insertBrandHeading () { var el = document.getElementById('converse-login-panel');
const el = document.getElementById('converse-login-panel'); el.parentNode.insertAdjacentHTML('afterbegin', this.createBrandHeadingHTML());
el.parentNode.insertAdjacentHTML(
'afterbegin',
this.createBrandHeadingHTML()
);
} }
}, },
ChatRoomView: { ChatRoomView: {
afterShown (focus) { afterShown: function afterShown(focus) {
/* Make sure chat rooms are scrolled down when opened /* Make sure chat rooms are scrolled down when opened
*/ */
this.scrollDown(); this.scrollDown();
...@@ -26189,28 +26108,23 @@ return __p ...@@ -26189,28 +26108,23 @@ return __p
} }
}, },
initialize () { initialize: function initialize() {
this._converse.api.settings.update({ this._converse.api.settings.update({
chatview_avatar_height: 44, chatview_avatar_height: 44,
chatview_avatar_width: 44, chatview_avatar_width: 44,
hide_open_bookmarks: true, hide_open_bookmarks: true,
show_controlbox_by_default: true, show_controlbox_by_default: true,
sticky_controlbox: true, sticky_controlbox: true
view_mode: 'fullscreen'
}); });
} }
}); });
})); });
//# sourceMappingURL=converse-fullscreen.js.map;
/*global define */ /*global define */
if (typeof define !== 'undefined') { if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build // The section below determines which plugins will be included in a build
define('converse',[ define('converse',[
"converse-core", "converse-core",
// PLEASE NOTE: By default all translations are included.
// You can modify the file src/locales.js to include only those
// translations that you care about.
/* START: Removable components /* START: Removable components
* -------------------- * --------------------
* Any of the following components may be removed if they're not needed. * Any of the following components may be removed if they're not needed.
...@@ -26270,6 +26184,5 @@ if (typeof define !== 'undefined') { ...@@ -26270,6 +26184,5 @@ if (typeof define !== 'undefined') {
define('backbone.browserStorage', ['backbone'], emptyFunction); define('backbone.browserStorage', ['backbone'], emptyFunction);
define('backbone.overview', ['backbone'], emptyFunction); define('backbone.overview', ['backbone'], emptyFunction);
define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };}); define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
define("locales", [], emptyFunction);
return require('converse'); return require('converse');
})); }));
...@@ -27902,6 +27902,8 @@ return uk; ...@@ -27902,6 +27902,8 @@ return uk;
}))); })));
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -27913,32 +27915,11 @@ return uk; ...@@ -27913,32 +27915,11 @@ return uk;
/*global define */ /*global define */
(function (root, factory) { (function (root, factory) {
define('i18n',[ define('i18n',["es6-promise", "jed", "lodash.noconflict", "moment", 'moment/locale/af', 'moment/locale/ca', 'moment/locale/de', 'moment/locale/es', 'moment/locale/fr', 'moment/locale/he', 'moment/locale/hu', 'moment/locale/id', 'moment/locale/it', 'moment/locale/ja', 'moment/locale/nb', 'moment/locale/nl', 'moment/locale/pl', 'moment/locale/pt-br', 'moment/locale/ru', 'moment/locale/uk'], factory);
"es6-promise", })(undefined, function (Promise, Jed, _, moment) {
"jed",
"lodash.noconflict",
"moment",
'moment/locale/af',
'moment/locale/ca',
'moment/locale/de',
'moment/locale/es',
'moment/locale/fr',
'moment/locale/he',
'moment/locale/hu',
'moment/locale/id',
'moment/locale/it',
'moment/locale/ja',
'moment/locale/nb',
'moment/locale/nl',
'moment/locale/pl',
'moment/locale/pt-br',
'moment/locale/ru',
'moment/locale/uk',
], factory);
}(this, function (Promise, Jed, _, moment) {
'use strict'; 'use strict';
function detectLocale (library_check) { function detectLocale(library_check) {
/* Determine which locale is supported by the user's system as well /* Determine which locale is supported by the user's system as well
* as by the relevant library (e.g. converse.js or moment.js). * as by the relevant library (e.g. converse.js or moment.js).
* *
...@@ -27951,7 +27932,7 @@ return uk; ...@@ -27951,7 +27932,7 @@ return uk;
locale = isLocaleAvailable(window.navigator.userLanguage, library_check); locale = isLocaleAvailable(window.navigator.userLanguage, library_check);
} }
if (window.navigator.languages && !locale) { if (window.navigator.languages && !locale) {
for (i=0; i<window.navigator.languages.length && !locale; i++) { for (i = 0; i < window.navigator.languages.length && !locale; i++) {
locale = isLocaleAvailable(window.navigator.languages[i], library_check); locale = isLocaleAvailable(window.navigator.languages[i], library_check);
} }
} }
...@@ -27967,15 +27948,15 @@ return uk; ...@@ -27967,15 +27948,15 @@ return uk;
return locale || 'en'; return locale || 'en';
} }
function isMomentLocale (locale) { function isMomentLocale(locale) {
return _.isString(locale) && moment.locale() === moment.locale(locale); return _.isString(locale) && moment.locale() === moment.locale(locale);
} }
function isConverseLocale (locale, supported_locales) { function isConverseLocale(locale, supported_locales) {
return _.isString(locale) && _.includes(supported_locales, locale); return _.isString(locale) && _.includes(supported_locales, locale);
} }
function getLocale (preferred_locale, isSupportedByLibrary) { function getLocale(preferred_locale, isSupportedByLibrary) {
if (_.isString(preferred_locale)) { if (_.isString(preferred_locale)) {
if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) { if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
return preferred_locale; return preferred_locale;
...@@ -27984,7 +27965,7 @@ return uk; ...@@ -27984,7 +27965,7 @@ return uk;
return detectLocale(isSupportedByLibrary) || 'en'; return detectLocale(isSupportedByLibrary) || 'en';
} }
function isLocaleAvailable (locale, available) { function isLocaleAvailable(locale, available) {
/* Check whether the locale or sub locale (e.g. en-US, en) is supported. /* Check whether the locale or sub locale (e.g. en-US, en) is supported.
* *
* Parameters: * Parameters:
...@@ -28001,31 +27982,25 @@ return uk; ...@@ -28001,31 +27982,25 @@ return uk;
} }
} }
let jed_instance; var jed_instance = void 0;
return { return {
setLocales: function setLocales(preferred_locale, _converse) {
setLocales (preferred_locale, _converse) { _converse.locale = getLocale(preferred_locale, _.partial(isConverseLocale, _, _converse.locales));
_converse.locale = getLocale(
preferred_locale,
_.partial(isConverseLocale, _, _converse.locales)
);
moment.locale(getLocale(preferred_locale, isMomentLocale)); moment.locale(getLocale(preferred_locale, isMomentLocale));
}, },
translate: function translate(str) {
translate (str) {
if (_.isNil(jed_instance)) { if (_.isNil(jed_instance)) {
return Jed.sprintf.apply(Jed, arguments); return Jed.sprintf.apply(Jed, arguments);
} }
var t = jed_instance.translate(str); var t = jed_instance.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();
} }
}, },
fetchTranslations: function fetchTranslations(locale, supported_locales, locale_url) {
fetchTranslations (locale, supported_locales, locale_url) {
/* Fetch the translations for the given local at the given URL. /* Fetch the translations for the given local at the given URL.
* *
* Parameters: * Parameters:
...@@ -28034,16 +28009,13 @@ return uk; ...@@ -28034,16 +28009,13 @@ return uk;
* (String) locale_url: The URL from which the translations * (String) locale_url: The URL from which the translations
* should be fetched. * should be fetched.
*/ */
return new Promise((resolve, reject) => { return new Promise(function (resolve, reject) {
if (!isConverseLocale(locale, supported_locales) || locale === 'en') { if (!isConverseLocale(locale, supported_locales) || locale === 'en') {
return resolve(); return resolve();
} }
const xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('GET', locale_url, true); xhr.open('GET', locale_url, true);
xhr.setRequestHeader( xhr.setRequestHeader('Accept', "application/json, text/javascript");
'Accept',
"application/json, text/javascript"
);
xhr.onload = function () { xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 400) { if (xhr.status >= 200 && xhr.status < 400) {
jed_instance = new Jed(window.JSON.parse(xhr.responseText)); jed_instance = new Jed(window.JSON.parse(xhr.responseText));
...@@ -28059,8 +28031,8 @@ return uk; ...@@ -28059,8 +28031,8 @@ return uk;
}); });
} }
}; };
})); });
//# sourceMappingURL=i18n.js.map;
/*! /*!
* jQuery JavaScript Library v2.2.3 * jQuery JavaScript Library v2.2.3
* http://jquery.com/ * http://jquery.com/
...@@ -59398,7 +59370,7 @@ return __p ...@@ -59398,7 +59370,7 @@ return __p
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com> // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2) // Licensed under the Mozilla Public License (MPLv2)
// //
/*global define, escape, locales, Jed */ /*global define, escape, Jed */
(function (root, factory) { (function (root, factory) {
define('form-utils',["sizzle", "lodash.noconflict", "utils", "tpl!field", "tpl!select_option", "tpl!form_select", "tpl!form_textarea", "tpl!form_checkbox", "tpl!form_username", "tpl!form_input", "tpl!form_captcha", "tpl!form_url"], factory); define('form-utils',["sizzle", "lodash.noconflict", "utils", "tpl!field", "tpl!select_option", "tpl!form_select", "tpl!form_textarea", "tpl!form_checkbox", "tpl!form_username", "tpl!form_input", "tpl!form_captcha", "tpl!form_url"], factory);
})(undefined, function (sizzle, _, u, tpl_field, tpl_select_option, tpl_form_select, tpl_form_textarea, tpl_form_checkbox, tpl_form_username, tpl_form_input, tpl_form_captcha, tpl_form_url) { })(undefined, function (sizzle, _, u, tpl_field, tpl_select_option, tpl_form_select, tpl_form_textarea, tpl_form_checkbox, tpl_form_username, tpl_form_input, tpl_form_captcha, tpl_form_url) {
...@@ -60934,10 +60906,10 @@ Strophe.addConnectionPlugin('disco', ...@@ -60934,10 +60906,10 @@ Strophe.addConnectionPlugin('disco',
_converse.DiscoEntity = Backbone.Model.extend({ _converse.DiscoEntity = Backbone.Model.extend({
/* A Disco Entity is a JID addressable entity that can be queried /* A Disco Entity is a JID addressable entity that can be queried
* for features. * for features.
* *
* See XEP-0030: https://xmpp.org/extensions/xep-0030.html * See XEP-0030: https://xmpp.org/extensions/xep-0030.html
*/ */
idAttribute: 'jid', idAttribute: 'jid',
initialize: function initialize() { initialize: function initialize() {
...@@ -61059,6 +61031,43 @@ Strophe.addConnectionPlugin('disco', ...@@ -61059,6 +61031,43 @@ Strophe.addConnectionPlugin('disco',
_converse.disco_entities.browserStorage._clear(); _converse.disco_entities.browserStorage._clear();
} }
}); });
/* We extend the default converse.js API to add methods specific to service discovery */
_.extend(_converse.api, {
'disco': {
'supports': function supports(entity_jid, feature) {
/* Returns a Promise which returns a boolean indicating
* whether the feature is supported or by the given
* entity or not.
*
* Parameters:
* (String) entity_jid - The JID of the entity which might support the feature.
* (String) feature - The feature that might be
* supported. In the XML stanza, this is the `var`
* attribute of the `<feature>` element. For
* example: 'http://jabber.org/protocol/muc'
*/
return _converse.api.waitUntil('discoInitialized').then(function () {
return new Promise(function (resolve, reject) {
function fulfillPromise(entity) {
if (entity.features.findWhere({ 'var': feature })) {
resolve(true);
} else {
resolve(false);
}
}
var entity = _converse.disco_entities.get(entity_jid);
if (_.isUndefined(entity)) {
entity = _converse.disco_entities.create({ 'jid': entity_jid });
entity.on('featuresDiscovered', _.partial(fulfillPromise, entity));
} else {
fulfillPromise(entity);
}
});
});
}
}
});
} }
}); });
}); });
...@@ -64666,31 +64675,6 @@ Strophe.RSM.prototype = { ...@@ -64666,31 +64675,6 @@ Strophe.RSM.prototype = {
// XEP-0313 Message Archive Management // XEP-0313 Message Archive Management
var MAM_ATTRIBUTES = ['with', 'start', 'end']; var MAM_ATTRIBUTES = ['with', 'start', 'end'];
function checkMAMSupport(_converse) {
/* Returns a promise which resolves when MAM is supported
* for this user, or which rejects if not.
*/
return _converse.api.waitUntil('discoInitialized').then(function () {
return new Promise(function (resolve, reject) {
function fulfillPromise(entity) {
if (entity.features.findWhere({ 'var': Strophe.NS.MAM })) {
resolve(true);
} else {
resolve(false);
}
}
var entity = _converse.disco_entities.get(_converse.bare_jid);
if (_.isUndefined(entity)) {
entity = _converse.disco_entities.create({ 'jid': _converse.bare_jid });
entity.on('featuresDiscovered', _.partial(fulfillPromise, entity));
} else {
fulfillPromise(entity);
}
});
});
}
converse.plugins.add('converse-mam', { converse.plugins.add('converse-mam', {
overrides: { overrides: {
...@@ -64726,7 +64710,7 @@ Strophe.RSM.prototype = { ...@@ -64726,7 +64710,7 @@ Strophe.RSM.prototype = {
this.addSpinner(); this.addSpinner();
checkMAMSupport(_converse).then(function (supported) { _converse.api.disco.supports(_converse.bare_jid, Strophe.NS.MAM).then(function (supported) {
// Success // Success
if (supported) { if (supported) {
_this.fetchArchivedMessages(); _this.fetchArchivedMessages();
...@@ -64946,19 +64930,6 @@ Strophe.RSM.prototype = { ...@@ -64946,19 +64930,6 @@ Strophe.RSM.prototype = {
}, _converse.message_archiving_timeout); }, _converse.message_archiving_timeout);
}; };
_.extend(_converse.api, {
/* Extend default converse.js API to add methods specific to MAM
*/
'archive': {
'query': function query() {
if (!_converse.api.connection.connected()) {
throw new Error('Can\'t call `api.archive.query` before having established an XMPP session');
}
return _converse.queryForArchivedMessages.apply(this, arguments);
}
}
});
_converse.onMAMError = function (iq) { _converse.onMAMError = function (iq) {
if ($(iq).find('feature-not-implemented').length) { if ($(iq).find('feature-not-implemented').length) {
_converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN); _converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN);
...@@ -65015,6 +64986,19 @@ Strophe.RSM.prototype = { ...@@ -65015,6 +64986,19 @@ Strophe.RSM.prototype = {
_converse.on('afterMessagesFetched', function (chatboxview) { _converse.on('afterMessagesFetched', function (chatboxview) {
chatboxview.fetchArchivedMessagesIfNecessary(); chatboxview.fetchArchivedMessagesIfNecessary();
}); });
_.extend(_converse.api, {
/* Extend default converse.js API to add methods specific to MAM
*/
'archive': {
'query': function query() {
if (!_converse.api.connection.connected()) {
throw new Error('Can\'t call `api.archive.query` before having established an XMPP session');
}
return _converse.queryForArchivedMessages.apply(this, arguments);
}
}
});
} }
}); });
}); });
...@@ -75431,6 +75415,8 @@ return __p ...@@ -75431,6 +75415,8 @@ return __p
}); });
}); });
//# sourceMappingURL=converse-singleton.js.map; //# sourceMappingURL=converse-singleton.js.map;
// Converse.js (A browser based XMPP chat client) // Converse.js (A browser based XMPP chat client)
// http://conversejs.org // http://conversejs.org
// //
...@@ -75440,23 +75426,21 @@ return __p ...@@ -75440,23 +75426,21 @@ return __p
/*global define */ /*global define */
(function (root, factory) { (function (root, factory) {
define('converse-fullscreen',["converse-core", define('converse-fullscreen',["converse-core", "tpl!inverse_brand_heading", "converse-chatview", "converse-controlbox", "converse-muc", "converse-singleton"], factory);
"tpl!inverse_brand_heading", })(undefined, function (converse, tpl_brand_heading) {
"converse-chatview",
"converse-controlbox",
"converse-muc",
"converse-singleton"
], factory);
}(this, function (converse, tpl_brand_heading) {
"use strict"; "use strict";
const { Strophe, _ } = converse.env;
converse.plugins.add('converse-fullscreen', { var _converse$env = converse.env,
Strophe = _converse$env.Strophe,
_ = _converse$env._;
enabled (_converse) { converse.plugins.add('converse-fullscreen', {
enabled: function enabled(_converse) {
return _.includes(['mobile', 'fullscreen'], _converse.view_mode); return _.includes(['mobile', 'fullscreen'], _converse.view_mode);
}, },
overrides: { overrides: {
// overrides mentioned here will be picked up by converse.js's // overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the // plugin architecture they will replace existing methods on the
...@@ -75465,21 +75449,17 @@ return __p ...@@ -75465,21 +75449,17 @@ return __p
// new functions which don't exist yet can also be added. // new functions which don't exist yet can also be added.
ControlBoxView: { ControlBoxView: {
createBrandHeadingHTML() { createBrandHeadingHTML: function createBrandHeadingHTML() {
return tpl_brand_heading(); return tpl_brand_heading();
}, },
insertBrandHeading: function insertBrandHeading() {
insertBrandHeading () { var el = document.getElementById('converse-login-panel');
const el = document.getElementById('converse-login-panel'); el.parentNode.insertAdjacentHTML('afterbegin', this.createBrandHeadingHTML());
el.parentNode.insertAdjacentHTML(
'afterbegin',
this.createBrandHeadingHTML()
);
} }
}, },
ChatRoomView: { ChatRoomView: {
afterShown (focus) { afterShown: function afterShown(focus) {
/* Make sure chat rooms are scrolled down when opened /* Make sure chat rooms are scrolled down when opened
*/ */
this.scrollDown(); this.scrollDown();
...@@ -75491,28 +75471,23 @@ return __p ...@@ -75491,28 +75471,23 @@ return __p
} }
}, },
initialize () { initialize: function initialize() {
this._converse.api.settings.update({ this._converse.api.settings.update({
chatview_avatar_height: 44, chatview_avatar_height: 44,
chatview_avatar_width: 44, chatview_avatar_width: 44,
hide_open_bookmarks: true, hide_open_bookmarks: true,
show_controlbox_by_default: true, show_controlbox_by_default: true,
sticky_controlbox: true, sticky_controlbox: true
view_mode: 'fullscreen'
}); });
} }
}); });
})); });
//# sourceMappingURL=converse-fullscreen.js.map;
/*global define */ /*global define */
if (typeof define !== 'undefined') { if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build // The section below determines which plugins will be included in a build
define('converse',[ define('converse',[
"converse-core", "converse-core",
// PLEASE NOTE: By default all translations are included.
// You can modify the file src/locales.js to include only those
// translations that you care about.
/* START: Removable components /* START: Removable components
* -------------------- * --------------------
* Any of the following components may be removed if they're not needed. * Any of the following components may be removed if they're not needed.
...@@ -215,12 +215,6 @@ ...@@ -215,12 +215,6 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"array-find-index": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
"integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
"dev": true
},
"array-union": { "array-union": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
...@@ -1246,24 +1240,6 @@ ...@@ -1246,24 +1240,6 @@
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
"dev": true "dev": true
}, },
"camelcase-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
"dev": true,
"requires": {
"camelcase": "2.1.1",
"map-obj": "1.0.1"
},
"dependencies": {
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
"integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
"dev": true
}
}
},
"camelize": { "camelize": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz",
...@@ -1620,12 +1596,6 @@ ...@@ -1620,12 +1596,6 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true
}, },
"coffee-script": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.10.0.tgz",
"integrity": "sha1-EpOLz5vhlI+gBvkuDEyegXBRCMA=",
"dev": true
},
"color-convert": { "color-convert": {
"version": "1.9.0", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
...@@ -1778,15 +1748,6 @@ ...@@ -1778,15 +1748,6 @@
"integrity": "sha1-j1zrOqvXaNtTnaRYKyFS1j73cV4=", "integrity": "sha1-j1zrOqvXaNtTnaRYKyFS1j73cV4=",
"dev": true "dev": true
}, },
"currently-unhandled": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
"integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
"dev": true,
"requires": {
"array-find-index": "1.0.2"
}
},
"d": { "d": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
...@@ -1819,16 +1780,6 @@ ...@@ -1819,16 +1780,6 @@
"integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
"dev": true "dev": true
}, },
"dateformat": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz",
"integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=",
"dev": true,
"requires": {
"get-stdin": "4.0.1",
"meow": "3.7.0"
}
},
"debug": { "debug": {
"version": "2.6.8", "version": "2.6.8",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
...@@ -2308,12 +2259,6 @@ ...@@ -2308,12 +2259,6 @@
"es5-ext": "0.10.30" "es5-ext": "0.10.30"
} }
}, },
"eventemitter2": {
"version": "0.4.14",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
"integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=",
"dev": true
},
"eventemitter3": { "eventemitter3": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz",
...@@ -2463,30 +2408,6 @@ ...@@ -2463,30 +2408,6 @@
"pinkie-promise": "2.0.1" "pinkie-promise": "2.0.1"
} }
}, },
"findup-sync": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
"integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=",
"dev": true,
"requires": {
"glob": "5.0.15"
},
"dependencies": {
"glob": {
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
"dev": true,
"requires": {
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
}
}
},
"flat-cache": { "flat-cache": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz",
...@@ -3501,24 +3422,12 @@ ...@@ -3501,24 +3422,12 @@
"integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
"dev": true "dev": true
}, },
"get-stdin": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
"dev": true
},
"get-stream": { "get-stream": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true "dev": true
}, },
"getobject": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz",
"integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=",
"dev": true
},
"getpass": { "getpass": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
...@@ -3793,177 +3702,6 @@ ...@@ -3793,177 +3702,6 @@
} }
} }
}, },
"grunt": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.1.tgz",
"integrity": "sha1-6HeHZOlEsY8yuw8QuQeEdcnftWs=",
"dev": true,
"requires": {
"coffee-script": "1.10.0",
"dateformat": "1.0.12",
"eventemitter2": "0.4.14",
"exit": "0.1.2",
"findup-sync": "0.3.0",
"glob": "7.0.6",
"grunt-cli": "1.2.0",
"grunt-known-options": "1.1.0",
"grunt-legacy-log": "1.0.0",
"grunt-legacy-util": "1.0.0",
"iconv-lite": "0.4.18",
"js-yaml": "3.5.5",
"minimatch": "3.0.4",
"nopt": "3.0.6",
"path-is-absolute": "1.0.1",
"rimraf": "2.2.8"
},
"dependencies": {
"esprima": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
"integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
"dev": true
},
"glob": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz",
"integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"js-yaml": {
"version": "3.5.5",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz",
"integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=",
"dev": true,
"requires": {
"argparse": "1.0.9",
"esprima": "2.7.3"
}
},
"rimraf": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=",
"dev": true
}
}
},
"grunt-cli": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz",
"integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=",
"dev": true,
"requires": {
"findup-sync": "0.3.0",
"grunt-known-options": "1.1.0",
"nopt": "3.0.6",
"resolve": "1.1.7"
},
"dependencies": {
"resolve": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=",
"dev": true
}
}
},
"grunt-json": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/grunt-json/-/grunt-json-0.2.0.tgz",
"integrity": "sha1-+dgHhWMZiqXDPJkE/yXQiO5TLUE=",
"dev": true
},
"grunt-known-options": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz",
"integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=",
"dev": true
},
"grunt-legacy-log": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-1.0.0.tgz",
"integrity": "sha1-+4bxgJhHvAfcR4Q/ns1srLYt8tU=",
"dev": true,
"requires": {
"colors": "1.1.2",
"grunt-legacy-log-utils": "1.0.0",
"hooker": "0.2.3",
"lodash": "3.10.1",
"underscore.string": "3.2.3"
},
"dependencies": {
"colors": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
"integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
"dev": true
},
"lodash": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true
}
}
},
"grunt-legacy-log-utils": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-1.0.0.tgz",
"integrity": "sha1-p7ji0Ps1taUPSvmG/BEnSevJbz0=",
"dev": true,
"requires": {
"chalk": "1.1.3",
"lodash": "4.3.0"
},
"dependencies": {
"lodash": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz",
"integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=",
"dev": true
}
}
},
"grunt-legacy-util": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.0.0.tgz",
"integrity": "sha1-OGqnjcbtUJhsKxiVcmWxtIq7m4Y=",
"dev": true,
"requires": {
"async": "1.5.2",
"exit": "0.1.2",
"getobject": "0.1.0",
"hooker": "0.2.3",
"lodash": "4.3.0",
"underscore.string": "3.2.3",
"which": "1.2.14"
},
"dependencies": {
"lodash": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz",
"integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=",
"dev": true
},
"which": {
"version": "1.2.14",
"resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz",
"integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=",
"dev": true,
"requires": {
"isexe": "2.0.0"
}
}
}
},
"har-schema": { "har-schema": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz",
...@@ -4059,12 +3797,6 @@ ...@@ -4059,12 +3797,6 @@
"os-tmpdir": "1.0.2" "os-tmpdir": "1.0.2"
} }
}, },
"hooker": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
"integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=",
"dev": true
},
"hosted-git-info": { "hosted-git-info": {
"version": "2.5.0", "version": "2.5.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
...@@ -4165,15 +3897,6 @@ ...@@ -4165,15 +3897,6 @@
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
"dev": true "dev": true
}, },
"indent-string": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
"integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
"dev": true,
"requires": {
"repeating": "2.0.1"
}
},
"individual": { "individual": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz", "resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz",
...@@ -4815,16 +4538,6 @@ ...@@ -4815,16 +4538,6 @@
"js-tokens": "3.0.2" "js-tokens": "3.0.2"
} }
}, },
"loud-rejection": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
"integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
"dev": true,
"requires": {
"currently-unhandled": "0.4.1",
"signal-exit": "3.0.2"
}
},
"lowercase-keys": { "lowercase-keys": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz",
...@@ -4841,12 +4554,6 @@ ...@@ -4841,12 +4554,6 @@
"yallist": "2.1.2" "yallist": "2.1.2"
} }
}, },
"map-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
"integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
"dev": true
},
"marked": { "marked": {
"version": "0.3.6", "version": "0.3.6",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz",
...@@ -4866,32 +4573,6 @@ ...@@ -4866,32 +4573,6 @@
"node-emoji": "1.8.1" "node-emoji": "1.8.1"
} }
}, },
"meow": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"dev": true,
"requires": {
"camelcase-keys": "2.1.0",
"decamelize": "1.2.0",
"loud-rejection": "1.6.0",
"map-obj": "1.0.1",
"minimist": "1.2.0",
"normalize-package-data": "2.4.0",
"object-assign": "4.1.1",
"read-pkg-up": "1.0.1",
"redent": "1.0.0",
"trim-newlines": "1.0.0"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
}
},
"micromatch": { "micromatch": {
"version": "2.3.11", "version": "2.3.11",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
...@@ -7927,7 +7608,7 @@ ...@@ -7927,7 +7608,7 @@
} }
}, },
"pluggable.js": { "pluggable.js": {
"version": "git+https://github.com/jcbrand/pluggable.js.git#8f8c8235816f44cda0f855d6ca879445aaa486a1", "version": "git+https://github.com/jcbrand/pluggable.js.git#4677f759c270edda4ce987a8565b817a1d15973b",
"dev": true, "dev": true,
"requires": { "requires": {
"lodash": "4.17.4" "lodash": "4.17.4"
...@@ -8186,16 +7867,6 @@ ...@@ -8186,16 +7867,6 @@
"resolve": "1.4.0" "resolve": "1.4.0"
} }
}, },
"redent": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
"integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=",
"dev": true,
"requires": {
"indent-string": "2.1.0",
"strip-indent": "1.0.1"
}
},
"redeyed": { "redeyed": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz", "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz",
...@@ -9151,15 +8822,6 @@ ...@@ -9151,15 +8822,6 @@
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"dev": true "dev": true
}, },
"strip-indent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
"integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
"dev": true,
"requires": {
"get-stdin": "4.0.1"
}
},
"strip-json-comments": { "strip-json-comments": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
...@@ -9379,12 +9041,6 @@ ...@@ -9379,12 +9041,6 @@
"integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=",
"dev": true "dev": true
}, },
"trim-newlines": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
"integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
"dev": true
},
"trim-right": { "trim-right": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
...@@ -9456,12 +9112,6 @@ ...@@ -9456,12 +9112,6 @@
"integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=",
"dev": true "dev": true
}, },
"underscore.string": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.2.3.tgz",
"integrity": "sha1-gGmSYzZl1eX8tNsfs6hi62jp5to=",
"dev": true
},
"union": { "union": {
"version": "0.4.6", "version": "0.4.6",
"resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz",
......
({
baseUrl: "../",
name: "almond",
mainConfigFile: 'config.js',
wrap: {
startFile: "start.frag",
endFile: "inverse-end.frag"
}
})
({
baseUrl: "../",
name: "almond",
mainConfigFile: 'config.js',
paths: {
"converse-bookmarks": "builds/converse-bookmarks",
"converse-chatboxes": "builds/converse-chatboxes",
"converse-chatview": "builds/converse-chatview",
"converse-controlbox": "builds/converse-controlbox",
"converse-core": "builds/converse-core",
"converse-disco": "builds/converse-disco",
"converse-dragresize": "builds/converse-dragresize",
"converse-headline": "builds/converse-headline",
"converse-inverse": "builds/converse-inverse",
"converse-mam": "builds/converse-mam",
"converse-minimize": "builds/converse-minimize",
"converse-muc": "builds/converse-muc",
"converse-muc-embedded": "builds/converse-muc-embedded",
"converse-notification": "builds/converse-notification",
"converse-otr": "builds/converse-otr",
"converse-ping": "builds/converse-ping",
"converse-register": "builds/converse-register",
"converse-roomslist": "builds/converse-roomslist",
"converse-rosterview": "builds/converse-rosterview",
"converse-singleton": "builds/converse-singleton",
"converse-vcard": "builds/converse-vcard",
"utils": "builds/utils"
},
wrap: {
startFile: "start.frag",
endFile: "inverse-end.frag"
}
})
...@@ -3,26 +3,6 @@ ...@@ -3,26 +3,6 @@
name: "almond", name: "almond",
out: "../dist/converse-no-dependencies.min.js", out: "../dist/converse-no-dependencies.min.js",
include: ["converse"], include: ["converse"],
excludeShallow: [
"locales",
"text!af",
"text!de",
"text!en",
"text!es",
"text!fr",
"text!he",
"text!hu",
"text!id",
"text!it",
"text!ja",
"text!nb",
"text!nl",
"text!pl",
"text!pt_BR",
"text!ru",
"text!uk",
"text!zh"
],
exclude: [ exclude: [
"awesomplete", "awesomplete",
"jquery", "jquery",
...@@ -42,12 +22,14 @@ ...@@ -42,12 +22,14 @@
], ],
paths: { paths: {
"converse-bookmarks": "builds/converse-bookmarks", "converse-bookmarks": "builds/converse-bookmarks",
"converse-chatboxes": "builds/converse-chatboxes",
"converse-chatview": "builds/converse-chatview", "converse-chatview": "builds/converse-chatview",
"converse-controlbox": "builds/converse-controlbox", "converse-controlbox": "builds/converse-controlbox",
"converse-core": "builds/converse-core", "converse-core": "builds/converse-core",
"converse-disco": "builds/converse-disco",
"converse-dragresize": "builds/converse-dragresize", "converse-dragresize": "builds/converse-dragresize",
"converse-headline": "builds/converse-headline", "converse-headline": "builds/converse-headline",
"converse-inverse": "builds/converse-inverse", "converse-fullscreen": "builds/converse-fullscreen",
"converse-mam": "builds/converse-mam", "converse-mam": "builds/converse-mam",
"converse-minimize": "builds/converse-minimize", "converse-minimize": "builds/converse-minimize",
"converse-muc": "builds/converse-muc", "converse-muc": "builds/converse-muc",
...@@ -60,7 +42,9 @@ ...@@ -60,7 +42,9 @@
"converse-rosterview": "builds/converse-rosterview", "converse-rosterview": "builds/converse-rosterview",
"converse-singleton": "builds/converse-singleton", "converse-singleton": "builds/converse-singleton",
"converse-vcard": "builds/converse-vcard", "converse-vcard": "builds/converse-vcard",
"utils": "builds/utils" "i18n": "builds/i18n",
"utils": "builds/utils",
"form-utils": "builds/form-utils"
}, },
wrap: { wrap: {
startFile: "start.frag", startFile: "start.frag",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"converse-disco": "builds/converse-disco", "converse-disco": "builds/converse-disco",
"converse-dragresize": "builds/converse-dragresize", "converse-dragresize": "builds/converse-dragresize",
"converse-headline": "builds/converse-headline", "converse-headline": "builds/converse-headline",
"converse-inverse": "builds/converse-inverse", "converse-fullscreen": "builds/converse-fullscreen",
"converse-mam": "builds/converse-mam", "converse-mam": "builds/converse-mam",
"converse-minimize": "builds/converse-minimize", "converse-minimize": "builds/converse-minimize",
"converse-muc": "builds/converse-muc", "converse-muc": "builds/converse-muc",
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"converse-rosterview": "builds/converse-rosterview", "converse-rosterview": "builds/converse-rosterview",
"converse-singleton": "builds/converse-singleton", "converse-singleton": "builds/converse-singleton",
"converse-vcard": "builds/converse-vcard", "converse-vcard": "builds/converse-vcard",
"i18n": "builds/i18n",
"utils": "builds/utils", "utils": "builds/utils",
"form-utils": "builds/form-utils" "form-utils": "builds/form-utils"
}, },
......
...@@ -3,10 +3,6 @@ if (typeof define !== 'undefined') { ...@@ -3,10 +3,6 @@ if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build // The section below determines which plugins will be included in a build
define([ define([
"converse-core", "converse-core",
// PLEASE NOTE: By default all translations are included.
// You can modify the file src/locales.js to include only those
// translations that you care about.
/* START: Removable components /* START: Removable components
* -------------------- * --------------------
* Any of the following components may be removed if they're not needed. * Any of the following components may be removed if they're not needed.
......
/*global define */
if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build
define([
"converse-core",
// PLEASE NOTE: By default all translations are included.
// You can modify the file src/locales.js to include only those
// translations that you care about.
/* START: Removable components
* --------------------
* Any of the following components may be removed if they're not needed.
*/
"converse-bookmarks", // XEP-0048 Bookmarks
"converse-chatview", // Renders standalone chat boxes for single user chat
"converse-controlbox", // The control box
"converse-headline", // Support for headline messages
"converse-mam", // XEP-0313 Message Archive Management
"converse-muc", // XEP-0045 Multi-user chat
"converse-notification",// HTML5 Notifications
"converse-otr", // Off-the-record encryption for one-on-one messages
"converse-ping", // XEP-0199 XMPP Ping
"converse-register", // XEP-0077 In-band registration
"converse-singleton", // Allow at most a single chat to be visible at any one time
"converse-vcard", // XEP-0054 VCard-temp
/* END: Removable components */
], function (converse) {
return converse;
});
}
...@@ -3,10 +3,6 @@ if (typeof define !== 'undefined') { ...@@ -3,10 +3,6 @@ if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build // The section below determines which plugins will be included in a build
define([ define([
"converse-core", "converse-core",
// PLEASE NOTE: By default all translations are included.
// You can modify the file src/locales.js to include only those
// translations that you care about.
/* START: Removable components /* START: Removable components
* -------------------- * --------------------
* Any of the following components may be removed if they're not needed. * Any of the following components may be removed if they're not needed.
......
...@@ -32,6 +32,5 @@ ...@@ -32,6 +32,5 @@
define('backbone.browserStorage', ['backbone'], emptyFunction); define('backbone.browserStorage', ['backbone'], emptyFunction);
define('backbone.overview', ['backbone'], emptyFunction); define('backbone.overview', ['backbone'], emptyFunction);
define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };}); define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
define("locales", [], emptyFunction);
return require('converse'); return require('converse');
})); }));
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com> // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2) // Licensed under the Mozilla Public License (MPLv2)
// //
/*global define, escape, locales, Jed */ /*global define, escape, Jed */
(function (root, factory) { (function (root, factory) {
define([ define([
"sizzle", "sizzle",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment