#5 Merged at f8b1b3c
  1. Marc DM
  1. updated javascript in template to use data attributes on div.nivoSlider for slider initiation.
  2. updated image-title update mechanism to use jquery and regular expressions.
  3. id attributes for images within the slider have been updated to include {{ object.pk }} so we don't have id clashes on pages with multiple sliders that use the same images
  4. multiple sliders on 1 page now render a single javascript block to handle all work.
  5. inline javascript encased in CDATA sections to facilitate XHTML validation
  6. added a tiny jquery plugin to get data attributes for versions of jquery less than 1.7.2

Comments (8)

    1. Marc DM author

      Just syntactic sugar to indicate that those variables are jquery objects. They serve no other purpose. So $txt could have just as easily be called txt. I just named it differently to make it easy to spot.

  1. Bertrand Bordage

    I will have some time tomorrow to test your patch (by adding an example project, btw). Then I'll merge it and upload this upgrade to pypi (as version 0.5.1).

    And you can also add to this pull request a commit that adds your name to AUTHORS, if you want :)

  2. Bertrand Bordage

    The example project is done. There is a problem with your patch, it requires a rather recent version of jQuery. Django-CMS uses 1.4.2, with which .data() is not working properly. 1.9.0 is not working either, not because of what you wrote, but because of nivoslider. With 1.7.2, everything works fine.

    Add this before your script and everything will work perfectly:

    {% addtoblock 'js' %}
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    {% endaddtoblock %}
    1. Marc DM author

      I'm not to keen on restricting the version of jquery or adding another copy of jquery into the page. I've updaed the inline script to fetch the data attributes a bit differently.