This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e94bac  [OPENMEETINGS-2000] js errors in chat should be fixed
5e94bac is described below

commit 5e94bac0b1161eecfba087ae7c751f2e471eac9c
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Sun Dec 27 14:45:41 2020 +0700

    [OPENMEETINGS-2000] js errors in chat should be fixed
---
 openmeetings-web/src/main/front/chat/src/cssemoticons.js | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/openmeetings-web/src/main/front/chat/src/cssemoticons.js 
b/openmeetings-web/src/main/front/chat/src/cssemoticons.js
index b6abd61..4445dd6 100644
--- a/openmeetings-web/src/main/front/chat/src/cssemoticons.js
+++ b/openmeetings-web/src/main/front/chat/src/cssemoticons.js
@@ -19,7 +19,8 @@ const escapeCharacters = [")", "(", "*", "[", "]", "{", "}", 
"|", "^", "<", ">",
        // (<\\S+.*>) matches <\\S+.*> (matches an HTML tag like <span> or 
<div>), but haven't quite gotten it working yet, need to push this fix now
        , preMatch = '(^|[\\s\\0])'
        , emoticons = []
-       , matchers = [];
+       , matchers = []
+       , defaults = {animate: true, delay: 500, exclude: 
'pre,code,.no-emoticons'};
 
 function createMatcher(m) {
        const str = m.text.replace(specialRegex, '\\$1');
@@ -80,23 +81,23 @@ addMatchers([ // emoticons to be treated with a special 
class, hash specifies th
 module.exports = {
        emoticons: emoticons
        , matchers: matchers
-       , defaults: {animate: true, delay: 500, exclude: 
'pre,code,.no-emoticons'}
+       , defaults: defaults
        , emoticonize: function(str, options) {
-               const opts = $.extend({}, this.defaults, options);
+               const opts = $.extend({}, defaults, options);
 
                let cssClass = 'css-emoticon';
                if (opts.animate) {
                        cssClass += ' un-transformed-emoticon 
animated-emoticon';
                }
-               for (let i = 0; i < this.matchers.length; ++i) {
-                       const m = this.matchers[i];
+               for (let i = 0; i < matchers.length; ++i) {
+                       const m = matchers[i];
                        const css = cssClass + " " + m.cssClass;
                        str = str.replace(m.regexp, "$1<span class='" + css + 
"'>$2</span>");
                }
                return str;
        }
        , animate: function(options) {
-               const opts = $.extend({}, this.defaults, options);
+               const opts = $.extend({}, defaults, options);
                // animate emoticons
                if (opts.animate) {
                        setTimeout(function () {

Reply via email to