Bugzilla – Attachment 111047 Details for
Bug 25354
Clean up JavaScript markup in cataloging plugin scripts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts
Bug-25354-Clean-up-JavaScript-markup-in-cataloging.patch (text/plain), 32.22 KB, created by
David Nind
on 2020-10-01 13:58:51 UTC
(
hide
)
Description:
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-10-01 13:58:51 UTC
Size:
32.22 KB
patch
obsolete
>From 1a1b2c0ce019815068bdc873c721049b07a3fdfc Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Sun, 3 May 2020 01:04:41 +0000 >Subject: [PATCH] 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> >--- > cataloguing/value_builder/EXAMPLE.pl | 13 ++++++++----- > cataloguing/value_builder/barcode.pl | 6 ++---- > cataloguing/value_builder/barcode_manual.pl | 6 ++---- > cataloguing/value_builder/callnumber-KU.pl | 2 +- > cataloguing/value_builder/callnumber.pl | 2 +- > cataloguing/value_builder/cn_browser.pl | 4 +--- > cataloguing/value_builder/dateaccessioned.pl | 4 ++-- > cataloguing/value_builder/macles.pl | 4 +--- > cataloguing/value_builder/marc21_field_005.pl | 6 ++---- > cataloguing/value_builder/marc21_field_006.pl | 4 +--- > cataloguing/value_builder/marc21_field_007.pl | 4 +--- > cataloguing/value_builder/marc21_field_008.pl | 4 +--- > cataloguing/value_builder/marc21_field_008_authorities.pl | 4 +--- > .../value_builder/marc21_field_008_classifications.pl | 4 +--- > cataloguing/value_builder/marc21_field_245h.pl | 6 ++---- > cataloguing/value_builder/marc21_leader.pl | 4 +--- > cataloguing/value_builder/marc21_leader_authorities.pl | 6 ++---- > cataloguing/value_builder/marc21_linking_section.pl | 2 +- > cataloguing/value_builder/marc21_orgcode.pl | 4 +--- > cataloguing/value_builder/normarc_field_007.pl | 4 +--- > cataloguing/value_builder/normarc_field_008.pl | 4 +--- > cataloguing/value_builder/normarc_leader.pl | 4 +--- > cataloguing/value_builder/stocknumber.pl | 4 +--- > cataloguing/value_builder/stocknumberam123.pl | 2 +- > cataloguing/value_builder/unimarc_field_010.pl | 2 +- > cataloguing/value_builder/unimarc_field_100.pl | 2 +- > cataloguing/value_builder/unimarc_field_100_authorities.pl | 2 +- > cataloguing/value_builder/unimarc_field_105.pl | 2 +- > cataloguing/value_builder/unimarc_field_110.pl | 2 +- > cataloguing/value_builder/unimarc_field_115a.pl | 2 +- > cataloguing/value_builder/unimarc_field_115b.pl | 2 +- > cataloguing/value_builder/unimarc_field_210c.pl | 2 +- > cataloguing/value_builder/unimarc_field_210c_bis.pl | 2 +- > cataloguing/value_builder/unimarc_field_225a.pl | 4 ++-- > cataloguing/value_builder/unimarc_field_225a_bis.pl | 2 +- > cataloguing/value_builder/unimarc_field_4XX.pl | 2 +- > cataloguing/value_builder/upload.pl | 2 +- > 37 files changed, 51 insertions(+), 84 deletions(-) > >diff --git a/cataloguing/value_builder/EXAMPLE.pl b/cataloguing/value_builder/EXAMPLE.pl >index 9b16b05eaf..2e13d6ad86 100755 >--- a/cataloguing/value_builder/EXAMPLE.pl >+++ b/cataloguing/value_builder/EXAMPLE.pl >@@ -50,6 +50,9 @@ use C4::Output; > # into the event data parameter; Focus e.g. uses that one again by looking at > # the variable event.data.id. > # >+# Comments in JavaScript must be multi-line style ( /* ... */ ) in case >+# the JavaScript block is collapsed by the template >+# > # Do not use the perl variable $id to extract the field value. Use variable > # event.data.id. This makes a difference when the field is cloned or has > # been created dynamically (as in additem.js). >@@ -59,7 +62,7 @@ my $builder= sub { > my $id = $params->{id}; > > return qq| >-<script type="text/javascript"> >+<script> > function Focus$id(event) { > if( \$('#'+event.data.id).val()=='' ) { > \$('#'+event.data.id).val('EXAMPLE:'); >@@ -68,14 +71,14 @@ function Focus$id(event) { > > function MouseOver$id(event) { > return Focus$id(event); >- // just redirecting it to Focus for the same effect >+ /* just redirecting it to Focus for the same effect */ > } > > function KeyPress$id(event) { >- if( event.which == 64 ) { // at character >+ if( event.which == 64 ) { /* at character */ > var f= \$('#'+event.data.id).val(); > \$('#'+event.data.id).val( f + 'AT' ); >- return false; // prevents getting the @ character back too >+ return false; /* prevents getting the @ character back too */ > } > } > >@@ -92,7 +95,7 @@ function Change$id(event) { > function Click$id(event) { > var fieldvalue=\$('#'+event.data.id).val(); > window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=EXAMPLE.pl&index=\"+event.data.id+\"&result=\"+fieldvalue,\"tag_editor\",'width=700,height=700,toolbar=false,scrollbars=yes'); >- return false; // prevents scrolling >+ return false; /* prevents scrolling */ > } > </script>|; > }; >diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl >index 4c7072631c..bf5b0739dd 100755 >--- a/cataloguing/value_builder/barcode.pl >+++ b/cataloguing/value_builder/barcode.pl >@@ -47,7 +47,7 @@ my $builder = sub { > warn "Barcode type = $autoBarcodeType" if $DEBUG; > if ((not $autoBarcodeType) or $autoBarcodeType eq 'OFF') { > # don't return a value unless we have the appropriate syspref set >- return q|<script type=\"text/javascript\"></script>|; >+ return q|<script></script>|; > } > if ($autoBarcodeType eq 'annual') { > ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args); >@@ -89,8 +89,7 @@ if (\$('#' + id).val() == '' || force) { > END_OF_JS > > my $js = <<END_OF_JS; >-<script type="text/javascript"> >-//<![CDATA[ >+<script> > > function Focus$function_name(id, force) { > $scr >@@ -100,7 +99,6 @@ function Click$function_name(id) { > Focus$function_name(id, 1); > return false; > } >-//]]> > </script> > END_OF_JS > return $js; >diff --git a/cataloguing/value_builder/barcode_manual.pl b/cataloguing/value_builder/barcode_manual.pl >index 1167c7fbc8..91c5f186a8 100755 >--- a/cataloguing/value_builder/barcode_manual.pl >+++ b/cataloguing/value_builder/barcode_manual.pl >@@ -48,7 +48,7 @@ my $builder = sub { > warn "Barcode type = $autoBarcodeType" if $DEBUG; > if ((not $autoBarcodeType) or $autoBarcodeType eq 'OFF') { > # don't return a value unless we have the appropriate syspref set >- return q|<script type=\"text/javascript\"></script>|; >+ return q|<script></script>|; > } > if ($autoBarcodeType eq 'annual') { > ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args); >@@ -68,14 +68,12 @@ my $builder = sub { > END_OF_JS > > my $js = <<END_OF_JS; >- <script type="text/javascript"> >- //<![CDATA[ >+ <script> > > function Click$function_name(id) { > $scr > return false; > } >- //]]> > </script> > END_OF_JS > return $js; >diff --git a/cataloguing/value_builder/callnumber-KU.pl b/cataloguing/value_builder/callnumber-KU.pl >index 7316afc617..d7a9278203 100755 >--- a/cataloguing/value_builder/callnumber-KU.pl >+++ b/cataloguing/value_builder/callnumber-KU.pl >@@ -45,7 +45,7 @@ CCC QW - returns first unused number CCC QWxx starting with CCC QW01 > my $builder = sub { > my ( $params ) = @_; > my $res=" >- <script type='text/javascript'> >+ <script> > function Click$params->{id}() { > var code = document.getElementById('$params->{id}'); > var url = '../cataloguing/plugin_launcher.pl?plugin_name=callnumber-KU.pl&code=' + code.value; >diff --git a/cataloguing/value_builder/callnumber.pl b/cataloguing/value_builder/callnumber.pl >index 05ef8f54ee..dd274129b9 100755 >--- a/cataloguing/value_builder/callnumber.pl >+++ b/cataloguing/value_builder/callnumber.pl >@@ -42,7 +42,7 @@ In this case, a callnumber has this form : "PREFIX 0009678570". > my $builder = sub { > my ( $params ) = @_; > my $res=" >- <script type='text/javascript'> >+ <script> > function Blur$params->{id}() { > var code = document.getElementById('$params->{id}'); > var url = '../cataloguing/plugin_launcher.pl?plugin_name=callnumber.pl&code=' + code.value; >diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl >index 6e5f7b8c11..c521b23c96 100755 >--- a/cataloguing/value_builder/cn_browser.pl >+++ b/cataloguing/value_builder/cn_browser.pl >@@ -32,15 +32,13 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Click$function_name(i) { > q = document.getElementById('$params->{id}'); > window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q=\"+q.value,\"cnbrowser\",\"width=500,height=400,toolbar=false,scrollbars=yes\"); > } > >-//]]> > </script> > "; > return $res; >diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl >index ab18ee9ec5..9479fb3f9c 100755 >--- a/cataloguing/value_builder/dateaccessioned.pl >+++ b/cataloguing/value_builder/dateaccessioned.pl >@@ -31,7 +31,7 @@ my $builder = sub { > > my $res = <<END_OF_JS; > <script> >-// from: cataloguing/value_builder/dateaccessioned.pl >+/* from: cataloguing/value_builder/dateaccessioned.pl */ > > \$(document).ready(function(){ > \$("#$function_name").datepicker({ >@@ -51,7 +51,7 @@ function Click$function_name(event) { > } > > function set_to_today( id, force ) { >- // The force parameter is used in Click but not in Focus ! >+ /* The force parameter is used in Click but not in Focus ! */ > if (! id) { alert(_("Bad id ") + id + _(" sent to set_to_today()")); return 0; } > if (\$("#" + id).val() == '' || \$("#" + id).val() == '0000-00-00' || force ) { > \$("#" + id).val("$date"); >diff --git a/cataloguing/value_builder/macles.pl b/cataloguing/value_builder/macles.pl >index d50edfb2d4..071a29e805 100755 >--- a/cataloguing/value_builder/macles.pl >+++ b/cataloguing/value_builder/macles.pl >@@ -30,12 +30,10 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res=" >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > function Click$function_name(i) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=macles.pl&index=\"+i,\"MACLES\",',toolbar=false,scrollbars=yes'); > } >-//]]> > </script> > "; > return $res; >diff --git a/cataloguing/value_builder/marc21_field_005.pl b/cataloguing/value_builder/marc21_field_005.pl >index 4bf4c21755..6b5263163a 100755 >--- a/cataloguing/value_builder/marc21_field_005.pl >+++ b/cataloguing/value_builder/marc21_field_005.pl >@@ -30,18 +30,16 @@ my $builder = sub { > my $date = sprintf("%4d%02d%02d%02d%02d%04.1f",@a); > > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(event) { > document.getElementById(event.data.id).value='$date'; > return 0; > } > >-//]]> > </script> > "; > return $res; > }; > >-return { builder => $builder }; >\ No newline at end of file >+return { builder => $builder }; >diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl >index b8740b13c9..65c8c8032f 100755 >--- a/cataloguing/value_builder/marc21_field_006.pl >+++ b/cataloguing/value_builder/marc21_field_006.pl >@@ -33,15 +33,13 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Click$function_name(event) { > defaultvalue=document.getElementById(event.data.id).value; > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_006.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/marc21_field_007.pl b/cataloguing/value_builder/marc21_field_007.pl >index 4aab5a8b15..f06dd8b260 100755 >--- a/cataloguing/value_builder/marc21_field_007.pl >+++ b/cataloguing/value_builder/marc21_field_007.pl >@@ -32,15 +32,13 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Click$function_name(event) { > defaultvalue=document.getElementById(event.data.id).value; > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_007.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl >index b046042b38..b3c5d0c47f 100755 >--- a/cataloguing/value_builder/marc21_field_008.pl >+++ b/cataloguing/value_builder/marc21_field_008.pl >@@ -42,8 +42,7 @@ my $builder = sub { > my $function_name = $params->{id}; > my $dateentered = date_entered(); > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(event) { > if ( document.getElementById(event.data.id).value ) { >@@ -66,7 +65,6 @@ function Click$function_name(event) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008.pl&index=\"+ event.data.id +\"&result=\"+encodeURIComponent(defaultvalue)+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/marc21_field_008_authorities.pl b/cataloguing/value_builder/marc21_field_008_authorities.pl >index 1eb45d0070..1047faca47 100755 >--- a/cataloguing/value_builder/marc21_field_008_authorities.pl >+++ b/cataloguing/value_builder/marc21_field_008_authorities.pl >@@ -37,8 +37,7 @@ my $builder = sub { > my $dateentered = date_entered(); > my $defaultval = substr( C4::Context->preference(PREF_008) || FIXLEN_DATA_ELTS, 0, 34 ); > my $res=" >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(event) { > if (!document.getElementById(event.data.id).value) { >@@ -58,7 +57,6 @@ function Click$function_name(event) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/marc21_field_008_classifications.pl b/cataloguing/value_builder/marc21_field_008_classifications.pl >index 8d6ccd05c6..d864f87459 100755 >--- a/cataloguing/value_builder/marc21_field_008_classifications.pl >+++ b/cataloguing/value_builder/marc21_field_008_classifications.pl >@@ -32,8 +32,7 @@ my $builder = sub { > my $dateentered = date_entered(); > my $defaultval = FIXLEN_DATA_ELTS; > my $res=" >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(event) { > if (!document.getElementById(event.data.id).value) { >@@ -50,7 +49,6 @@ function Click$function_name(event) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_classifications.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > } > >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/marc21_field_245h.pl b/cataloguing/value_builder/marc21_field_245h.pl >index 0680410d88..667ae2249a 100755 >--- a/cataloguing/value_builder/marc21_field_245h.pl >+++ b/cataloguing/value_builder/marc21_field_245h.pl >@@ -27,8 +27,7 @@ my $builder = sub { > my $function_name = $params->{id}; > > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Blur$function_name(event) { > var fieldValue = document.getElementById(event.data.id).value; >@@ -41,10 +40,9 @@ function Blur$function_name(event) { > return 0; > } > >-//]]> > </script> > "; > return $res; > }; > >-return { builder => $builder }; >\ No newline at end of file >+return { builder => $builder }; >diff --git a/cataloguing/value_builder/marc21_leader.pl b/cataloguing/value_builder/marc21_leader.pl >index 452f45176a..4a176e0d11 100755 >--- a/cataloguing/value_builder/marc21_leader.pl >+++ b/cataloguing/value_builder/marc21_leader.pl >@@ -30,8 +30,7 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(event) { > if(!document.getElementById(event.data.id).value){ >@@ -44,7 +43,6 @@ function Click$function_name(event) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > } > >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/marc21_leader_authorities.pl b/cataloguing/value_builder/marc21_leader_authorities.pl >index 86e6b8e195..03d76eed21 100755 >--- a/cataloguing/value_builder/marc21_leader_authorities.pl >+++ b/cataloguing/value_builder/marc21_leader_authorities.pl >@@ -32,8 +32,7 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(event) { > if(!document.getElementById(event.data.id).value){ >@@ -47,7 +46,6 @@ function Click$function_name(event) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_authorities.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >@@ -91,4 +89,4 @@ my $launcher = sub { > output_html_with_http_headers $input, $cookie, $template->output; > }; > >-return { builder => $builder, launcher => $launcher }; >\ No newline at end of file >+return { builder => $builder, launcher => $launcher }; >diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl >index 18a24e3e95..905dd102ab 100755 >--- a/cataloguing/value_builder/marc21_linking_section.pl >+++ b/cataloguing/value_builder/marc21_linking_section.pl >@@ -41,7 +41,7 @@ my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > my $res = " >- <script type='text/javascript'> >+ <script> > function Click$function_name(event) { > defaultvalue=document.getElementById(event.data.id).value; > window.open(\"/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=\" + event.data.id + \"&result=\"+defaultvalue, 'tag_editor', 'width=900,height=700,toolbar=false,scrollbars=yes'); >diff --git a/cataloguing/value_builder/marc21_orgcode.pl b/cataloguing/value_builder/marc21_orgcode.pl >index 6724fc8905..aa9142cfc7 100755 >--- a/cataloguing/value_builder/marc21_orgcode.pl >+++ b/cataloguing/value_builder/marc21_orgcode.pl >@@ -30,8 +30,7 @@ my $builder = sub { > my $library = Koha::Libraries->find( C4::Context->userenv->{'branch'} ); > my $org = $library->get_effective_marcorgcode; > return <<"HERE"; >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$params->{id}(event) { > if( ! \$('#'+event.data.id).val() ) { >@@ -39,7 +38,6 @@ function Focus$params->{id}(event) { > } > } > >-//]]> > </script> > HERE > }; >diff --git a/cataloguing/value_builder/normarc_field_007.pl b/cataloguing/value_builder/normarc_field_007.pl >index 87f2329aef..89051a2356 100755 >--- a/cataloguing/value_builder/normarc_field_007.pl >+++ b/cataloguing/value_builder/normarc_field_007.pl >@@ -29,15 +29,13 @@ sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; > my $function_name= $field_number; > my $res=" >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Clic$function_name(i) { > defaultvalue=document.getElementById(\"$field_number\").value; > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=normarc_field_007.pl&index=$field_number&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/normarc_field_008.pl b/cataloguing/value_builder/normarc_field_008.pl >index 1a5893f35d..0f0bfb9a1a 100755 >--- a/cataloguing/value_builder/normarc_field_008.pl >+++ b/cataloguing/value_builder/normarc_field_008.pl >@@ -39,8 +39,7 @@ sub plugin_javascript { > my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; > my $function_name = $field_number; > my $res = " >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(subfield_managed) { > >@@ -58,7 +57,6 @@ function Clic$function_name(i) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=normarc_field_008.pl&index=$field_number&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/normarc_leader.pl b/cataloguing/value_builder/normarc_leader.pl >index debc3aa0bf..7a07aac284 100755 >--- a/cataloguing/value_builder/normarc_leader.pl >+++ b/cataloguing/value_builder/normarc_leader.pl >@@ -31,8 +31,7 @@ sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; > my $function_name= $field_number; > my $res=" >-<script type=\"text/javascript\"> >-//<![CDATA[ >+<script> > > function Focus$function_name(subfield_managed) { > if(!document.getElementById(\"$field_number\").value){ >@@ -46,7 +45,6 @@ function Clic$function_name(i) { > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=normarc_leader.pl&index=$field_number&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes'); > > } >-//]]> > </script> > "; > >diff --git a/cataloguing/value_builder/stocknumber.pl b/cataloguing/value_builder/stocknumber.pl >index 11e237c921..03dc79de06 100755 >--- a/cataloguing/value_builder/stocknumber.pl >+++ b/cataloguing/value_builder/stocknumber.pl >@@ -37,8 +37,7 @@ my $builder = sub { > $nextnum = $branchcode.'_'.$nextnum; > > my $js = <<END_OF_JS; >-<script type="text/javascript"> >-//<![CDATA[ >+<script> > > function Focus$function_name(id, force) { > if (\$('#' + id).val() == '' || force) { >@@ -50,7 +49,6 @@ function Click$function_name(event) { > Focus$function_name(event.data.id, 1); > return false; > } >-//]]> > </script> > END_OF_JS > return $js; >diff --git a/cataloguing/value_builder/stocknumberam123.pl b/cataloguing/value_builder/stocknumberam123.pl >index 13872ba5f4..a69506eaf1 100755 >--- a/cataloguing/value_builder/stocknumberam123.pl >+++ b/cataloguing/value_builder/stocknumberam123.pl >@@ -43,7 +43,7 @@ In this case, a stocknumber has this form : "PREFIX 0009678570". > my $builder = sub { > my ( $params ) = @_; > my $res=" >- <script type='text/javascript'> >+ <script> > function Blur$params->{id}() { > var code = document.getElementById('$params->{id}'); > var url = '../cataloguing/plugin_launcher.pl?plugin_name=stocknumberam123.pl&code=' + code.value; >diff --git a/cataloguing/value_builder/unimarc_field_010.pl b/cataloguing/value_builder/unimarc_field_010.pl >index 439af9bd2a..4994dc3418 100755 >--- a/cataloguing/value_builder/unimarc_field_010.pl >+++ b/cataloguing/value_builder/unimarc_field_010.pl >@@ -28,7 +28,7 @@ use C4::Output; > sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; > my $res=" >- <script type='text/javascript'> >+ <script> > function Blur$field_number() { > var isbn = document.getElementById('$field_number'); > var url = '../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_010.pl&isbn=' + isbn.value; >diff --git a/cataloguing/value_builder/unimarc_field_100.pl b/cataloguing/value_builder/unimarc_field_100.pl >index ea52b36971..1fe873924a 100755 >--- a/cataloguing/value_builder/unimarc_field_100.pl >+++ b/cataloguing/value_builder/unimarc_field_100.pl >@@ -32,7 +32,7 @@ use C4::Output; > sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $res = " >- <script type='text/javascript'> >+ <script> > function Clic$field_number(i) { > var defaultvalue; > try { >diff --git a/cataloguing/value_builder/unimarc_field_100_authorities.pl b/cataloguing/value_builder/unimarc_field_100_authorities.pl >index 0f48c14a6e..13563548aa 100755 >--- a/cataloguing/value_builder/unimarc_field_100_authorities.pl >+++ b/cataloguing/value_builder/unimarc_field_100_authorities.pl >@@ -29,7 +29,7 @@ use C4::Output; > sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $res = " >- <script type='text/javascript'> >+ <script> > function Clic$field_number(i) { > var defaultvalue; > try { >diff --git a/cataloguing/value_builder/unimarc_field_105.pl b/cataloguing/value_builder/unimarc_field_105.pl >index 9dca3d4b71..75b26d26a2 100755 >--- a/cataloguing/value_builder/unimarc_field_105.pl >+++ b/cataloguing/value_builder/unimarc_field_105.pl >@@ -32,7 +32,7 @@ use C4::Output; > sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; > my $res=" >- <script type='text/javascript'> >+ <script> > function Clic$field_number() { > defaultvalue=document.getElementById(\"$field_number\").value; > window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_105.pl&index=$field_number&result=\"+defaultvalue,\"unimarc_field_105\",'width=1200,height=400,toolbar=false,scrollbars=yes'); >diff --git a/cataloguing/value_builder/unimarc_field_110.pl b/cataloguing/value_builder/unimarc_field_110.pl >index ddde049ff6..68fad1379f 100755 >--- a/cataloguing/value_builder/unimarc_field_110.pl >+++ b/cataloguing/value_builder/unimarc_field_110.pl >@@ -32,7 +32,7 @@ use C4::Output; > sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; > my $res=" >- <script type='text/javascript'> >+ <script> > function Clic$field_number() { > defaultvalue=document.getElementById(\"$field_number\").value; > window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_110.pl&index=$field_number&result=\"+defaultvalue,\"unimarc_field_110\",'width=700,height=600,toolbar=false,scrollbars=yes'); >diff --git a/cataloguing/value_builder/unimarc_field_115a.pl b/cataloguing/value_builder/unimarc_field_115a.pl >index 17ad4d32a5..746597f1f2 100755 >--- a/cataloguing/value_builder/unimarc_field_115a.pl >+++ b/cataloguing/value_builder/unimarc_field_115a.pl >@@ -31,7 +31,7 @@ use C4::Output; > sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $res = " >- <script type=\"text/javascript\"> >+ <script> > function Clic$field_number(i) { > var defaultvalue; > try { >diff --git a/cataloguing/value_builder/unimarc_field_115b.pl b/cataloguing/value_builder/unimarc_field_115b.pl >index 685448decd..e4d3379e4d 100755 >--- a/cataloguing/value_builder/unimarc_field_115b.pl >+++ b/cataloguing/value_builder/unimarc_field_115b.pl >@@ -31,7 +31,7 @@ use C4::Output; > sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $res = " >-<script type=\"text/javascript\"> >+<script> > function Clic$field_number() { > defaultvalue=document.getElementById(\"$field_number\").value; > window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_115b.pl&index=$field_number&result=\"+defaultvalue,\"unimarc_field_115b\",'width=1200,height=600,toolbar=false,scrollbars=yes'); >diff --git a/cataloguing/value_builder/unimarc_field_210c.pl b/cataloguing/value_builder/unimarc_field_210c.pl >index b512a595ce..6298f0c922 100755 >--- a/cataloguing/value_builder/unimarc_field_210c.pl >+++ b/cataloguing/value_builder/unimarc_field_210c.pl >@@ -42,7 +42,7 @@ my $function_name= $field_number; > > > my $res = " >-<script type=\"text/javascript\"> >+<script> > function Clic$function_name(subfield_managed) { > defaultvalue=escape(document.getElementById(\"$field_number\").value); > newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&index=\"+subfield_managed,\"unimarc_225a\",'width=500,height=600,toolbar=false,scrollbars=yes'); >diff --git a/cataloguing/value_builder/unimarc_field_210c_bis.pl b/cataloguing/value_builder/unimarc_field_210c_bis.pl >index 0c42e4dd11..89ab95b93a 100755 >--- a/cataloguing/value_builder/unimarc_field_210c_bis.pl >+++ b/cataloguing/value_builder/unimarc_field_210c_bis.pl >@@ -51,7 +51,7 @@ sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $function_name = $field_number; > my $res = " >- <script type=\"text/javascript\"> >+ <script> > > > function Clic$function_name(index) { >diff --git a/cataloguing/value_builder/unimarc_field_225a.pl b/cataloguing/value_builder/unimarc_field_225a.pl >index b494f30e88..a8b39930d4 100755 >--- a/cataloguing/value_builder/unimarc_field_225a.pl >+++ b/cataloguing/value_builder/unimarc_field_225a.pl >@@ -58,11 +58,11 @@ sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $function_name = $field_number; > my $res = " >- <script type=\"text/javascript\"> >+ <script> > > > function Clic$function_name(index) { >- // find the 010a value and the 210c. it will be used in the popup to find possibles collections >+ /* find the 010a value and the 210c. it will be used in the popup to find possibles collections */ > var isbn_found = 0; > var editor_found = 0; > >diff --git a/cataloguing/value_builder/unimarc_field_225a_bis.pl b/cataloguing/value_builder/unimarc_field_225a_bis.pl >index b2a33bd4bd..98af5b50c3 100755 >--- a/cataloguing/value_builder/unimarc_field_225a_bis.pl >+++ b/cataloguing/value_builder/unimarc_field_225a_bis.pl >@@ -34,7 +34,7 @@ sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $function_name = $field_number; > my $res = " >- <script type=\"text/javascript\"> >+ <script> > function Clic$function_name(index) { > window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_225a_bis.pl&index=\"+index,\"unimarc225a\",'width=500,height=400,toolbar=false,scrollbars=no'); > } >diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl >index e15768780e..ed90394e27 100755 >--- a/cataloguing/value_builder/unimarc_field_4XX.pl >+++ b/cataloguing/value_builder/unimarc_field_4XX.pl >@@ -46,7 +46,7 @@ sub plugin_javascript { > my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; > my $function_name = $field_number; > my $res = " >- <script type='text/javascript'> >+ <script> > function Clic$function_name(i) { > defaultvalue=document.getElementById(\"$field_number\").value; > window.open(\"/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl&index=\" + i + \"&result=\"+defaultvalue,\"unimarc_field_4\"+i+\"\",'width=900,height=700,toolbar=false,scrollbars=yes'); >diff --git a/cataloguing/value_builder/upload.pl b/cataloguing/value_builder/upload.pl >index 85c6bc656e..82b9816f62 100755 >--- a/cataloguing/value_builder/upload.pl >+++ b/cataloguing/value_builder/upload.pl >@@ -33,7 +33,7 @@ use Modern::Perl; > my $builder = sub { > my ( $params ) = @_; > return <<"SCRIPT"; >-<script type=\"text/javascript\"> >+<script> > function Click$params->{id}(event) { > event.preventDefault(); > var index = event.data.id; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25354
:
104239
|
109857
|
111047
|
111537