Remove the need for emojione

This commit is contained in:
JC Brand 2018-09-03 14:06:18 +02:00
parent 1d38d8af03
commit e35fceff1a
10 changed files with 21722 additions and 608 deletions

View File

@ -29,6 +29,7 @@
"lodash/prefer-constant": "off",
"lodash/prefer-noop": "off",
"lodash/prefer-lodash-typecheck": "off",
"lodash/prefer-includes": "off",
"lodash/preferred-alias": "off",
"lodash/prefer-get": "off",
"accessor-pairs": "error",

View File

@ -97,6 +97,10 @@ Open [tests.html](https://github.com/conversejs/converse.js/blob/master/tests.ht
`Converse.js` is released under the [Mozilla Public License (MPL)](https://www.mozilla.org/MPL/2.0/index.txt).
## Attribution
Emoji images are courtesy of [Twemoji](https://emojitwo.github.io/).
## Support
For support queries and discussions, please join the mailing list: <conversejs@librelist.com>

22026
dist/converse.js vendored

File diff suppressed because one or more lines are too long

6
package-lock.json generated
View File

@ -3530,12 +3530,6 @@
"minimalistic-crypto-utils": "1.0.1"
}
},
"emojione": {
"version": "3.1.7",
"resolved": "https://registry.npmjs.org/emojione/-/emojione-3.1.7.tgz",
"integrity": "sha1-LTxyXGlvF5yd3jrLZVxiHulCmx4=",
"dev": true
},
"emojis-list": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",

View File

@ -48,7 +48,6 @@
"bourbon": "^4.3.2",
"bytebuffer": "^3.5.5",
"clean-css-cli": "^4.0.10",
"emojione": "^3.0.3",
"es6-promise": "^4.1.0",
"eslint": "4.19.1",
"eslint-plugin-lodash": "^2.3.3",

View File

@ -7,13 +7,13 @@
(function (root, factory) {
define([
"converse-core",
"emojione",
"filesize",
"templates/chatboxes.html",
"backbone.overview",
"utils/form"
"utils/form",
"utils/emoji"
], factory);
}(this, function (converse, emojione, filesize, tpl_chatboxes) {
}(this, function (converse, filesize, tpl_chatboxes) {
"use strict";
const { $msg, Backbone, Promise, Strophe, b64_sha1, moment, sizzle, utils, _ } = converse.env;
@ -389,7 +389,7 @@
'from': _converse.bare_jid,
'sender': 'me',
'time': moment().format(),
'message': text ? u.httpToGeoUri(emojione.shortnameToUnicode(text), _converse) : undefined,
'message': text ? u.httpToGeoUri(u.shortnameToUnicode(text), _converse) : undefined,
'is_spoiler': is_spoiler,
'spoiler_hint': is_spoiler ? spoiler_hint : undefined,
'type': this.get('message_type')

View File

@ -8,14 +8,14 @@
define([
"utils/form",
"converse-core",
"emojione",
"converse-disco",
"backbone.overview",
"backbone.orderedlistview",
"backbone.vdomview",
"utils/muc"
"utils/muc",
"utils/emoji"
], factory);
}(this, function (u, converse, emojione) {
}(this, function (u, converse) {
"use strict";
const MUC_ROLE_WEIGHTS = {
@ -380,7 +380,7 @@
'from': `${this.get('jid')}/${this.get('nick')}`,
'fullname': this.get('nick'),
'is_spoiler': is_spoiler,
'message': text ? u.httpToGeoUri(emojione.shortnameToUnicode(text), _converse) : undefined,
'message': text ? u.httpToGeoUri(u.shortnameToUnicode(text), _converse) : undefined,
'nick': this.get('nick'),
'references': references,
'sender': 'me',

View File

@ -205,15 +205,15 @@
return matches;
}
u.unescapeHTML = function (htmlEscapedText) {
u.unescapeHTML = function (string) {
/* Helper method that replace HTML-escaped symbols with equivalent characters
* (e.g. transform occurrences of '&amp;' to '&')
*
* Parameters:
* (String) htmlEscapedText: a String containing the HTML-escaped symbols.
* (String) string: a String containing the HTML-escaped symbols.
*/
var div = document.createElement('div');
div.innerHTML = htmlEscapedText;
div.innerHTML = string;
return div.innerText;
};

269
src/utils/emoji.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -88,7 +88,6 @@ const config = {
"backbone.vdomview": path.resolve(__dirname, "node_modules/backbone.vdomview/backbone.vdomview"),
"bootstrap": path.resolve(__dirname, "node_modules/bootstrap.native/dist/bootstrap-native-v4"),
"crypto": path.resolve(__dirname, "node_modules/otr/build/dep/crypto"),
"emojione": path.resolve(__dirname, "node_modules/emojione/lib/js/emojione"),
"es6-promise": path.resolve(__dirname, "node_modules/es6-promise/dist/es6-promise.auto"),
"filesize": path.resolve(__dirname, "node_modules/filesize/lib/filesize"),
"jed": path.resolve(__dirname, "node_modules/jed/jed"),