Bug 22957: Remove type attribute from script tags: Staff client includes 1/2
authorOwen Leonard <oleonard@myacpl.org>
Tue, 21 May 2019 18:25:39 +0000 (18:25 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 15 Jul 2019 10:27:58 +0000 (11:27 +0100)
This patch removes the "type" attribute from <script> tags in several
staff client include files. Also removed: Obsolete "//<![CDATA[ //]]>"
markers.

This patch also makes minor indentation changes, so diff using the "-w"
flag.

To test, apply the patch and confirm that examples of affected pages
work properly without any JavaScript errors in the browser console:

 - Acquisitions -> Vendor (uses acuisitions-toolbar.inc)
 - Acquisitions -> Vendor -> Add to basket -> From a new (empty) record
   (uses additem.js.inc)
 - Catalog -> Search results -> Bibliographic detail view. (uses
   browser-strings.inc, catalog-strings.inc, datatables.inc, and
   format_price.inc )
 - Tools -> Label creator -> Manage -> Label batches -> Export batch
   (uses greybox.inc)

Validating the HTML source of any of these pages should return no errors
related to the "type" attribute.

Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/additem.js.inc
koha-tmpl/intranet-tmpl/prog/en/includes/browser-strings.inc
koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc
koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc
koha-tmpl/intranet-tmpl/prog/en/includes/format_price.inc
koha-tmpl/intranet-tmpl/prog/en/includes/greybox.inc

index 401c16d..9e4f802 100644 (file)
@@ -1,12 +1,10 @@
 [% INCLUDE 'blocking_errors.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-function confirm_deletion() {
-    if (confirm(_("Are you sure you want to delete this vendor?"))) {
-        window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
+<script>
+    function confirm_deletion() {
+        if (confirm(_("Are you sure you want to delete this vendor?"))) {
+            window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
+        }
     }
-}
-//]]>
 </script>
 <div id="toolbar" class="btn-toolbar">
     [% IF ( booksellerid ) %]
index d7cd4d7..0ad90cf 100644 (file)
@@ -1,16 +1,14 @@
-<script type="text/javascript">
-//<![CDATA[
-var MSG_ADDITEM_JS_ADDITEM = _("Add item");
-var MSG_ADDITEM_JS_ADDMULTI = _("Add multiple items");
-var MSG_ADDITEM_JS_MULTIVAL = _("Number of items to add");
-var MSG_ADDITEM_JS_MULTI_UNIQUE_NOTE = _("NOTE: Fields listed in the \'UniqueItemsFields\' system preference will not be copied");
-var MSG_ADDITEM_JS_SUBMITMULTI = _("Add");
-var MSG_ADDITEM_JS_UPDATEITEM = _("Update item");
-var MSG_ADDITEM_JS_EDIT = _("Edit");
-var MSG_ADDITEM_JS_DELETE = _("Delete");
-var MSG_ADDITEM_JS_CLEAR = _("Clear");
-var MSG_ADDITEM_JS_CANT_RECEIVE_MORE_ITEMS = _("You can't receive any more items");
-var MSG_ADDITEM_JS_IS_DUPLICATE = _("is duplicated");
-var MSG_ADDITEM_JS_ALREADY_EXISTS_IN_DB = _("already exists in database");
-//]]>
+<script>
+    var MSG_ADDITEM_JS_ADDITEM = _("Add item");
+    var MSG_ADDITEM_JS_ADDMULTI = _("Add multiple items");
+    var MSG_ADDITEM_JS_MULTIVAL = _("Number of items to add");
+    var MSG_ADDITEM_JS_MULTI_UNIQUE_NOTE = _("NOTE: Fields listed in the \'UniqueItemsFields\' system preference will not be copied");
+    var MSG_ADDITEM_JS_SUBMITMULTI = _("Add");
+    var MSG_ADDITEM_JS_UPDATEITEM = _("Update item");
+    var MSG_ADDITEM_JS_EDIT = _("Edit");
+    var MSG_ADDITEM_JS_DELETE = _("Delete");
+    var MSG_ADDITEM_JS_CLEAR = _("Clear");
+    var MSG_ADDITEM_JS_CANT_RECEIVE_MORE_ITEMS = _("You can't receive any more items");
+    var MSG_ADDITEM_JS_IS_DUPLICATE = _("is duplicated");
+    var MSG_ADDITEM_JS_ALREADY_EXISTS_IN_DB = _("already exists in database");
 </script>
index 3dda230..68c544c 100644 (file)
@@ -1,7 +1,5 @@
-<script type="text/javascript">
-//<![CDATA[
+<script>
     var BROWSER_RETURN_TO_SEARCH = _("Return to results");
     var BROWSER_PREVIOUS = _("Previous");
     var BROWSER_NEXT = _("Next");
-//]]>
 </script>
index 549f26b..5c6e0ca 100644 (file)
@@ -1,4 +1,4 @@
-<script type="text/javascript">
+<script>
     /* Strings for translation */
     var MSG_REPLACE_RECORD = _("Please note that this external search could replace the current record.");
     var MSG_DELETE_ALL_ITEMS = _("%s item(s) are attached to this record. You must delete all items before deleting this record.");
index eda776e..5138e7d 100644 (file)
@@ -7,8 +7,7 @@
 [% Asset.js("lib/jquery/plugins/jszip.min.js") | $raw %]
 [% Asset.js("lib/jquery/plugins/buttons.print.min.js") | $raw %]
 [% Asset.js("lib/jquery/plugins/buttons.html5.min.js") | $raw %]
-<script type="text/javascript">
-//<![CDATA[
+<script>
     var MSG_DT_FIRST = _("First");
     var MSG_DT_LAST = _("Last");
     var MSG_DT_NEXT = _("Next");
@@ -28,6 +27,5 @@
     var MSG_DT_COPY_KEYS = _("Press ctrl or ⌘ + C to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.");
     var MSG_DT_COPY_SUCCESS_ONE = _("Copied one row to clipboard");
     var MSG_DT_COPY_SUCCESS_X = _("Copied %d rows to clipboard");
-//]]>
 </script>
 [% Asset.js("js/datatables.js") | $raw %]
index 2bc052b..cf71171 100644 (file)
@@ -1,5 +1,5 @@
 [% USE Koha %]
-<script type="text/javascript">
+<script>
     [%# This should use the Format template plugin, but not pushed yet %]
     [% IF Koha.Preference("CurrencyFormat") == 'FR' %]
         var default_value = {
index 5a497e2..0fc2e18 100644 (file)
@@ -1,6 +1,6 @@
 [% USE raw %]
 [% USE Asset %]
-<script type="text/javascript">
+<script>
     var GB_ROOT_DIR = "[% interface | html %]/lib/greybox/";
 </script>
 [% Asset.js("lib/greybox/AJS.js") | $raw %]