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
bda567ca
Commit
bda567ca
authored
Aug 05, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting errors
parent
db550b3e
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
57 deletions
+57
-57
spec/autocomplete.js
spec/autocomplete.js
+10
-10
spec/chatbox.js
spec/chatbox.js
+2
-2
spec/controlbox.js
spec/controlbox.js
+2
-2
spec/messages.js
spec/messages.js
+18
-18
spec/muc.js
spec/muc.js
+14
-14
spec/omemo.js
spec/omemo.js
+5
-5
spec/room_registration.js
spec/room_registration.js
+1
-1
spec/spoilers.js
spec/spoilers.js
+2
-2
src/converse-headline.js
src/converse-headline.js
+2
-2
src/converse-oauth.js
src/converse-oauth.js
+1
-1
No files found.
spec/autocomplete.js
View file @
bda567ca
...
...
@@ -41,8 +41,8 @@
const
textarea
=
view
.
el
.
querySelector
(
'
textarea.chat-textarea
'
);
const
at_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
50
,
'
key
'
:
'
@
'
};
...
...
@@ -84,8 +84,8 @@
// Press tab
const
tab_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
9
,
'
key
'
:
'
Tab
'
}
...
...
@@ -97,7 +97,7 @@
const
backspace_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
keyCode
'
:
8
}
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -129,7 +129,7 @@
const
up_arrow_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
()
=>
(
up_arrow_event
.
defaultPrevented
=
true
),
'
stopPropagation
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
38
}
view
.
onKeyDown
(
up_arrow_event
);
...
...
@@ -140,8 +140,8 @@
view
.
onKeyDown
({
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
13
// Enter
});
expect
(
textarea
.
value
).
toBe
(
'
hello s @some2
'
);
...
...
@@ -195,8 +195,8 @@
// Press backspace
const
backspace_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
8
,
'
key
'
:
'
Backspace
'
}
...
...
spec/chatbox.js
View file @
bda567ca
...
...
@@ -497,7 +497,7 @@
const
textarea
=
view
.
el
.
querySelector
(
'
.chat-textarea
'
);
const
ev
=
{
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
};
view
.
onKeyDown
(
ev
);
...
...
@@ -1167,7 +1167,7 @@
view
.
el
.
querySelector
(
'
.chat-textarea
'
).
value
=
message
;
view
.
onKeyDown
({
target
:
view
.
el
.
querySelector
(
'
textarea.chat-textarea
'
),
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
view
.
clearMessages
).
toHaveBeenCalled
();
...
...
spec/controlbox.js
View file @
bda567ca
...
...
@@ -267,7 +267,7 @@
async
function
(
done
,
_converse
)
{
const
xhr
=
{
'
open
'
:
function
noop
()
{},
'
open
'
:
function
open
()
{},
'
send
'
:
function
()
{
xhr
.
responseText
=
JSON
.
stringify
([
{
"
jid
"
:
"
marty@mcfly.net
"
,
"
fullname
"
:
"
Marty McFly
"
},
...
...
@@ -328,7 +328,7 @@
test_utils
.
createContacts
(
_converse
,
'
all
'
).
openControlBox
();
var
modal
;
const
xhr
=
{
'
open
'
:
function
noop
()
{},
'
open
'
:
function
open
()
{},
'
send
'
:
function
()
{
const
value
=
modal
.
el
.
querySelector
(
'
input[name="name"]
'
).
value
;
if
(
value
===
'
existing
'
)
{
...
...
spec/messages.js
View file @
bda567ca
...
...
@@ -27,7 +27,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -55,7 +55,7 @@
textarea
.
value
=
'
But soft, what light through yonder window breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
...
...
@@ -161,7 +161,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -184,7 +184,7 @@
textarea
.
value
=
'
But soft, what light through yonder window breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
...
...
@@ -237,7 +237,7 @@
textarea
.
value
=
'
It is the east, and Juliet is the one.
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -246,7 +246,7 @@
textarea
.
value
=
'
Arise, fair sun, and kill the envious moon
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -277,7 +277,7 @@
textarea
.
value
=
'
It is the east, and Juliet is the sun.
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
model
.
messages
.
once
(
'
rendered
'
,
resolve
));
...
...
@@ -1331,7 +1331,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
u
.
waitUntil
(()
=>
_converse
.
api
.
chats
.
get
().
length
);
...
...
@@ -1354,7 +1354,7 @@
textarea
.
value
=
'
Another message
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -2537,7 +2537,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -2561,7 +2561,7 @@
textarea
.
value
=
'
But soft, what light through yonder window breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
...
...
@@ -2636,7 +2636,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -2715,7 +2715,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -2751,7 +2751,7 @@
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -2996,8 +2996,8 @@
textarea
.
value
=
'
hello @z3r0 @gibson @mr.robot, how are you?
'
const
enter_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
13
// Enter
}
spyOn
(
_converse
.
connection
,
'
send
'
);
...
...
@@ -3074,8 +3074,8 @@
textarea
.
value
=
'
hello @z3r0 @gibson @mr.robot, how are you?
'
const
enter_event
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
stopPropagation
'
:
function
noop
()
{},
'
preventDefault
'
:
function
preventDefault
()
{},
'
stopPropagation
'
:
function
stopPropagation
()
{},
'
keyCode
'
:
13
// Enter
}
view
.
onKeyDown
(
enter_event
);
...
...
spec/muc.js
View file @
bda567ca
...
...
@@ -2011,7 +2011,7 @@
textarea
.
value
=
text
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -2864,7 +2864,7 @@
const
textarea
=
view
.
el
.
querySelector
(
'
.chat-textarea
'
);
textarea
.
value
=
'
/clear
'
;
const
enter
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
keyCode
'
:
13
};
const
enter
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
preventDefault
()
{},
'
keyCode
'
:
13
};
view
.
onKeyDown
(
enter
);
textarea
.
value
=
'
/help
'
;
view
.
onKeyDown
(
enter
);
...
...
@@ -2935,7 +2935,7 @@
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
lounge@montague.lit
'
,
'
romeo
'
);
const
view
=
_converse
.
chatboxviews
.
get
(
'
lounge@montague.lit
'
);
var
textarea
=
view
.
el
.
querySelector
(
'
.chat-textarea
'
);
const
enter
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
noop
()
{},
'
keyCode
'
:
13
};
const
enter
=
{
'
target
'
:
textarea
,
'
preventDefault
'
:
function
preventDefault
()
{},
'
keyCode
'
:
13
};
spyOn
(
window
,
'
confirm
'
).
and
.
callFake
(()
=>
true
);
textarea
.
value
=
'
/clear
'
;
view
.
onKeyDown
(
enter
);
...
...
@@ -2999,7 +2999,7 @@
textarea
.
value
=
'
/member chris Welcome to the club!
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
_converse
.
connection
.
send
).
not
.
toHaveBeenCalled
();
...
...
@@ -3011,7 +3011,7 @@
textarea
.
value
=
'
/member marc Welcome to the club!
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
...
...
@@ -3126,7 +3126,7 @@
textarea
.
value
=
'
/topic This is the groupchat subject
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
...
...
@@ -3136,7 +3136,7 @@
textarea
.
value
=
'
/subject This is a new subject
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
...
...
@@ -3150,7 +3150,7 @@
textarea
.
value
=
'
/Subject This is yet another subject
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
sent_stanza
.
textContent
).
toBe
(
'
This is yet another subject
'
);
...
...
@@ -3173,7 +3173,7 @@
textarea
.
value
=
'
/clear
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
view
.
clearMessages
).
toHaveBeenCalled
();
...
...
@@ -3215,7 +3215,7 @@
textarea
.
value
=
'
/owner
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
view
.
validateRoleOrAffiliationChangeArgs
).
toHaveBeenCalled
();
...
...
@@ -3303,7 +3303,7 @@
textarea
.
value
=
'
/ban
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
view
.
validateRoleOrAffiliationChangeArgs
).
toHaveBeenCalled
();
...
...
@@ -3404,7 +3404,7 @@
textarea
.
value
=
'
/kick
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
view
.
validateRoleOrAffiliationChangeArgs
).
toHaveBeenCalled
();
...
...
@@ -3508,7 +3508,7 @@
textarea
.
value
=
'
/op
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
...
...
@@ -3651,7 +3651,7 @@
textarea
.
value
=
'
/mute
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
...
...
spec/omemo.js
View file @
bda567ca
...
...
@@ -126,7 +126,7 @@
textarea
.
value
=
'
This message will be encrypted
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
iq_stanza
=
await
u
.
waitUntil
(()
=>
bundleFetched
(
_converse
,
contact_jid
,
'
555
'
));
...
...
@@ -310,7 +310,7 @@
textarea
.
value
=
'
This message will be encrypted
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
iq_stanza
=
await
u
.
waitUntil
(()
=>
bundleFetched
(
_converse
,
contact_jid
,
'
4e30f35051b7b8b42abe083742187228
'
),
1000
);
...
...
@@ -458,7 +458,7 @@
textarea
.
value
=
'
This is an encrypted message from this device
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
iq_stanza
=
await
u
.
waitUntil
(()
=>
bundleFetched
(
_converse
,
_converse
.
bare_jid
,
'
988349631
'
));
...
...
@@ -515,7 +515,7 @@
textarea
.
value
=
'
This message will be encrypted
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
// Enter
});
let
iq_stanza
=
await
u
.
waitUntil
(()
=>
deviceListFetched
(
_converse
,
contact_jid
));
...
...
@@ -1251,7 +1251,7 @@
textarea
.
value
=
'
This message will be sent encrypted
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
...
...
spec/room_registration.js
View file @
bda567ca
...
...
@@ -24,7 +24,7 @@
textarea
.
value
=
'
/register
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
let
stanza
=
await
u
.
waitUntil
(()
=>
_
.
filter
(
...
...
spec/spoilers.js
View file @
bda567ca
...
...
@@ -111,7 +111,7 @@
textarea
.
value
=
'
This is the spoiler
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
@@ -188,7 +188,7 @@
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
noop
()
{},
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
...
...
src/converse-headline.js
View file @
bda567ca
...
...
@@ -112,8 +112,8 @@ converse.plugins.add('converse-headline', {
},
// Override to avoid the methods in converse-chatview.js
'
renderMessageForm
'
:
function
noop
()
{},
'
afterShown
'
:
function
noop
()
{}
'
renderMessageForm
'
:
function
renderMessageForm
()
{},
'
afterShown
'
:
function
afterShown
()
{}
});
async
function
onHeadlineMessage
(
message
)
{
...
...
src/converse-oauth.js
View file @
bda567ca
...
...
@@ -78,7 +78,7 @@ converse.plugins.add("converse-oauth", {
});
_converse
.
OAuthProviders
=
_converse
.
Collection
.
extend
({
'
sync
'
:
_function
noop
()
{},
'
sync
'
:
function
sync
()
{},
initialize
()
{
_
.
each
(
_converse
.
user_settings
.
oauth_providers
,
(
provider
)
=>
{
...
...
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