Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14097486
D20122.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20122.diff
View Options
diff --git a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
@@ -112,6 +112,7 @@
id(new AphrontFormTextControl())
->setLabel(pht('LDAP Username'))
->setName('ldap_username')
+ ->setAutofocus(true)
->setValue($v_user)
->setError($e_user))
->appendChild(
diff --git a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
@@ -229,6 +229,7 @@
id(new AphrontFormTextControl())
->setLabel(pht('Username or Email'))
->setName('username')
+ ->setAutofocus(true)
->setValue($v_user)
->setError($e_user))
->appendChild(
diff --git a/src/view/form/control/AphrontFormTextControl.php b/src/view/form/control/AphrontFormTextControl.php
--- a/src/view/form/control/AphrontFormTextControl.php
+++ b/src/view/form/control/AphrontFormTextControl.php
@@ -5,6 +5,7 @@
private $disableAutocomplete;
private $sigil;
private $placeholder;
+ private $autofocus;
public function setDisableAutocomplete($disable) {
$this->disableAutocomplete = $disable;
@@ -24,6 +25,15 @@
return $this;
}
+ public function setAutofocus($autofocus) {
+ $this->autofocus = $autofocus;
+ return $this;
+ }
+
+ public function getAutofocus() {
+ return $this->autofocus;
+ }
+
public function getSigil() {
return $this->sigil;
}
@@ -49,6 +59,7 @@
'id' => $this->getID(),
'sigil' => $this->getSigil(),
'placeholder' => $this->getPlaceholder(),
+ 'autofocus' => ($this->getAutofocus() ? 'autofocus' : null),
));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 7:10 AM (20 h, 23 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6789797
Default Alt Text
D20122.diff (2 KB)
Attached To
Mode
D20122: On login forms, autofocus the "username" field
Attached
Detach File
Event Timeline
Log In to Comment