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
016bca74
Commit
016bca74
authored
Aug 21, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`console.warn` is not supported on FF < 52
parent
d70746d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
src/converse-core.js
src/converse-core.js
+5
-5
src/utils.js
src/utils.js
+11
-4
No files found.
src/converse-core.js
View file @
016bca74
...
...
@@ -121,10 +121,10 @@
message
=
message
.
stack
;
}
const
logger
=
_
.
assignIn
({
'
debug
'
:
_
.
noop
,
'
error
'
:
_
.
noop
,
'
info
'
:
_
.
noop
,
'
warn
'
:
_
.
noop
,
'
debug
'
:
console
.
log
||
_
.
noop
,
'
error
'
:
console
.
log
||
_
.
noop
,
'
info
'
:
console
.
log
||
_
.
noop
,
'
warn
'
:
console
.
log
||
_
.
noop
,
},
console
);
if
(
level
===
Strophe
.
LogLevel
.
ERROR
)
{
if
(
_converse
.
debug
)
{
...
...
@@ -136,7 +136,7 @@
logger
.
warn
(
`WARNING:
${
message
}
`
);
}
else
if
(
level
===
Strophe
.
LogLevel
.
FATAL
)
{
if
(
_converse
.
debug
)
{
logger
.
error
(
`FATAL:
${
message
}
`
);
logger
.
trace
(
`FATAL:
${
message
}
`
);
}
else
{
logger
.
error
(
`FATAL:
${
message
}
`
);
}
...
...
src/utils.js
View file @
016bca74
...
...
@@ -33,6 +33,13 @@
const
URL_REGEX
=
/
\b(
https
?
:
\/\/
|www
\.
|https
?
:
\/\/
www
\.)[^\s
<>
]{2,200}\b
/g
;
const
logger
=
_
.
assignIn
({
'
debug
'
:
console
.
log
||
_
.
noop
,
'
error
'
:
console
.
log
||
_
.
noop
,
'
info
'
:
console
.
log
||
_
.
noop
,
'
warn
'
:
console
.
log
||
_
.
noop
,
},
console
);
var
afterAnimationEnd
=
function
(
el
,
callback
)
{
el
.
classList
.
remove
(
'
visible
'
);
if
(
_
.
isFunction
(
callback
))
{
...
...
@@ -198,7 +205,7 @@
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
_
.
isNil
(
el
))
{
const
err
=
"
Undefined or null element passed into slideOut
"
console
.
warn
(
err
);
logger
.
warn
(
err
);
reject
(
new
Error
(
err
));
return
;
}
...
...
@@ -242,7 +249,7 @@
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
_
.
isNil
(
el
))
{
const
err
=
"
Undefined or null element passed into slideIn
"
;
console
.
warn
(
err
);
logger
.
warn
(
err
);
return
reject
(
new
Error
(
err
));
}
else
if
(
_
.
includes
(
el
.
classList
,
'
collapsed
'
))
{
return
resolve
();
...
...
@@ -280,7 +287,7 @@
u
.
fadeIn
=
function
(
el
,
callback
)
{
if
(
_
.
isNil
(
el
))
{
console
.
warn
(
"
Undefined or null element passed into fadeIn
"
);
logger
.
warn
(
"
Undefined or null element passed into fadeIn
"
);
}
if
(
window
.
converse_disable_effects
)
{
// Effects are disabled (for tests)
el
.
classList
.
remove
(
'
hidden
'
);
...
...
@@ -488,7 +495,7 @@
var
obj
=
window
.
JSON
.
parse
(
preferred_locale
);
return
obj
.
locale_data
.
converse
[
""
].
lang
;
}
catch
(
e
)
{
console
.
log
(
e
);
logger
.
error
(
e
);
}
}
return
u
.
detectLocale
(
isSupportedByLibrary
)
||
'
en
'
;
...
...
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