aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/ui.js2
-rw-r--r--views/default/core/account/login_box.php9
-rw-r--r--views/default/forms/login.php6
-rw-r--r--views/default/forms/register.php7
-rw-r--r--views/default/forms/user/requestnewpassword.php12
5 files changed, 13 insertions, 23 deletions
diff --git a/js/lib/ui.js b/js/lib/ui.js
index 7abf7626f..57378a4d6 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -19,6 +19,8 @@ elgg.ui.init = function () {
$('.elgg-requires-confirmation').live('click', elgg.ui.requiresConfirmation);
+ $('.elgg-autofocus').focus();
+
if ($('.elgg-input-date').length) {
elgg.ui.initDatePicker();
}
diff --git a/views/default/core/account/login_box.php b/views/default/core/account/login_box.php
index 274172bdb..8c586d425 100644
--- a/views/default/core/account/login_box.php
+++ b/views/default/core/account/login_box.php
@@ -15,12 +15,3 @@ $title = elgg_echo('login');
$body = elgg_view_form('login', array('action' => "{$login_url}action/login"));
echo elgg_view_module('aside', $title, $body);
-
-?>
-
-
-<script type="text/javascript">
- elgg.register_hook_handler('init', 'system', function() {
- $('input[name=username]').focus();
- });
-</script>
diff --git a/views/default/forms/login.php b/views/default/forms/login.php
index 91e9cda42..956b3a87f 100644
--- a/views/default/forms/login.php
+++ b/views/default/forms/login.php
@@ -9,7 +9,11 @@
<div>
<label><?php echo elgg_echo('loginusername'); ?></label>
- <?php echo elgg_view('input/text', array('name' => 'username')); ?>
+ <?php echo elgg_view('input/text', array(
+ 'name' => 'username',
+ 'class' => 'elgg-autofocus',
+ ));
+ ?>
</div>
<div>
<label><?php echo elgg_echo('password'); ?></label>
diff --git a/views/default/forms/register.php b/views/default/forms/register.php
index 6e18cd53d..411152205 100644
--- a/views/default/forms/register.php
+++ b/views/default/forms/register.php
@@ -23,6 +23,7 @@ if (elgg_is_sticky_form('register')) {
echo elgg_view('input/text', array(
'name' => 'name',
'value' => $name,
+ 'class' => 'elgg-autofocus',
));
?>
</div>
@@ -75,9 +76,3 @@ echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['
echo elgg_view('input/hidden', array('name' => 'invitecode', 'value' => $vars['invitecode']));
echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register')));
echo '</div>';
-?>
-<script type="text/javascript">
- $(function() {
- $('input[name=name]').focus();
- });
-</script> \ No newline at end of file
diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php
index 22357e728..8a5a18734 100644
--- a/views/default/forms/user/requestnewpassword.php
+++ b/views/default/forms/user/requestnewpassword.php
@@ -12,15 +12,13 @@
</div>
<div>
<label><?php echo elgg_echo('username'); ?></label><br />
- <?php echo elgg_view('input/text', array('name' => 'username')); ?>
+ <?php echo elgg_view('input/text', array(
+ 'name' => 'username',
+ 'class' => 'elgg-autofocus',
+ ));
+ ?>
</div>
<?php echo elgg_view('input/captcha'); ?>
<div class="elgg-foot">
<?php echo elgg_view('input/submit', array('value' => elgg_echo('request'))); ?>
</div>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
- $(document).ready(function() {
- $('input[name=username]').focus();
- });
-</script> \ No newline at end of file