Coding guideline JS1 (https://wiki.koha-community.org/wiki/Coding_Guidelines#JS1:_Embedding_JavaScript_blocks_in_templates) says "Whenever possible JavaScript should be placed in a separate file." The JavaScript embedded in tools/marc_modification_templates.tt is not so dependent on template processing that it can't be safely moved to a separate file.
Created attachment 48253 [details] [review] Bug 15867 - Move MARC modification templates JavaScript into separate file The JavaScript embedded in the MARC modification templates template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a some translatable strings to the template. Other minor changes: A couple of JSHint warnings corrected, a couple of missing semicolons added to template markup. To test, apply the patch and go to Tools -> MARC modification templates - Confirm that The add/update form works normally with various actions (Add/update,Delete,Move, etc.). - Confirm that template switching works correctly. - Confirm that template deletion confirmation works correctly. - Confirm that cancelling an edit works correctly
Hi Owen JSHint give me one error: koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js: line 182, col 14, 'i' is already defined. 1 error
(In reply to Héctor Eduardo Castro Avalos from comment #2) > JSHint give me one error: > > koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js: line 182, > col 14, 'i' is already defined. I think that is a case where the warning can be ignored, since "i" is only being used in the for loop.
Created attachment 48313 [details] [review] [SIGNED-OFF]Bug 15867: Move MARC modification templates JavaScript into separate file The JavaScript embedded in the MARC modification templates template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a some translatable strings to the template. Other minor changes: A couple of JSHint warnings corrected, a couple of missing semicolons added to template markup. To test, apply the patch and go to Tools -> MARC modification templates - Confirm that The add/update form works normally with various actions (Add/update,Delete,Move, etc.). - Confirm that template switching works correctly. - Confirm that template deletion confirmation works correctly. - Confirm that cancelling an edit works correctly Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised
Created attachment 48461 [details] [review] Bug 15867: Move MARC modification templates JavaScript into separate file The JavaScript embedded in the MARC modification templates template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a some translatable strings to the template. Other minor changes: A couple of JSHint warnings corrected, a couple of missing semicolons added to template markup. To test, apply the patch and go to Tools -> MARC modification templates - Confirm that The add/update form works normally with various actions (Add/update,Delete,Move, etc.). - Confirm that template switching works correctly. - Confirm that template deletion confirmation works correctly. - Confirm that cancelling an edit works correctly Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to Master - Should be in the May 2016 Release. Thanks!
severity changed to enhancement