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
dd155220
Commit
dd155220
authored
Sep 18, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use declarative autofocus for login form
parent
4dedfdb8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
src/converse-controlbox.js
src/converse-controlbox.js
+0
-3
src/templates/login_panel.js
src/templates/login_panel.js
+11
-4
No files found.
src/converse-controlbox.js
View file @
dd155220
...
...
@@ -251,9 +251,6 @@ converse.plugins.add('converse-controlbox', {
this
.
insertBrandHeading
();
}
this
.
loginpanel
.
initPopovers
();
if
(
api
.
settings
.
get
(
'
auto_focus
'
))
{
this
.
loginpanel
.
el
.
querySelector
(
'
#converse-login-jid
'
).
focus
();
}
return
this
;
},
...
...
src/templates/login_panel.js
View file @
dd155220
import
{
html
}
from
"
lit-html
"
;
import
{
__
}
from
'
../i18n
'
;
import
tpl_spinner
from
'
./spinner.js
'
;
import
{
__
}
from
'
../i18n
'
;
import
{
api
}
from
"
@converse/headless/converse-core
"
;
import
{
html
}
from
"
lit-html
"
;
const
trust_checkbox
=
(
o
)
=>
{
...
...
@@ -45,7 +46,7 @@ const register_link = () => {
const
show_register_link
=
(
o
)
=>
{
const
_converse
=
o
.
_converse
;
return
_converse
.
allow_registration
&&
!
_converse
.
api
.
settings
.
get
(
"
auto_login
"
)
&&
!
api
.
settings
.
get
(
"
auto_login
"
)
&&
_converse
.
pluggable
.
plugins
[
'
converse-register
'
].
enabled
(
_converse
);
}
...
...
@@ -56,7 +57,13 @@ const auth_fields = (o) => {
return
html
`
<div class="form-group">
<label for="converse-login-jid">
${
i18n_xmpp_address
}
:</label>
<input id="converse-login-jid" class="form-control" required="required" type="text" name="jid" placeholder="
${
o
.
placeholder_username
}
"/>
<input id="converse-login-jid"
?autofocus=
${
api
.
settings
.
get
(
'
auto_focus
'
)
?
true
:
false
}
required
class="form-control"
type="text"
name="jid"
placeholder="
${
o
.
placeholder_username
}
"/>
</div>
${
(
o
.
authentication
!==
o
.
EXTERNAL
)
?
password_input
()
:
''
}
${
o
.
show_trust_checkbox
?
trust_checkbox
(
o
)
:
''
}
...
...
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