There is a lot of JavaScript in the patron entry form template which is not dependent on template processing and can therefore be moved to members.js.
Created attachment 47392 [details] [review] Bug 15692 - Move some patron entry form JavaScript into members.js We should strive to keep as much JavaScript as possible out of templates in order to keep things modular and maximize the benefits of browser caching. This patch moves JavaScript out of the patron entry template Two other minor edits: Missing semicolons added on the advice of JSHint. To test, apply the patch and confirm that the following interactions still work on the patron entry form: 1. clear_entry(): With ExtendedPatronAttributes enabled, the "Clear" link next to any attribute form field should work to clear the field. 2. clone_entry(): With ExtendedPatronAttributes enabled and a repeatable attribute defined, it should be possible to click the "New" link to add another instance of that attribute's entry field. 3. update_category_code(): With ExtendedPatronAttributes enabled and an attribute defined which is limited to a single patron category, changing the patron category selection should correctly show or hide the attribute entry form. 4. select_user(): When adding or editing a patron with a "Child" category it should be possible to search for and select a guarantor to add to the record by clicking the "Set to patron" button. Selecting a new guarantor should change the text of the button from "Set to patron" to "Change." 5. noEnterSubmit(): This function should be correctly preventing you from hitting "ENTER" in any form field to submit the form. 6. guarantordelete(): When adding or editing a patron with a "Child" category, it should be possible to clear existing guarantor information by clicking the "Delete" button. Clicking the "Delete" button should change the text of the adjacent button to "Set to patron." 7. select_city(): With one or more cities defined it should be possible to use the drop-down menu of cities to populate the city, state, zip, and country fields. 8. Date of birth entry should have a maximum date limit of yesterday. The drop-down menu of years should go back 100 years. 9. Client-side validation rules should be in effect, requiring that a valid email address be entered in the primary email, secondary email, and alternate address email fields. 10.When editing a patron, the "Add manual restriction" link should display the form for adding a manual restriction, and clicking the "Cancel" link should hide it.
Created attachment 47453 [details] [review] Bug 15692 - Move some patron entry form JavaScript into members.js We should strive to keep as much JavaScript as possible out of templates in order to keep things modular and maximize the benefits of browser caching. This patch moves JavaScript out of the patron entry template Two other minor edits: Missing semicolons added on the advice of JSHint. To test, apply the patch and confirm that the following interactions still work on the patron entry form: 1. clear_entry(): With ExtendedPatronAttributes enabled, the "Clear" link next to any attribute form field should work to clear the field. 2. clone_entry(): With ExtendedPatronAttributes enabled and a repeatable attribute defined, it should be possible to click the "New" link to add another instance of that attribute's entry field. 3. update_category_code(): With ExtendedPatronAttributes enabled and an attribute defined which is limited to a single patron category, changing the patron category selection should correctly show or hide the attribute entry form. 4. select_user(): When adding or editing a patron with a "Child" category it should be possible to search for and select a guarantor to add to the record by clicking the "Set to patron" button. Selecting a new guarantor should change the text of the button from "Set to patron" to "Change." 5. noEnterSubmit(): This function should be correctly preventing you from hitting "ENTER" in any form field to submit the form. 6. guarantordelete(): When adding or editing a patron with a "Child" category, it should be possible to clear existing guarantor information by clicking the "Delete" button. Clicking the "Delete" button should change the text of the adjacent button to "Set to patron." 7. select_city(): With one or more cities defined it should be possible to use the drop-down menu of cities to populate the city, state, zip, and country fields. 8. Date of birth entry should have a maximum date limit of yesterday. The drop-down menu of years should go back 100 years. 9. Client-side validation rules should be in effect, requiring that a valid email address be entered in the primary email, secondary email, and alternate address email fields. 10.When editing a patron, the "Add manual restriction" link should display the form for adding a manual restriction, and clicking the "Cancel" link should hide it. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 47469 [details] [review] Bug 15692 - Move some patron entry form JavaScript into members.js We should strive to keep as much JavaScript as possible out of templates in order to keep things modular and maximize the benefits of browser caching. This patch moves JavaScript out of the patron entry template Two other minor edits: Missing semicolons added on the advice of JSHint. To test, apply the patch and confirm that the following interactions still work on the patron entry form: 1. clear_entry(): With ExtendedPatronAttributes enabled, the "Clear" link next to any attribute form field should work to clear the field. 2. clone_entry(): With ExtendedPatronAttributes enabled and a repeatable attribute defined, it should be possible to click the "New" link to add another instance of that attribute's entry field. 3. update_category_code(): With ExtendedPatronAttributes enabled and an attribute defined which is limited to a single patron category, changing the patron category selection should correctly show or hide the attribute entry form. 4. select_user(): When adding or editing a patron with a "Child" category it should be possible to search for and select a guarantor to add to the record by clicking the "Set to patron" button. Selecting a new guarantor should change the text of the button from "Set to patron" to "Change." 5. noEnterSubmit(): This function should be correctly preventing you from hitting "ENTER" in any form field to submit the form. 6. guarantordelete(): When adding or editing a patron with a "Child" category, it should be possible to clear existing guarantor information by clicking the "Delete" button. Clicking the "Delete" button should change the text of the adjacent button to "Set to patron." 7. select_city(): With one or more cities defined it should be possible to use the drop-down menu of cities to populate the city, state, zip, and country fields. 8. Date of birth entry should have a maximum date limit of yesterday. The drop-down menu of years should go back 100 years. 9. Client-side validation rules should be in effect, requiring that a valid email address be entered in the primary email, secondary email, and alternate address email fields. 10.When editing a patron, the "Add manual restriction" link should display the form for adding a manual restriction, and clicking the "Cancel" link should hide it. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to Master - Should be in the May 2016 release. Thanks !