Commit 0efb2cac authored by llaffont's avatar llaffont
Browse files

On peut maintenant faire défilement manuellement les diaporamas

parent 000e8488
......@@ -374,25 +374,8 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_BaseHelper {
* @return ZendAfi_View_Helper_Accueil_BibNumerique
*/
public function renderSlideShowScriptsOn($script_loader, $selector, $options=null) {
$cycle_options = array('pause' => 1,
'fx' => 'fade');
if (array_isset('op_transition', $this->preferences)
&& in_array($this->preferences['op_transition'],
array('fade', 'shuffle', 'scrollHorz')))
$cycle_options['fx'] = $this->preferences['op_transition'];
if (array_isset('op_timeout', $this->preferences))
$cycle_options['timeout'] = 1000 * $this->preferences['op_timeout'];
if ($options)
$cycle_options = array_merge($cycle_options, $options);
$script_loader
->addScript(URL_JAVA . 'diaporama/jquery.cycle.all.min')
->addJQueryReady(sprintf(
'$(\'%s\').cycle(%s);',
$selector,
json_encode($cycle_options)));
return $this;
$this->view->getHelper('TagSlideshow')
->setPreferences($this->preferences)
->renderSlideShowScriptsOn($script_loader, $selector, $options);
}
}
......@@ -59,7 +59,7 @@ class ZendAfi_View_Helper_TagSlideshow extends Zend_View_Helper_HtmlElement {
if (!$this->_album)
return $this;
return $this->renderSlideShowScriptsOn(
return $this->renderSlideShowScriptsOn(Class_ScriptLoader::getInstance(),
sprintf('div.slideshow-%d .medias',
$this->_album->getId()),
array('width' => $this->_preferences['op_largeur_img'],
......@@ -71,10 +71,10 @@ class ZendAfi_View_Helper_TagSlideshow extends Zend_View_Helper_HtmlElement {
* @param Class_Album $album
* @return ZendAfi_View_Helper_Accueil_BibNumerique
*/
public function renderSlideShowScriptsOn($selector, $options=null) {
public function renderSlideShowScriptsOn($script_loader, $selector, $options=null) {
$cycle_options = array('pause' => 1,
'fx' => 'fade');
if (array_isset('op_transition', $this->_preferences)
if (array_isset('op_transition', $this->_preferences)
&& in_array($this->_preferences['op_transition'], array('fade', 'shuffle', 'scrollHorz')))
$cycle_options['fx'] = $this->_preferences['op_transition'];
......@@ -84,10 +84,22 @@ class ZendAfi_View_Helper_TagSlideshow extends Zend_View_Helper_HtmlElement {
if ($options)
$cycle_options = array_merge($cycle_options, $options);
Class_ScriptLoader::getInstance()
$script_loader
->addScript(URL_JAVA . 'diaporama/jquery.cycle.all.min')
->addJQueryReady(sprintf(
'$(\'%s\').cycle(%s);',
'$(\'%s\').cycle(%s);
var container = $(\'%1$s\').parent();
container.addClass(\'slideshow\');
container.prepend(\'<div class="controls"><a href="#"></a><a href="#"></a></div>\');
container.find(\'.controls a:first-child\').click(
function(event){
event.preventDefault();
$(\'%1$s\').cycle(\'prev\') } );
container.find(\'.controls a + a\').click(
function(event){
event.preventDefault();
$(\'%1$s\').cycle(\'next\') } );
container.find(\'.controls a\').css(\'top\', (container.parent().height()/3)+\'px\')',
$selector,
json_encode($cycle_options)))
->loadPrettyPhoto();
......@@ -104,7 +116,7 @@ class ZendAfi_View_Helper_TagSlideshow extends Zend_View_Helper_HtmlElement {
$html = sprintf('<div class="slideshow slideshow-%d">'.
'<h2></h2>'.
'<div class="medias">%s</div>'.
'<div class="medias">%s</div>'.
'<p></p>'.
'</div>',
$this->_album->getId(),
......
......@@ -34,7 +34,7 @@ a {
float: right;
position: relative;
height: 0px;
z-index: 5;
z-index: 100;
}
div#header .boiteBanniereGauche {
......@@ -869,4 +869,39 @@ div.ui-sortable-placeholder {
max-height: 200px;
cursor: move;
overflow: hidden;
}
\ No newline at end of file
}
.slideshow .controls {
width: 100%;
height: 0px;
overflow: visible;
position: relative;
}
.slideshow .controls a {
display: block;
width: 20px;
height: 80px;
z-index: 100;
position: absolute;
}
.slideshow .controls a:first-child {
background: transparent url(../java/slide_show/arrow_left.gif) center center no-repeat;
}
.slideshow .controls a:first-child:hover {
background-image: url(../java/slide_show/arrow_left_over.gif);
}
.slideshow .controls a:last-child {
right: 0px;
background: transparent url(../java/slide_show/arrow_right.gif) center center no-repeat;
}
.slideshow .controls a:last-child:hover {
background-image: url(../java/slide_show/arrow_right_over.gif);
}
public/opac/java/slide_show/arrow_right.gif

250 Bytes | W: | H:

public/opac/java/slide_show/arrow_right.gif

232 Bytes | W: | H:

public/opac/java/slide_show/arrow_right.gif
public/opac/java/slide_show/arrow_right.gif
public/opac/java/slide_show/arrow_right.gif
public/opac/java/slide_show/arrow_right.gif
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment