Permalink
Browse files

more like this

  • Loading branch information...
1 parent 213163c commit 7a8a176c432526e4562aa5dbc2eb49a37e9abfc9 User committed Nov 23, 2011
@@ -14,24 +14,28 @@ class FilerGalleryPlugin(CMSPluginBase):
def render(self, context, instance, placeholder):
config = simplejson.dumps({
- 'animation': instance.get_animation_display(), # fade, horizontal-slide, vertical-slide, horizontal-push
- 'animationSpeed': instance.speed, # how fast animations are
- 'timer': instance.timer, # True or False to have the timer
- 'advanceSpeed': instance.advanced_speed, # if timer is enabled, time between transitions
- 'pauseOnHover': instance.pause_on_hover, # if you hover pauses the slider
- 'startClockOnMouseOut': instance.start_on_mouseout, # if clock should start on MouseOut
- 'startClockOnMouseOutAfter': instance.start_after, # how long after MouseOut should the timer start again
- 'directionalNav': instance.directional_nav, # manual advancing directional navs
- 'captions': instance.captions, # do you want captions?
- 'captionAnimation': instance.caption_animation and
- instance.get_caption_animation_display() or 'none', # fade, slideOpen, none
- 'captionAnimationSpeed': instance.caption_speed, # if so how quickly should they animate in
- 'bullets': instance.bullets # True or False to activate the bullet navigation
- })
+ 'navigation': True,
+ 'interval': 2500,
+ 'numbers': True,
+ 'label': True,
+ 'animation': 'random',
+ 'thumbs': False,
+ 'hideTools': False,
+ 'dots': False,
+ 'easing_default': None,
+ 'velocity': 1,
+ 'animateNumberOut': {'backgroundColor':'#000', 'color':'#ccc'},
+ 'animateNumberOver': {'backgroundColor':'#000', 'color':'#ccc'},
+ 'animateNumberActive': {'backgroundColor':'#000', 'color':'#ccc'},
+ 'width_label': None,
+ 'show_randomly': False
+ }
+ )
context.update({
'instance': instance,
'size': (instance.height, instance.width),
- 'orbit_config': config
+ 'thumb_size': (instance.thumb_height, instance.thumb_width),
+ 'skitter_config': config
})
return context
@@ -13,18 +13,8 @@ class FilerGallery(CMSPlugin):
gallery = models.ForeignKey('filer_gallery.Gallery')
height = models.SmallIntegerField(default=200)
width = models.SmallIntegerField(default=300)
- animation = models.SmallIntegerField(choices=ANIMATION_CHOICES)
- speed = models.SmallIntegerField(default=600)
- timer = models.BooleanField(default=True)
- advanced_speed = models.IntegerField(default=4000)
- pause_on_hover = models.BooleanField(default=True)
- start_on_mouseout = models.BooleanField(default=True)
- start_after = models.IntegerField(default=1000)
- directional_nav = models.BooleanField(default=False)
- captions = models.BooleanField(default=False)
- caption_animation = models.SmallIntegerField(choices=CAPTION_ANIMATION_CHOICES, null=True, blank=True)
- caption_speed = models.SmallIntegerField(default=800)
- bullets = models.BooleanField(default=False)
+ thumb_height = models.SmallIntegerField(null=True, blank=True, default=None, help_text='Leave empty for no thumbs.')
+ thumb_width = models.SmallIntegerField(null=True, blank=True, default=None, help_text='Leave empty for no thumbs.')
class Meta:
verbose_name = _("django filer gallery")
@@ -1,33 +1,59 @@
-{% load thumbnail adminmedia sekizai_tags %}
-{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}filer_gallery/orbit/jquery-1.5.1.min.js"></script>{% endaddtoblock %}
-{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}filer_gallery/orbit/jquery.orbit-1.2.3.min.js"></script>{% endaddtoblock %}
-{% addtoblock "css" %}<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}filer_gallery/orbit/orbit-1.2.3.css" media="all" />{% endaddtoblock %}
-{% addtoblock "css" %}<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cmsplugin_filer_gallery/cmsplugin_filer_gallery.css" media="all" />{% endaddtoblock %}
+{% load thumbnail sekizai_tags %}
+{% addtoblock "css" %}<link href="{{ STATIC_URL }}filer_gallery/skitter/css/skitter.styles.css" type="text/css" media="all" rel="stylesheet" />{% endaddtoblock %}
+{% addtoblock "css" %}<link href="{{ STATIC_URL }}filer_gallery/skitter.css" type="text/css" media="all" rel="stylesheet" />{% endaddtoblock %}
+{% addtoblock "css" %}<link href="{{ STATIC_URL }}filer_gallery/filer_gallery.css" type="text/css" media="all" rel="stylesheet" />{% endaddtoblock %}
+
+{% addtoblock "js" %}<script src="{{ STATIC_URL }}filer_gallery/skitter/js/jquery-1.6.3.min.js"></script>{% endaddtoblock %}
+{% addtoblock "js" %}<script src="{{ STATIC_URL }}filer_gallery/skitter/js/jquery.easing.1.3.js"></script>{% endaddtoblock %}
+{% addtoblock "js" %}<script src="{{ STATIC_URL }}filer_gallery/skitter/js/jquery.animate-colors-min.js"></script>{% endaddtoblock %}
+
+{% addtoblock "js" %}<script src="{{ STATIC_URL }}filer_gallery/skitter/js/jquery.skitter.js"></script>{% endaddtoblock %}
+{% addtoblock "js" %}<script src="{{ STATIC_URL }}filer_gallery/skitter_init.js"></script>{% endaddtoblock %}
+
+
{% addtoblock "js" %}
<script type="text/javascript">
//<![CDATA[
(function ($) {
- var config = {{ orbit_config|safe }}
-
- config.bulletThumbs = false // thumbnails for the bullets
- config.bulletThumbLocation = ''
- config.afterSlideChange = function(){}
-
+ var config = {{ skitter_config|safe }}
$(document).ready(function () {
- $('#filer-gallery-{{ instance.pk }}').orbit(config);
+ $('#filer-gallery-plugin-{{ instance.pk }}').skitter(config);
+ $('#filer-gallerythumbs-plugin-{{ instance.pk }} img:first').addClass('active')
+ $('#filer-gallery-plugin-{{ instance.pk }}').bind("imageSwitched", function(event, skitter, imagenum ) {
+ $('#filer-gallerythumbs-plugin-{{ gallery.pk }} img').removeClass('active')
+ var child = imagenum == 0 ? 'last' : 'nth-child(' + imagenum + ')'
+ $('#filer-gallerythumbs-plugin-{{ gallery.pk }} img:' + child).addClass('active')
+ });
+
});
-})(jQuery)
+})(skitter_jQuery)
//]]>
</script>
{% endaddtoblock %}
-<div id="filer-gallery-{{ instance.pk }}">
- {% for image in instance.gallery.galleryimage_set.all %}
- <img src="{% thumbnail image.image size %}" alt="{{ image.title }}" {% if instance.captions %}data-caption="#filer-gallery-caption-{{ image.pk }}"{% endif %} />
- {% endfor %}
-</div>
-{% if instance.captions %}
+<div class="filer-gallery-wrapper border_shadow">
+<div class="filer-gallery-imagewrapper">
+
+<div id="filer-gallery-plugin-{{ instance.pk }}" class="box_skitter box_skitter_medium">
+ <ul>
{% for image in instance.gallery.galleryimage_set.all %}
- <span class="orbit-caption" id="filer-gallery-caption-{{ image.pk }}">{{ image.title }}</span>
+ <li>
+ <a href="#"><img src="{% thumbnail image.image size %}" /></a>
+ <div class="label_text">
+ <p>{{ image.title }}</p>
+ </div>
+ </li>
{% endfor %}
-{% endif %}
+ </ul>
+</div>
+</div>
+{% if instance.thumb_height %}
+<div id="filer-gallerythumbs-{{ instance.pk }}" class="filer-gallery-thumbswrapper">
+{% spaceless %}
+{% for image in instance.gallery.galleryimage_set.all %}
+<img src="{% thumbnail image.image thumb_size %}" onclick="skitter_jQuery('#filer-gallery-{{ instance.pk }}').skitter('setimage', {{ forloop.counter0 }});return false"/>
+{% endfor %}
+{% endspaceless %}
+</div>
+{% endif %}
+</div>

0 comments on commit 7a8a176

Please sign in to comment.