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
86a962be
Commit
86a962be
authored
Feb 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't render message form via separate Backbone.View
Appeared to only complicate things...
parent
cc4d4a6f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
106 additions
and
124 deletions
+106
-124
src/converse-chatview.js
src/converse-chatview.js
+81
-112
src/converse-otr.js
src/converse-otr.js
+13
-2
src/templates/chatbox.html
src/templates/chatbox.html
+1
-0
src/templates/chatbox_message_form.html
src/templates/chatbox_message_form.html
+3
-5
src/templates/spoiler_button.html
src/templates/spoiler_button.html
+7
-4
src/templates/toolbar.html
src/templates/toolbar.html
+1
-1
No files found.
src/converse-chatview.js
View file @
86a962be
This diff is collapsed.
Click to expand it.
src/converse-otr.js
View file @
86a962be
...
...
@@ -298,6 +298,10 @@
return
this
.
__super__
.
parseMessageForCommands
.
apply
(
this
,
arguments
);
},
isOTREncryptedSession
()
{
return
_
.
includes
([
UNVERIFIED
,
VERIFIED
],
this
.
model
.
get
(
'
otr_status
'
));
},
onMessageSubmitted
(
text
,
spoiler_hint
)
{
const
{
_converse
}
=
this
.
__super__
;
if
(
!
_converse
.
connection
.
authenticated
)
{
...
...
@@ -306,8 +310,7 @@
if
(
this
.
parseMessageForCommands
(
text
))
{
return
;
}
if
(
_
.
includes
([
UNVERIFIED
,
VERIFIED
],
this
.
model
.
get
(
'
otr_status
'
)))
{
// Off-the-record encryption is active
if
(
this
.
isOTREncryptedSession
())
{
this
.
model
.
otr
.
sendMsg
(
text
);
this
.
model
.
trigger
(
'
showSentOTRMessage
'
,
text
);
}
else
{
...
...
@@ -453,6 +456,14 @@
));
},
getToolbarOptions
(
options
)
{
options
=
this
.
__super__
.
getToolbarOptions
();
if
(
this
.
model
.
get
(
'
composing_spoiler
'
)
&&
this
.
isOTREncryptedSession
())
{
options
.
show_spoiler_button
=
false
;
}
return
options
;
},
renderToolbar
(
toolbar
,
options
)
{
const
result
=
this
.
__super__
.
renderToolbar
.
apply
(
this
,
arguments
);
this
.
addOTRToolbarButton
(
options
);
...
...
src/templates/chatbox.html
View file @
86a962be
<div
class=
"flyout box-flyout"
>
<div
class=
"chat-body"
>
<div
class=
"chat-content {[ if (o.show_send_button) { ]}chat-content-sendbutton{[ } ]}"
></div>
<div
class=
"message-form-container"
/>
</div>
</div>
src/templates/chatbox_message_form.html
View file @
86a962be
...
...
@@ -4,15 +4,13 @@
{[ if (o.show_toolbar) { ]}
<ul
class=
"chat-toolbar no-text-select"
></ul>
{[ } ]}
{[ if (o.allow_spoiler_messages) { ]}
<input
type=
"text"
placeholder=
"{{o.label_spoiler_hint}}"
value=
"{{ o.hint_value }}"
class=
"{[ if (!o.sending_spoiler) { ]} hidden {[ } ]} spoiler-hint"
/>
{[ } ]}
<input
type=
"text"
placeholder=
"{{o.label_spoiler_hint}}"
value=
"{{ o.hint_value }}"
class=
"{[ if (!o.composing_spoiler) { ]} hidden {[ } ]} spoiler-hint"
/>
<textarea
type=
"text"
class=
"chat-textarea
{[ if (o.show_send_button) { ]} chat-textarea-send-button {[ } ]}
{[ if (o.
send
ing_spoiler) { ]} spoiler {[ } ]}"
{[ if (o.
compos
ing_spoiler) { ]} spoiler {[ } ]}"
placeholder=
"{{{o.label_personal_message}}}"
>
{{ o.message_value }}
</textarea>
{[ if (o.show_send_button) { ]}
<button
type=
"submit"
class=
"pure-button send-button"
>
{{{ o.label_send }}}
</button>
...
...
src/templates/spoiler_button.html
View file @
86a962be
{[ if (o.show_spoiler_button) { ]}
<!-- XXX: This markup is also in src/templates/toolbar.html -->
<li
class=
"toggle-spoiler-edit"
>
<a
class=
"
{[ if (o.sending_spoiler) { ]} icon-eye-blocked {[ } ]}
{[ if (!o.sending_spoiler) { ]} icon-eye {[ } ]}"
title=
"{{ o.title }}"
></a>
<a
class=
"
{[ if (o.sending_spoiler) { ]} icon-eye-blocked {[ } ]}
{[ if (!o.sending_spoiler) { ]} icon-eye {[ } ]}"
title=
"{{ o.title }}"
></a>
</li>
{[ } ]}
src/templates/toolbar.html
View file @
86a962be
...
...
@@ -8,7 +8,7 @@
<a
class=
"
{[ if (o.sending_spoiler) { ]} icon-eye-blocked {[ } ]}
{[ if (!o.sending_spoiler) { ]} icon-eye {[ } ]}"
title=
"{{ o.
title
}}"
></a>
title=
"{{ o.
label_toggle_spoiler
}}"
></a>
</li>
{[ } ]}
{[ if (o.show_call_button) { ]}
...
...
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