Skip to content

Commit

Permalink
fixed lightbox, added missing min file, fixed some styling
Browse files Browse the repository at this point in the history
  • Loading branch information
santonelli committed Jan 21, 2016
1 parent ed24377 commit 5def9c8
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 55 deletions.
12 changes: 9 additions & 3 deletions src/operun/gallery/browser/static/gallery.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
/* import lightbox less */
@import "lightbox.less";

#gallery {
overflow: auto;
width: 100%;
height: auto;
margin-bottom: 30px;
}

.gallery-image img {
width: 100%;
height: 100%;
}

.lightbox a:focus,
.lightbox a:hover,
.lightbox a:active {
outline: none !important;
}
10 changes: 5 additions & 5 deletions src/operun/gallery/browser/static/lightbox.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Preload images */
body:after {
content: url(../images/close.png) url(../images/loading.gif) url(../images/prev.png) url(../images/next.png);
content: url(++resource++operun.gallery/images/close.png) url(++resource++operun.gallery/images/loading.gif) url(++resource++operun.gallery/images/prev.png) url(++resource++operun.gallery/images/next.png);
display: none;
}

Expand Down Expand Up @@ -75,7 +75,7 @@ body.lb-disable-scrolling {
width: 32px;
height: 32px;
margin: 0 auto;
background: url(../images/loading.gif) no-repeat;
background: url(++resource++operun.gallery/images/loading.gif) no-repeat;
}

.lb-nav {
Expand Down Expand Up @@ -106,7 +106,7 @@ body.lb-disable-scrolling {
width: 34%;
left: 0;
float: left;
background: url(../images/prev.png) left 48% no-repeat;
background: url(++resource++operun.gallery/images/prev.png) left 48% no-repeat;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-webkit-transition: opacity 0.6s;
Expand All @@ -124,7 +124,7 @@ body.lb-disable-scrolling {
width: 64%;
right: 0;
float: right;
background: url(../images/next.png) right 48% no-repeat;
background: url(++resource++operun.gallery/images/next.png) right 48% no-repeat;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-webkit-transition: opacity 0.6s;
Expand Down Expand Up @@ -188,7 +188,7 @@ body.lb-disable-scrolling {
float: right;
width: 30px;
height: 30px;
background: url(../images/close.png) top right no-repeat;
background: url(++resource++operun.gallery/images/close.png) top right no-repeat;
text-align: right;
outline: none;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
Expand Down
79 changes: 35 additions & 44 deletions src/operun/gallery/browser/templates/gallery.pt
Original file line number Diff line number Diff line change
@@ -1,47 +1,38 @@
<html i18n:domain="plone"
lang="en"
metal:use-macro="context/main_template/macros/master"
xml:lang="en"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns="http://www.w3.org/1999/xhtml">

<body>

<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core" tal:define="toc context/table_of_contents|nothing;">

<div id="parent-fieldname-text"
tal:condition="exists:context/text"
tal:content="structure python:context.text.output_relative_to(view.context)"
tal:attributes="class python: toc and 'pat-autotoc' or ''"/>

<section id="gallery" tal:define="images view/images" tal:condition="images">
<div class="col-xs-4 col-sm-3" tal:repeat="image images">
<div class="gallery-image">
<!-- <div class="image-title">
<h2 tal:content="image/title">Teaser Title</h2>
</div> -->
<a href="" tal:attributes="href image/url;data-title image/title" data-lightbox="image" data-title=""></a>
</div>
</div>
</section>

</metal:content-core>
</metal:content-core>

<script type="text/javascript">

require([
'jquery',
'lightbox',
], function ($) {
'use strict';

})
</script>

</body>
lang="en"
metal:use-macro="context/main_template/macros/master"
xml:lang="en"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns="http://www.w3.org/1999/xhtml">

<body>
<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core" tal:define="toc context/table_of_contents|nothing;">

<div id="parent-fieldname-text"
tal:condition="exists:context/text"
tal:content="structure python:context.text.output_relative_to(view.context)"
tal:attributes="class python: toc and 'pat-autotoc' or ''"/>

<div class="row" id="gallery" tal:define="images view/images" tal:condition="images">
<div class="col-xs-4 col-sm-3" tal:repeat="image images">
<div class="gallery-image">
<div class="image-title">
<h2 tal:content="image/title">Teaser Title</h2>
</div>
<a href="" data-lightbox="" data-title="" tal:attributes="href image/url;
data-lightbox context/id;
data-title image/title">
<img tal:replace="structure image/image"/>
</a>
</div>
</div>
</div>

</metal:content-core>
</metal:content-core>
</body>

</html>
3 changes: 0 additions & 3 deletions src/operun/gallery/profiles/default/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<records interface='Products.CMFPlone.interfaces.IResourceRegistry' prefix="plone.resources/lightbox">
<value key="js">++resource++operun.gallery/lightbox.js</value>
<value key="deps">jquery</value>
<value key="css">
<element>++resource++operun.gallery/lightbox.less</element>
</value>
</records>

<records interface='Products.CMFPlone.interfaces.IResourceRegistry' prefix="plone.resources/gallery">
Expand Down

0 comments on commit 5def9c8

Please sign in to comment.