Page MenuHomePhabricator

D20122.diff
No OneTemporary

D20122.diff

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

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)

Event Timeline