Bugzilla – Attachment 14285 Details for
Bug 8377
Show HTML5 video/ audio for media files in OPAC and staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8377: Followup move style in a css file and do not pass template to a pm
Bug-8377-Followup-move-style-in-a-css-file-and-do-.patch (text/plain), 7.32 KB, created by
Jonathan Druart
on 2012-12-27 09:03:20 UTC
(
hide
)
Description:
Bug 8377: Followup move style in a css file and do not pass template to a pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-12-27 09:03:20 UTC
Size:
7.32 KB
patch
obsolete
>From 8c94f8bd5ae557e259ee895829c108cc38fc2aed Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 9 Nov 2012 15:12:59 +0100 >Subject: [PATCH] Bug 8377: Followup move style in a css file and do not pass > template to a pm > >1/ It's better to set style of the video marked in a css file. > >2/ Replace some > for my $i in (0..#$array) >with > for my $element in (@array) > >3/ the routine in a pm returns a hash not the $template variable > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/HTML5Media.pm | 35 +++++++++----------- > catalogue/detail.pl | 4 +-- > .../intranet-tmpl/prog/en/css/staff-global.css | 5 +++ > .../prog/en/modules/catalogue/detail.tt | 2 +- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 4 +++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 +- > opac/opac-detail.pl | 4 +-- > 7 files changed, 31 insertions(+), 25 deletions(-) > >diff --git a/C4/HTML5Media.pm b/C4/HTML5Media.pm >index aff7192..89620d3 100644 >--- a/C4/HTML5Media.pm >+++ b/C4/HTML5Media.pm >@@ -36,13 +36,12 @@ This module gets the relevant data from field 856 (MARC21/UNIMARC) to create a H > > =head2 gethtml5media > >-Get all relevant data from field 856. Takes $template and $record in the subroutine call, sets appropriate params. >+Get all relevant data from field 856. Takes a $record in the subroutine call, sets appropriate params. > > =cut > > sub gethtml5media { > my $self = shift; >- my $template = shift; > my $record = shift; > my @HTML5Media_sets = (); > my @HTML5Media_fields = $record->field(856); >@@ -189,38 +188,36 @@ sub gethtml5media { > } > } > # parent element >- for my $i ( 0 .. $#HTML5Media_sets ) { >- if ( ($HTML5Media_sets[$i]{mime}) && ($HTML5Media_sets[$i]{mime} =~ /audio/) ) { >+ for my $media ( @HTML5Media_sets ) { >+ if ( ($media->{mime}) && ($media->{mime} =~ /audio/) ) { > if ( $HTML5MediaParent ne 'video' ) { > $HTML5MediaParent = 'audio'; > $HTML5MediaWidth = ''; > } > } >- elsif ( ($HTML5Media_sets[$i]{mime}) && ($HTML5Media_sets[$i]{mime} =~ /video/) ) { >+ elsif ( ($media->{mime}) && ($media->{mime} =~ /video/) ) { > $HTML5MediaParent = 'video'; > $HTML5MediaWidth = ' width="480"'; > } > } > # child element >- for my $j ( 0 .. $#HTML5Media_sets ) { >- if ( ($HTML5Media_sets[$j]{type}) && ( ($HTML5Media_sets[$j]{type} eq 'video') || ($HTML5Media_sets[$j]{type} eq 'audio') ) ) { >- if ( $HTML5Media_sets[$j]{type} eq $HTML5MediaParent ) { >- $HTML5Media_sets[$j]{child} = 'source'; >+ for my $media ( @HTML5Media_sets ) { >+ if ( ($media->{type}) && ( ($media->{type} eq 'video') || ($media->{type} eq 'audio') ) ) { >+ if ( $media->{type} eq $HTML5MediaParent ) { >+ $media->{child} = 'source'; > } > } > else { >- $HTML5Media_sets[$j]{child} = $HTML5Media_sets[$j]{type}; >+ $media->{child} = $media->{type}; > } > } >- # template parameters >- if ( (scalar(@HTML5Media_sets) > 0) && ($HTML5MediaParent) ) { >- $template->param( >- HTML5MediaEnabled => 1, >- HTML5MediaSets => \@HTML5Media_sets, >- HTML5MediaParent => $HTML5MediaParent, >- HTML5MediaWidth => $HTML5MediaWidth); >- } >- return $template; >+ >+ return ( >+ HTML5MediaEnabled => ( (scalar(@HTML5Media_sets) > 0) && ($HTML5MediaParent) ), >+ HTML5MediaSets => \@HTML5Media_sets, >+ HTML5MediaParent => $HTML5MediaParent, >+ HTML5MediaWidth => $HTML5MediaWidth, >+ ); > } > > 1; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 65866b8..9379704 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -381,8 +381,8 @@ if ( C4::Context->preference("LocalCoverImages") == 1 ) { > } > > # HTML5 Media >-if ( (C4::Context->preference("HTML5MediaEnabled") eq 'staff') || (C4::Context->preference("HTML5MediaEnabled") eq 'both') ) { >- $template = C4::HTML5Media->gethtml5media($template,$record); >+if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'staff') ) { >+ $template->param( C4::HTML5Media->gethtml5media($record)); > } > > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >index 28d53f4..eaa1624 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >@@ -2400,3 +2400,8 @@ div.authorizedheading { > > /* jQuery UI Accordion */ > .ui-accordion-header { font-weight: bold; font-size : 110%; } >+ >+video { >+ width: 480px; >+} >+ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index fc9d6e1..cc68bfe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -591,7 +591,7 @@ function verify_images() { > [% IF ( HTML5MediaEnabled ) %] > <div id="html5media"> > <p> >- <[% HTML5MediaParent %][% HTML5MediaWidth %] controls preload=none> >+ <[% HTML5MediaParent %] controls preload=none> > [% FOREACH HTML5MediaSet IN HTML5MediaSets %] > <[% HTML5MediaSet.child %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] /> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index d14ea50..3149784 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2846,3 +2846,7 @@ body#opac-main #opacmainuserblockmobile { > #patronregistration a { > display: block; > } >+ >+video { >+ width: 480px; >+} >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 3ef2470..fa5ec3d 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -1062,7 +1062,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > [% IF ( HTML5MediaEnabled ) %] > <div id="html5media"> > <p> >- <[% HTML5MediaParent %][% HTML5MediaWidth %] controls preload=none> >+ <[% HTML5MediaParent %] controls preload=none> > [% FOREACH HTML5MediaSet IN HTML5MediaSets %] > <[% HTML5MediaSet.child %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] /> > [% END %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 0fe44f5..22c922b 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -778,8 +778,8 @@ if (C4::Context->preference("OPACLocalCoverImages")){ > } > > # HTML5 Media >-if ( (C4::Context->preference("HTML5MediaEnabled") eq 'opac') || (C4::Context->preference("HTML5MediaEnabled") eq 'both') ) { >- $template = C4::HTML5Media->gethtml5media($template,$record); >+if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'opac') ) { >+ $template->param( C4::HTML5Media->gethtml5media($record)); > } > > my $syndetics_elements; >-- >1.7.10.4
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 8377
:
10684
|
10685
|
10688
|
10776
|
11056
|
11057
|
11058
|
11059
|
11067
|
11068
|
11153
|
11545
|
11546
|
11548
|
12372
|
12373
|
12378
|
12447
|
12603
|
13343
|
13623
|
13635
|
13636
|
14279
|
14280
|
14284
| 14285