[open-ils-commits] [GIT] Evergreen ILS branch rel_2_2 updated. 5d1c05e4340c1050a8a8896b875e245cbd16e4e6

Evergreen Git git at git.evergreen-ils.org
Mon Jul 23 14:55:55 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_2 has been updated
       via  5d1c05e4340c1050a8a8896b875e245cbd16e4e6 (commit)
      from  e729b944f959c115fe14c024cdfb5e77a92c0c47 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5d1c05e4340c1050a8a8896b875e245cbd16e4e6
Author: Dan Scott <dscott at laurentian.ca>
Date:   Thu Jul 12 19:12:06 2012 -0400

    TPAC: Set autofocus appropriately for different contexts
    
    At login, the basic search bar was fighting (and winning) for the
    default focus rather than the username field. Additionally, in the
    advanced search pages, no field was getting focus. Therefore, check to
    see if we expect to be in a context where it makes sense to set the
    default focus to the basic search input field; otherwise, set the focus
    to the login username field or the appropriate advanced search field.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/login.tt2 b/Open-ILS/src/templates/opac/login.tt2
index 29994ad..f6892bb 100644
--- a/Open-ILS/src/templates/opac/login.tt2
+++ b/Open-ILS/src/templates/opac/login.tt2
@@ -1,6 +1,7 @@
 [%  PROCESS "opac/parts/header.tt2";
     WRAPPER "opac/parts/base.tt2";
     INCLUDE "opac/parts/topnav.tt2";
+    basic_search = "f";
     ctx.page_title = l("Account Login") %]
     <div id="search-wrapper">
         [% INCLUDE "opac/parts/searchbar.tt2" %]
@@ -9,18 +10,6 @@
         <div id="main-content">
             [% INCLUDE "opac/parts/login/form.tt2" %]
             <div class="clear-both very-big-height"></div>	
-            <script type="text/javascript">
-                /* Note: when common browsers support HTML5 "autofocus", we can remove this */
-                var _onload = window.onload;
-                window.onload = function() {
-                    try {
-                        document.getElementById("username_field").focus();
-                        if (_onload) _onload();
-                    } catch (E) {
-                        void(0);
-                    }
-                };
-            </script>
         </div>
     </div>
 [% END %]
diff --git a/Open-ILS/src/templates/opac/parts/advanced/expert.tt2 b/Open-ILS/src/templates/opac/parts/advanced/expert.tt2
index da8bba6..7d1ffa1 100644
--- a/Open-ILS/src/templates/opac/parts/advanced/expert.tt2
+++ b/Open-ILS/src/templates/opac/parts/advanced/expert.tt2
@@ -6,7 +6,7 @@
         <tbody id="adv_expert_rows_here">
             <tr id="adv_expert_row">
                 <th>[% l("Tag:") %]</th>
-                <td><input type="text" name="tag" size="3" /></td>
+                <td><input type="text" name="tag" size="3" autofocus /></td>
                 <th>[% l("Subfield:") %]</th>
                 <td><input type="text" name="subfield" size="1" /></td>
                 <th>[% l("Value:") %]</th>
diff --git a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
index 02aa5d1..5171c35 100644
--- a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
+++ b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
@@ -42,7 +42,7 @@
             <option value="[% o.value %]" [% c == o.value ? ' selected="selected"' : '' %]>[% o.label %]</option>
             [% END %]
         </select>
-        <input type='text' size='18' name='query' value="[% q | html %]" x-webkit-speech />
+        <input type='text' size='18' name='query' value="[% q | html %]" x-webkit-speech [% IF loop.index == 0 %] autofocus [% END %] />
         <a href="javascript:;" class="row-remover"
             title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
             onclick='return killRowIfAtLeast(2, this);'><img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" /></a>
diff --git a/Open-ILS/src/templates/opac/parts/advanced/numeric.tt2 b/Open-ILS/src/templates/opac/parts/advanced/numeric.tt2
index 7262801..32bf56e 100644
--- a/Open-ILS/src/templates/opac/parts/advanced/numeric.tt2
+++ b/Open-ILS/src/templates/opac/parts/advanced/numeric.tt2
@@ -18,7 +18,7 @@
                 </select>
             </td>
             <td>
-                <input type="text" name="query" size="16" />
+                <input type="text" name="query" size="16" autofocus />
             </td>
         </tr>
         <tr>
diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2
index df50a03..0060bbe 100644
--- a/Open-ILS/src/templates/opac/parts/js.tt2
+++ b/Open-ILS/src/templates/opac/parts/js.tt2
@@ -59,7 +59,7 @@
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf_xhr.js?[% ctx.eg_cache_hash %]"></script>
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/JSON_v1.js?[% ctx.eg_cache_hash %]"></script>
 
-[% IF use_autosuggest.enabled == "t"; %]
+[% IF use_autosuggest.enabled == "t" AND basic_search != "f"; %]
 <script type="text/javascript">
     dojo.require("openils.widget.AutoSuggest");
 
diff --git a/Open-ILS/src/templates/opac/parts/login/form.tt2 b/Open-ILS/src/templates/opac/parts/login/form.tt2
index 48f2f67..e4200bd 100644
--- a/Open-ILS/src/templates/opac/parts/login/form.tt2
+++ b/Open-ILS/src/templates/opac/parts/login/form.tt2
@@ -95,7 +95,7 @@
                             </td>
                             <td width="58%" valign="top">
                                 <div class="input_bg">
-                                    <input type="text" id="username_field" name="username"/>
+                                    <input type="text" id="username_field" name="username" autofocus />
                                 </div>
                             </td>
                         </tr>
diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2
index f4ee110..d20d36b 100644
--- a/Open-ILS/src/templates/opac/parts/searchbar.tt2
+++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2
@@ -24,7 +24,7 @@
                 store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}'
                 [%-     END # opac_visible -%]
                 [%- ELSE -%]
-                autofocus x-webkit-speech
+                    [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech
                 [%- END # autosuggest enabled %] />
         </span>
         [%- INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
diff --git a/Open-ILS/src/templates/opac/record.tt2 b/Open-ILS/src/templates/opac/record.tt2
index 9503cb8..374cca4 100644
--- a/Open-ILS/src/templates/opac/record.tt2
+++ b/Open-ILS/src/templates/opac/record.tt2
@@ -1,7 +1,9 @@
 [%  PROCESS "opac/parts/header.tt2";
     WRAPPER "opac/parts/base.tt2";
     INCLUDE "opac/parts/topnav.tt2";
-    ctx.page_title = l("Record Detail") %]
+    ctx.page_title = l("Record Detail");
+    IF CGI.param("expand"); basic_search = "f"; END;    
+-%]
     <div id="search-wrapper">
         [% INCLUDE "opac/parts/searchbar.tt2" %]
     </div>

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/login.tt2              |   13 +------------
 .../src/templates/opac/parts/advanced/expert.tt2   |    2 +-
 .../templates/opac/parts/advanced/global_row.tt2   |    2 +-
 .../src/templates/opac/parts/advanced/numeric.tt2  |    2 +-
 Open-ILS/src/templates/opac/parts/js.tt2           |    2 +-
 Open-ILS/src/templates/opac/parts/login/form.tt2   |    2 +-
 Open-ILS/src/templates/opac/parts/searchbar.tt2    |    2 +-
 Open-ILS/src/templates/opac/record.tt2             |    4 +++-
 8 files changed, 10 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list