Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c3302b4
Basics working with Cycle2 (but no tests changed as yet)
djowett Sep 26, 2014
f44a7a2
Add cycle2 related stuff to the uninstall profile (#442)
djowett Sep 26, 2014
65ba512
Stop Flash of unstyled content by removing auto-initialization & some…
djowett Sep 29, 2014
183d754
Got autoplay checkbox functioning
djowett Sep 29, 2014
744311d
Don't run JSHint on minified Cycle2 Javascript; Fix issues raised by …
djowett Sep 29, 2014
bb1f491
Added Prev & Next buttons
djowett Sep 29, 2014
c0ea873
Use unminified version of cycle2 JS
djowett Sep 29, 2014
52a711f
Stop codeanalysis baulking at cycle2's console.log
djowett Sep 29, 2014
ed05aee
Merge branch 'master' into carousel_tile_with_cycle2
djowett Sep 30, 2014
f4ef50f
Merge branch 'master' of https://github.com/collective/collective.cov…
djowett Oct 1, 2014
49f52c6
Merge branch 'issue_378' of https://github.com/collective/collective.…
djowett Oct 1, 2014
d45e327
Switched carousel tile to use Cycle2 by default (#442)
djowett Oct 1, 2014
71b4c54
Fixed tests for Cycle2 carousel tile (#442)
djowett Oct 1, 2014
cdd27ca
Reverted wrong assumption in carousel test about it not updating befo…
djowett Oct 1, 2014
b42d166
Fix for Flake8 again
djowett Oct 1, 2014
5b711ea
collective.js.galleria should not be installed in default profile
djowett Oct 2, 2014
51cdf36
Rename interface. Rationalize profiles so installing 'galleriacarouse…
djowett Oct 2, 2014
4c3aba4
Add test for Galleria tile (with a separate fixture for running 'gall…
djowett Oct 2, 2014
c1abc00
Enable deprecated galleria tiles to be used with adding egg 'collecti…
djowett Oct 2, 2014
56cf1d6
Reduce code in GalleriaFixture by relying on superclass methods
djowett Oct 2, 2014
d877ad6
Copy recent fixes from test_carousel_tile.robot to testgalleria_carou…
djowett Oct 2, 2014
b6e974a
Proposed Doc changes for Cycle2 tile #442
djowett Oct 2, 2014
d94dca3
Remove redundant lines from carousel template
djowett Oct 3, 2014
df34622
Make testing of Image drag & drop predictable in list_tile robot test
djowett Oct 10, 2014
e3b7dcd
Add swipe gesture to Cycle2 slideshow (#442) using dedicated Cycle2 p…
djowett Oct 10, 2014
a60e6ff
Add same tal:condition to <script> as is already on slideshow content
djowett Oct 14, 2014
f7d5ae6
Add non-image-fields (Title, Desc & Date) to Carousel tile in such a …
djowett Oct 14, 2014
33d6514
Fix for content menu dropdowns, which were being hidden by Cycle2 ver…
djowett Oct 14, 2014
bf8f812
Merge branch 'master' into carousel_tile_with_cycle2
hvelarde Oct 16, 2014
1f60c33
Merge branch 'carousel_tile_with_cycle2' of github.com:collective/col…
hvelarde Oct 16, 2014
03c3a7f
Use Cycle2 from collective.js.cycle2
hvelarde Oct 16, 2014
877cc08
Remove needless GS file
hvelarde Oct 16, 2014
30d7ec7
Use HTTPS schema to clone dependency repo
hvelarde Oct 16, 2014
46fdcf9
Stop Cycle2 slides hiding the nice green loading-mask
djowett Oct 17, 2014
38312da
Basics working with Cycle2 (but no tests changed as yet)
djowett Sep 26, 2014
557a281
Add cycle2 related stuff to the uninstall profile (#442)
djowett Sep 26, 2014
c98f4b0
Stop Flash of unstyled content by removing auto-initialization & some…
djowett Sep 29, 2014
3fa0264
Got autoplay checkbox functioning
djowett Sep 29, 2014
1fdf4d2
Don't run JSHint on minified Cycle2 Javascript; Fix issues raised by …
djowett Sep 29, 2014
0a33fcd
Added Prev & Next buttons
djowett Sep 29, 2014
d275303
Use unminified version of cycle2 JS
djowett Sep 29, 2014
bdb3410
Stop codeanalysis baulking at cycle2's console.log
djowett Sep 29, 2014
63fa50f
Switched carousel tile to use Cycle2 by default (#442)
djowett Oct 1, 2014
f56cc35
Fixed tests for Cycle2 carousel tile (#442)
djowett Oct 1, 2014
003a311
Reverted wrong assumption in carousel test about it not updating befo…
djowett Oct 1, 2014
f2f0b91
Fix for Flake8 again
djowett Oct 1, 2014
241c30d
collective.js.galleria should not be installed in default profile
djowett Oct 2, 2014
0aa0c84
Rename interface. Rationalize profiles so installing 'galleriacarouse…
djowett Oct 2, 2014
50eaa9e
Add test for Galleria tile (with a separate fixture for running 'gall…
djowett Oct 2, 2014
a4fafbd
Enable deprecated galleria tiles to be used with adding egg 'collecti…
djowett Oct 2, 2014
08b34c0
Reduce code in GalleriaFixture by relying on superclass methods
djowett Oct 2, 2014
6fc06a9
Copy recent fixes from test_carousel_tile.robot to testgalleria_carou…
djowett Oct 2, 2014
6a85770
Proposed Doc changes for Cycle2 tile #442
djowett Oct 2, 2014
a5f908f
Remove redundant lines from carousel template
djowett Oct 3, 2014
a9e9476
Make testing of Image drag & drop predictable in list_tile robot test
djowett Oct 10, 2014
aafcadf
Add swipe gesture to Cycle2 slideshow (#442) using dedicated Cycle2 p…
djowett Oct 10, 2014
3dce18c
Add same tal:condition to <script> as is already on slideshow content
djowett Oct 14, 2014
4e0e833
Add non-image-fields (Title, Desc & Date) to Carousel tile in such a …
djowett Oct 14, 2014
5d1fe98
Fix for content menu dropdowns, which were being hidden by Cycle2 ver…
djowett Oct 14, 2014
efd8b4d
Use Cycle2 from collective.js.cycle2
hvelarde Oct 16, 2014
47f5736
Remove needless GS file
hvelarde Oct 16, 2014
9fc35e2
Use HTTPS schema to clone dependency repo
hvelarde Oct 16, 2014
bacce56
Stop Cycle2 slides hiding the nice green loading-mask
djowett Oct 17, 2014
be9882f
Clean up code
hvelarde Oct 17, 2014
13d84ce
Merge branch 'master' into carousel_tile_with_cycle2
hvelarde Oct 20, 2014
a144950
Hide autoplay field on Tile Configuration popup
djowett Oct 21, 2014
bc0e77d
Move carousel pager outside of carousel & align over bottom of slides…
djowett Oct 21, 2014
07414b8
Merge branch 'carousel_tile_with_cycle2' of https://github.com/collec…
djowett Oct 21, 2014
2389d76
Removed jquery.cycle2.caption2 plugin - we are not using it
djowett Oct 21, 2014
8236c02
Use released version of collective.js.cycle2
hvelarde Oct 20, 2014
79b77db
Install collective.js.cycle2 only if not previously installed
hvelarde Oct 20, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ src/collective/cover/static/bootstrap.min.js
src/collective/cover/static/jquery.*
src/collective/cover/static/jss.js
src/collective/cover/static/jss.min.js
src/collective/cover/static/cycle2-theme/jquery.cycle2*.min.js
22 changes: 22 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,35 @@ To enable this package in a buildout-based installation:
plone.app.z3cform = 0.6.3
plone.directives.form = 1.1

#. The carousel slide now defaults to use Cycle2 rather than Galleria, but if
you (still) want to use Galleria, then use::

[buildout]
...
eggs =
collective.cover[galleria]

[versions]
...
(as above)

After updating the configuration you need to run ''bin/buildout'', which will
take care of updating your system.

Go to the 'Site Setup' page in a Plone site and click on the 'Add-ons' link.

Check the box next to ``collective.cover`` and click the 'Activate' button.

If you want to use Galleria slides, then load the Generic Setup profile as follows:

#. Go to the ZMI (Zope Management Interface)
#. Go to portal_setup
#. Click the Import tab
#. Select "collective.cover: using deprecated galleria carousel tile" in the
drop down field
#. At the bottom of the page uncheck "Include dependencies", then click "Import
all steps"

.. Note::
You may have to empty your browser cache and save your resource registries
in order to see the effects of the product installation.
Expand Down
2 changes: 1 addition & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extends =
versions-4.3.x.cfg

package-name = collective.cover
package-extras = [test]
package-extras = [test, galleria]
eggs +=
iw.debug
plone.reload
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'AccessControl',
'Acquisition',
'collective.js.bootstrap',
'collective.js.galleria',
'collective.js.cycle2',
'collective.js.jqueryui',
'five.grok',
'Missing',
Expand Down Expand Up @@ -96,6 +96,9 @@
'zope.schema',
],
extras_require={
'galleria': [
'collective.js.galleria',
],
'test': [
'mock',
'plone.app.robotframework',
Expand All @@ -104,6 +107,7 @@
'plone.cachepurging',
'plone.testing',
'Products.PloneFormGen',
'collective.js.galleria',
],
},
entry_points="""
Expand Down
5 changes: 5 additions & 0 deletions src/collective/cover/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class ICoverLayer(Interface):
"""


class IGalleriaCarouselsLayer(ICoverLayer):
""" A layer indicating that Galleria Carousels are to be used in this add-on.
"""


class ICover(form.Schema):

"""A composable page."""
Expand Down
12 changes: 12 additions & 0 deletions src/collective/cover/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:zcml="http://namespaces.zope.org/zcml"
i18n_domain="collective.cover"
>

Expand All @@ -13,6 +14,15 @@
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
zcml:condition="installed collective.js.galleria"
name="galleriacarousel"
title="collective.cover: using deprecated galleria carousel tile"
directory="profiles/galleriacarousel"
description="Enable Cycle2 Carousel Tiles in collective.cover"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="uninstall"
title="collective.cover uninstall"
Expand Down Expand Up @@ -111,4 +121,6 @@
/>
</genericsetup:upgradeSteps>

<include package=".upgrades" />

</configure>
5 changes: 5 additions & 0 deletions src/collective/cover/profiles/default/browserlayer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
<layers>
<layer name="collective.cover"
interface="collective.cover.interfaces.ICoverLayer" />

<!-- Reinstalling the product should revert to Cycle2 carousels -->
<layer name="collective.cover.galleriacarousels"
interface="collective.cover.interfaces.IGalleriaCarouselsLayer"
remove="True"/>
</layers>
2 changes: 1 addition & 1 deletion src/collective/cover/profiles/default/jsregistry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<javascript id="++resource++collective.cover/jquery.endless-scroll.js"
cacheable="True" compression="none" cookable="True" enabled="True"
expression="" inline="False" authenticated="True" />
</object>
</object>
4 changes: 2 additions & 2 deletions src/collective/cover/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<metadata>
<version>9</version>
<version>10</version>
<dependencies>
<dependency>profile-collective.js.galleria:default</dependency>
<dependency>profile-collective.js.cycle2:default</dependency>
<dependency>profile-collective.js.jqueryui:default</dependency>
<dependency>profile-plone.app.blocks:default</dependency>
<dependency>profile-plone.app.dexterity:default</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<layers>
<layer name="collective.cover.galleriacarousels"
interface="collective.cover.interfaces.IGalleriaCarouselsLayer" />
</layers>
8 changes: 8 additions & 0 deletions src/collective/cover/profiles/galleriacarousel/jsregistry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<object name="portal_javascripts">
<!-- These are not required if we are using Galleria for carousels -->
<javascript id="++resource++collective.cover/cycle2-theme/jquery.cycle2.js"
remove="True" />
<javascript id="++resource++collective.cover/cycle2-theme/jquery.cycle2.swipe.min.js"
remove="True" />
</object>
8 changes: 8 additions & 0 deletions src/collective/cover/profiles/galleriacarousel/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<metadata>
<version>1</version>
<dependencies>
<dependency>profile-collective.cover:default</dependency>
<dependency>profile-collective.js.galleria:default</dependency>
</dependencies>
</metadata>
10 changes: 10 additions & 0 deletions src/collective/cover/profiles/uninstall/browserlayer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<layers>
<layer name="collective.cover"
interface="collective.cover.interfaces.ICoverLayer"
remove="True" />

<layer name="collective.cover.galleriacarousels"
interface="collective.cover.interfaces.IGalleriaCarouselsLayer"
remove="True" />
</layers>
2 changes: 1 addition & 1 deletion src/collective/cover/static/cover.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
background-color:#000;
opacity: 0.6 !important;
display: none;
z-index: 99;
z-index: 120;
}
.loading-mask.show {
display:block;
Expand Down
62 changes: 62 additions & 0 deletions src/collective/cover/static/cycle2-theme/cycle2.cover_theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* Prev/Next arrows */
.cycle-prev, .cycle-next {
cursor: pointer;
height: 100%;
opacity: 0.7;
position: absolute;
top: 0;
width: 8%;
z-index: 110;
}
.cycle-prev {
background: url("++resource++collective.cover/cycle2-theme/prev-arrow.png") no-repeat scroll 10% 50% rgba(0, 0, 0, 0);
left: 0;
padding-right: 17%;
}
.cycle-next {
background: url("++resource++collective.cover/cycle2-theme/next-arrow.png") no-repeat scroll 90% 50% rgba(0, 0, 0, 0);
right: 0;
padding-left: 17%;
}
.cycle-prev:hover, .cycle-next:hover {
opacity: 1;
}

.cycle-pager-container {
position: absolute;
bottom: 0;
width: 100%;
z-index: 110;
text-align: center;
}
.cycle-pager {
display: inline-block;
margin: 0 auto;
padding: 8px;
}
.cycle-pager span {
background: url("++resource++collective.cover/cycle2-theme/dot.png") no-repeat;
display: inline-block;
font-size: 0;
height: 16px;
opacity: 0.6;
width: 16px;
}
.cycle-pager > span {
cursor: pointer;
}
.cycle-pager .cycle-pager-active {
opacity: 1;
}
.contentActions {
z-index: 130;
}

/* Stop Flash of unstyled content */
.cycle2-carousel .slide {
display: none;
}

.cycle2-carousel .cycle-pager + .slide {
display: block;
}
Binary file added src/collective/cover/static/cycle2-theme/dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 28 additions & 1 deletion src/collective/cover/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def setUpZope(self, app, configurationContext):
import collective.cover
self.loadZCML(package=collective.cover)

if 'virtual_hosting' not in app.objectIds():
if ('virtual_hosting' not in app.objectIds() and
'VHM' not in app.objectIds()):
# If ZopeLite was imported, we have no default virtual
# host monster
from Products.SiteAccess.VirtualHostMonster \
Expand Down Expand Up @@ -160,6 +161,27 @@ def setUpZope(self, app, configurationContext):
sm.registerUtility(newgrid, name='bootstrap3')


class GalleriaFixture(Fixture):

defaultBases = (FIXTURE,)

def setUpZope(self, app, configurationContext):

# Load ZCML
pkg_resources.get_distribution('collective.js.galleria')
import collective.js.galleria
self.loadZCML(package=collective.js.galleria)
z2.installProduct(app, 'collective.js.galleria')

super(GalleriaFixture, self).setUpZope(app, configurationContext)

def setUpPloneSite(self, portal):

super(GalleriaFixture, self).setUpPloneSite(portal)
# Install extra Generic Setup profile
self.applyProfile(portal, 'collective.cover:galleriacarousel')


INTEGRATION_TESTING = IntegrationTesting(
bases=(FIXTURE,),
name='collective.cover:Integration',
Expand All @@ -179,3 +201,8 @@ def setUpZope(self, app, configurationContext):
ROBOT_TESTING = FunctionalTesting(
bases=(FIXTURE, AUTOLOGIN_LIBRARY_FIXTURE, z2.ZSERVER_FIXTURE),
name='collective.cover:Robot')

GALLERIA_FIXTURE = GalleriaFixture()
GALLERIA_FUNCTIONAL_TESTING = FunctionalTesting(
bases=(GALLERIA_FIXTURE, AUTOLOGIN_LIBRARY_FIXTURE, z2.ZSERVER_FIXTURE),
name='collective.cover:GalleriaFunctional')
45 changes: 22 additions & 23 deletions src/collective/cover/tests/test_carousel_tile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Suite Teardown Close all browsers

${carousel_tile_location} "collective.cover.carousel"
${document_selector} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Document"]/span[text()='My document']/..
${image_selector} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image']/..
${image_selector2} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image1']/..
${image_selector1} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image1']/..
${image_selector2} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image2']/..
${tile_selector} div.tile-container div.tile
${autoplay_id} collective-cover-carousel-autoplay-0
${edit_link_selector} a.edit-tile-link
Expand All @@ -21,7 +21,8 @@ ${edit_link_selector} a.edit-tile-link
Get Total Carousel Images
[Documentation] Total number of images in carousel is stored in this
... element
${return} = Get Matching XPath Count //div[@class="galleria-stage"]//div[@class="galleria-image"]/img
# Note: we are a bit lazy about adding concat here, but then how long do you want this line to be?
${return} = Get Matching XPath Count //div[contains(@class,"cycle2-carousel")]//div[contains(concat(" ", @class," "), " slide ") and not(contains(@class, "sentinel"))]
[Return] ${return}

*** Test cases ***
Expand All @@ -45,19 +46,18 @@ Test Carousel Tile
# drag&drop an Image
Open Content Chooser
Click Element link=Content tree
Drag And Drop xpath=${image_selector} css=${tile_selector}
# The carousel was previously empty, so autoplay=false, so we might not see the carousel updated
# Wait Until Page Contains Test image
# Page Should Contain This image was created for testing purposes

# move to the default view and check tile persisted
Click Link link=View
Wait Until Page Contains Test image
Page Should Contain This image was created for testing purposes
Drag And Drop xpath=${image_selector1} css=${tile_selector}
Wait Until Page Contains Test image #1
Page Should Contain This image #1 was created for testing purposes
# we have 1 image in the carousel
${images} = Get Total Carousel Images
Should Be Equal '${images}' '1'

# move to the default view and check tile persisted
Click Link link=View
Wait Until Page Contains Test image #1
Page Should Contain This image #1 was created for testing purposes

# drag&drop another Image
Compose Cover
Sleep 1s Wait for carousel to load
Expand All @@ -70,8 +70,8 @@ Test Carousel Tile
# move to the default view and check tile persisted
Click Link link=View
Sleep 5s Wait for carousel to load
Wait Until Page Contains Test image #1
Page Should Contain This image #1 was created for testing purposes
Wait Until Page Contains Test image #2
Page Should Contain This image #2 was created for testing purposes
# we now have 2 images in the carousel
${images} = Get Total Carousel Images
Should Be Equal '${images}' '2'
Expand All @@ -84,14 +84,13 @@ Test Carousel Tile

Drag And Drop xpath=${document_selector} css=${tile_selector}

# No point to test Documents - they are not used in carousel
# see: https://github.com/collective/collective.cover/commit/8df37e04d7299a0cb1a90e9f0a8ace746859c49c
# Documents are (at least slightly) revived in Carousel thanks to Cycle2
Click Link link=View
#Wait Until Page Contains My document
#Page Should Contain This document was created for testing purposes
Wait Until Page Contains My document
Page Should Contain This document was created for testing purposes

# carousel autoplay is enabled
Page Should Contain options.autoplay = true;
Page Should Contain Element xpath=//div[contains(@class,"cycle2-carousel") and @data-cycle-paused="false"]

# edit the tile
Compose Cover
Expand All @@ -100,12 +99,12 @@ Test Carousel Tile
# disable carousel autoplay
Unselect Checkbox ${autoplay_id}
Click Button Save
Wait Until Page Contains Test image
Page Should Contain This image was created for testing purposes
Wait Until Page Contains Test image #1
Page Should Contain This image #1 was created for testing purposes

# carousel autoplay is now disabled. Sometimes we need to reload the page.
Compose Cover
Page Should Contain options.autoplay = false;
Reload Page
Page Should Contain Element xpath=//div[contains(@class,"cycle2-carousel") and @data-cycle-paused="true"]

# delete the tile
Edit Cover Layout
Expand Down
Loading