Bugzilla – Attachment 174484 Details for
Bug 35716
Duplicated assets in both koha-tmpl/intra-tmpl and koha-tmpl/opac-tmpl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35716: (alternate) Javascript proof of concept
Bug-35716-alternate-Javascript-proof-of-concept.patch (text/plain), 3.05 KB, created by
David Cook
on 2024-11-14 02:07:06 UTC
(
hide
)
Description:
Bug 35716: (alternate) Javascript proof of concept
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-11-14 02:07:06 UTC
Size:
3.05 KB
patch
obsolete
>From 8f2122943e3315ac7ab01ce3a2dad5047b454a87 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 14 Nov 2024 02:05:34 +0000 >Subject: [PATCH] Bug 35716: (alternate) Javascript proof of concept > >--- > Koha/Template/Plugin/Asset.pm | 15 +++++++++++---- > .../prog/en/includes/intranet-bottom.inc | 1 + > .../bootstrap/en/includes/opac-bottom.inc | 1 + > public/shared/js/debug.js | 3 +++ > 4 files changed, 16 insertions(+), 4 deletions(-) > create mode 100644 public/shared/js/debug.js > >diff --git a/Koha/Template/Plugin/Asset.pm b/Koha/Template/Plugin/Asset.pm >index 0afe209805..b1a6cced7f 100644 >--- a/Koha/Template/Plugin/Asset.pm >+++ b/Koha/Template/Plugin/Asset.pm >@@ -124,7 +124,7 @@ Returns the URL for the given file > =cut > > sub url { >- my ( $self, $filename ) = @_; >+ my ( $self, $filename, $args ) = @_; > > my $stash = $self->{_CONTEXT}->stash(); > my $interface = $stash->get('interface'); >@@ -136,13 +136,20 @@ sub url { > my ($basename, $dirname, $suffix) = fileparse($filename, qr/\.[^.]*/); > > my $type = substr $suffix, 1; >+ >+ my $version = Koha::version; >+ $version =~ s/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/$1.$2$3$4/; >+ >+ my $shared = $args->{shared}; >+ if ($shared){ >+ my $url = File::Spec->catfile('/shared',$dirname, "${basename}_${version}${suffix}"); >+ return $url; >+ } >+ > my @dirs = ( > "$theme", > ".", > ); >- >- my $version = Koha::version; >- $version =~ s/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/$1.$2$3$4/; > foreach my $dir (@dirs) { > my $abspath = File::Spec->catfile($root, $dir, $filename); > if (-e $abspath) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >index cb6b50ae30..fd9e436c38 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >@@ -169,6 +169,7 @@ > [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %] > [% END %] > [% KohaPlugins.get_plugins_intranet_js | $raw %] >+<script src="[% Asset.url("js/debug.js",{ shared => 1 }) | $raw %]"></script> > > </body> > </html> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 50d78ea97b..859e79abd2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -203,5 +203,6 @@ $(document).ready(function() { > [% Asset.js("js/cookieconsent.js") | $raw %] > [% END %] > [% KohaPlugins.get_plugins_opac_js | $raw %] >+<script src="[% Asset.url("js/debug.js",{ shared => 1 }) | $raw %]"></script> > </body> > </html> >diff --git a/public/shared/js/debug.js b/public/shared/js/debug.js >new file mode 100644 >index 0000000000..453e3f70c3 >--- /dev/null >+++ b/public/shared/js/debug.js >@@ -0,0 +1,3 @@ >+function debug_shared_js (){ >+ console.log("You successfully ran this function!"); >+} >-- >2.39.5
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 35716
:
164381
|
174481
|
174482
|
174483
| 174484