Bug 25354

Summary: Clean up JavaScript markup in cataloging plugin scripts
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: josef.moravec, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19623
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:
Attachments: Bug 25354: Clean up JavaScript markup in cataloging plugin scripts
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts

Description Owen Leonard 2020-05-03 01:11:27 UTC
I have an idea for how to move JavaScript in additem.tt and addbiblio.tt to the footer, but the JavaScript generated by the plugin scripts needs some cleanup before that can happen.

Specifically, single line JS comments (// ... ) will break the script if whitespace in the script is collapsed. These will be changed to multi-line comments (/* ... */).

While I'm making changes I'll be removing the <script> tag's "type" attribute and obsolete "//<![CDATA[" markers.
Comment 1 Owen Leonard 2020-05-03 22:17:03 UTC
Created attachment 104239 [details] [review]
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts

This patch makes some minor changes to the JavaScript generated by the
cataloging plugins: <script> "type" attribute removed; single-line
comments converted to multi-line style; obsolete //<![CDATA[ marks
removed.

These changes help the JavaScript conform to current coding guidelines.
The comment style change allows for whitespace in the scripts to be
collapsed by the Template::Toolkit "collapse" filter.

Since the patch makes small cosmetic changes to many files it may be
easiest to test this patch by visually inspecting the changes.

It's also simple to test some plugins which are enabled by default (at
least in MARC21): In the basic MARC editor, the leader, 007, and 008. In
the item editor, subfield d - Date acquired.
Comment 2 Owen Leonard 2020-09-10 18:11:06 UTC
Created attachment 109857 [details] [review]
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts

This patch makes some minor changes to the JavaScript generated by the
cataloging plugins: <script> "type" attribute removed; single-line
comments converted to multi-line style; obsolete //<![CDATA[ marks
removed.

These changes help the JavaScript conform to current coding guidelines.
The comment style change allows for whitespace in the scripts to be
collapsed by the Template::Toolkit "collapse" filter.

Since the patch makes small cosmetic changes to many files it may be
easiest to test this patch by visually inspecting the changes.

It's also simple to test some plugins which are enabled by default (at
least in MARC21): In the basic MARC editor, the leader, 007, and 008. In
the item editor, subfield d - Date acquired.
Comment 3 David Nind 2020-10-01 13:58:51 UTC
Created attachment 111047 [details] [review]
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts

This patch makes some minor changes to the JavaScript generated by the
cataloging plugins: <script> "type" attribute removed; single-line
comments converted to multi-line style; obsolete //<![CDATA[ marks
removed.

These changes help the JavaScript conform to current coding guidelines.
The comment style change allows for whitespace in the scripts to be
collapsed by the Template::Toolkit "collapse" filter.

Since the patch makes small cosmetic changes to many files it may be
easiest to test this patch by visually inspecting the changes.

It's also simple to test some plugins which are enabled by default (at
least in MARC21): In the basic MARC editor, the leader, 007, and 008. In
the item editor, subfield d - Date acquired.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2020-10-13 11:41:10 UTC
Created attachment 111537 [details] [review]
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts

This patch makes some minor changes to the JavaScript generated by the
cataloging plugins: <script> "type" attribute removed; single-line
comments converted to multi-line style; obsolete //<![CDATA[ marks
removed.

These changes help the JavaScript conform to current coding guidelines.
The comment style change allows for whitespace in the scripts to be
collapsed by the Template::Toolkit "collapse" filter.

Since the patch makes small cosmetic changes to many files it may be
easiest to test this patch by visually inspecting the changes.

It's also simple to test some plugins which are enabled by default (at
least in MARC21): In the basic MARC editor, the leader, 007, and 008. In
the item editor, subfield d - Date acquired.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-10-14 12:54:22 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass (lukeg) 2020-11-13 14:44:11 UTC
enhancement will not be backported to 20.05.x