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
f032af91
Commit
f032af91
authored
May 31, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial work on moving certain settings into a model
parent
b02c70b4
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
164 additions
and
143 deletions
+164
-143
src/converse-chatboxes.js
src/converse-chatboxes.js
+2
-2
src/converse-controlbox.js
src/converse-controlbox.js
+7
-6
src/converse-core.js
src/converse-core.js
+132
-112
src/converse-dragresize.js
src/converse-dragresize.js
+1
-1
src/converse-embedded.js
src/converse-embedded.js
+1
-1
src/converse-fullscreen.js
src/converse-fullscreen.js
+1
-1
src/converse-headline.js
src/converse-headline.js
+1
-1
src/converse-message-view.js
src/converse-message-view.js
+1
-1
src/converse-minimize.js
src/converse-minimize.js
+1
-1
src/converse-muc.js
src/converse-muc.js
+8
-8
src/converse-notification.js
src/converse-notification.js
+3
-3
src/converse-rosterview.js
src/converse-rosterview.js
+1
-1
src/converse-singleton.js
src/converse-singleton.js
+5
-5
No files found.
src/converse-chatboxes.js
View file @
f032af91
...
...
@@ -722,7 +722,7 @@
_converse
.
root
.
appendChild
(
el
);
}
}
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
],
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
],
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
el
.
classList
.
add
(
'
fullscreen
'
);
}
el
.
innerHTML
=
''
;
...
...
@@ -735,7 +735,7 @@
initialize
()
{
this
.
model
.
on
(
"
add
"
,
this
.
onChatBoxAdded
,
this
);
this
.
model
.
on
(
"
destroy
"
,
this
.
removeChat
,
this
);
this
.
el
.
classList
.
add
(
`converse-
${
_converse
.
view_mode
}
`
);
this
.
el
.
classList
.
add
(
`converse-
${
_converse
.
settings
.
get
(
'
view_mode
'
)
}
`
);
this
.
render
();
},
...
...
src/converse-controlbox.js
View file @
f032af91
...
...
@@ -406,8 +406,8 @@
this
.
render
();
_
.
forEach
(
this
.
el
.
querySelectorAll
(
'
[data-title]
'
),
(
el
)
=>
{
const
popover
=
new
bootstrap
.
Popover
(
el
,
{
'
trigger
'
:
_converse
.
view_mode
===
'
mobile
'
&&
'
click
'
||
'
hover
'
,
'
dismissible
'
:
_converse
.
view_mode
===
'
mobile
'
&&
true
||
false
,
'
trigger
'
:
_converse
.
settings
.
get
(
'
view_mode
'
)
===
'
mobile
'
&&
'
click
'
||
'
hover
'
,
'
dismissible
'
:
_converse
.
settings
.
get
(
'
view_mode
'
)
===
'
mobile
'
&&
true
||
false
,
'
container
'
:
_converse
.
chatboxviews
.
el
})
});
...
...
@@ -465,9 +465,10 @@
if
(
!
this
.
validate
())
{
return
;
}
const
form_data
=
new
FormData
(
ev
.
target
);
_converse
.
trusted
=
form_data
.
get
(
'
trusted
'
);
_converse
.
storage
=
form_data
.
get
(
'
trusted
'
)
?
'
local
'
:
'
session
'
;
_converse
.
settings
.
save
({
'
trusted
'
:
form_data
.
get
(
'
trusted
'
),
'
storage
'
:
form_data
.
get
(
'
trusted
'
)
?
'
local
'
:
'
session
'
});
let
jid
=
form_data
.
get
(
'
jid
'
);
if
(
_converse
.
locked_domain
)
{
jid
=
Strophe
.
escapeNode
(
jid
)
+
'
@
'
+
_converse
.
locked_domain
;
...
...
@@ -578,7 +579,7 @@
});
_converse
.
on
(
'
clearSession
'
,
()
=>
{
if
(
_converse
.
trusted
)
{
if
(
_converse
.
settings
.
get
(
'
trusted
'
)
)
{
const
chatboxes
=
_
.
get
(
_converse
,
'
chatboxes
'
,
null
);
if
(
!
_
.
isNil
(
chatboxes
))
{
const
controlbox
=
chatboxes
.
get
(
'
controlbox
'
);
...
...
src/converse-core.js
View file @
f032af91
This diff is collapsed.
Click to expand it.
src/converse-dragresize.js
View file @
f032af91
...
...
@@ -41,7 +41,7 @@
dependencies
:
[
"
converse-chatview
"
,
"
converse-headline
"
,
"
converse-muc-views
"
],
enabled
(
_converse
)
{
return
_converse
.
view_mode
==
'
overlayed
'
;
return
_converse
.
settings
.
get
(
'
view_mode
'
)
==
'
overlayed
'
;
},
overrides
:
{
...
...
src/converse-embedded.js
View file @
f032af91
...
...
@@ -13,7 +13,7 @@
converse
.
plugins
.
add
(
'
converse-embedded
'
,
{
enabled
(
_converse
)
{
return
_converse
.
view_mode
===
'
embedded
'
;
return
_converse
.
settings
.
get
(
'
view_mode
'
)
===
'
embedded
'
;
},
initialize
()
{
...
...
src/converse-fullscreen.js
View file @
f032af91
...
...
@@ -21,7 +21,7 @@
converse
.
plugins
.
add
(
'
converse-fullscreen
'
,
{
enabled
(
_converse
)
{
return
_
.
includes
([
'
fullscreen
'
,
'
embedded
'
],
_converse
.
view_mode
);
return
_
.
includes
([
'
fullscreen
'
,
'
embedded
'
],
_converse
.
settings
.
get
(
'
view_mode
'
)
);
},
overrides
:
{
...
...
src/converse-headline.js
View file @
f032af91
...
...
@@ -129,7 +129,7 @@
/* Handler method for all incoming messages of type "headline". */
const
from_jid
=
message
.
getAttribute
(
'
from
'
);
if
(
utils
.
isHeadlineMessage
(
_converse
,
message
))
{
if
(
_
.
includes
(
from_jid
,
'
@
'
)
&&
!
_converse
.
allow_non_roster_messaging
)
{
if
(
_
.
includes
(
from_jid
,
'
@
'
)
&&
!
_converse
.
settings
.
get
(
'
allow_non_roster_messaging
'
)
)
{
return
;
}
const
chatbox
=
_converse
.
chatboxes
.
create
({
...
...
src/converse-message-view.js
View file @
f032af91
...
...
@@ -221,7 +221,7 @@
processMessageText
()
{
var
text
=
this
.
get
(
'
message
'
);
text
=
u
.
geoUriToHttp
(
text
,
_converse
.
geouri_replacement
);
text
=
u
.
geoUriToHttp
(
text
,
_converse
.
g
geouri_replacement
eouri_replacement
);
},
getExtraMessageClasses
()
{
...
...
src/converse-minimize.js
View file @
f032af91
...
...
@@ -42,7 +42,7 @@
dependencies
:
[
"
converse-chatview
"
,
"
converse-controlbox
"
,
"
converse-muc
"
,
"
converse-muc-views
"
,
"
converse-headline
"
],
enabled
(
_converse
)
{
return
_converse
.
view_mode
==
'
overlayed
'
;
return
_converse
.
settings
.
get
(
'
view_mode
'
)
==
'
overlayed
'
;
},
overrides
:
{
...
...
src/converse-muc.js
View file @
f032af91
...
...
@@ -108,14 +108,14 @@
// Refer to docs/source/configuration.rst for explanations of these
// configuration settings.
_converse
.
api
.
settings
.
update
({
allow_muc
:
true
,
allow_muc_invitations
:
true
,
auto_join_on_invite
:
false
,
auto_join_rooms
:
[],
muc_domain
:
undefined
,
muc_history_max_stanzas
:
undefined
,
muc_instant_rooms
:
true
,
muc_nickname_from_jid
:
false
'
allow_muc
'
:
true
,
'
allow_muc_invitations
'
:
true
,
'
auto_join_on_invite
'
:
false
,
'
auto_join_rooms
'
:
[],
'
muc_domain
'
:
undefined
,
'
muc_history_max_stanzas
'
:
undefined
,
'
muc_instant_rooms
'
:
true
,
'
muc_nickname_from_jid
'
:
false
});
_converse
.
api
.
promises
.
add
([
'
roomsAutoJoined
'
]);
...
...
src/converse-notification.js
View file @
f032af91
...
...
@@ -71,7 +71,7 @@
};
_converse
.
isMessageToHiddenChat
=
function
(
message
)
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
const
jid
=
Strophe
.
getBareJidFromJid
(
message
.
getAttribute
(
'
from
'
));
const
model
=
_converse
.
chatboxes
.
get
(
jid
);
if
(
!
_
.
isNil
(
model
))
{
...
...
@@ -138,7 +138,7 @@
const
full_from_jid
=
message
.
getAttribute
(
'
from
'
),
from_jid
=
Strophe
.
getBareJidFromJid
(
full_from_jid
);
if
(
message
.
getAttribute
(
'
type
'
)
===
'
headline
'
)
{
if
(
!
_
.
includes
(
from_jid
,
'
@
'
)
||
_converse
.
allow_non_roster_messaging
)
{
if
(
!
_
.
includes
(
from_jid
,
'
@
'
)
||
_converse
.
get
(
'
allow_non_roster_messaging
'
)
)
{
title
=
__
(
"
Notification from %1$s
"
,
from_jid
);
}
else
{
return
;
...
...
@@ -159,7 +159,7 @@
if
(
!
_
.
isUndefined
(
roster_item
))
{
title
=
__
(
"
%1$s says
"
,
roster_item
.
getDisplayName
());
}
else
{
if
(
_converse
.
allow_non_roster_messaging
)
{
if
(
_converse
.
get
(
'
allow_non_roster_messaging
'
)
)
{
title
=
__
(
"
%1$s says
"
,
from_jid
);
}
else
{
return
;
...
...
src/converse-rosterview.js
View file @
f032af91
...
...
@@ -821,7 +821,7 @@
}
this
.
filter_view
.
showOrHide
();
return
this
;
},
_converse
.
animate
?
100
:
0
),
},
_converse
.
get
(
'
animate
'
)
?
100
:
0
),
filter
(
query
,
type
)
{
// First we make sure the filter is restored to its
...
...
src/converse-singleton.js
View file @
f032af91
...
...
@@ -46,7 +46,7 @@
ChatBoxes
:
{
chatBoxMayBeShown
(
chatbox
)
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
return
!
chatbox
.
get
(
'
hidden
'
);
}
else
{
return
this
.
__super__
.
chatBoxMayBeShown
.
apply
(
this
,
arguments
);
...
...
@@ -55,7 +55,7 @@
createChatBox
(
jid
,
attrs
)
{
/* Make sure new chat boxes are hidden by default. */
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
attrs
=
attrs
||
{};
attrs
.
hidden
=
true
;
}
...
...
@@ -65,7 +65,7 @@
ChatBoxView
:
{
shouldShowOnTextMessage
()
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
return
false
;
}
else
{
return
this
.
__super__
.
shouldShowOnTextMessage
.
apply
(
this
,
arguments
);
...
...
@@ -77,7 +77,7 @@
* time. So before opening a chat, we make sure all other
* chats are hidden.
*/
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
_
.
each
(
this
.
__super__
.
_converse
.
chatboxviews
.
xget
(
this
.
model
.
get
(
'
id
'
)),
hideChat
);
this
.
model
.
set
(
'
hidden
'
,
false
);
}
...
...
@@ -87,7 +87,7 @@
ChatRoomView
:
{
show
(
focus
)
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
view_mode
))
{
if
(
_
.
includes
([
'
mobile
'
,
'
fullscreen
'
,
'
embedded
'
],
this
.
__super__
.
_converse
.
settings
.
get
(
'
view_mode
'
)
))
{
_
.
each
(
this
.
__super__
.
_converse
.
chatboxviews
.
xget
(
this
.
model
.
get
(
'
id
'
)),
hideChat
);
this
.
model
.
set
(
'
hidden
'
,
false
);
}
...
...
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