Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
3fabe889
Commit
3fabe889
authored
Jul 15, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated package-lock. Fix tests.
parent
67578c97
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
835 additions
and
701 deletions
+835
-701
Makefile
Makefile
+1
-1
package-lock.json
package-lock.json
+814
-654
spec/chatbox.js
spec/chatbox.js
+0
-33
src/utils.js
src/utils.js
+20
-13
No files found.
Makefile
View file @
3fabe889
...
...
@@ -110,7 +110,7 @@ stamp-bundler: Gemfile
.PHONY
:
clean
clean
:
-
rm
-f
stamp-npm stamp-bundler
-
rm
-f
stamp-npm stamp-bundler
package-lock.json
-
rm
-rf
node_modules .bundle
.PHONY
:
dev
...
...
package-lock.json
View file @
3fabe889
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/chatbox.js
View file @
3fabe889
...
...
@@ -1238,39 +1238,6 @@
done
();
}));
it
(
"
should display emoticons correctly
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
test_utils
.
openContactsPanel
(
_converse
);
var
contact_jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
var
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
var
messages
=
[
'
:)
'
,
'
;)
'
,
'
:D
'
,
'
:P
'
,
'
8)
'
,
'
>:)
'
,
'
:S
'
,
'
:
\\
'
,
'
>:(
'
,
'
:(
'
,
'
:O
'
,
'
(^.^)b
'
,
'
<3
'
];
var
emoticons
=
[
'
<span class="emoticon icon-smiley"></span>
'
,
'
<span class="emoticon icon-wink"></span>
'
,
'
<span class="emoticon icon-grin"></span>
'
,
'
<span class="emoticon icon-tongue"></span>
'
,
'
<span class="emoticon icon-cool"></span>
'
,
'
<span class="emoticon icon-evil"></span>
'
,
'
<span class="emoticon icon-confused"></span>
'
,
'
<span class="emoticon icon-wondering"></span>
'
,
'
<span class="emoticon icon-angry"></span>
'
,
'
<span class="emoticon icon-sad"></span>
'
,
'
<span class="emoticon icon-shocked"></span>
'
,
'
<span class="emoticon icon-thumbs-up"></span>
'
,
'
<span class="emoticon icon-heart"></span>
'
];
spyOn
(
view
,
'
sendMessage
'
).
and
.
callThrough
();
for
(
var
i
=
0
;
i
<
messages
.
length
;
i
++
)
{
var
message
=
messages
[
i
];
test_utils
.
sendMessage
(
view
,
message
);
expect
(
view
.
sendMessage
).
toHaveBeenCalled
();
var
msg
=
view
.
$el
.
find
(
'
.chat-content
'
).
find
(
'
.chat-message
'
).
last
().
find
(
'
.chat-msg-content
'
);
expect
(
msg
.
html
()).
toEqual
(
emoticons
[
i
]);
}
done
();
}));
it
(
"
can contain hyperlinks, which will be clickable
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
...
...
src/utils.js
View file @
3fabe889
...
...
@@ -574,23 +574,30 @@
* lists of emojis in that category as values.
*/
if
(
_
.
isUndefined
(
this
.
emojis_by_category
))
{
var
emojis
=
_
.
values
(
_
.
mapValues
(
emojione
.
emojioneList
,
function
(
value
,
key
,
o
)
{
const
emojis
=
_
.
values
(
_
.
mapValues
(
emojione
.
emojioneList
,
function
(
value
,
key
,
o
)
{
value
.
_shortname
=
key
;
return
value
}));
var
tones
=
[
'
:tone1:
'
,
'
:tone2:
'
,
'
:tone3:
'
,
'
:tone4:
'
,
'
:tone5:
'
];
var
excluded
=
[
'
:kiss_ww:
'
,
'
:kiss_mm:
'
,
'
:kiss_woman_man:
'
];
var
excluded_substrings
=
[
'
:woman
'
,
'
:man
'
,
'
:women_
'
,
'
:men_
'
,
'
_man_
'
,
'
_woman_
'
,
'
_woman:
'
,
'
_man:
'
];
var
categories
=
_
.
uniq
(
_
.
map
(
emojis
,
_
.
partial
(
_
.
get
,
_
,
'
category
'
)));
var
emojis_by_category
=
{};
_
.
forEach
(
categories
,
function
(
cat
)
{
var
list
=
_
.
sortBy
(
_
.
filter
(
emojis
,
[
'
category
'
,
cat
]),
[
'
uc_base
'
]);
list
=
_
.
filter
(
list
,
function
(
item
)
{
return
!
_
.
includes
(
_
.
concat
(
tones
,
excluded
),
item
.
_shortname
)
&&
!
_
.
some
(
excluded_substrings
,
_
.
partial
(
_
.
includes
,
item
.
_shortname
));
});
const
tones
=
[
'
:tone1:
'
,
'
:tone2:
'
,
'
:tone3:
'
,
'
:tone4:
'
,
'
:tone5:
'
];
const
excluded
=
[
'
:kiss_ww:
'
,
'
:kiss_mm:
'
,
'
:kiss_woman_man:
'
];
const
excluded_substrings
=
[
'
:woman
'
,
'
:man
'
,
'
:women_
'
,
'
:men_
'
,
'
_man_
'
,
'
_woman_
'
,
'
_woman:
'
,
'
_man:
'
];
const
excluded_categories
=
[
'
modifier
'
];
const
categories
=
_
.
difference
(
_
.
uniq
(
_
.
map
(
emojis
,
_
.
partial
(
_
.
get
,
_
,
'
category
'
))),
excluded_categories
);
const
emojis_by_category
=
{};
_
.
forEach
(
categories
,
(
cat
)
=>
{
let
list
=
_
.
sortBy
(
_
.
filter
(
emojis
,
[
'
category
'
,
cat
]),
[
'
uc_base
'
]);
list
=
_
.
filter
(
list
,
(
item
)
=>
!
_
.
includes
(
_
.
concat
(
tones
,
excluded
),
item
.
_shortname
)
&&
!
_
.
some
(
excluded_substrings
,
_
.
partial
(
_
.
includes
,
item
.
_shortname
))
);
if
(
cat
===
'
people
'
)
{
var
idx
=
_
.
findIndex
(
list
,
[
'
uc_base
'
,
'
1f600
'
]);
const
idx
=
_
.
findIndex
(
list
,
[
'
uc_base
'
,
'
1f600
'
]);
list
=
_
.
union
(
_
.
slice
(
list
,
idx
),
_
.
slice
(
list
,
0
,
idx
+
1
));
}
else
if
(
cat
===
'
activity
'
)
{
list
=
_
.
union
(
_
.
slice
(
list
,
27
-
1
),
_
.
slice
(
list
,
0
,
27
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment