Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
87 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,8 @@ | ||
var PhotoGallery = (function() { | ||
function PhotoGallery(el) { | ||
var self = this; | ||
self.$el = $(el); | ||
self.proportion = 3 / 2; | ||
self.bind_events(); | ||
self.fix_image_size(); | ||
} | ||
PhotoGallery.prototype.$ = function(selector) { | ||
var self = this; | ||
return $(selector, self.$el); | ||
}; | ||
PhotoGallery.prototype.bind_events = function() { | ||
var self = this; | ||
self.$('.cycle-player').on('cycle-next cycle-prev', self, self.sync_slideshows); | ||
self.$('.cycle-carrossel .thumb-itens').on('click', self, self.thumbs_click); | ||
}; | ||
PhotoGallery.prototype.fix_image_size = function() { | ||
var self, max_height, max_width, $player, $imgs; | ||
self = this; | ||
|
||
// Calc max_with and max_height | ||
$player = self.$('.cycle-player'); | ||
max_width = $player.width(); | ||
max_height = max_width / self.proportion; | ||
// Calc max_with and max_height | ||
|
||
$imgs = self.$('.cycle-player img'); | ||
$imgs.css({ | ||
'max-width': max_width, | ||
'max-height': max_height | ||
}); | ||
}; | ||
|
||
PhotoGallery.prototype.sync_slideshows = function(e, opts) { | ||
var self, index, $player, $slideshows; | ||
self = e.data; | ||
$slideshows = self.$('.cycle-slideshow'); | ||
$slideshows.cycle('goto', opts.currSlide); | ||
}; | ||
|
||
PhotoGallery.prototype.thumbs_click = function(e) { | ||
var self, index, $thumbs, $slideshows; | ||
self = e.data; | ||
e.preventDefault(); | ||
$thumbs = self.$('.cycle-carrossel'); | ||
index = $thumbs.data('cycle.API').getSlideIndex(this); | ||
$slideshows = self.$('.cycle-slideshow'); | ||
$slideshows.cycle('goto', index); | ||
}; | ||
return PhotoGallery; | ||
})(); | ||
$(window).load(function() { | ||
var i, len, ref, slideshow; | ||
ref = $('.slideshow-container'); | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
slideshow = ref[i]; | ||
new PhotoGallery(slideshow); | ||
new cycle2SlideShow(slideshow); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding:utf-8 -*- | ||
from sc.photogallery.config import PROJECTNAME | ||
|
||
import logging | ||
|
||
|
||
logger = logging.getLogger(PROJECTNAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
from plone import api | ||
from sc.photogallery.logger import logger | ||
|
||
|
||
def cook_css_resources(context): # pragma: no cover | ||
"""Cook CSS resources.""" | ||
css_tool = api.portal.get_tool('portal_css') | ||
css_tool.cookResources() | ||
logger.info('CSS resources were cooked') | ||
|
||
|
||
def cook_javascript_resources(context): # pragma: no cover | ||
"""Cook JavaScript resources.""" | ||
js_tool = api.portal.get_tool('portal_javascripts') | ||
js_tool.cookResources() | ||
logger.info('JavaScript resources were cooked') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters