Bug 25354 - Clean up JavaScript markup in cataloging plugin scripts
Summary: Clean up JavaScript markup in cataloging plugin scripts
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-03 01:11 UTC by Owen Leonard
Modified: 2020-11-13 14:44 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Text to go in the release notes:
Version(s) released in:
20.11.00


Attachments
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts (32.20 KB, patch)
2020-05-03 22:17 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts (32.17 KB, patch)
2020-09-10 18:11 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts (32.22 KB, patch)
2020-10-01 13:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts (32.28 KB, patch)
2020-10-13 11:41 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 2020-11-13 14:44:11 UTC
enhancement will not be backported to 20.05.x