[pmwiki-users] Galleria

Peter Gragert p.k.h.gragert at misc.utwente.nl
Sat Jun 11 10:12:42 CDT 2011


Hallo to Petko and Dave

This works in my config.php

$HTMLHeaderFmt['galleria-js'] = '<script type="text/javascript"
  src="$PubDirUrl/galleria/galleria-1.2.3.js"></script>
<script type="text/javascript"><!--
$(document).ready(function(){
  $(".Galleria").galleria({
    width: 900,
    height: 900,
    autoplay: 2000,
    transition: "pulse",
    dataConfig: function(img){ 
      return { description: $(img).nextAll(\'em\').html() }; 
    }
  });
});
//--></script>';

But now it is the same for all >>Galleria<<

Could be with different with an if ... else if ... but that is not so nice.
Any idea how to put the parameters to >>Galleria ???autoplay ???
???transition ??? <<

>>Galleria<<
Pictures with text and caption
>><<
Is indeed easier = nicer 

Greetings
      Peter


-----Oorspronkelijk bericht-----
Van: pmwiki-users-bounces at pmichaud.com
[mailto:pmwiki-users-bounces at pmichaud.com] Namens DaveG
Verzonden: zaterdag 11 juni 2011 16:07
Aan: Petko Yotov
CC: pmwiki-users at pmichaud.com
Onderwerp: Re: [pmwiki-users] Galleria



On 6/11/2011 8:41 AM, Petko Yotov wrote:
> 1. When your image is in a bulletted list, the "| Caption" part is not
> converted to "<br/>Caption" and the image is not wrapped in a div.
In my testing the caption is translated to <br/>Caption (ref the last 
demo on the page http://wiki.solidgone.org/Galleria/Demo8). Since that's 
being handled by PmWiki, it should be consistent. Not too important for 
this case though given the solution of styling the caption you noted.


> Tell your
> users to wrap the Caption with (for example) double apostrophes which
PmWiki
> uses for italics/emphasized text, and jQuery can easily identify.
Excellent point -- solves the selector issue.


> 2. I don't need the (:galleria list=#section:) markup if I use one CSS
class
> "Galleria", and let the library find all such blocks automatically:
>
>>> Galleria<<
> * Attach:Im1.jpg"Title1" | ''Some caption1, including %red% styles%%.''
> * Attach:Im2.jpg"Title2" | ''Some caption2, including %green% styles%%.''
>>> <<
> A 2nd Calleria will also work in the page, even without bulletted list.
>>> Galleria<<
> Attach:Im3.jpg"Title3" | ''Some caption3, including %red% styles%%.''
> Attach:Im4.jpg"Title4" | ''Some caption4, including %red% styles%%.''
>>> <<
Agreed, and I'll document that. As you note in your subsequent post 
though the markup provides a way to style each gallery.


> 3. Here is the javascript that goes to the HTML he	ader. I have it in
> config.php, you should adapt it for the recipe, probably allowing width
and
> height to be configurable:
>
> $HTMLHeaderFmt['galleria-js'] = '<script type="text/javascript"
>    src="$PubDirUrl/galleria/galleria-1.2.3.js"></script>
> <script type="text/javascript"><!--
> $(document).ready(function(){
>    $(".Galleria").galleria({
>      width: 500,
>      height: 400,
>      dataConfig: function(img){
>        return { description: $(img).nextAll(\'em\').html() };
>      }
>    });
> });
> //--></script>';
>
> This snippet will take care of all Galleria blocks without the need to
specify
> id=#demo etc., contrary to next(), nextAll() finds the 'em' element even
after
> a<br/>  break.
Thanks. My stumbling block was getting jquery to select textnodes. 
Adding styling avoids that issue.


> This works, I'll leave it to you to incorporate it in your recipe, if you
> wish. :-)
Thanks for the help.


  ~ ~ Dave

_______________________________________________
pmwiki-users mailing list
pmwiki-users at pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 10.0.1382 / Virusdatabase: 1513/3693 - datum van uitgifte: 06/10/11




More information about the pmwiki-users mailing list