Bugzilla – Attachment 104239 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.20 KB, created by
Owen Leonard
on 2020-05-03 22:17:03 UTC
(
hide
)
Description:
Bug 25354: Clean up JavaScript markup in cataloging plugin scripts
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-05-03 22:17:03 UTC
Size:
32.20 KB
patch
obsolete
>From 32251409c638d0d9e12834a9f2998efea2e2e4a0 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. >--- > 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 d363e3f668..dde1988334 100644 >--- 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 5cbdd25905..1dce791395 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 aeca228a20..e3d7cd1e54 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 bd036045aa..5f5159f86f 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 bed0c88f66..e3ec7b9c40 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 aeb5df1949..73e3cd13e8 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 a64f407e59..e59aca3581 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 4acbb6946f..27a13dcacf 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 fe109a2498..3e3d756b43 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 f066c7ec21..c4e50d8bf1 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 755300a827..45537786b0 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 1b7aa7e1cd..d79933d234 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> > "; > >@@ -92,4 +90,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 ccadc9cac6..2800a04ad6 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 2931b4204e..ccc7ff892d 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 a156cd268e..50fdb81180 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 29a1a7aef2..a3381aaff6 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 afed9e96ee..06c6abe570 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 5c68b184cd..64c45cc839 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 efb6772de0..468b2e5472 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 ac5d506112..f8f252d8e5 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 0afc26f2cc..d83c683ce8 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 547b4087bd..8d8a1b57d9 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 46b0fd55e7..8d862fdb0c 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 582b42395b..c3f151790f 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 f6602a0e1b..1db1b43751 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 e272ffd359..d6f8ed752b 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 0e0dca7dcd..fd85ec8a18 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 8bfa488d1b..1f8dbd256f 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 259a903817..8a1b642a90 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 e26bca7f99..ac45fb4123 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) { > var index = event.data.id; > var str = document.getElementById(index).value; >-- >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