Bug 17011 - Remove "onblur" event attribute from some templates
authorOwen Leonard <oleonard@myacpl.org>
Mon, 1 Aug 2016 14:20:00 +0000 (10:20 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 12:55:41 +0000 (12:55 +0000)
Several templates have an "onblur" event attribute in the markup. This
patch moves the onblur event definition into the JavaScript.

To test, apply the patch and clear your browser cache if necessary.

In Administration -> Authority types:

  - Choose "New authority type."
  - Enter any text into the "Authority type" field.
  - Moving the cursor focus away from this field should convert your
    text to uppercase.

In Administration -> MARC bibliographic framework:

  - Choose "New framework."
  - Enter any text into the "Framework code" field.
  - Moving the cursor focus away from this field should convert your
    text to uppercase.

In Administration -> Currencies and exchange rates:

 - Choose "New currency."
  - Enter any text into the "Currency" field.
  - Moving the cursor focus away from this field should convert your
    text to uppercase.

In Administration -> Item types

 - Choose "New item type."
  - Enter any text into the "Item type" field.
  - Moving the cursor focus away from this field should convert your
    text to uppercase.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/js/biblio_framework.js

index 9c7d419..7cad110 100644 (file)
@@ -18,6 +18,9 @@
             ],
             "sPaginationType": "four_button"
         }));
+        $("#authtypecode").on("blur",function(){
+            toUC(this);
+        });
     });
 //]]>
 </script>
@@ -85,7 +88,7 @@
                             <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode %]" />[% authority_type.authtypecode %]
                     [% ELSE %]
                             <label for="authtypecode" class="required">Authority type: </label>
-                            <input id="authtypecode" type="text" class="required" required="required" name="authtypecode" size="10" maxlength="10" onblur="toUC(this)" />
+                            <input id="authtypecode" type="text" class="required" required="required" name="authtypecode" size="10" maxlength="10" />
                             <span class="required">Required</span>
                     [% END %]
                 </li>
index ebf449c..50cd4b2 100644 (file)
@@ -86,7 +86,7 @@
                 [% ELSE %]
                     <li>
                         <label for="frameworkcode" class="required">Framework code: </label>
-                        <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" required="required" class="required" />
+                        <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" required="required" class="required" />
                         <span class="required">Required</span>
                     </li>
                 [% END %]
index 90c828b..1bbacf2 100644 (file)
@@ -38,6 +38,9 @@
             check_currency( $(this).val() );
         });
         check_currency( $("#rate").val() );
+        $("#currency_code").on("blur",function(){
+            toUC(this);
+        });
     });
 //]]>
 </script>
                     <input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %]
                 [% ELSE %]
                     <label for="currency_code" class="required">Currency: </label>
-                    <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" onblur="toUC(this);" required="required" class="required" /> <span class="required">Required</span>
+                    <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
                 [% END %]
             </li>
             <li>
index 9a8f431..95bbb7b 100644 (file)
@@ -43,6 +43,9 @@ Data deleted
                 rentalcharge: { number: true }
             }
         });
+        $("#itemtype").on("blur",function(){
+            toUC(this);
+        });
      });
 //]]>
 </script>
@@ -134,7 +137,7 @@ Item types administration
                 [% ELSE %]
                     <li>
                         <label for="itemtype" class="required">Item type: </label>
-                        <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
+                        <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" /> <span class="required">Required</span>
                     </li>
                 [% END %]
                 <li>
index 581c392..171cb83 100644 (file)
@@ -73,4 +73,7 @@
             obj.css("background-color","white");
             return false;
         });
-    });
\ No newline at end of file
+        $("#frameworkcode").on("blur",function(){
+            toUC(this);
+        });
+    });