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
36c2a2ac
Commit
36c2a2ac
authored
Sep 08, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to hide the toolbar
parent
ac3ac98c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
converse.js
converse.js
+22
-17
index.html
index.html
+2
-2
No files found.
converse.js
View file @
36c2a2ac
...
...
@@ -62,6 +62,7 @@
this
.
allow_otr
=
true
;
this
.
prebind
=
false
;
this
.
show_controlbox_by_default
=
false
;
this
.
show_toolbar
=
true
;
this
.
testing
=
false
;
// Exposes sensitive data for testing. Never set to true in production systems!
this
.
xhr_custom_status
=
false
;
this
.
xhr_user_search
=
false
;
...
...
@@ -83,6 +84,7 @@
'
prebind
'
,
'
rid
'
,
'
show_controlbox_by_default
'
,
'
show_toolbar
'
,
'
sid
'
,
'
testing
'
,
'
xhr_custom_status
'
,
...
...
@@ -516,7 +518,9 @@
'
</div>
'
+
'
<div class="chat-content"></div>
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
'
<ul class="chat-toolbar no-text-select"></ul>
'
+
'
{[ if (
'
+
converse
.
show_toolbar
+
'
) { ]}
'
+
'
<ul class="chat-toolbar no-text-select"></ul>
'
+
'
{[ } ]}
'
+
'
<textarea
'
+
'
type="text"
'
+
'
class="chat-textarea"
'
+
...
...
@@ -746,11 +750,10 @@
];
this
.
showHelpMessages
(
msgs
);
return
;
}
else
if
((
converse
.
allow_otr
)
||
(
match
[
1
]
===
"
otr
"
))
{
return
this
.
model
.
initiateOTR
();
}
else
if
((
converse
.
allow_otr
)
||
(
match
[
1
]
===
"
endotr
"
))
{
return
this
.
endOTR
();
}
else
if
((
converse
.
allow_otr
)
||
(
match
[
1
]
===
"
otr
"
))
{
return
this
.
model
.
initiateOTR
();
}
}
if
(
_
.
contains
([
UNVERIFIED
,
VERIFIED
],
this
.
model
.
get
(
'
otr_status
'
)))
{
...
...
@@ -957,20 +960,22 @@
},
renderToolbar
:
function
()
{
var
data
=
this
.
model
.
toJSON
();
if
(
data
.
otr_status
==
UNENCRYPTED
)
{
data
.
otr_tooltip
=
__
(
'
Your messages are not encrypted. Click here to enable OTR encryption.
'
);
}
else
if
(
data
.
otr_status
==
UNVERIFIED
){
data
.
otr_tooltip
=
__
(
'
Your messages are encrypted, but your buddy has not been verified.
'
);
}
else
if
(
data
.
otr_status
==
VERIFIED
){
data
.
otr_tooltip
=
__
(
'
Your messages are encrypted and your buddy verified.
'
);
}
else
if
(
data
.
otr_status
==
FINISHED
){
data
.
otr_tooltip
=
__
(
'
Your buddy has closed their end of the private session, you should do the same
'
);
if
(
converse
.
show_toolbar
)
{
var
data
=
this
.
model
.
toJSON
();
if
(
data
.
otr_status
==
UNENCRYPTED
)
{
data
.
otr_tooltip
=
__
(
'
Your messages are not encrypted. Click here to enable OTR encryption.
'
);
}
else
if
(
data
.
otr_status
==
UNVERIFIED
){
data
.
otr_tooltip
=
__
(
'
Your messages are encrypted, but your buddy has not been verified.
'
);
}
else
if
(
data
.
otr_status
==
VERIFIED
){
data
.
otr_tooltip
=
__
(
'
Your messages are encrypted and your buddy verified.
'
);
}
else
if
(
data
.
otr_status
==
FINISHED
){
data
.
otr_tooltip
=
__
(
'
Your buddy has closed their end of the private session, you should do the same
'
);
}
data
.
allow_otr
=
converse
.
allow_otr
;
data
.
otr_translated_status
=
OTR_TRANSLATED_MAPPING
[
data
.
otr_status
];
data
.
otr_status_class
=
OTR_CLASS_MAPPING
[
data
.
otr_status
];
this
.
$el
.
find
(
'
.chat-toolbar
'
).
html
(
this
.
toolbar_template
(
data
));
}
data
.
allow_otr
=
converse
.
allow_otr
;
data
.
otr_translated_status
=
OTR_TRANSLATED_MAPPING
[
data
.
otr_status
];
data
.
otr_status_class
=
OTR_CLASS_MAPPING
[
data
.
otr_status
];
this
.
$el
.
find
(
'
.chat-toolbar
'
).
html
(
this
.
toolbar_template
(
data
));
return
this
;
},
...
...
index.html
View file @
36c2a2ac
...
...
@@ -192,16 +192,16 @@
<script>
require
([
'
converse
'
],
function
(
converse
)
{
converse
.
initialize
({
allow_otr
:
true
,
auto_list_rooms
:
false
,
auto_subscribe
:
false
,
allow_otr
:
true
,
bosh_service_url
:
'
https://bind.opkode.im
'
,
// Please use this connection manager only for testing purposes
debug
:
true
,
hide_muc_server
:
false
,
i18n
:
locales
[
'
fr
'
],
// Refer to ./locale/locales.js to see which locales are supported
prebind
:
false
,
show_controlbox_by_default
:
true
,
xhr_user_search
:
false
,
debug
:
true
});
});
</script>
...
...
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