Bug 22957: Remove type attribute from script tags: Staff client includes 1/2

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>
This commit is contained in:
Owen Leonard 2019-05-21 18:25:39 +00:00 committed by Martin Renvoize
parent 178a805a5d
commit 0658d84732
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
7 changed files with 23 additions and 31 deletions

View 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 ) %]

View 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>

View 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>

View 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.");

View 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 %]

View 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 = {

View 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 %]