closes bug 237 : focus sur le quick search
authorPascal Corpet <pascal.corpet@m4x.org>
Fri, 7 Jan 2005 16:47:12 +0000 (16:47 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:13 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-232

templates/search.quick.form.tpl
templates/search.quick.tpl
templates/search.tpl

index 54f6e04..bf20bd4 100644 (file)
@@ -20,7 +20,7 @@
 
 <h1>Recherche simple dans l'annuaire</h1>
 
-<form action="{"search.php"|url}" method="get">
+<form action="{"search.php"|url}" method="get"{if $show_js} id="quick_form"{/if}>
   <table class="bicol" cellspacing="0" cellpadding="4">
     <tr>
       <td style="width: 78%">
 
 <br />
 
+{if $show_js}
 {literal}
 <script type="text/javascript">
   <!--
   // Activate the first search input field.
-  var nodes = document.getElementsByTagName('input');
-  for(var i=0; i<nodes.length; i++) {
-    node = nodes[i];
-    if(node.name == 'quick') {
-      node.focus();
-      break;
-    }
-  }
+  document.getElementById("quick_form").quick.focus();
   // -->
 </script>
 {/literal}
+{/if}
 {* vim:set et sw=2 sts=2 sws=2: *}
index d19c8bb..dd845be 100644 (file)
@@ -18,8 +18,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
 
-{include file="search.quick.form.tpl"}
-
+{include file="search.quick.form.tpl" show_js=1}
 <h1>Comment faire une recherche ?</h1>
 
 <h2>Nom, Prenom, Promo ...</h2>
index 574535c..0cd1564 100644 (file)
@@ -21,7 +21,7 @@
 
 {if $formulaire==0 and !$xorg_error->errs|count}
   {if !$advanced}
-  {include file='search.quick.form.tpl'}
+  {include file='search.quick.form.tpl' show_js=1}
   {else}
   {include file=search.adv.links.tpl do_title=1}
   {/if}