Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move to using collective.ptg.presentation

  • Loading branch information...
commit d61e45c38619ed7042cf2d646e4250a6054f17d3 1 parent e1057c7
@vangheem vangheem authored
View
2  README.txt
@@ -28,7 +28,7 @@ the dependant js package in buildout
- galleria(ships with)
- contact sheet(collective.ptg.contactsheet)
- thumbnail zoom gallery(ships with)
- - presentation(ships with)
+ - presentation(collective.ptg.presentation)
- galleriffic(collective.ptg.galleriffic)
- highslide(collective.ptg.highslide)
- fancybox(collective.ptg.fancybox)
View
BIN  collective/plonetruegallery/browser/files/presentation/presentation-shadow.png
Deleted file not rendered
View
68 collective/plonetruegallery/browser/files/presentation/style.css
@@ -1,68 +0,0 @@
-/* @override http://localhost:8080/asdfasdfs/++resource++plonetruegallery.resources/presentation/style.css */
-
-.presentationWrapper {
- overflow-y: hidden;
-}
-.presentationWrapper ul {
- padding: 0;
- margin: 0 !important;
- list-style-type: none;
- list-style-image: none;
- list-style-position: outside;
-
-}
-
-.presentationWrapper li {
- border-left: 1px solid #FFF;
- overflow: hidden;
- float: left;
- background-repeat: no-repeat;
- background-position: center center;
- position: relative;
- margin: 0;
- padding: 0;
-}
-
-div.presentationWrapper a {
- text-decoration: none;
-}
-
-
-li.row_0 {
- clear: left; /* this is for making columns */
- border-left: 0 none;
-}
-
-div.presentationshadow {
- width: 100%;
- height: 100%;
- opacity: 0.6;
- position: relative;
- top: 0;
- right: 0;
- background: url(++resource++plonetruegallery.resources/presentation/presentation-shadow.png) repeat-y right;
-}
-
-
-div.presentationtext {
- background: #000;
- opacity: 0.7;
- width: 100%;
- height: 57px;
- position:absolute;
- bottom: 0;
- z-index: 2;
- padding-top: 7px;
-}
-
-div.presentationtext p,
-div.presentationtext h3 {
- color: white;
- margin-left: 15px;
- text-decoration: none;
-}
-
-.unpresented p,
-.unpresente h3 {
- display: none;
-}
View
12 collective/plonetruegallery/browser/views/configure.zcml
@@ -34,9 +34,6 @@
<adapter for="collective.plonetruegallery.interfaces.IGallery"
provides="collective.plonetruegallery.interfaces.IThumbnailzoomDisplaySettings"
factory=".display.ThumbnailzoomSettings" />
- <adapter for="collective.plonetruegallery.interfaces.IGallery"
- provides="collective.plonetruegallery.interfaces.IPresentationDisplaySettings"
- factory=".display.PresentationSettings" />
<!-- End Adapters -->
@@ -65,12 +62,6 @@
class=".display.ThumbnailzoomDisplayType"
template="templates/thumbnailzoom.pt"
permission="zope2.View" />
- <browser:page
- for="collective.plonetruegallery.interfaces.IGallery"
- name="galleryview-presentation"
- class=".display.PresentationDisplayType"
- template="templates/presentation.pt"
- permission="zope2.View" />
<!-- non-displaytype views -->
<browser:page
@@ -123,8 +114,5 @@
<utility component=".display.ThumbnailzoomDisplayType"
provides="collective.plonetruegallery.interfaces.IDisplayType"
name="galleryview-thumbnailzoom" />
- <utility component=".display.PresentationDisplayType"
- provides="collective.plonetruegallery.interfaces.IDisplayType"
- name="galleryview-presentation" />
</configure>
View
83 collective/plonetruegallery/browser/views/display.py
@@ -5,8 +5,6 @@
IThumbnailzoomDisplaySettings
from collective.plonetruegallery.interfaces import \
ISupersizedDisplaySettings
-from collective.plonetruegallery.interfaces import \
- IPresentationDisplaySettings
from plone.memoize.view import memoize
from zope.interface import implements
from collective.plonetruegallery import PTGMessageFactory as _
@@ -370,84 +368,3 @@ def javascript(self):
'duration': self.settings.delay,
}
SupersizedSettings = createSettingsFactory(SupersizedDisplayType.schema)
-
-
-class PresentationDisplayType(BatchingDisplayType):
- name = u"presentation"
- schema = IPresentationDisplaySettings
- description = _(u"label_presentation_display_type",
- default=u"Presentation")
-
- def javascript(self):
- imagecount = len(self.adapter.cooked_images)
- if imagecount == 0:
- imagecount = 1
- return u"""
-<script type="text/javascript" charset="utf-8">
-$(document).ready(function() {
- $(".presentationWrapper li").bind ({
- %(effect)s: function(){
- $(".presentationWrapper li").addClass("unpresented");
- $(this).addClass("presented").removeClass("unpresented");
- $(".unpresented").stop().animate({
- width: '%(minimum_width)ipx',
- }, 600);
- $(this).stop().animate({
- width: '%(imagelargewidth)ipx',
- }, 600);
- }
- });
- $(".presentationWrapper ul").bind ({
- mouseleave: function(){
- $(".presentationWrapper li").removeClass("unpresented presented");
- $(".presentationWrapper li").stop().animate({
- width: '%(imagewidth)ipx',
- }, 600);
- }
- });
-});
-</script>
-""" % {
- 'imagewidth': (self.settings.presentation_width - imagecount + 1) /
- imagecount,
- 'imagelargewidth': self.settings.presentation_width -
- ((imagecount - 1) * self.settings.minimum_width) - imagecount + 1,
- 'effect': self.settings.presentation_effect,
- 'minimum_width': self.settings.minimum_width
- }
-
- def css(self):
- imagecount = len(self.adapter.cooked_images)
- if imagecount == 0:
- imagecount = 1
- return u"""
-<link rel="stylesheet" type="text/css"
- href="%(base_url)s/presentation/style.css"/>
- <style>
-.presentationWrapper {
- width: %(width)ipx;
- height: %(height)ipx;
-}
-
-.presentationWrapper li {
- width: %(imagewidth)ipx;
- height: %(height)ipx;
- background-position: %(xposition)s %(yposition)s;
-}
-
-li.row_%(lastimagenr)s div.presentationshadow {
- background-image: none;
-}
-</style>
-""" % {
- 'base_url': self.staticFiles,
- 'height': self.settings.presentation_height,
- 'width': self.settings.presentation_width,
- 'xposition': self.settings.presentation_xposition,
- 'yposition': self.settings.presentation_yposition,
- 'lastimagenr': imagecount - 1,
- 'imagewidth': (self.settings.presentation_width - imagecount + 1) /
- imagecount
- }
-PresentationSettings = createSettingsFactory(PresentationDisplayType.schema)
-
View
23 collective/plonetruegallery/browser/views/templates/presentation.pt
@@ -1,23 +0,0 @@
-<div class="presentationWrapper">
- <ul>
- <tal:images tal:repeat="img view/batch">
- <li tal:define="number repeat/img/index;
- theimage img/image_url;
- thelink img/link;
- style python:'background-image:url(' + theimage + ')';
- theclass python:'row_' + str(number)"
- tal:attributes="class theclass;
- style style">
-
- <div class="presentationshadow"></div>
- <a href="" tal:attributes="href img/link" >
- <div class="presentationtext">
- <h3 tal:content="img/title" />
- <p class="captiondescription" tal:content="img/description" />
- </div>
- </a>
- </li>
- </tal:images>
- </ul>
-</div>
-
View
54 collective/plonetruegallery/interfaces.py
@@ -450,60 +450,6 @@ class ISupersizedDisplaySettings(IBaseSettings):
default=u'#portal-footer {display: none; } body {background: #111; }')
-class IPresentationDisplaySettings(IBaseSettings):
- presentation_effect = schema.Choice(
- title=_(u"label_presentation_effect",
- default=u"Mouseover or click"),
- default="click",
- vocabulary=SimpleVocabulary([
- SimpleTerm("click", "click",
- _(u"label_presentation_click", default=u"Click on image")),
- SimpleTerm("mouseenter", "mouseenter",
- _(u"label_presentation_mouseover", default=u"Mouse enter")
- )
- ]))
- presentation_width = schema.Int(
- title=_(u"label_presentation_width",
- default=u"Width of the gallery in pixels"),
- default=600,
- min=200)
- presentation_height = schema.Int(
- title=_(u"label_presentation_height",
- default=u"Height of the gallery in pixels"),
- default=350,
- min=60)
- minimum_width = schema.Int(
- title=_(u"label_presentation_minimum_width",
- default=u"Minimum width of images"),
- default=15)
- presentation_xposition = schema.Choice(
- title=_(u"label_presentation_xposition",
- default=u"Horizontal image position"),
- default="center",
- vocabulary=SimpleVocabulary([
- SimpleTerm("top", "top",
- _(u"label_presentation_xpositiontop", default=u"Top")),
- SimpleTerm("center", "center",
- _(u"label_presentation_xpositioncenter", default=u"Center")),
- SimpleTerm("bottom", "bottom",
- _(u"label_presentation_xpositionbottom", default=u"Bottom")
- )
- ]))
- presentation_yposition = schema.Choice(
- title=_(u"label_presentation_yposition",
- default=u"Vertical image position"),
- default="center",
- vocabulary=SimpleVocabulary([
- SimpleTerm("left", "left",
- _(u"label_presentation_ypositionleft", default=u"Left")),
- SimpleTerm("center", "center",
- _(u"label_presentation_ypositioncenter", default=u"Center")),
- SimpleTerm("right", "right",
- _(u"label_presentation_ypositionright", default=u"Right")
- )
- ]))
-
-
class IBasicGallerySettings(IBaseSettings):
pass
View
1  docs/HISTORY.txt
@@ -27,6 +27,7 @@ Changelog
- move to using collective.ptg.pikachoose
+- move to using collective.ptg.presentation
2.4b3 (2012-06-25)
------------------
Please sign in to comment.
Something went wrong with that request. Please try again.