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
387df5b8
Commit
387df5b8
authored
Feb 19, 2018
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
fadad9bb
fa656935
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
CHANGES.md
CHANGES.md
+4
-0
src/converse-core.js
src/converse-core.js
+10
-10
src/utils.js
src/utils.js
+11
-0
No files found.
CHANGES.md
View file @
387df5b8
# Changelog
## 3.3.4 (Unreleased)
-
Avoid
`eval`
(via
`_.template`
from lodash).
## 3.3.3 (2018-02-14)
### Bugfixes
...
...
src/converse-core.js
View file @
387df5b8
...
...
@@ -20,7 +20,7 @@
"
backbone.nativeview
"
,
"
backbone.browserStorage
"
],
factory
);
}(
this
,
function
(
sizzle
,
Promise
,
_
,
f
,
polyfill
,
i18n
,
u
tils
,
moment
,
Strophe
,
pluggable
,
Backbone
)
{
}(
this
,
function
(
sizzle
,
Promise
,
_
,
f
,
polyfill
,
i18n
,
u
,
moment
,
Strophe
,
pluggable
,
Backbone
)
{
/* Cannot use this due to Safari bug.
* See https://github.com/jcbrand/converse.js/issues/196
...
...
@@ -217,7 +217,7 @@
/* Private function, used to add a new promise to the ones already
* available via the `waitUntil` api method.
*/
_converse
.
promises
[
promise
]
=
u
tils
.
getResolveablePromise
();
_converse
.
promises
[
promise
]
=
u
.
getResolveablePromise
();
}
_converse
.
emit
=
function
(
name
)
{
...
...
@@ -235,7 +235,7 @@
_converse
.
initialize
=
function
(
settings
,
callback
)
{
"
use strict
"
;
settings
=
!
_
.
isUndefined
(
settings
)
?
settings
:
{};
const
init_promise
=
u
tils
.
getResolveablePromise
();
const
init_promise
=
u
.
getResolveablePromise
();
_
.
each
(
PROMISES
,
addPromise
);
...
...
@@ -617,7 +617,7 @@
this
.
initStatus
=
()
=>
new
Promise
((
resolve
,
reject
)
=>
{
const
promise
=
new
u
tils
.
getResolveablePromise
();
const
promise
=
new
u
.
getResolveablePromise
();
this
.
xmppstatus
=
new
this
.
XMPPStatus
();
const
id
=
b64_sha1
(
`converse.xmppstatus-
${
_converse
.
bare_jid
}
`
);
this
.
xmppstatus
.
id
=
id
;
// Appears to be necessary for backbone.browserStorage
...
...
@@ -1142,7 +1142,7 @@
},
isSelf
(
jid
)
{
return
u
tils
.
isSameBareJID
(
jid
,
_converse
.
connection
.
jid
);
return
u
.
isSameBareJID
(
jid
,
_converse
.
connection
.
jid
);
},
addAndSubscribe
(
jid
,
name
,
groups
,
message
,
attributes
)
{
...
...
@@ -1862,7 +1862,7 @@
i18n
.
fetchTranslations
(
_converse
.
locale
,
_converse
.
locales
,
_
.
template
(
_converse
.
locales_url
)(
{
'
locale
'
:
_converse
.
locale
}))
u
.
interpolate
(
_converse
.
locales_url
,
{
'
locale
'
:
_converse
.
locale
}))
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
))
.
then
(
finishInitialization
)
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
...
...
@@ -1921,9 +1921,9 @@
},
'
settings
'
:
{
'
update
'
(
settings
)
{
u
tils
.
merge
(
_converse
.
default_settings
,
settings
);
u
tils
.
merge
(
_converse
,
settings
);
u
tils
.
applyUserSettings
(
_converse
,
settings
,
_converse
.
user_settings
);
u
.
merge
(
_converse
.
default_settings
,
settings
);
u
.
merge
(
_converse
,
settings
);
u
.
applyUserSettings
(
_converse
,
settings
,
_converse
.
user_settings
);
},
'
get
'
(
key
)
{
if
(
_
.
includes
(
_
.
keys
(
_converse
.
default_settings
),
key
))
{
...
...
@@ -2045,7 +2045,7 @@
'
b64_sha1
'
:
b64_sha1
,
'
moment
'
:
moment
,
'
sizzle
'
:
sizzle
,
'
utils
'
:
u
tils
'
utils
'
:
u
}
};
window
.
dispatchEvent
(
new
Event
(
'
converse-loaded
'
));
...
...
src/utils.js
View file @
387df5b8
...
...
@@ -646,6 +646,14 @@
return
promise
;
};
u
.
interpolate
=
function
(
string
,
o
)
{
return
string
.
replace
(
/{{{
([^
{}
]
*
)
}}}/g
,
(
a
,
b
)
=>
{
var
r
=
o
[
b
];
return
typeof
r
===
'
string
'
||
typeof
r
===
'
number
'
?
r
:
a
;
});
};
u
.
safeSave
=
function
(
model
,
attributes
)
{
if
(
u
.
isPersistableModel
(
model
))
{
model
.
save
(
attributes
);
...
...
@@ -655,6 +663,9 @@
}
u
.
isVisible
=
function
(
el
)
{
if
(
u
.
hasClass
(
'
hidden
'
,
el
))
{
return
false
;
}
// XXX: Taken from jQuery's "visible" implementation
return
el
.
offsetWidth
>
0
||
el
.
offsetHeight
>
0
||
el
.
getClientRects
().
length
>
0
;
};
...
...
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