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
98fe6062
Commit
98fe6062
authored
Dec 17, 2017
by
Seve
Committed by
JC Brand
Feb 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send hints
parent
26c579e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
src/converse-spoilers.js
src/converse-spoilers.js
+10
-1
No files found.
src/converse-spoilers.js
View file @
98fe6062
...
...
@@ -16,6 +16,15 @@
function
isEditSpoilerMessage
()
{
return
document
.
querySelector
(
'
.toggle-spoiler
'
).
getAttribute
(
'
active
'
)
===
'
true
'
;
}
function
hasHint
()
{
return
document
.
querySelector
(
'
.chat-textarea-hint
'
).
value
.
length
>
0
;
}
function
getHint
()
{
let
hint
=
document
.
querySelector
(
'
.chat-textarea-hint
'
).
value
;
return
hasHint
()
?
hint
:
_
(
'
Spoiler
'
);
}
// The following line registers your plugin.
converse
.
plugins
.
add
(
"
converse-spoilers
"
,
{
...
...
@@ -151,7 +160,7 @@
debugger
;
let
messageStanza
=
this
.
__super__
.
createMessageStanza
.
apply
(
this
,
arguments
);
if
(
isEditSpoilerMessage
())
{
messageStanza
.
c
(
'
spoiler
'
,{
'
xmlns
'
:
'
urn:xmpp:spoiler:0
'
},
_
(
'
Spoiler
'
));
//TODO Check for hint or send __('Spoiler');
messageStanza
.
c
(
'
spoiler
'
,{
'
xmlns
'
:
'
urn:xmpp:spoiler:0
'
},
getHint
(
));
//TODO Check for hint or send __('Spoiler');
}
alert
(
messageStanza
);
return
messageStanza
;
...
...
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