Bug 21784: Clean up js_includes.inc
authorOwen Leonard <oleonard@myacpl.org>
Wed, 7 Nov 2018 18:55:57 +0000 (18:55 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 24 Apr 2019 11:00:19 +0000 (11:00 +0000)
This patch cleans up js_includes.inc by removing script "type"
attributes which are now invalid HTML. The patch also removes "CDATA"
markers from script blocks. They have been unnecessary since we stopped
using an XHTML doctype.

To test, apply the patch and look at various pages in the staff client
to confirm that no JavaScript-driven interactions are broken.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc

index 6c02936..f91f734 100644 (file)
@@ -4,7 +4,7 @@
 [% USE To %]
 [%# Prevent XFS attacks -%]
 [% UNLESS popup %]
-    <script type="text/javascript">
+    <script>
        if (self === top) {
            var antiClickjack = document.getElementById("antiClickjack");
            antiClickjack.parentNode.removeChild(antiClickjack);
 
 [% INCLUDE 'validator-strings.inc' %]
 [% IF ( IntranetUserJS ) %]
-    <script type="text/javascript">
-    //<![CDATA[
+    <script>
     [% IntranetUserJS | $raw %]
-    //]]>
     </script>
 [% END %]
 
 [% IF ( virtualshelves || intranetbookbag ) %]
-<script type="text/javascript">
-    //<![CDATA[
+    <script>
         var MSG_BASKET_EMPTY = _("Your cart is currently empty");
         var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
         var MSG_RECORD_ADDED = _("This item has been added to your cart");
@@ -52,7 +49,6 @@
         var MSG_ITEM_NOT_IN_CART = _("Add to cart");
         var MSG_ITEM_IN_CART = _("In your cart");
         var MSG_RECORD_REMOVED = _("The item has been removed from your cart");
-    //]]>
     </script>
 
     [% Asset.js("js/basket.js") | $raw %]
 
 [% IF LocalCoverImages %]
     [% Asset.js("js/localcovers.js") | $raw %]
-    <script type="text/javascript">
-        //<![CDATA[
-            var NO_LOCAL_JACKET = _("No cover image available");
-        //]]>
+    <script>
+        var NO_LOCAL_JACKET = _("No cover image available");
     </script>
 [% END %]
 
 [% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %]
-    <script type="text/javascript">
-        //<![CDATA[
-            var AUDIO_ALERT_PATH = '[% interface | html %]/[% theme | html %]/sound/';
-            var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
-        //]]>
+    <script>
+        var AUDIO_ALERT_PATH = '[% interface | html %]/[% theme | html %]/sound/';
+        var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
 
         $( document ).ready(function() {
             if ( AUDIO_ALERTS ) {
@@ -90,7 +82,7 @@
 
 [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
     [% IF ( CircAutocompl ) %]
-        <script type="text/javascript">
+        <script>
             $(document).ready(function(){
                 var obj = $( "#findborrower" ).autocomplete({
                     source: "/cgi-bin/koha/circ/ysearch.pl",