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
CHROMIUM ?= ./node_modules/.bin/run-headless-chromium
CLEANCSS ?= ./node_modules/clean-css-cli/bin/cleancss --skip-rebase
ESLINT ?= ./node_modules/.bin/eslint
GRUNT ?= ./node_modules/.bin/grunt
HTTPSERVE ?= ./node_modules/.bin/http-server
PAPER =
PO2JSON ?= ./node_modules/.bin/po2json
......@@ -167,37 +166,32 @@ BUILDS = dist/converse.js \
dist/converse-no-dependencies.min.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
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
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
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
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
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
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
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
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
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
.PHONY: jsmin
jsmin: $(BUILDS)
.PHONY: dist
dist:: build
.PHONY: build
build:: dev css transpile
$(GRUNT) json
make jsmin
build:: dev css transpile $(BUILDS)
########################################################################
## Tests
......
......@@ -6333,6 +6333,8 @@ return uk;
})));
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -6344,32 +6346,11 @@ return uk;
/*global define */
(function (root, factory) {
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);
}(this, function (Promise, Jed, _, moment) {
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);
})(undefined, function (Promise, Jed, _, moment) {
'use strict';
function detectLocale (library_check) {
function detectLocale(library_check) {
/* Determine which locale is supported by the user's system as well
* as by the relevant library (e.g. converse.js or moment.js).
*
......@@ -6382,7 +6363,7 @@ return uk;
locale = isLocaleAvailable(window.navigator.userLanguage, library_check);
}
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);
}
}
......@@ -6398,15 +6379,15 @@ return uk;
return locale || 'en';
}
function isMomentLocale (locale) {
function isMomentLocale(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);
}
function getLocale (preferred_locale, isSupportedByLibrary) {
function getLocale(preferred_locale, isSupportedByLibrary) {
if (_.isString(preferred_locale)) {
if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
return preferred_locale;
......@@ -6415,7 +6396,7 @@ return uk;
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.
*
* Parameters:
......@@ -6432,31 +6413,25 @@ return uk;
}
}
let jed_instance;
var jed_instance = void 0;
return {
setLocales (preferred_locale, _converse) {
_converse.locale = getLocale(
preferred_locale,
_.partial(isConverseLocale, _, _converse.locales)
);
setLocales: function setLocales(preferred_locale, _converse) {
_converse.locale = getLocale(preferred_locale, _.partial(isConverseLocale, _, _converse.locales));
moment.locale(getLocale(preferred_locale, isMomentLocale));
},
translate (str) {
translate: function translate(str) {
if (_.isNil(jed_instance)) {
return Jed.sprintf.apply(Jed, arguments);
}
var t = jed_instance.translate(str);
if (arguments.length>1) {
if (arguments.length > 1) {
return t.fetch.apply(t, [].slice.call(arguments, 1));
} else {
return t.fetch();
}
},
fetchTranslations (locale, supported_locales, locale_url) {
fetchTranslations: function fetchTranslations(locale, supported_locales, locale_url) {
/* Fetch the translations for the given local at the given URL.
*
* Parameters:
......@@ -6465,16 +6440,13 @@ return uk;
* (String) locale_url: The URL from which the translations
* should be fetched.
*/
return new Promise((resolve, reject) => {
return new Promise(function (resolve, reject) {
if (!isConverseLocale(locale, supported_locales) || locale === 'en') {
return resolve();
}
const xhr = new XMLHttpRequest();
var xhr = new XMLHttpRequest();
xhr.open('GET', locale_url, true);
xhr.setRequestHeader(
'Accept',
"application/json, text/javascript"
);
xhr.setRequestHeader('Accept', "application/json, text/javascript");
xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 400) {
jed_instance = new Jed(window.JSON.parse(xhr.responseText));
......@@ -6490,8 +6462,8 @@ return uk;
});
}
};
}));
});
//# sourceMappingURL=i18n.js.map;
/*!
* jQuery Browser Plugin 0.1.0
* https://github.com/gabceb/jquery-browser-plugin
......@@ -9457,6 +9429,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
};
});
//# sourceMappingURL=converse-core.js.map;
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -9467,9 +9441,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
(function (root, factory) {
define('converse-chatboxes',["converse-core"], factory);
}(this, function (converse) {
})(undefined, function (converse) {
"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', {
......@@ -9478,152 +9460,134 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
// plugin architecture they will replace existing methods on the
// relevant objects or classes.
disconnect: function () {
const { _converse } = this.__super__;
disconnect: function disconnect() {
var _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes();
return this.__super__.disconnect.apply(this, arguments);
},
logOut: function () {
const { _converse } = this.__super__;
logOut: function logOut() {
var _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes();
return this.__super__.logOut.apply(this, arguments);
},
initStatus: function () {
const { _converse } = this.__super__;
initStatus: function initStatus() {
var _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes();
return this.__super__.initStatus.apply(this, arguments);
},
onStatusInitialized: function () {
const { _converse } = this.__super__;
onStatusInitialized: function onStatusInitialized() {
var _converse = this.__super__._converse;
_converse.chatboxes.onConnected();
return this.__super__.onStatusInitialized.apply(this, arguments);
}
},
initialize () {
initialize: function initialize() {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
var _converse = this._converse;
_converse.api.promises.add([
'chatBoxesFetched',
'chatBoxesInitialized'
]);
_converse.api.promises.add(['chatBoxesFetched', 'chatBoxesInitialized']);
function openChat (jid) {
function openChat(jid) {
if (!utils.isValidJID(jid)) {
return converse.log(
`Invalid JID "${jid}" provided in URL fragment`,
Strophe.LogLevel.WARN
);
return converse.log("Invalid JID \"" + jid + "\" provided in URL fragment", Strophe.LogLevel.WARN);
}
Promise.all([
_converse.api.waitUntil('rosterContactsFetched'),
_converse.api.waitUntil('chatBoxesFetched')
]).then(() => {
Promise.all([_converse.api.waitUntil('rosterContactsFetched'), _converse.api.waitUntil('chatBoxesFetched')]).then(function () {
_converse.api.chats.open(jid);
});
}
_converse.router.route('converse/chat?jid=:jid', openChat);
_converse.ChatBoxes = Backbone.Collection.extend({
comparator: 'time_opened',
model (attrs, options) {
model: function model(attrs, options) {
return new _converse.ChatBox(attrs, options);
},
registerMessageHandler () {
_converse.connection.addHandler(
this.onMessage.bind(this), null, 'message', 'chat'
);
_converse.connection.addHandler(
this.onErrorMessage.bind(this), null, 'message', 'error'
);
registerMessageHandler: function registerMessageHandler() {
_converse.connection.addHandler(this.onMessage.bind(this), null, 'message', 'chat');
_converse.connection.addHandler(this.onErrorMessage.bind(this), null, 'message', 'error');
},
chatBoxMayBeShown (chatbox) {
chatBoxMayBeShown: function chatBoxMayBeShown(chatbox) {
return true;
},
onChatBoxesFetched: function onChatBoxesFetched(collection) {
var _this = this;
onChatBoxesFetched (collection) {
/* Show chat boxes upon receiving them from sessionStorage
*
* This method gets overridden entirely in src/converse-controlbox.js
* if the controlbox plugin is active.
*/
collection.each((chatbox) => {
if (this.chatBoxMayBeShown(chatbox)) {
collection.each(function (chatbox) {
if (_this.chatBoxMayBeShown(chatbox)) {
chatbox.trigger('show');
}
});
_converse.emit('chatBoxesFetched');
},
onConnected () {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage](
b64_sha1(`converse.chatboxes-${_converse.bare_jid}`));
onConnected: function onConnected() {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.chatboxes-" + _converse.bare_jid));
this.registerMessageHandler();
this.fetch({
add: true,
success: this.onChatBoxesFetched.bind(this)
});
},
onErrorMessage (message) {
onErrorMessage: function onErrorMessage(message) {
/* Handler method for all incoming error message stanzas
*/
// 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)) {
return true;
}
// 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) {
return true;
}
chatbox.createMessage(message, null, message);
return true;
},
onMessage (message) {
onMessage: function onMessage(message) {
/* Handler method for all incoming single-user chat "message"
* stanzas.
*/
let contact_jid, delay, resource,
var contact_jid = void 0,
delay = void 0,
resource = void 0,
from_jid = message.getAttribute('from'),
to_jid = message.getAttribute('to');
const original_stanza = message,
var original_stanza = message,
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)) {
_converse.log(
`onMessage: Ignoring incoming message intended for a different resource: ${to_jid}`,
Strophe.LogLevel.INFO
);
if (_converse.filter_by_resource && to_resource && to_resource !== _converse.resource) {
_converse.log("onMessage: Ignoring incoming message intended for a different resource: " + to_jid, Strophe.LogLevel.INFO);
return true;
} else if (utils.isHeadlineMessage(message)) {
// XXX: Ideally we wouldn't have to check for headline
// messages, but Prosody sends headline messages with the
// wrong type ('chat'), so we need to filter them out here.
_converse.log(
`onMessage: Ignoring incoming headline message sent with type 'chat' from JID: ${from_jid}`,
Strophe.LogLevel.INFO
);
_converse.log("onMessage: Ignoring incoming headline message sent with type 'chat' from JID: " + from_jid, Strophe.LogLevel.INFO);
return true;
}
const forwarded = message.querySelector('forwarded');
var forwarded = message.querySelector('forwarded');
if (!_.isNull(forwarded)) {
const forwarded_message = forwarded.querySelector('message');
const forwarded_from = forwarded_message.getAttribute('from');
var forwarded_message = forwarded.querySelector('message');
var forwarded_from = forwarded_message.getAttribute('from');
if (is_carbon && Strophe.getBareJidFromJid(forwarded_from) !== from_jid) {
// Prevent message forging via carbons
//
......@@ -9636,7 +9600,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
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),
is_me = from_bare_jid === _converse.bare_jid;
......@@ -9649,11 +9613,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
resource = from_resource;
}
// 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');
if (chatbox) {
const messages = msgid && chatbox.messages.findWhere({msgid}) || [];
var messages = msgid && chatbox.messages.findWhere({ msgid: msgid }) || [];
if (_.isEmpty(messages)) {
// Only create the message when we're sure it's not a
// duplicate
......@@ -9661,11 +9625,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
chatbox.createMessage(message, delay, original_stanza);
}
}
_converse.emit('message', {'stanza': original_stanza, 'chatbox': chatbox});
_converse.emit('message', { 'stanza': original_stanza, 'chatbox': chatbox });
return true;
},
createChatBox (jid, attrs) {
createChatBox: function createChatBox(jid, attrs) {
/* Creates a chat box
*
* Parameters:
......@@ -9673,34 +9636,31 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
* gets created.
* (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);
let roster_info = {};
var roster_info = {};
if (! _.isUndefined(roster_item)) {
if (!_.isUndefined(roster_item)) {
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': roster_item.get('image'),
'url': roster_item.get('url'),
'url': roster_item.get('url')
};
} else if (!_converse.allow_non_roster_messaging) {
_converse.log(`Could not get roster item for JID ${bare_jid}`+
' and allow_non_roster_messaging is set to false',
Strophe.LogLevel.ERROR);
_converse.log("Could not get roster item for JID " + bare_jid + ' and allow_non_roster_messaging is set to false', Strophe.LogLevel.ERROR);
return;
}
return this.create(_.assignIn({
'id': bare_jid,
'jid': bare_jid,
'fullname': jid,
'image_type': _converse.DEFAULT_IMAGE_TYPE,
'image': _converse.DEFAULT_IMAGE,
'url': '',
}, roster_info, attrs || {}));
},
getChatBox (jid, create, attrs) {
'id': bare_jid,
'jid': bare_jid,
'fullname': jid,
'image_type': _converse.DEFAULT_IMAGE_TYPE,
'image': _converse.DEFAULT_IMAGE,
'url': ''
}, roster_info, attrs || {}));
},
getChatBox: function getChatBox(jid, create, attrs) {
/* Returns a chat box or optionally return a newly
* created one if one doesn't exist.
*
......@@ -9710,7 +9670,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
* (Object) attrs - Optional chat box atributes.
*/
jid = jid.toLowerCase();
let chatbox = this.get(Strophe.getBareJidFromJid(jid));
var chatbox = this.get(Strophe.getBareJidFromJid(jid));
if (!chatbox && create) {
chatbox = this.createChatBox(jid, attrs);
}
......@@ -9719,18 +9679,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
});
_converse.ChatBoxViews = Backbone.Overview.extend({
initialize () {
initialize: function initialize() {
this.model.on("add", this.onChatBoxAdded, this);
this.model.on("destroy", this.removeChat, this);
},
_ensureElement () {
_ensureElement: function _ensureElement() {
/* Override method from backbone.js
* If the #conversejs element doesn't exist, create it.
*/
if (!this.el) {
let el = document.querySelector('#conversejs');
var el = document.querySelector('#conversejs');
if (_.isNull(el)) {
el = document.createElement('div');
el.setAttribute('id', 'conversejs');
......@@ -9743,47 +9701,43 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
this.setElement(_.result(this, 'el'), false);
}
},
onChatBoxAdded (item) {
onChatBoxAdded: function onChatBoxAdded(item) {
// Views aren't created here, since the core code doesn't
// contain any views. Instead, they're created in overrides in
// plugins, such as in converse-chatview.js and converse-muc.js
return this.get(item.get('id'));
},
removeChat (item) {
removeChat: function removeChat(item) {
this.remove(item.get('id'));
},
closeAllChatBoxes () {
closeAllChatBoxes: function closeAllChatBoxes() {
/* This method gets overridden in src/converse-controlbox.js if
* the controlbox plugin is active.
*/
this.each(function (view) { view.close(); });
this.each(function (view) {
view.close();
});
return this;
},
chatBoxMayBeShown (chatbox) {
chatBoxMayBeShown: function chatBoxMayBeShown(chatbox) {
return this.model.chatBoxMayBeShown(chatbox);
},
getChatBox (attrs, create) {
let chatbox = this.model.get(attrs.jid);
getChatBox: function getChatBox(attrs, create) {
var chatbox = this.model.get(attrs.jid);
if (!chatbox && create) {
chatbox = this.model.create(attrs, {
'error' (model, response) {
'error': function error(model, response) {
_converse.log(response.responseText);
}
});
}
return chatbox;
},
showChat (attrs) {
showChat: function showChat(attrs) {
/* Find the chat box and show it (if it may be shown).
* If it doesn't exist, create it.
*/
const chatbox = this.getChatBox(attrs, true);
var chatbox = this.getChatBox(attrs, true);
if (this.chatBoxMayBeShown(chatbox)) {
chatbox.trigger('show', true);
}
......@@ -9792,7 +9746,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
});
// BEGIN: Event handlers
_converse.api.listen.on('pluginsInitialized', () => {
_converse.api.listen.on('pluginsInitialized', function () {
_converse.chatboxes = new _converse.ChatBoxes();
_converse.chatboxviews = new _converse.ChatBoxViews({
'model': _converse.chatboxes
......@@ -9800,41 +9754,41 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
_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.
delete _converse.chatboxes.browserStorage;
});
// END: Event handlers
_converse.getViewForChatBox = function (chatbox) {
if (!chatbox) { return; }
if (!chatbox) {
return;
}
return _converse.chatboxviews.get(chatbox.get('id'));
};
/* We extend the default converse.js API */
_.extend(_converse.api, {
'chats': {
'open' (jids, attrs) {
'open': function open(jids, attrs) {
if (_.isUndefined(jids)) {
_converse.log("chats.open: You need to provide at least one JID", Strophe.LogLevel.ERROR);
return null;
} else if (_.isString(jids)) {
const chatbox = _converse.chatboxes.getChatBox(jids, true, attrs);
var chatbox = _converse.chatboxes.getChatBox(jids, true, attrs);
if (_.isNil(chatbox)) {
_converse.log("Could not open chatbox for JID: "+jids);
_converse.log("Could not open chatbox for JID: " + jids);
return;
}
return _converse.getViewForChatBox(chatbox.trigger('show'));
}
return _.map(jids, (jid) =>
_converse.getViewForChatBox(
_converse.chatboxes.getChatBox(jid, true, attrs).trigger('show')
)
);
return _.map(jids, function (jid) {
return _converse.getViewForChatBox(_converse.chatboxes.getChatBox(jid, true, attrs).trigger('show'));
});
},
'get' (jids) {
'get': function get(jids) {
if (_.isUndefined(jids)) {
const result = [];
var result = [];
_converse.chatboxes.each(function (chatbox) {
// FIXME: Leaky abstraction from MUC. We need to add a
// base type for chat boxes, and check for that.
......@@ -9846,22 +9800,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
} else if (_.isString(jids)) {
return _converse.getViewForChatBox(_converse.chatboxes.getChatBox(jids));
}
return _.map(jids,
_.partial(
_.flow(
_converse.chatboxes.getChatBox.bind(_converse.chatboxes),
_converse.getViewForChatBox.bind(_converse)
), _, true
)
);
return _.map(jids, _.partial(_.flow(_converse.chatboxes.getChatBox.bind(_converse.chatboxes), _converse.getViewForChatBox.bind(_converse)), _, true));
}
}
});
}
});
return converse;
}));
});
//# sourceMappingURL=converse-chatboxes.js.map;
/* jshint maxerr: 10000 */
/* jslint unused: true */
/* jshint shadow: true */
......@@ -18313,6 +18260,8 @@ __e(value) +
return __p
};});
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -18321,36 +18270,10 @@ return __p
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define, escape, locales, Jed */
/*global define, escape, Jed */
(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);
}(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
) {
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) {
"use strict";
var XFORM_TYPE_MAP = {
......@@ -18370,7 +18293,7 @@ return __p
* Parameters:
* (DOMElement) field - the field to convert
*/
let value;
var value = void 0;
if (field.getAttribute('type') === 'checkbox') {
value = field.checked && 1 || 0;
} else if (field.tagName == "textarea") {
......@@ -18378,12 +18301,10 @@ return __p
} else {
value = field.value;
}
return u.stringToDOM(
tpl_field({
name: field.getAttribute('name'),
value: value
})
)[0];
return u.stringToDOM(tpl_field({
name: field.getAttribute('name'),
value: value
}))[0];
};
u.xForm2webForm = function (field, stanza, domain) {
......@@ -18397,35 +18318,28 @@ return __p
* (XMLElement) field - the field to convert
*/
if (field.getAttribute('type')) {
if (field.getAttribute('type') === 'list-single' ||
field.getAttribute('type') === 'list-multi') {
const values = _.map(
u.queryChildren(field, 'value'),
_.partial(_.get, _, 'textContent')
);
const options = _.map(
u.queryChildren(field, 'option'),
function (option) {
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'))
})
}
);
if (field.getAttribute('type') === 'list-single' || field.getAttribute('type') === 'list-multi') {
var values = _.map(u.queryChildren(field, 'value'), _.partial(_.get, _, 'textContent'));
var options = _.map(u.queryChildren(field, 'option'), function (option) {
var 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({
'name': field.getAttribute('var'),
'label': field.getAttribute('label'),
'options': options.join(''),
'multiple': (field.getAttribute('type') === 'list-multi'),
'multiple': field.getAttribute('type') === 'list-multi',
'required': !_.isNil(field.querySelector('required'))
});
} else if (field.getAttribute('type') === 'fixed') {
const text = _.get(field.querySelector('value'), 'textContent');
return '<p class="form-help">'+text+'</p>';
var text = _.get(field.querySelector('value'), 'textContent');
return '<p class="form-help">' + text + '</p>';
} else if (field.getAttribute('type') === 'jid-multi') {
return tpl_form_textarea({
'name': field.getAttribute('var'),
......@@ -18448,7 +18362,7 @@ return __p
});
} else if (field.getAttribute('var') === 'username') {
return tpl_form_username({
'domain': ' @'+domain,
'domain': ' @' + domain,
'name': field.getAttribute('var'),
'type': XFORM_TYPE_MAP[field.getAttribute('type')],
'label': field.getAttribute('label') || '',
......@@ -18466,9 +18380,10 @@ return __p
});
}
} else {
if (field.getAttribute('var') === 'ocr') { // Captcha
const uri = field.querySelector('uri');
const el = sizzle('data[cid="'+uri.textContent.replace(/^cid:/, '')+'"]', stanza)[0];
if (field.getAttribute('var') === 'ocr') {
// Captcha
var uri = field.querySelector('uri');
var el = sizzle('data[cid="' + uri.textContent.replace(/^cid:/, '') + '"]', stanza)[0];
return tpl_form_captcha({
'label': field.getAttribute('label'),
'name': field.getAttribute('var'),
......@@ -18478,10 +18393,10 @@ return __p
});
}
}
}
};
return u;
}));
});
//# sourceMappingURL=form-utils.js.map;
define('tpl!chatarea', ['lodash'], function(_) {return function(obj) {
obj || (obj = {});
......@@ -19060,6 +18975,8 @@ __p += '\n <input type="' +
return __p
};});
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -19072,29 +18989,34 @@ return __p
/*global Backbone, define, window, document */
(function (root, 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', {
initialize () {
initialize: function initialize() {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
var _converse = this._converse;
function onDiscoItems (stanza) {
_.each(stanza.querySelectorAll('query item'), (item) => {
function onDiscoItems(stanza) {
_.each(stanza.querySelectorAll('query item'), function (item) {
if (item.getAttribute("node")) {
// XXX: ignore nodes for now.
// See: https://xmpp.org/extensions/xep-0030.html#items-nodes
return;
}
const jid = item.getAttribute('jid');
const entities = _converse.disco_entities;
var jid = item.getAttribute('jid');
var entities = _converse.disco_entities;
if (_.isUndefined(entities.get(jid))) {
entities.create({'jid': jid});
entities.create({ 'jid': jid });
}
});
}
......@@ -19104,65 +19026,58 @@ return __p
_converse.DiscoEntity = Backbone.Model.extend({
/* A Disco Entity is a JID addressable entity that can be queried
* for features.
*
* See XEP-0030: https://xmpp.org/extensions/xep-0030.html
*/
* for features.
*
* See XEP-0030: https://xmpp.org/extensions/xep-0030.html
*/
idAttribute: 'jid',
initialize () {
initialize: function initialize() {
this.features = new Backbone.Collection();
this.features.browserStorage = new Backbone.BrowserStorage[_converse.storage](
b64_sha1(`converse.features-${this.get('jid')}`)
);
this.features.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.features-" + this.get('jid')));
this.features.on('add', this.onFeatureAdded);
this.identities = new Backbone.Collection();
this.identities.browserStorage = new Backbone.BrowserStorage[_converse.storage](
b64_sha1(`converse.identities-${this.get('jid')}`)
);
this.identities.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1("converse.identities-" + this.get('jid')));
this.fetchFeatures();
},
onFeatureAdded (feature) {
onFeatureAdded: function onFeatureAdded(feature) {
_converse.emit('serviceDiscovered', feature);
},
fetchFeatures () {
fetchFeatures: function fetchFeatures() {
if (this.features.browserStorage.records.length === 0) {
this.queryInfo();
} else {
this.features.fetch({add: true});
this.identities.fetch({add: true});
this.features.fetch({ add: true });
this.identities.fetch({ add: true });
}
},
queryInfo () {
queryInfo: function queryInfo() {
_converse.connection.disco.info(this.get('jid'), null, this.onInfo.bind(this));
},
queryForItems () {
if (_.isEmpty(this.identities.where({'category': 'server'}))) {
queryForItems: function queryForItems() {
if (_.isEmpty(this.identities.where({ 'category': 'server' }))) {
// Don't fetch features and items if this is not a
// server or a conference component.
return;
}
_converse.connection.disco.items(this.get('jid'), null, onDiscoItems);
},
onInfo: function onInfo(stanza) {
var _this = this;
onInfo (stanza) {
_.forEach(stanza.querySelectorAll('identity'), (identity) => {
this.identities.create({
_.forEach(stanza.querySelectorAll('identity'), function (identity) {
_this.identities.create({
'category': identity.getAttribute('category'),
'type': stanza.getAttribute('type'),
'name': stanza.getAttribute('name')
});
});
if (stanza.querySelector('feature[var="'+Strophe.NS.DISCO_ITEMS+'"]')) {
if (stanza.querySelector('feature[var="' + Strophe.NS.DISCO_ITEMS + '"]')) {
this.queryForItems();
}
_.forEach(stanza.querySelectorAll('feature'), (feature) => {
this.features.create({
_.forEach(stanza.querySelectorAll('feature'), function (feature) {
_this.features.create({
'var': feature.getAttribute('var'),
'from': stanza.getAttribute('from')
});
......@@ -19174,35 +19089,31 @@ return __p
_converse.DiscoEntities = Backbone.Collection.extend({
model: _converse.DiscoEntity,
initialize () {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage](
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));
initialize: function initialize() {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage](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));
},
fetchEntities: function fetchEntities() {
var _this2 = this;
fetchEntities () {
return new Promise((resolve, reject) => {
this.fetch({
return new Promise(function (resolve, reject) {
_this2.fetch({
add: true,
success: function (collection) {
if (collection.length === 0 || !collection.get(_converse.domain)) {
this.create({'jid': _converse.domain});
this.create({ 'jid': _converse.domain });
}
resolve();
}.bind(this),
error () {
reject (new Error("Could not fetch disco entities"));
}.bind(_this2),
error: function error() {
reject(new Error("Could not fetch disco entities"));
}
});
});
}
});
function addClientFeatures () {
function addClientFeatures() {
/* The strophe.disco.js plugin keeps a list of features which
* it will advertise to any #info queries made to it.
*
......@@ -19223,16 +19134,16 @@ return __p
return this;
}
function initializeDisco () {
function initializeDisco() {
addClientFeatures();
_converse.disco_entities = new _converse.DiscoEntities();
}
_converse.api.listen.on('reconnected', initializeDisco);
_converse.api.listen.on('connected', initializeDisco);
_converse.api.listen.on('beforeTearDown', () => {
_converse.api.listen.on('beforeTearDown', function () {
if (_converse.disco_entities) {
_converse.disco_entities.each((entity) => {
_converse.disco_entities.each(function (entity) {
entity.features.reset();
entity.features.browserStorage._clear();
});
......@@ -19240,10 +19151,47 @@ return __p
_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)
......@@ -22766,31 +22714,6 @@ return __p
// XEP-0313 Message Archive Management
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', {
overrides: {
......@@ -22826,7 +22749,7 @@ return __p
this.addSpinner();
checkMAMSupport(_converse).then(function (supported) {
_converse.api.disco.supports(_converse.bare_jid, Strophe.NS.MAM).then(function (supported) {
// Success
if (supported) {
_this.fetchArchivedMessages();
......@@ -23046,19 +22969,6 @@ return __p
}, _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) {
if ($(iq).find('feature-not-implemented').length) {
_converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN);
......@@ -23115,6 +23025,19 @@ return __p
_converse.on('afterMessagesFetched', function (chatboxview) {
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
});
});
//# sourceMappingURL=converse-singleton.js.map;
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -26138,23 +26063,21 @@ return __p
/*global define */
(function (root, factory) {
define('converse-fullscreen',["converse-core",
"tpl!inverse_brand_heading",
"converse-chatview",
"converse-controlbox",
"converse-muc",
"converse-singleton"
], factory);
}(this, function (converse, tpl_brand_heading) {
define('converse-fullscreen',["converse-core", "tpl!inverse_brand_heading", "converse-chatview", "converse-controlbox", "converse-muc", "converse-singleton"], factory);
})(undefined, function (converse, tpl_brand_heading) {
"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);
},
overrides: {
// overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the
......@@ -26163,21 +26086,17 @@ return __p
// new functions which don't exist yet can also be added.
ControlBoxView: {
createBrandHeadingHTML() {
createBrandHeadingHTML: function createBrandHeadingHTML() {
return tpl_brand_heading();
},
insertBrandHeading () {
const el = document.getElementById('converse-login-panel');
el.parentNode.insertAdjacentHTML(
'afterbegin',
this.createBrandHeadingHTML()
);
insertBrandHeading: function insertBrandHeading() {
var el = document.getElementById('converse-login-panel');
el.parentNode.insertAdjacentHTML('afterbegin', this.createBrandHeadingHTML());
}
},
ChatRoomView: {
afterShown (focus) {
afterShown: function afterShown(focus) {
/* Make sure chat rooms are scrolled down when opened
*/
this.scrollDown();
......@@ -26189,28 +26108,23 @@ return __p
}
},
initialize () {
initialize: function initialize() {
this._converse.api.settings.update({
chatview_avatar_height: 44,
chatview_avatar_width: 44,
hide_open_bookmarks: true,
show_controlbox_by_default: true,
sticky_controlbox: true,
view_mode: 'fullscreen'
sticky_controlbox: true
});
}
});
}));
});
//# sourceMappingURL=converse-fullscreen.js.map;
/*global define */
if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build
define('converse',[
"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.
......@@ -26270,6 +26184,5 @@ if (typeof define !== 'undefined') {
define('backbone.browserStorage', ['backbone'], emptyFunction);
define('backbone.overview', ['backbone'], emptyFunction);
define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
define("locales", [], emptyFunction);
return require('converse');
}));
......@@ -27902,6 +27902,8 @@ return uk;
})));
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -27913,32 +27915,11 @@ return uk;
/*global define */
(function (root, factory) {
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);
}(this, function (Promise, Jed, _, moment) {
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);
})(undefined, function (Promise, Jed, _, moment) {
'use strict';
function detectLocale (library_check) {
function detectLocale(library_check) {
/* Determine which locale is supported by the user's system as well
* as by the relevant library (e.g. converse.js or moment.js).
*
......@@ -27951,7 +27932,7 @@ return uk;
locale = isLocaleAvailable(window.navigator.userLanguage, library_check);
}
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);
}
}
......@@ -27967,15 +27948,15 @@ return uk;
return locale || 'en';
}
function isMomentLocale (locale) {
function isMomentLocale(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);
}
function getLocale (preferred_locale, isSupportedByLibrary) {
function getLocale(preferred_locale, isSupportedByLibrary) {
if (_.isString(preferred_locale)) {
if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
return preferred_locale;
......@@ -27984,7 +27965,7 @@ return uk;
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.
*
* Parameters:
......@@ -28001,31 +27982,25 @@ return uk;
}
}
let jed_instance;
var jed_instance = void 0;
return {
setLocales (preferred_locale, _converse) {
_converse.locale = getLocale(
preferred_locale,
_.partial(isConverseLocale, _, _converse.locales)
);
setLocales: function setLocales(preferred_locale, _converse) {
_converse.locale = getLocale(preferred_locale, _.partial(isConverseLocale, _, _converse.locales));
moment.locale(getLocale(preferred_locale, isMomentLocale));
},
translate (str) {
translate: function translate(str) {
if (_.isNil(jed_instance)) {
return Jed.sprintf.apply(Jed, arguments);
}
var t = jed_instance.translate(str);
if (arguments.length>1) {
if (arguments.length > 1) {
return t.fetch.apply(t, [].slice.call(arguments, 1));
} else {
return t.fetch();
}
},
fetchTranslations (locale, supported_locales, locale_url) {
fetchTranslations: function fetchTranslations(locale, supported_locales, locale_url) {
/* Fetch the translations for the given local at the given URL.
*
* Parameters:
......@@ -28034,16 +28009,13 @@ return uk;
* (String) locale_url: The URL from which the translations
* should be fetched.
*/
return new Promise((resolve, reject) => {
return new Promise(function (resolve, reject) {
if (!isConverseLocale(locale, supported_locales) || locale === 'en') {
return resolve();
}
const xhr = new XMLHttpRequest();
var xhr = new XMLHttpRequest();
xhr.open('GET', locale_url, true);
xhr.setRequestHeader(
'Accept',
"application/json, text/javascript"
);
xhr.setRequestHeader('Accept', "application/json, text/javascript");
xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 400) {
jed_instance = new Jed(window.JSON.parse(xhr.responseText));
......@@ -28059,8 +28031,8 @@ return uk;
});
}
};
}));
});
//# sourceMappingURL=i18n.js.map;
/*!
* jQuery JavaScript Library v2.2.3
* http://jquery.com/
......@@ -59398,7 +59370,7 @@ return __p
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define, escape, locales, Jed */
/*global define, escape, Jed */
(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);
})(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',
_converse.DiscoEntity = Backbone.Model.extend({
/* A Disco Entity is a JID addressable entity that can be queried
* for features.
*
* See XEP-0030: https://xmpp.org/extensions/xep-0030.html
*/
* for features.
*
* See XEP-0030: https://xmpp.org/extensions/xep-0030.html
*/
idAttribute: 'jid',
initialize: function initialize() {
......@@ -61059,6 +61031,43 @@ Strophe.addConnectionPlugin('disco',
_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 = {
// XEP-0313 Message Archive Management
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', {
overrides: {
......@@ -64726,7 +64710,7 @@ Strophe.RSM.prototype = {
this.addSpinner();
checkMAMSupport(_converse).then(function (supported) {
_converse.api.disco.supports(_converse.bare_jid, Strophe.NS.MAM).then(function (supported) {
// Success
if (supported) {
_this.fetchArchivedMessages();
......@@ -64946,19 +64930,6 @@ Strophe.RSM.prototype = {
}, _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) {
if ($(iq).find('feature-not-implemented').length) {
_converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN);
......@@ -65015,6 +64986,19 @@ Strophe.RSM.prototype = {
_converse.on('afterMessagesFetched', function (chatboxview) {
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
});
});
//# sourceMappingURL=converse-singleton.js.map;
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
//
......@@ -75440,23 +75426,21 @@ return __p
/*global define */
(function (root, factory) {
define('converse-fullscreen',["converse-core",
"tpl!inverse_brand_heading",
"converse-chatview",
"converse-controlbox",
"converse-muc",
"converse-singleton"
], factory);
}(this, function (converse, tpl_brand_heading) {
define('converse-fullscreen',["converse-core", "tpl!inverse_brand_heading", "converse-chatview", "converse-controlbox", "converse-muc", "converse-singleton"], factory);
})(undefined, function (converse, tpl_brand_heading) {
"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);
},
overrides: {
// overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the
......@@ -75465,21 +75449,17 @@ return __p
// new functions which don't exist yet can also be added.
ControlBoxView: {
createBrandHeadingHTML() {
createBrandHeadingHTML: function createBrandHeadingHTML() {
return tpl_brand_heading();
},
insertBrandHeading () {
const el = document.getElementById('converse-login-panel');
el.parentNode.insertAdjacentHTML(
'afterbegin',
this.createBrandHeadingHTML()
);
insertBrandHeading: function insertBrandHeading() {
var el = document.getElementById('converse-login-panel');
el.parentNode.insertAdjacentHTML('afterbegin', this.createBrandHeadingHTML());
}
},
ChatRoomView: {
afterShown (focus) {
afterShown: function afterShown(focus) {
/* Make sure chat rooms are scrolled down when opened
*/
this.scrollDown();
......@@ -75491,28 +75471,23 @@ return __p
}
},
initialize () {
initialize: function initialize() {
this._converse.api.settings.update({
chatview_avatar_height: 44,
chatview_avatar_width: 44,
hide_open_bookmarks: true,
show_controlbox_by_default: true,
sticky_controlbox: true,
view_mode: 'fullscreen'
sticky_controlbox: true
});
}
});
}));
});
//# sourceMappingURL=converse-fullscreen.js.map;
/*global define */
if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build
define('converse',[
"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.
......@@ -215,12 +215,6 @@
"dev": 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": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
......@@ -1246,24 +1240,6 @@
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
"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": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz",
......@@ -1620,12 +1596,6 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"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": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
......@@ -1778,15 +1748,6 @@
"integrity": "sha1-j1zrOqvXaNtTnaRYKyFS1j73cV4=",
"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": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
......@@ -1819,16 +1780,6 @@
"integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
"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": {
"version": "2.6.8",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
......@@ -2308,12 +2259,6 @@
"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": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz",
......@@ -2463,30 +2408,6 @@
"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": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz",
......@@ -3501,24 +3422,12 @@
"integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
"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": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true
},
"getobject": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz",
"integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=",
"dev": true
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
......@@ -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": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz",
......@@ -4059,12 +3797,6 @@
"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": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
......@@ -4165,15 +3897,6 @@
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
"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": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz",
......@@ -4815,16 +4538,6 @@
"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": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz",
......@@ -4841,12 +4554,6 @@
"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": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz",
......@@ -4866,32 +4573,6 @@
"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": {
"version": "2.3.11",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
......@@ -7927,7 +7608,7 @@
}
},
"pluggable.js": {
"version": "git+https://github.com/jcbrand/pluggable.js.git#8f8c8235816f44cda0f855d6ca879445aaa486a1",
"version": "git+https://github.com/jcbrand/pluggable.js.git#4677f759c270edda4ce987a8565b817a1d15973b",
"dev": true,
"requires": {
"lodash": "4.17.4"
......@@ -8186,16 +7867,6 @@
"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": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz",
......@@ -9151,15 +8822,6 @@
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"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": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
......@@ -9379,12 +9041,6 @@
"integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=",
"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": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
......@@ -9456,12 +9112,6 @@
"integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=",
"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": {
"version": "0.4.6",
"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 @@
name: "almond",
out: "../dist/converse-no-dependencies.min.js",
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: [
"awesomplete",
"jquery",
......@@ -42,12 +22,14 @@
],
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-fullscreen": "builds/converse-fullscreen",
"converse-mam": "builds/converse-mam",
"converse-minimize": "builds/converse-minimize",
"converse-muc": "builds/converse-muc",
......@@ -60,7 +42,9 @@
"converse-rosterview": "builds/converse-rosterview",
"converse-singleton": "builds/converse-singleton",
"converse-vcard": "builds/converse-vcard",
"utils": "builds/utils"
"i18n": "builds/i18n",
"utils": "builds/utils",
"form-utils": "builds/form-utils"
},
wrap: {
startFile: "start.frag",
......
......@@ -11,7 +11,7 @@
"converse-disco": "builds/converse-disco",
"converse-dragresize": "builds/converse-dragresize",
"converse-headline": "builds/converse-headline",
"converse-inverse": "builds/converse-inverse",
"converse-fullscreen": "builds/converse-fullscreen",
"converse-mam": "builds/converse-mam",
"converse-minimize": "builds/converse-minimize",
"converse-muc": "builds/converse-muc",
......@@ -24,6 +24,7 @@
"converse-rosterview": "builds/converse-rosterview",
"converse-singleton": "builds/converse-singleton",
"converse-vcard": "builds/converse-vcard",
"i18n": "builds/i18n",
"utils": "builds/utils",
"form-utils": "builds/form-utils"
},
......
......@@ -3,10 +3,6 @@ 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.
......
/*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') {
// 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.
......
......@@ -32,6 +32,5 @@
define('backbone.browserStorage', ['backbone'], emptyFunction);
define('backbone.overview', ['backbone'], emptyFunction);
define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
define("locales", [], emptyFunction);
return require('converse');
}));
......@@ -6,7 +6,7 @@
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define, escape, locales, Jed */
/*global define, escape, Jed */
(function (root, factory) {
define([
"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