View | Details | Raw Unified | Return to bug 35716
Collapse All | Expand All

(-)a/Koha/Template/Plugin/Asset.pm (-4 / +11 lines)
Lines 124-130 Returns the URL for the given file Link Here
124
=cut
124
=cut
125
125
126
sub url {
126
sub url {
127
    my ( $self, $filename ) = @_;
127
    my ( $self, $filename, $args ) = @_;
128
128
129
    my $stash = $self->{_CONTEXT}->stash();
129
    my $stash = $self->{_CONTEXT}->stash();
130
    my $interface = $stash->get('interface');
130
    my $interface = $stash->get('interface');
Lines 136-148 sub url { Link Here
136
    my ($basename, $dirname, $suffix) = fileparse($filename, qr/\.[^.]*/);
136
    my ($basename, $dirname, $suffix) = fileparse($filename, qr/\.[^.]*/);
137
137
138
    my $type = substr $suffix, 1;
138
    my $type = substr $suffix, 1;
139
140
    my $version = Koha::version;
141
    $version =~ s/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/$1.$2$3$4/;
142
143
    my $shared = $args->{shared};
144
    if ($shared){
145
        my $url = File::Spec->catfile('/shared',$dirname, "${basename}_${version}${suffix}");
146
        return $url;
147
    }
148
139
    my @dirs = (
149
    my @dirs = (
140
        "$theme",
150
        "$theme",
141
        ".",
151
        ".",
142
    );
152
    );
143
144
    my $version = Koha::version;
145
    $version =~ s/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/$1.$2$3$4/;
146
    foreach my $dir (@dirs) {
153
    foreach my $dir (@dirs) {
147
        my $abspath = File::Spec->catfile($root, $dir, $filename);
154
        my $abspath = File::Spec->catfile($root, $dir, $filename);
148
        if (-e $abspath) {
155
        if (-e $abspath) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc (+1 lines)
Lines 169-174 Link Here
169
    [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %]
169
    [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %]
170
[% END %]
170
[% END %]
171
[% KohaPlugins.get_plugins_intranet_js | $raw %]
171
[% KohaPlugins.get_plugins_intranet_js | $raw %]
172
<script src="[% Asset.url("js/debug.js",{ shared => 1 }) | $raw %]"></script>
172
173
173
</body>
174
</body>
174
</html>
175
</html>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+1 lines)
Lines 203-207 $(document).ready(function() { Link Here
203
    [% Asset.js("js/cookieconsent.js") | $raw %]
203
    [% Asset.js("js/cookieconsent.js") | $raw %]
204
[% END %]
204
[% END %]
205
[% KohaPlugins.get_plugins_opac_js | $raw %]
205
[% KohaPlugins.get_plugins_opac_js | $raw %]
206
<script src="[% Asset.url("js/debug.js",{ shared => 1 }) | $raw %]"></script>
206
</body>
207
</body>
207
</html>
208
</html>
(-)a/public/shared/js/debug.js (-1 / +3 lines)
Line 0 Link Here
0
- 
1
function debug_shared_js (){
2
    console.log("You successfully ran this function!");
3
}

Return to bug 35716