Skip to content

Commit

Permalink
Prepare collective.prettyphoto 0.4.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Jul 13, 2011
1 parent 7567d40 commit 5ff31fa
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 180 deletions.
5 changes: 5 additions & 0 deletions README.txt
Expand Up @@ -94,6 +94,11 @@ collective.prettyphoto can be customized via property sheet (go to ZMI, portal_p


* slideshow: false OR interval time in ms (default: False) * slideshow: false OR interval time in ms (default: False)


* deeplinking: rewrite the browser location to enable directlinks to overlay images (default: False)

* social_tools: html markup for social links within image overlays (twitter, FB, ...) (default: empty) see http://bit.ly/pDQ19A for detailed information


Copyright and Credits Copyright and Credits
===================== =====================


Expand Down

This file was deleted.

249 changes: 154 additions & 95 deletions collective/prettyphoto/browser/javascript/jquery.prettyPhoto.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions collective/prettyphoto/browser/javascript/prettyPhoto.js
@@ -1,14 +1,14 @@
jq(document).ready(function(){ (function($) {
jq(document).ready(function(){ $(function() {
// add rel tag for all links with class 'prettyPhoto' // add rel tag for all links with class 'prettyPhoto'
jq("a.prettyPhoto").attr({"rel": "prettyPhoto"}); $("a.prettyPhoto").attr({"rel": "prettyPhoto"});


// add iframe attributes for all links with class 'prettyPhotoIframe' // add iframe attributes for all links with class 'prettyPhotoIframe'
jq("a.prettyPhotoIframe").attr("href", function() { $("a.prettyPhotoIframe").attr("href", function() {
return this.href + "?iframe=true&width=75%&height=75%"; return this.href + "?iframe=true&width=75%&height=75%";
}).attr({"rel": "prettyPhoto"}); }).attr({"rel": "prettyPhoto"});


// enable prettyPhoto // enable prettyPhoto
jq("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'}); $("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});
}); });
}); })(jQuery);
20 changes: 13 additions & 7 deletions collective/prettyphoto/browser/view.py
Expand Up @@ -14,29 +14,33 @@ def __call__(self, request=None, response=None):
portal_properties.""" portal_properties."""
self.request.response.setHeader("Content-type", "text/javascript") self.request.response.setHeader("Content-type", "text/javascript")


return """jq(document).ready(function(){ social_tools = getattr(self.prettyphoto_properties, 'social_tools', '')
jq(document).ready(function(){
return """(function($) {
$(function() {
// add rel tag for all links with class 'prettyPhoto' // add rel tag for all links with class 'prettyPhoto'
jq("a.prettyPhoto").attr({"rel": "prettyPhoto"}); $("a.prettyPhoto").attr({"rel": "prettyPhoto"});
// add iframe attributes for all links with class 'prettyPhotoIframe' // add iframe attributes for all links with class 'prettyPhotoIframe'
jq("a.prettyPhotoIframe").attr("href", function() { $("a.prettyPhotoIframe").attr("href", function() {
return this.href + "?iframe=true&width=%(iframe_width)s&height=%(iframe_height)s"; return this.href + "?iframe=true&width=%(iframe_width)s&height=%(iframe_height)s";
}).attr({"rel": "prettyPhoto"}); }).attr({"rel": "prettyPhoto"});
// enable prettyPhoto // enable prettyPhoto
jq("a[rel^='prettyPhoto']").prettyPhoto({ $("a[rel^='prettyPhoto']").prettyPhoto({
animationSpeed: '%(speed)s', /* fast/slow/normal */ animationSpeed: '%(speed)s', /* fast/slow/normal */
opacity: %(opacity)s, /* Value between 0 and 1 */ opacity: %(opacity)s, /* Value between 0 and 1 */
showTitle: %(show_title)s, /* true/false */ showTitle: %(show_title)s, /* true/false */
counter_separator_label: '%(counter_sep)s', /* The separator for the gallery counter 1 "of" 2 */ counter_separator_label: '%(counter_sep)s', /* The separator for the gallery counter 1 "of" 2 */
theme: '%(theme)s', theme: '%(theme)s',
autoplay: %(autoplay)s, /* Automatically start videos: True/False */ autoplay: %(autoplay)s, /* Automatically start videos: True/False */
slideshow: %(slideshow)s, /* false OR interval time in ms */ slideshow: %(slideshow)s, /* false OR interval time in ms */
overlay_gallery: %(overlay_gallery)s /* If set to true, a gallery will overlay the fullscreen image on mouse over */ overlay_gallery: %(overlay_gallery)s, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
social_tools: %(social_tools)s, /* html markup for social tool icons */
deeplinking: %(deeplinking)s /* allow prettyphoto to rewrite url for direktlinking to an image */
}); });
}); });
}); })(jQuery);
""" % dict(speed=getattr(self.prettyphoto_properties, 'speed', 'normal'), """ % dict(speed=getattr(self.prettyphoto_properties, 'speed', 'normal'),
opacity=getattr(self.prettyphoto_properties, 'opacity', '0.80'), opacity=getattr(self.prettyphoto_properties, 'opacity', '0.80'),
show_title=getattr(self.prettyphoto_properties, 'show_title', True) and 'true' or 'false', show_title=getattr(self.prettyphoto_properties, 'show_title', True) and 'true' or 'false',
Expand All @@ -47,4 +51,6 @@ def __call__(self, request=None, response=None):
iframe_height=getattr(self.prettyphoto_properties, 'iframe_height', '75%'), iframe_height=getattr(self.prettyphoto_properties, 'iframe_height', '75%'),
overlay_gallery=getattr(self.prettyphoto_properties, 'overlay_gallery', False) and 'true' or 'false', overlay_gallery=getattr(self.prettyphoto_properties, 'overlay_gallery', False) and 'true' or 'false',
slideshow=getattr(self.prettyphoto_properties, 'slideshow', 0) or 'false', slideshow=getattr(self.prettyphoto_properties, 'slideshow', 0) or 'false',
social_tools=social_tools and "'%s'" % social_tools or 'false',
deeplinking=getattr(self.prettyphoto_properties, 'deeplinking', False) and 'true' or 'false',
) )
2 changes: 2 additions & 0 deletions collective/prettyphoto/exportimport.py
Expand Up @@ -16,6 +16,8 @@
dict(name='iframe_height', type_='string', value='75%'), dict(name='iframe_height', type_='string', value='75%'),
dict(name='overlay_gallery', type_='boolean', value=False), dict(name='overlay_gallery', type_='boolean', value=False),
dict(name='slideshow', type_='int', value=0), dict(name='slideshow', type_='int', value=0),
dict(name='deeplinking', type_='boolean', value=False),
dict(name='social_tools', type_='string', value=''),
] ]




Expand Down
2 changes: 1 addition & 1 deletion collective/prettyphoto/profiles/default/jsregistry.xml
Expand Up @@ -15,4 +15,4 @@
expression="" expression=""
id="prettyPhoto.js" id="prettyPhoto.js"
inline="False" /> inline="False" />
</object> </object>
6 changes: 5 additions & 1 deletion docs/HISTORY.txt
@@ -1,9 +1,13 @@
Changelog Changelog
========= =========


0.4.2 (unreleased) 0.4.2 (2011-07-13)
------------------ ------------------


- Upgraded to prettyPhoto 3.1.2 and implemented two new properties:
deeplinking , social_tools
[petschki]

0.4.1 (2011-03-22) 0.4.1 (2011-03-22)
------------------ ------------------


Expand Down
2 changes: 1 addition & 1 deletion setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
import os import os


version = '0.4.2dev' version = '0.4.2'


setup(name='collective.prettyphoto', setup(name='collective.prettyphoto',
version=version, version=version,
Expand Down

0 comments on commit 5ff31fa

Please sign in to comment.