]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3673 added autofocus class
authorCash Costello <cash.costello@gmail.com>
Sun, 9 Oct 2011 21:38:09 +0000 (17:38 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 9 Oct 2011 21:38:09 +0000 (17:38 -0400)
js/lib/ui.js
views/default/core/account/login_box.php
views/default/forms/login.php
views/default/forms/register.php
views/default/forms/user/requestnewpassword.php

index 7abf7626f5f07f00b425ee6b3c78e41e681a0879..57378a4d63fa37127505c2651d45f502bad30a08 100644 (file)
@@ -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();
        }
index 274172bdbcf83b7d6dab1fcd8bd55162c2d948cc..8c586d425837a614172773cc0df80d9aa8b75484 100644 (file)
@@ -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>
index 91e9cda424d80adc33b8572b27e0e1334882b392..956b3a87f704655facbe16f88a24e2e2143e8758 100644 (file)
@@ -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>
index 6e18cd53d800b703409cb15f13fd3013d3774f1c..411152205ad192b5d596fa1a8327b9783f7efbc8 100644 (file)
@@ -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
index 22357e728f65834e0725094628e48705a34139d7..8a5a18734d3348d2b321ceeeaefa8383425c67db 100644 (file)
 </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