From 1aa311efe07565a696b25f92810515d5d11db958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Fri, 7 Mar 2014 11:22:57 +0100 Subject: [PATCH 01/29] Added options `loop`, `centerContent` and carousel settings --- dca/tl_content.php | 155 ++++++++++++++++------- dca/tl_module.php | 82 ++++++++++-- languages/de/tl_content.php | 66 +--------- languages/de/tl_module.php | 23 +++- languages/en/tl_content.php | 66 +--------- languages/en/tl_module.php | 23 +++- src/MadeYourDay/Contao/Module/Slider.php | 28 +++- 7 files changed, 259 insertions(+), 184 deletions(-) diff --git a/dca/tl_content.php b/dca/tl_content.php index c21eb00..c692f06 100644 --- a/dca/tl_content.php +++ b/dca/tl_content.php @@ -12,17 +12,18 @@ * @author Martin Auswöger */ -/** - * Dynamically add the parent table - */ +// Dynamically add the parent table if (Input::get('do') == 'rocksolid_slider') { $GLOBALS['TL_DCA']['tl_content']['config']['ptable'] = 'tl_rocksolid_slide'; } -$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_slider'] = '{type_legend},type,headline;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_autoplay,rsts_videoAutoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_navType,rsts_controls,rsts_scaleMode,rsts_deepLinkPrefix,rsts_keyboard,rsts_captions;{template_legend:hide},rsts_template,imgSize;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; +// Load module language file +$this->loadLanguageFile('tl_module'); + +$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_slider'] = '{type_legend},type,headline;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_scaleMode,rsts_captions;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_prevNextSteps,rsts_slideMinSize,rsts_visibleArea,rsts_combineNavItems;{template_legend:hide},rsts_template,size;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_id'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_id'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_id'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => array('MadeYourDay\\Contao\\Slider', 'getSliderIds'), @@ -30,7 +31,7 @@ 'sql' => "int(10) unsigned NOT NULL default '0'", ); $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_template'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_template'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_template'], 'default' => 'rsts_default', 'exclude' => true, 'inputType' => 'select', @@ -38,38 +39,62 @@ 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''", ); -// slider type (slide or fade) +// slider type (slide, side-slide or fade) $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_type'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_type'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_type'], 'exclude' => true, 'inputType' => 'select', - 'options' => array('slide' => 'slide', 'fade' => 'fade'), + 'options' => array('slide' => 'slide', 'side-slide' => 'side-slide', 'fade' => 'fade'), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); // "x" for horizontal or "y" for vertical $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_direction'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_direction'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_direction'], 'exclude' => true, 'inputType' => 'select', 'options' => array( - 'x' => $GLOBALS['TL_LANG']['tl_content']['rsts_direction_x'], - 'y' => $GLOBALS['TL_LANG']['tl_content']['rsts_direction_y'], + 'x' => $GLOBALS['TL_LANG']['tl_module']['rsts_direction_x'], + 'y' => $GLOBALS['TL_LANG']['tl_module']['rsts_direction_y'], ), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); // if true the slides get shuffled once on initialization $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_random'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_random'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_random'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50 m12'), + 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''", ); +// if true the slider loops infinitely +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_loop'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_loop'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "char(1) NOT NULL default ''", +); +// true, "x" or "y" to center the the slides content +// use the attribute data-rsts-center to set the mode per slide +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_centerContent'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array( + 'false', + 'true', + 'x', + 'y', + ), + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options'], + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); // slider skin (set this to "none" to disable the default skin) $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_skin'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_skin'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_skin'], 'exclude' => true, 'inputType' => 'select', 'options' => array( @@ -80,7 +105,7 @@ 'light', 'custom', ), - 'reference' => &$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options'], + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_skin_options'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); @@ -92,14 +117,14 @@ // - a proportion: keep a fixed proportion for the slides, e.g. "480x270" // this must not set to both dimensions $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_width'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_width'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_width'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_height'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_height'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_height'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), @@ -107,7 +132,7 @@ ); // number of slides to preload (to the left/right or top/bottom) $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_preloadSlides'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_preloadSlides'], 'exclude' => true, 'inputType' => 'select', 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9), @@ -116,15 +141,15 @@ ); // gap between the slides $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_gapSize'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), - 'sql' => "int(10) unsigned NOT NULL default '0'", + 'sql' => "varchar(64) NOT NULL default '0%'", ); // duration of the slide animation in milliseconds $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_duration'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_duration'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_duration'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), @@ -132,7 +157,7 @@ ); // false or the duration between slides in milliseconds $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_autoplay'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_autoplay'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), @@ -140,16 +165,16 @@ ); // true to autoplay videos $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_videoAutoplay'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_videoAutoplay'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50 m12'), + 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''", ); // false or the duration between user interaction and autoplay // (must be bigger than autoplay) $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_autoplayRestart'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_autoplayRestart'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), @@ -157,7 +182,7 @@ ); // displays a progress bar $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_autoplayProgress'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_autoplayProgress'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), @@ -165,7 +190,7 @@ ); // true to pause the autoplay on hover $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_pauseAutoplayOnHover'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_pauseAutoplayOnHover'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), @@ -173,43 +198,43 @@ ); // navigation type (bullets, numbers, tabs) $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_navType'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_navType'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_navType'], 'exclude' => true, 'inputType' => 'select', 'options' => array( - 'bullets' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_bullets'], - 'numbers' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_numbers'], - 'tabs' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_tabs'], - 'none' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_none'], + 'bullets' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_bullets'], + 'numbers' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_numbers'], + 'tabs' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_tabs'], + 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_none'], ), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); // false to hide the prev and next controls $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_controls'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_controls'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_controls'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50 m12'), + 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default '1'", ); // image scale mode (fit, crop, scale) // only works if width and height are not set to "auto" $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_scaleMode'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'], 'exclude' => true, 'inputType' => 'select', 'options' => array( - 'fit' => $GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_fit'], - 'crop' => $GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_crop'], - 'scale' => $GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_scale'], + 'fit' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'], + 'crop' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'], + 'scale' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'], ), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); // URL hash prefix or false to disable deep linking, e.g. "slider-" $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_deepLinkPrefix'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_deepLinkPrefix'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), @@ -217,7 +242,7 @@ ); // true to enable keyboard arrow navigation $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_keyboard'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_keyboard'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), @@ -225,7 +250,49 @@ ); // true to enable keyboard arrow navigation $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_captions'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_captions'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_captions'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "char(1) NOT NULL default '1'", +); +// maximum number of visible slides +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_slideMaxCount'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +// number of slides to navigate by clicking prev or next +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_prevNextSteps'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +// the size of the area for the visible slide (0 = 0%, 1 = 100%) +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_visibleArea'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "double unsigned NOT NULL default '0'", +); +// minimal size of one slide in px +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_slideMinSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +// combine navigation items if multiple slides are visible (default true) +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_combineNavItems'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_combineNavItems'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), @@ -233,7 +300,7 @@ ); // custom slider skin (rsts_skin gets ignored if this is set) $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_customSkin'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_customSkin'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50 clr'), @@ -241,7 +308,7 @@ ); // prefix for all RockSolid Slider specific css class names $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_cssPrefix'] = array( - 'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'], + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_cssPrefix'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), diff --git a/dca/tl_module.php b/dca/tl_module.php index 8a9cb3f..9fa822c 100644 --- a/dca/tl_module.php +++ b/dca/tl_module.php @@ -12,7 +12,7 @@ * @author Martin Auswöger */ -$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_slider'] = '{title_legend},name,headline,type;{config_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_autoplay,rsts_videoAutoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_navType,rsts_controls,rsts_scaleMode,rsts_deepLinkPrefix,rsts_keyboard,rsts_captions;{template_legend:hide},rsts_template,imgSize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_slider'] = '{title_legend},name,headline,type;{config_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_scaleMode,rsts_captions;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_prevNextSteps,rsts_slideMinSize,rsts_visibleArea,rsts_combineNavItems;{template_legend:hide},rsts_template,imgSize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_id'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_id'], @@ -31,12 +31,12 @@ 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''", ); -// slider type (slide or fade) +// slider type (slide, side-slide or fade) $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_type'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_type'], 'exclude' => true, 'inputType' => 'select', - 'options' => array('slide' => 'slide', 'fade' => 'fade'), + 'options' => array('slide' => 'slide', 'side-slide' => 'side-slide', 'fade' => 'fade'), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); @@ -57,9 +57,33 @@ 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_random'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50 m12'), + 'eval' => array('tl_class' => 'w50'), + 'sql' => "char(1) NOT NULL default ''", +); +// if true the slider loops infinitely +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_loop'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_loop'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''", ); +// true, "x" or "y" to center the the slides content +// use the attribute data-rsts-center to set the mode per slide +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_centerContent'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array( + 'false', + 'true', + 'x', + 'y', + ), + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options'], + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); // slider skin (set this to "none" to disable the default skin) $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_skin'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_skin'], @@ -113,7 +137,7 @@ 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), - 'sql' => "int(10) unsigned NOT NULL default '0'", + 'sql' => "varchar(64) NOT NULL default '0%'", ); // duration of the slide animation in milliseconds $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_duration'] = array( @@ -136,7 +160,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_videoAutoplay'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50 m12'), + 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''", ); // false or the duration between user interaction and autoplay @@ -183,7 +207,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_controls'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50 m12'), + 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default '1'", ); // image scale mode (fit, crop, scale) @@ -224,12 +248,54 @@ 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default '1'", ); +// maximum number of visible slides +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_slideMaxCount'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +// number of slides to navigate by clicking prev or next +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_prevNextSteps'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +// the size of the area for the visible slide (0 = 0%, 1 = 100%) +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_visibleArea'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "double unsigned NOT NULL default '0'", +); +// minimal size of one slide in px +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_slideMinSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +// combine navigation items if multiple slides are visible (default true) +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_combineNavItems'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_combineNavItems'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "char(1) NOT NULL default '1'", +); // custom slider skin (rsts_skin gets ignored if this is set) $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_customSkin'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_customSkin'], 'exclude' => true, 'inputType' => 'text', - 'eval' => array('tl_class' => 'w50'), + 'eval' => array('tl_class' => 'w50 clr'), 'sql' => "varchar(64) NOT NULL default ''", ); // prefix for all RockSolid Slider specific css class names diff --git a/languages/de/tl_content.php b/languages/de/tl_content.php index 15e6896..8b8fc0e 100644 --- a/languages/de/tl_content.php +++ b/languages/de/tl_content.php @@ -13,66 +13,6 @@ */ $GLOBALS['TL_LANG']['tl_content']['rocksolid_slider_legend'] = 'RockSolid Slider'; -$GLOBALS['TL_LANG']['tl_content']['rsts_id'][0] = 'Slider'; -$GLOBALS['TL_LANG']['tl_content']['rsts_id'][1] = 'Die Inhalte können unter Inhalte › RockSolid Slider verwaltet werden.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_type'][0] = 'Animationstyp'; -$GLOBALS['TL_LANG']['tl_content']['rsts_type'][1] = 'Bei "slide" bewegen sich die Elemente horizontal oder vertikal. Bei "fade" werden die Elemente überblendet.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction'][0] = 'Ausrichtung'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction'][1] = 'Ausrichtung der Slide-Bewegung (nur für Animationstyp "slide").'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction_x'] = 'Horizontal'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction_y'] = 'Vertikal'; -$GLOBALS['TL_LANG']['tl_content']['rsts_random'][0] = 'Zufällige Sortierung'; -$GLOBALS['TL_LANG']['tl_content']['rsts_random'][1] = 'Wenn aktiviert werden die einzelnen Slides beim Start zufällig sortiert.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin'][0] = 'Slider-Skin'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin'][1] = 'Wählen Sie einen der mitgelieferten Skins oder verwenden Sie Ihren eigenen.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options'][''] = 'Standard'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['default-content'] = 'Standard Inhalt'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['liquid'] = 'Liquid'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['dark'] = 'Dark'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['light'] = 'Light'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['custom'] = 'eigener Skin (siehe Experten-Einstellungen)'; -$GLOBALS['TL_LANG']['tl_content']['rsts_width'][0] = 'Breite'; -$GLOBALS['TL_LANG']['tl_content']['rsts_width'][1] = 'Mögliche Werte: "css", "auto", eine CSS-Längen-Angabe oder eine Proportion (z.B.: 640x360). Bei "css" wird die Breite aus dem Stylesheet übernommen.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_height'][0] = 'Höhe'; -$GLOBALS['TL_LANG']['tl_content']['rsts_height'][1] = 'Mögliche Werte: "css", "auto", eine CSS-Längen-Angabe oder eine Proportion (z.B.: 640x360). Bei "css" wird die Höhe aus dem Stylesheet übernommen.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'][0] = 'Slides vorausladen'; -$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'][1] = 'Anzahl der Slides die vorausgeladen werden sollen.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'][0] = 'Slide-Abstand'; -$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'][1] = 'Abstand zwischen den einzelnen Slider-Elementen in Pixeln.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_duration'][0] = 'Animationsdauer'; -$GLOBALS['TL_LANG']['tl_content']['rsts_duration'][1] = 'Dauer der Animation in Millisekunden (0 für die Standarddauer).'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'][0] = 'Autoplaydauer'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'][1] = 'Autoplay-Wartezeit zwischen den Slide-Vorgängen in Millisekunden (0 für kein Autoplay).'; -$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'][0] = 'Video-Autoplay'; -$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'][1] = 'Videos automatisch starten sobald sie angezeigt werden.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'][0] = 'Autoplay-Neustart-Dauer'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'][1] = 'Wartezeit bis ein Autoplay-Vorgang nach einer Benutzer-Interaktion erneut gestartet wird (muss größer als die Autoplay-Dauer sein oder 0 für keinen Autoplay-Neustart).'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'][0] = 'Autoplay-Fortschrittsbalken'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'][1] = 'Zeigt den aktuellen Autoplay-Status als Fortschrittsbalken an.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'][0] = 'Autoplay bei hover pausieren'; -$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'][1] = 'Autoplay pausieren sobald man die Maus über den Slider bewegt.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType'][0] = 'Navigationstyp'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType'][1] = 'Wählen Sie den gewünschten Navigations-Typ.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_bullets'] = 'Punkte'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_numbers'] = 'Nummeriert'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_tabs'] = 'Tabs'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_none'] = 'Navigation ausblenden'; -$GLOBALS['TL_LANG']['tl_content']['rsts_controls'][0] = 'Weiter und Zurück anzeigen'; -$GLOBALS['TL_LANG']['tl_content']['rsts_controls'][1] = 'Aktiviert die Navigationspfeile.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'][0] = 'Skalierungsmodus'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'][1] = 'Achtung: Hat keine Auswirkung wenn Höhe oder Breite auf "auto" gesetzt ist.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_fit'] = 'Proportional'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_crop'] = 'Beschneiden'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_scale'] = 'Verzerren'; -$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'][0] = 'Deep-Link-Prefix'; -$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'][1] = 'Beispiel: "slide-". Tragen Sie ein Prefix ein um Deep-Linking zu aktivieren.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'][0] = 'Tastaturnavigation aktivieren'; -$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'][1] = 'Bei aktivierter Tastatur-Navigation kann der Slider mit den Pfeiltasten gesteuert werden.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_captions'][0] = 'Titel in Slides anzeigen'; -$GLOBALS['TL_LANG']['tl_content']['rsts_captions'][1] = 'Zeigt die Titel der Slides als Überschriften an.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_template'][0] = 'Template'; -$GLOBALS['TL_LANG']['tl_content']['rsts_template'][1] = 'Slider-Template auswählen.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'][0] = 'Eigener Slider-Skin'; -$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'][1] = 'Geben Sie den Namen Ihres Skins ein. Weitere Informationen dazu finden Sie in der Dokumentation.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'][0] = 'CSS-Prefix'; -$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'][1] = 'Warnung: Nur bei Bedarf ändern! Lassen Sie das Feld leer um das Standard-Prefix "rsts-" zu verwenden.'; +$GLOBALS['TL_LANG']['tl_content']['rsts_carousel_legend'] = 'Karussell-Einstellungen'; +$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay_legend'] = 'Autoplay-Einstellungen'; +$GLOBALS['TL_LANG']['tl_content']['rsts_navigation_legend'] = 'Navigations-Einstellungen'; diff --git a/languages/de/tl_module.php b/languages/de/tl_module.php index 99e8331..945448d 100644 --- a/languages/de/tl_module.php +++ b/languages/de/tl_module.php @@ -12,6 +12,9 @@ * @author Martin Auswöger */ +$GLOBALS['TL_LANG']['tl_module']['rsts_carousel_legend'] = 'Karussell-Einstellungen'; +$GLOBALS['TL_LANG']['tl_module']['rsts_autoplay_legend'] = 'Autoplay-Einstellungen'; +$GLOBALS['TL_LANG']['tl_module']['rsts_navigation_legend'] = 'Navigations-Einstellungen'; $GLOBALS['TL_LANG']['tl_module']['rsts_id'][0] = 'Slider'; $GLOBALS['TL_LANG']['tl_module']['rsts_id'][1] = 'Die Inhalte können unter Inhalte › RockSolid Slider verwaltet werden.'; $GLOBALS['TL_LANG']['tl_module']['rsts_type'][0] = 'Animationstyp'; @@ -22,6 +25,14 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_direction_y'] = 'Vertikal'; $GLOBALS['TL_LANG']['tl_module']['rsts_random'][0] = 'Zufällige Sortierung'; $GLOBALS['TL_LANG']['tl_module']['rsts_random'][1] = 'Wenn aktiviert werden die einzelnen Slides beim Start zufällig sortiert.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_loop'][0] = 'Endlosschleife'; +$GLOBALS['TL_LANG']['tl_module']['rsts_loop'][1] = 'Wenn aktiviert erscheint nach dem letzen Slide wieder der Erste.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent'][0] = 'Inhalt zentrieren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent'][1] = 'Zentriert den Inhalt der Slides horizontal und/oder vertikal.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['false'] = 'Nicht zentrieren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['x'] = 'Horizontal zentrieren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['y'] = 'Vertikal zentrieren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['true'] = 'Horizontal und vertikal zentrieren'; $GLOBALS['TL_LANG']['tl_module']['rsts_skin'][0] = 'Slider-Skin'; $GLOBALS['TL_LANG']['tl_module']['rsts_skin'][1] = 'Wählen Sie einen der mitgelieferten Skins oder verwenden Sie Ihren eigenen.'; $GLOBALS['TL_LANG']['tl_module']['rsts_skin_options'][''] = 'Standard'; @@ -37,7 +48,7 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_preloadSlides'][0] = 'Slides vorausladen'; $GLOBALS['TL_LANG']['tl_module']['rsts_preloadSlides'][1] = 'Anzahl der Slides die vorausgeladen werden sollen.'; $GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'][0] = 'Slide-Abstand'; -$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'][1] = 'Abstand zwischen den einzelnen Slider-Elementen in Pixeln.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'][1] = 'Abstand zwischen den einzelnen Slider-Elementen in Pixeln oder Prozent.'; $GLOBALS['TL_LANG']['tl_module']['rsts_duration'][0] = 'Animationsdauer'; $GLOBALS['TL_LANG']['tl_module']['rsts_duration'][1] = 'Dauer der Animation in Millisekunden (0 für die Standarddauer).'; $GLOBALS['TL_LANG']['tl_module']['rsts_autoplay'][0] = 'Autoplaydauer'; @@ -69,6 +80,16 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_keyboard'][1] = 'Bei aktivierter Tastatur-Navigation kann der Slider mit den Pfeiltasten gesteuert werden.'; $GLOBALS['TL_LANG']['tl_module']['rsts_captions'][0] = 'Titel in Slides anzeigen'; $GLOBALS['TL_LANG']['tl_module']['rsts_captions'][1] = 'Zeigt die Titel der Slides als Überschriften an.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'][0] = 'Anzahl Slides'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'][1] = 'Die Anzahl der Slides die gleichzeitig sichtbar sein sollen.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'][0] = 'Navigationsschritte'; +$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'][1] = 'Die Anzahl der Slides um die sich der Slider vor oder zurück bewegen soll.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'][0] = 'Mindestbreite der Slides'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'][1] = 'Die minimale Breite eines Slides in Pixel. Diese Einstellung hat Vorrang gegenüber der eingestellten Slide-Anzahl.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'][0] = 'Sichtbarer Bereich'; +$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'][1] = 'Zwischen 1% und 100%. Unter 100% wird der nächste und der vorherige Slide teilweise sichtbar.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_combineNavItems'][0] = 'Navigationspunkte zusammenfassen'; +$GLOBALS['TL_LANG']['tl_module']['rsts_combineNavItems'][1] = 'Fasst die Navigationspunkte zusammen wenn mehr als ein Slide angezeigt wird.'; $GLOBALS['TL_LANG']['tl_module']['rsts_template'][0] = 'Template'; $GLOBALS['TL_LANG']['tl_module']['rsts_template'][1] = 'Slider-Template auswählen.'; $GLOBALS['TL_LANG']['tl_module']['rsts_customSkin'][0] = 'Eigener Slider-Skin'; diff --git a/languages/en/tl_content.php b/languages/en/tl_content.php index faf8593..9edf982 100644 --- a/languages/en/tl_content.php +++ b/languages/en/tl_content.php @@ -13,66 +13,6 @@ */ $GLOBALS['TL_LANG']['tl_content']['rocksolid_slider_legend'] = 'RockSolid Slider'; -$GLOBALS['TL_LANG']['tl_content']['rsts_id'][0] = 'Slider'; -$GLOBALS['TL_LANG']['tl_content']['rsts_id'][1] = 'Edit the content at Content › RockSolid Slider.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_type'][0] = 'Animation type'; -$GLOBALS['TL_LANG']['tl_content']['rsts_type'][1] = '"Slide" moves the elements vertically and horizontally. "Fade" uses a change-over effect.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction'][0] = 'Direction'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction'][1] = 'Direction of the slide animation (only for animation type "slide").'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction_x'] = 'Horizontal'; -$GLOBALS['TL_LANG']['tl_content']['rsts_direction_y'] = 'Vertical'; -$GLOBALS['TL_LANG']['tl_content']['rsts_random'][0] = 'Randomize elements'; -$GLOBALS['TL_LANG']['tl_content']['rsts_random'][1] = 'If activated slider elements are randomized at the start.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin'][0] = 'Slider skin'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin'][1] = 'Choose a preconfigured slider style or use your own.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options'][''] = 'Default'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['default-content'] = 'Default Content'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['liquid'] = 'Liquid'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['dark'] = 'Dark'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['light'] = 'Light'; -$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['custom'] = 'Individual skin (Expert settings)'; -$GLOBALS['TL_LANG']['tl_content']['rsts_width'][0] = 'Width'; -$GLOBALS['TL_LANG']['tl_content']['rsts_width'][1] = 'Possible values: "css", "auto", a css length value or a proportion (e.g. 640x360). The option "css" imports the width from the stylesheet.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_height'][0] = 'Height'; -$GLOBALS['TL_LANG']['tl_content']['rsts_height'][1] = 'Possible values: "css", "auto", a css length value or a proportion (e.g. 640x360). The option "css" imports the height from the stylesheet.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'][0] = 'Preload slides'; -$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'][1] = 'Number of slides that are preloaded.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'][0] = 'Slide distance'; -$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'][1] = 'Distance between the single slider elements in pixels.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_duration'][0] = 'Animation duration'; -$GLOBALS['TL_LANG']['tl_content']['rsts_duration'][1] = 'Duration of the animation in milliseconds (0 for default).'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'][0] = 'Autoplay duration'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'][1] = 'Autoplay delay between the slide events in milliseconds (0 to turn autoplay off).'; -$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'][0] = 'Video autoplay'; -$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'][1] = 'Start videos automatically if they are loaded.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'][0] = 'Autoplay restart duration'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'][1] = 'Delay until the autplay is restarted after a user action (value needs to be larger than the autoplay duration; 0 to turn autoplay restart off).'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'][0] = 'Autoplay progress bar'; -$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'][1] = 'Displays the autoplay progress as a bar.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'][0] = 'Pause autoplay on hover'; -$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'][1] = 'Pauses the autoplay if the mouse is placed over the slider.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType'][0] = 'Navigation type'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType'][1] = 'Choose the navigation type.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_bullets'] = 'Bullets'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_numbers'] = 'Numbers'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_tabs'] = 'Tabs'; -$GLOBALS['TL_LANG']['tl_content']['rsts_navType_none'] = 'Hide navigation'; -$GLOBALS['TL_LANG']['tl_content']['rsts_controls'][0] = 'Show next and previous arrows'; -$GLOBALS['TL_LANG']['tl_content']['rsts_controls'][1] = 'Activates the next and previous controls.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'][0] = 'Scale mode'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'][1] = 'Note: Has no effect if either width or height are set to "auto".'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_fit'] = 'Proportional'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_crop'] = 'Cut'; -$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_scale'] = 'Distort'; -$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'][0] = 'Deep link prefix'; -$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'][1] = 'Example: "slide-". Enter a prefix to activate deep links.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'][0] = 'Activate keyboard navigation'; -$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'][1] = 'If activated the arrow keys can be used to controll the slider.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_captions'][0] = 'Show slide title'; -$GLOBALS['TL_LANG']['tl_content']['rsts_captions'][1] = 'Displays the title as a headline in the slides.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_template'][0] = 'Template'; -$GLOBALS['TL_LANG']['tl_content']['rsts_template'][1] = 'Choose the slider template.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'][0] = 'Individual skin'; -$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'][1] = 'Enter the name of your skin. Take a look at the documentation for more information.'; -$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'][0] = 'CSS prefix'; -$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'][1] = 'Warning: Change only if necessary. Leave empty to use the default prefix "rsts-".'; +$GLOBALS['TL_LANG']['tl_content']['rsts_carousel_legend'] = 'Carousel Settings'; +$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay_legend'] = 'Autoplay Settings'; +$GLOBALS['TL_LANG']['tl_content']['rsts_navigation_legend'] = 'Navigation Settings'; diff --git a/languages/en/tl_module.php b/languages/en/tl_module.php index e29767b..cdd667f 100644 --- a/languages/en/tl_module.php +++ b/languages/en/tl_module.php @@ -12,6 +12,9 @@ * @author Martin Auswöger */ +$GLOBALS['TL_LANG']['tl_module']['rsts_carousel_legend'] = 'Carousel Settings'; +$GLOBALS['TL_LANG']['tl_module']['rsts_autoplay_legend'] = 'Autoplay Settings'; +$GLOBALS['TL_LANG']['tl_module']['rsts_navigation_legend'] = 'Navigation Settings'; $GLOBALS['TL_LANG']['tl_module']['rsts_id'][0] = 'Slider'; $GLOBALS['TL_LANG']['tl_module']['rsts_id'][1] = 'Edit the content at Content › RockSolid Slider.'; $GLOBALS['TL_LANG']['tl_module']['rsts_type'][0] = 'Animation type'; @@ -22,6 +25,14 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_direction_y'] = 'Vertical'; $GLOBALS['TL_LANG']['tl_module']['rsts_random'][0] = 'Randomize elements'; $GLOBALS['TL_LANG']['tl_module']['rsts_random'][1] = 'If activated slider elements are randomized at the start.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_loop'][0] = 'Loop'; +$GLOBALS['TL_LANG']['tl_module']['rsts_loop'][1] = 'If activated the last slide is followed by the first one.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent'][0] = 'Center content'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent'][1] = 'Centers the contents of the slides horizontally and/or vertically.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['false'] = 'Not centered'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['x'] = 'Horizontal'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['y'] = 'Vertical'; +$GLOBALS['TL_LANG']['tl_module']['rsts_centerContent_options']['true'] = 'Horizontal and vertical'; $GLOBALS['TL_LANG']['tl_module']['rsts_skin'][0] = 'Slider skin'; $GLOBALS['TL_LANG']['tl_module']['rsts_skin'][1] = 'Choose a preconfigured slider style or use your own.'; $GLOBALS['TL_LANG']['tl_module']['rsts_skin_options'][''] = 'Default'; @@ -37,7 +48,7 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_preloadSlides'][0] = 'Preload slides'; $GLOBALS['TL_LANG']['tl_module']['rsts_preloadSlides'][1] = 'Number of slides that are preloaded.'; $GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'][0] = 'Slide distance'; -$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'][1] = 'Distance between the single slider elements in pixels.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'][1] = 'Distance between the single slider elements in pixels or percent.'; $GLOBALS['TL_LANG']['tl_module']['rsts_duration'][0] = 'Animation duration'; $GLOBALS['TL_LANG']['tl_module']['rsts_duration'][1] = 'Duration of the animation in milliseconds (0 for default).'; $GLOBALS['TL_LANG']['tl_module']['rsts_autoplay'][0] = 'Autoplay duration'; @@ -69,6 +80,16 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_keyboard'][1] = 'If activated the arrow keys can be used to controll the slider.'; $GLOBALS['TL_LANG']['tl_module']['rsts_captions'][0] = 'Show slide title'; $GLOBALS['TL_LANG']['tl_module']['rsts_captions'][1] = 'Displays the title as a headline in the slides.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'][0] = 'Slides count'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'][1] = 'The Number of slides to display at once.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'][0] = 'Navigation steps'; +$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'][1] = 'The Number of slides by which the slider should move forward or backward.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'][0] = 'Minimal width of the slides'; +$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'][1] = 'The minimal width of a slide in pixels. This setting takes precedence over the slides count setting.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'][0] = 'Visible area'; +$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'][1] = 'Between 1% and 100%. Under 100% the next and previous slides get partially visible.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_combineNavItems'][0] = 'Combine navigation items'; +$GLOBALS['TL_LANG']['tl_module']['rsts_combineNavItems'][1] = 'Combines navigation items if more than one slide is shown.'; $GLOBALS['TL_LANG']['tl_module']['rsts_template'][0] = 'Template'; $GLOBALS['TL_LANG']['tl_module']['rsts_template'][1] = 'Choose the slider template.'; $GLOBALS['TL_LANG']['tl_module']['rsts_customSkin'][0] = 'Individual skin'; diff --git a/src/MadeYourDay/Contao/Module/Slider.php b/src/MadeYourDay/Contao/Module/Slider.php index f6f8a87..c529b62 100644 --- a/src/MadeYourDay/Contao/Module/Slider.php +++ b/src/MadeYourDay/Contao/Module/Slider.php @@ -147,7 +147,7 @@ protected function compile() foreach ($images as $key => $image) { $newImage = new \stdClass(); - $image['size'] = $this->imgSize; + $image['size'] = isset($this->imgSize) ? $this->imgSize : $this->size; $this->addImageToTemplate($newImage, $image); $images[$key] = $newImage; } @@ -171,18 +171,38 @@ protected function compile() } } + // strings / boolean + foreach (array('centerContent') as $key) { + if (! empty($this->arrData['rsts_' . $key])) { + $options[$key] = $this->arrData['rsts_' . $key]; + if ($options[$key] === 'false') { + $options[$key] = false; + } + if ($options[$key] === 'true') { + $options[$key] = true; + } + } + } + // boolean - foreach (array('random', 'videoAutoplay', 'autoplayProgress', 'pauseAutoplayOnHover', 'keyboard', 'captions', 'controls') as $key) { + foreach (array('random', 'loop', 'videoAutoplay', 'autoplayProgress', 'pauseAutoplayOnHover', 'keyboard', 'captions', 'controls', 'combineNavItems') as $key) { $options[$key] = (bool) $this->arrData['rsts_' . $key]; } // positive numbers - foreach (array('preloadSlides', 'duration', 'autoplay', 'autoplayRestart') as $key) { + foreach (array('preloadSlides', 'duration', 'autoplay', 'autoplayRestart', 'slideMaxCount', 'slideMinSize', 'prevNextSteps') as $key) { if (! empty($this->arrData['rsts_' . $key]) && $this->arrData['rsts_' . $key] > 0) { $options[$key] = $this->arrData['rsts_' . $key] * 1; } } + // percentages + foreach (array('visibleArea') as $key) { + if (!empty($this->arrData['rsts_' . $key])) { + $options[$key] = $this->arrData['rsts_' . $key] / 100; + } + } + // gap size if (isset($this->arrData['rsts_gapSize']) && $this->arrData['rsts_gapSize'] !== '') { if (substr($this->arrData['rsts_gapSize'], -1) === '%') { @@ -246,7 +266,7 @@ protected function parseSlides($objSlides) 'alt' => $meta['title'], 'imageUrl' => $meta['link'], 'caption' => $meta['caption'], - 'size' => $this->imgSize, + 'size' => isset($this->imgSize) ? $this->imgSize : $this->size, )); } From d360dd414d8ae681106f1f19dab334eac0e0f917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Mon, 10 Mar 2014 08:55:07 +0100 Subject: [PATCH 02/29] Updated XHTML template --- templates/rsts_default.xhtml | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/templates/rsts_default.xhtml b/templates/rsts_default.xhtml index 2f8b45d..7fb74d3 100644 --- a/templates/rsts_default.xhtml +++ b/templates/rsts_default.xhtml @@ -50,32 +50,6 @@ From 8830563c4cebe36a0352c339dd5a80673500d3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Mon, 10 Mar 2014 10:36:14 +0100 Subject: [PATCH 03/29] Added background settings to slides --- dca/tl_rocksolid_slide.php | 85 +++++++++++++++++++++++- languages/de/tl_rocksolid_slide.php | 23 +++++++ languages/en/tl_rocksolid_slide.php | 23 +++++++ src/MadeYourDay/Contao/Module/Slider.php | 40 +++++++++++ templates/rsts_default.html5 | 46 +++++++++++-- templates/rsts_default.xhtml | 46 +++++++++++-- 6 files changed, 250 insertions(+), 13 deletions(-) diff --git a/dca/tl_rocksolid_slide.php b/dca/tl_rocksolid_slide.php index 075d772..bf7b70e 100644 --- a/dca/tl_rocksolid_slide.php +++ b/dca/tl_rocksolid_slide.php @@ -90,7 +90,7 @@ ), 'palettes' => array( - 'default' => '{title_legend},title,videoURL,singleSRC;{publish_legend},published,start,stop', + 'default' => '{title_legend},title,videoURL,singleSRC,scaleMode,centerContent;{background_legend},backgroundImage,backgroundVideos,backgroundImageSize,backgroundScaleMode;{publish_legend},published,start,stop', ), 'fields' => array( @@ -135,6 +135,89 @@ ), 'sql' => version_compare(VERSION, '3.2', '<') ? "varchar(255) NOT NULL default ''" : "binary(16) NULL", ), + 'scaleMode' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('fit', 'crop', 'scale'), + 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes'], + 'eval' => array( + 'includeBlankOption' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default ''", + ), + 'centerContent' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array( + 'false', + 'true', + 'x', + 'y', + ), + 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents'], + 'eval' => array( + 'includeBlankOption' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default ''", + ), + 'backgroundImage' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImage'], + 'exclude' => true, + 'inputType' => 'fileTree', + 'eval' => array( + 'fieldType' => 'radio', + 'files' => true, + 'filesOnly' => true, + ), + 'sql' => version_compare(VERSION, '3.2', '<') ? "varchar(255) NOT NULL default ''" : "binary(16) NULL", + ), + 'backgroundVideos' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'], + 'exclude' => true, + 'inputType' => 'fileTree', + 'eval' => array( + 'multiple' => true, + 'fieldType' => 'checkbox', + 'orderField' => 'backgroundVideosOrder', + 'files' => true, + 'filesOnly' => true, + ), + 'sql' => "blob NULL", + ), + 'backgroundVideosOrder' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideosOrder'], + 'sql' => "blob NULL", + ), + 'backgroundImageSize' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'], + 'exclude' => true, + 'inputType' => 'imageSize', + 'options' => $GLOBALS['TL_CROP'], + 'reference' => &$GLOBALS['TL_LANG']['MSC'], + 'eval' => array( + 'rgxp' => 'digit', + 'nospace' => true, + 'helpwizard' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default ''", + ), + 'backgroundScaleMode' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('fit', 'crop', 'scale'), + 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes'], + 'eval' => array( + 'includeBlankOption' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default ''", + ), 'published' => array( 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'], 'exclude' => true, diff --git a/languages/de/tl_rocksolid_slide.php b/languages/de/tl_rocksolid_slide.php index eb0e06c..1a48e56 100644 --- a/languages/de/tl_rocksolid_slide.php +++ b/languages/de/tl_rocksolid_slide.php @@ -40,6 +40,29 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['videoURL'][1] = 'YouTube- oder Vimeo-Video-URL (http://www.youtube.com/watch?v=XXXX oder http://vimeo.com/XXXX).'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][0] = 'Bild'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][1] = 'Wählen Sie hier ein Bild aus wenn Sie einen Bild- oder Video-Slide (Vorschaubild) erstellen möchten.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][0] = 'Skalierungsmodus'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][1] = 'Skalierungsmodus des Bildes. Diese Einstellung überschreibt die Moduleinstellungen.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['fit'] = 'Proportional'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['crop'] = 'Beschneiden'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['scale'] = 'Verzerren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][0] = 'Inhalt zentrieren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][1] = 'Zentriert den Inhalt des Slides horizontal und/oder vertikal. Diese Einstellung überschreibt die Moduleinstellungen.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['false'] = 'Nicht zentrieren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['x'] = 'Horizontal zentrieren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['y'] = 'Vertikal zentrieren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['true'] = 'Horizontal und vertikal zentrieren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['background_legend'] = 'Hintergrund'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImage'][0] = 'Hintergrund-Bild'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImage'][1] = 'Wählen Sie ein Bild aus, dass im Hintergrund des Slides angezeigt werden soll.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'][0] = 'Hintergrund-Video'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'][1] = 'Wählen Sie eine oder mehrere Videodateien aus, um im Hintergrund des Slides ein Video anzuzeigen.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][0] = 'Hintergrundbild Größe'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][1] = 'Die Größe des Hintergrundbildes in Pixel.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][0] = 'Skalierungsmodus'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][1] = 'Skalierungsmodus des Hintergrundbildes bzw. des Hintergrundvideos.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['fit'] = 'Proportional'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['crop'] = 'Beschneiden'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['scale'] = 'Verzerren'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['publish_legend'] = 'Veröffentlichung'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][0] = 'Slide veröffentlichen'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][1] = 'Den Slide auf der Webseite anzeigen.'; diff --git a/languages/en/tl_rocksolid_slide.php b/languages/en/tl_rocksolid_slide.php index 69a1bbc..1dc9e60 100644 --- a/languages/en/tl_rocksolid_slide.php +++ b/languages/en/tl_rocksolid_slide.php @@ -40,6 +40,29 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['videoURL'][1] = 'YouTube- oder Vimeo-Video-URL (http://www.youtube.com/watch?v=XXXX oder http://vimeo.com/XXXX)'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][0] = 'Image'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][1] = 'Choose an image if you want to create an image slide or a video slide (preview image).'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][0] = 'Scale mode'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][1] = 'Scale mode of the image. This setting overwrites the module settings.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['fit'] = 'Proportional'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['crop'] = 'Cut'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['scale'] = 'Distort'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][0] = 'Center content'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][1] = 'Centers the contents of the slide horizontally and/or vertically. This setting overwrites the module settings.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['false'] = 'Not centered'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['x'] = 'Horizontal'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['y'] = 'Vertical'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['true'] = 'Horizontal and vertical'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['background_legend'] = 'Background'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImage'][0] = 'Background image'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImage'][1] = 'Choose an image to display it in the background of the slide.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'][0] = 'Background video'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'][1] = 'Choose one or more video files to display a video in the background of the slide.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][0] = 'Background image size'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][1] = 'The background image size in pixels.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][0] = 'Scale mode'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][1] = 'Scale mode of the background image or video.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['fit'] = 'Proportional'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['crop'] = 'Cut'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['scale'] = 'Distort'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['publish_legend'] = 'Publish'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][0] = 'Publish slide'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][1] = 'Display the slide on the website.'; diff --git a/src/MadeYourDay/Contao/Module/Slider.php b/src/MadeYourDay/Contao/Module/Slider.php index c529b62..aed5854 100644 --- a/src/MadeYourDay/Contao/Module/Slider.php +++ b/src/MadeYourDay/Contao/Module/Slider.php @@ -298,6 +298,46 @@ protected function parseSlides($objSlides) } } + if ( + trim($slide['backgroundImage']) && + ($file = version_compare(VERSION, '3.2', '<') + ? \FilesModel::findByPk($slide['backgroundImage']) + : \FilesModel::findByUuid($slide['backgroundImage']) + ) && + ($fileObject = new \File($file->path, true)) && + $fileObject->isGdImage + ) { + $meta = $this->getMetaData($file->meta, $objPage->language); + $slide['backgroundImage'] = new \stdClass; + $this->addImageToTemplate($slide['backgroundImage'], array( + 'id' => $file->id, + 'name' => $fileObject->basename, + 'singleSRC' => $file->path, + 'alt' => $meta['title'], + 'imageUrl' => $meta['link'], + 'caption' => $meta['caption'], + 'size' => $slide['backgroundImageSize'], + )); + } + else { + $slide['backgroundImage'] = null; + } + + if ($slide['backgroundVideos']) { + $videoFiles = deserialize($slide['backgroundVideos'], true); + if (version_compare(VERSION, '3.2', '<')) { + $videoFiles = \FilesModel::findMultipleByIds($videoFiles); + } + else { + $videoFiles = \FilesModel::findMultipleByUuids($videoFiles); + } + $videos = array(); + foreach ($videoFiles as $file) { + $videos[] = $file; + } + $slide['backgroundVideos'] = $videos; + } + $slides[] = $slide; } diff --git a/templates/rsts_default.html5 b/templates/rsts_default.html5 index b37886a..c43b368 100644 --- a/templates/rsts_default.html5 +++ b/templates/rsts_default.html5 @@ -20,34 +20,68 @@ slides as $slide): ?> + + - data-rsts-name="" data-rsts-type="video" data-rsts-video="" src="src ?>"> +
> + > -
data-rsts-name=""> - imgSize ?> alt="alt ?>"> +
> + imgSize ?> alt="alt ?>" > href): ?> more... caption): ?>

caption ?>

-
- data-rsts-name=""> +
> -
+ + + + imgSize ?> alt="alt ?>" data-rsts-scale-mode=""> + + +
+
diff --git a/templates/rsts_default.xhtml b/templates/rsts_default.xhtml index 7fb74d3..d9f5bc4 100644 --- a/templates/rsts_default.xhtml +++ b/templates/rsts_default.xhtml @@ -20,36 +20,70 @@ slides as $slide): ?> + + - data-rsts-name="" data-rsts-type="video" data-rsts-video="" src="src ?>" /> +
> + /> -
data-rsts-name=""> - imgSize ?> alt="alt ?>" /> +
> + imgSize ?> alt="alt ?>" /> href): ?> more... caption): ?>

caption ?>

-
- data-rsts-name=""> +
> -
+ + + + imgSize ?> alt="alt ?>" data-rsts-scale-mode="" /> + + +
+
From 8a9793ebbb2bb392743981677a81bd21b1a12dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 11 Mar 2014 11:37:33 +0100 Subject: [PATCH 04/29] Updated jQuery plugin to version 1.3.1 --- assets/js/rocksolid-slider-1.3.0.min.js | 13 -------- ...der-1.3.0.js => rocksolid-slider-1.3.1.js} | 32 +++++++++++++------ assets/js/rocksolid-slider-1.3.1.min.js | 13 ++++++++ src/MadeYourDay/Contao/Module/Slider.php | 2 +- 4 files changed, 36 insertions(+), 24 deletions(-) delete mode 100644 assets/js/rocksolid-slider-1.3.0.min.js rename assets/js/{rocksolid-slider-1.3.0.js => rocksolid-slider-1.3.1.js} (98%) create mode 100644 assets/js/rocksolid-slider-1.3.1.min.js diff --git a/assets/js/rocksolid-slider-1.3.0.min.js b/assets/js/rocksolid-slider-1.3.0.min.js deleted file mode 100644 index ffab8a5..0000000 --- a/assets/js/rocksolid-slider-1.3.0.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! rocksolid-slider v1.3.0 */ -(function(d,c,a){var b={};b.Slide=(function(){function e(i,j){var h=this;this.slider=j;this.content=d(i);this.data={name:this.content.attr("data-rsts-name")||this.content.attr("title")};if(i.nodeName==="IMG"){this.type="image"}this.type=this.content.attr("data-rsts-type")||this.type||"default";this.centerContent=this.content.attr("data-rsts-center")!==undefined?this.content.attr("data-rsts-center"):j.options.centerContent;if(this.centerContent!=="x"&&this.centerContent!=="y"){this.centerContent=!!this.centerContent}if(this.type==="image"||this.type==="video"){this.centerContent=false}this.element=d(a.createElement("div")).addClass(j.options.cssPrefix+"slide").addClass(j.options.cssPrefix+"slide-"+this.type).append(i);if(!a.createElement("video").canPlayType||this.slider.device==="iPhone"||this.slider.device==="iPod"){this.element.find("[data-rsts-background]").each(function(){if(this.nodeName!=="VIDEO"){return}var k=d(this);if(k.attr("poster")){d(a.createElement("img")).attr("src",k.attr("poster")).attr("data-rsts-background","").attr("data-rsts-scale-mode",k.attr("data-rsts-scale-mode")).insertBefore(k)}k.detach()})}this.backgrounds=this.element.find("[data-rsts-background]").attr("autoplay",true).attr("loop",true).css({position:"absolute",top:0,left:0}).prependTo(this.element);if(this.backgrounds.length){this.element.children().last().css({position:"relative"})}this.element.find("video[autoplay]").each(function(){if(this.pause){this.pause()}});if(this.type==="image"){this.data.name=this.data.name||this.element.find("img").last().attr("alt")}if(this.data.name&&j.options.captions){d(a.createElement("div")).addClass(j.options.cssPrefix+"caption").text(this.data.name).appendTo(this.element)}var g=function(){j.resize();if(j.css3Supported){j.elements.crop.css("transform","");j.elements.crop.css("transform");j.elements.crop.css("transform","translateZ(0)")}};this.element.find("img").on("load",g);this.element.find("video").on("loadedmetadata",g);var f=this.element.find("h1,h2,h3,h4,h5,h6");if(!this.data.name&&f.length){this.data.name=f.text()}if(this.type==="video"){this.data.video=this.content.attr("data-rsts-video");d(a.createElement("a")).attr("href",this.data.video).text("play").addClass(this.slider.options.cssPrefix+"video-play").on("click",function(k){k.preventDefault();h.startVideo()}).appendTo(this.element)}this.setState("inactive")}e.prototype.videoRegExp={youtube:/^https?:\/\/(?:www\.youtube\.com\/(?:watch\?v=|v\/|embed\/)|youtu\.be\/)([0-9a-z_\-]{11})(?:$|&|\/)/i,vimeo:/^https?:\/\/(?:player\.)?vimeo\.com\/(?:video\/)?([0-9]+)/i};e.prototype.isInjected=function(){return !!(this.element.get(0).parentNode&&this.element.get(0).parentNode.tagName)};e.prototype.size=function(g,i,h){var f=!g||!i;if(g&&!i){this.slider.modify(this.element,{width:g,height:""});this.resetScaledContent();if(h||this.backgrounds.length){i=this.element.outerHeight()}}else{if(i&&!g){this.slider.modify(this.element,{height:i,width:""});this.resetScaledContent();if(h||this.backgrounds.length){g=this.element.outerWidth()}}else{if(g&&i){this.slider.modify(this.element,{width:g,height:i})}else{this.resetScaledContent();g=this.element.outerWidth();i=this.element.outerHeight()}}}this.scaleContent(g,i,f);this.scaleBackground(g,i);return{x:g,y:i}};e.prototype.scaleContent=function(g,h,f){if(this.centerContent){if(this.content.css("display")==="inline"){this.content.css("display","inline-block")}if(this.centerContent!=="y"&&g){this.content.css("margin-left",Math.round((g-this.content.outerWidth())/2))}if(this.centerContent!=="x"&&h){this.content.css("margin-top",Math.round((h-this.content.outerHeight())/2))}}if(!f&&(this.type==="image"||this.type==="video")){this.scaleImage(this.element.find("img").last(),g,h)}};e.prototype.scaleBackground=function(f,h){var g=this;this.backgrounds.each(function(){g.scaleImage(d(this),f,h)})};e.prototype.scaleImage=function(k,f,m){var i=k.attr("data-rsts-scale-mode")||this.slider.options.scaleMode;var h=this.getOriginalSize(k);var l=h.x/h.y;var j=f/m;var g={width:h.x,height:h.y,"margin-left":0,"margin-top":0};if(i==="fit"||i==="crop"){if((l>=j&&i==="fit")||(l<=j&&i==="crop")){g.width=f;g.height=f/l;g["margin-top"]=(m-g.height)/2}else{g.width=m*l;g.height=m;g["margin-left"]=(f-g.width)/2}}else{if(i==="scale"){g.width=f;g.height=m}else{g["margin-top"]=(m-h.y)/2;g["margin-left"]=(f-h.x)/2}}k.css(g)};e.prototype.getOriginalSize=function(h){h=d(h);var g={};if(h[0].nodeName==="IMG"){if("naturalWidth" in new Image()){g.x=h[0].naturalWidth;g.y=h[0].naturalHeight}else{var f=new Image();f.src=h[0].src;g.x=f.width;g.y=f.height}}else{if(h[0].nodeName==="VIDEO"){g.x=h[0].videoWidth;g.y=h[0].videoHeight}}return{x:g.x||10,y:g.y||10}};e.prototype.resetScaledContent=function(f,h){var g=this.element.find("img").last();if(this.type==="image"||this.type==="video"){g.css({width:"",height:"","margin-left":"","margin-top":""})}if(this.centerContent){this.content.css({"margin-left":"","margin-top":""})}};e.prototype.setState=function(g){if(this.type==="video"&&this.state&&g==="inactive"&&g!==this.state){this.stopVideo()}if(this.type==="video"&&this.state&&g==="active"&&g!==this.state&&this.slider.options.videoAutoplay){this.startVideo()}if((g==="preactive"||g==="active")&&g!==this.state){this.element.find("video[autoplay]").each(function(){if(this.play){this.play()}})}else{if(g!=="active"&&g!=="preactive"&&(this.state==="active"||this.state==="preactive")){this.element.find("video").each(function(){if(this.pause){this.pause()}})}}this.state=g;var f=this.slider.options.cssPrefix;this.element.removeClass(f+"active").removeClass(f+"inactive").removeClass(f+"preactive").removeClass(f+"postactive").addClass(f+g)};e.prototype.stopVideo=function(g,f){if(this.eventNamespace){d(c).off("message."+this.eventNamespace);delete this.eventNamespace}if(this.videoElement){this.videoElement.attr("src","");this.videoElement.remove();delete this.videoElement}if(this.videoStopButton){this.videoStopButton.remove();delete this.videoStopButton}this.slider.elements.main.removeClass(this.slider.options.cssPrefix+"video-playing");if(g&&this.slider.options.autoplayRestart){this.slider.autoplay(200)}else{if(f){this.slider.stopAutoplay()}}};e.prototype.startVideo=function(){var f=this;var i,g,h;this.slider.stopAutoplay(true);if((h=this.data.video.match(this.videoRegExp.youtube))){this.element.addClass(this.slider.options.cssPrefix+"video-youtube");i=h[1];this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src","http://www.youtube.com/embed/"+i+"?autoplay=1&enablejsapi=1&wmode=opaque").attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element);g=function(){if(f.videoElement&&c.YT){new YT.Player(f.videoElement.get(0),{events:{onStateChange:function(j){if(j.data===YT.PlayerState.ENDED){f.stopVideo(true)}}}})}};if(c.YT&&YT.Player){g()}else{d(a.createElement("script")).attr("src","//www.youtube.com/iframe_api").appendTo(a.head);c.onYouTubeIframeAPIReady=function(){delete c.onYouTubeIframeAPIReady;g()}}}else{if((h=this.data.video.match(this.videoRegExp.vimeo))){this.element.addClass(this.slider.options.cssPrefix+"video-vimeo");i=h[1];this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src","http://player.vimeo.com/video/"+i+"?autoplay=1&api=1").attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element);this.eventNamespace="rsts"+new Date().getTime();d(c).on("message."+this.eventNamespace,function(j){var k=JSON.parse(j.originalEvent.data);if(k&&k.event){if(k.event==="ready"){f.videoElement.get(0).contentWindow.postMessage('{"method":"addEventListener","value":"finish"}',f.videoElement.attr("src").split("?")[0])}else{if(k.event==="finish"){f.stopVideo(true)}}}})}else{this.element.addClass(this.slider.options.cssPrefix+"video-unknown");this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src",this.data.video).attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element)}}if(this.slider.device==="iPad"){this.element.addClass(this.slider.options.cssPrefix+"video-ipad")}this.videoStopButton=d(a.createElement("a")).attr("href",this.data.video).text("stop").addClass(this.slider.options.cssPrefix+"video-stop").on("click",function(j){j.preventDefault();f.stopVideo(false,true)}).appendTo(this.element);this.slider.elements.main.addClass(this.slider.options.cssPrefix+"video-playing")};e.prototype.setIndex=function(f){this.data.index=f};e.prototype.getData=function(){return this.data};return e})();b.Slider=(function(){function e(i,h){var g=this;this.slides=[];this.elements={};this.elements.main=i;this.options=d.extend({},this.defaultOptions,h);if(this.options.height==="auto"&&this.options.direction==="y"){throw new Error('height "auto" with direction "y" ist not possible')}if(this.options.type!=="slide"){this.options.visibleArea=1;this.options.slideMaxCount=0;this.options.slideMinSize=0}this.checkCss3Support();this.readSlides();if(this.options.random){this.slides.sort(function(){return Math.random()-0.5})}d.each(this.slides,function(k){this.setIndex(k)});this.slideIndex=this.getIndexFromUrl();if(this.slideIndex===false){this.slideIndex=0}this.activeSlideOffset=0;d(c).on("hashchange.rsts",function(){var k=g.getIndexFromUrl();if(k!==false&&k!==g.slideIndex){g.goTo(k)}});this.elements.main.addClass(this.options.cssPrefix+"main").addClass(this.options.cssPrefix+"direction-"+this.options.direction).addClass(this.options.cssPrefix+"type-"+this.options.type).addClass(this.options.cssPrefix+"skin-"+this.options.skin);if(this.options.direction==="x"&&(this.options.height==="auto"||(this.options.height==="css"&&this.elements.main.height()<1))){this.autoSize=true}else{if(this.options.direction==="y"&&(this.options.width==="auto"||(this.options.width==="css"&&this.elements.main.width()<1))){this.autoSize=true}}var j=this.options.width.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.width}j=this.options.height.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.height}if(this.options.width&&this.options.width!=="css"){this.elements.main.css({width:this.options.width});if(this.options.width==="auto"){this.options.width="css"}}if(this.options.height&&this.options.height!=="css"){this.elements.main.css({height:this.options.height})}if(this.elements.header){this.elements.header.addClass(this.options.cssPrefix+"header").appendTo(this.elements.main)}this.elements.view=d(a.createElement("div")).addClass(this.options.cssPrefix+"view").appendTo(this.elements.main);this.elements.crop=d(a.createElement("div")).addClass(this.options.cssPrefix+"crop").on("scroll",function(){d(this).scrollLeft(0).scrollTop(0)}).appendTo(this.elements.view);this.elements.slides=d(a.createElement("div")).addClass(this.options.cssPrefix+"slides").appendTo(this.elements.crop);if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress=d(a.createElement("div")).addClass(this.options.cssPrefix+"progress").appendTo(this.elements.view);this.elements.progressBar=d(a.createElement("div")).appendTo(this.elements.progress)}if(this.options.visibleArea<1){this.elements.overlayPrev=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-prev").appendTo(this.elements.view);this.elements.overlayNext=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-next").appendTo(this.elements.view)}this.nav=new b.SliderNav(this);if(this.elements.footer){this.elements.footer.addClass(this.options.cssPrefix+"footer").appendTo(this.elements.main)}this.preloadSlides(this.slideIndex);this.cleanupSlides();d(c).on("resize.rsts",function(){g.resize()});this.resize();this.nav.combineItems();if(this.options.type==="slide"){this.setDragEvents()}else{this.modify(this.slides[this.slideIndex].element,{opacity:1})}if(this.css3Supported){this.elements.slides.on("transitionend webkitTransitionEnd oTransitionEnd msTransitionEnd",function(k){if((g.options.type==="slide"&&k.target===g.elements.slides.get(0))||(g.options.type!=="slide"&&k.target.parentNode===g.elements.slides.get(0))){g.cleanupSlides()}});this.elements.crop.css({transform:"translateZ(0)"})}this.autoplay();if(this.options.pauseAutoplayOnHover){this.elements.view.on("mouseenter",function(){if(!g.isTouch){g.pauseAutoplay()}});this.elements.view.on("mouseleave",function(){g.playAutoplay()})}this.isVisible=true;d(a).on("visibilitychange webkitvisibilitychange",function(k){g.checkVisibility()});var f;d(c).on("scroll",function(k){clearTimeout(f);f=setTimeout(function(){g.checkVisibility()},100)});this.checkVisibility();if(this.options.keyboard){d(a.body).on("keydown.rsts",function(m){var l=g.options.direction==="x"?37:38;var k=g.options.direction==="x"?39:40;if((m.which===l||m.which===k)&&(m.target===a.body||d(m.target).closest(g.elements.main).length)){if(m.which===l){g.prev()}else{g.next()}}})}}e.prototype.defaultOptions={type:"slide",direction:"x",visibleArea:1,random:false,loop:false,cssPrefix:"rsts-",skin:"default",width:"css",height:"css",preloadSlides:2,slideMaxCount:0,slideMinSize:0,combineNavItems:true,prevNextSteps:0,centerContent:false,gapSize:20,duration:400,autoplay:false,videoAutoplay:false,autoplayRestart:false,autoplayProgress:false,pauseAutoplayOnHover:false,navType:"bullets",controls:true,scaleMode:"fit",deepLinkPrefix:false,keyboard:true,captions:true};e.prototype.goTo=function(n,u,g){var v=this;if(!g){this.stopAutoplay()}var s=this.getVisibleSlidesCount();var j=false;var m=0;var q=this.slideIndex;var p=n-this.slideIndex<0?-1:n===this.slideIndex?0:1;if((n<0||n>this.slides.length-1)&&this.options.loop){m=n-this.slideIndex;while(n<0){n+=this.slides.length}while(n>this.slides.length-1){n-=this.slides.length}}else{if((n<0||n>this.slides.length-s)&&!this.options.loop){if(this.options.type!=="slide"){return}j=n<0?-1:1;n=n<0?0:this.slides.length-s}}if(!j&&this.slideIndex===n&&!u){return}var o=[];for(var l=this.slideIndex;l<=this.slideIndex+s-1;l++){o.push(l>=this.slides.length?l-this.slides.length:l)}var r=[];for(l=n;l<=n+s-1;l++){r.push(l>=this.slides.length?l-this.slides.length:l)}d.each(o,function(x,y){if(d.inArray(y,r)===-1){v.slides[y].setState("postactive")}});d.each(r,function(x,y){if(d.inArray(y,o)===-1){v.slides[y].setState("preactive")}});var h=this.slideSize+this.getGapSize();if(m){this.activeSlideOffset+=h*m}else{if(n>this.slideIndex&&n-this.slideIndex-s>this.options.preloadSlides*2){this.activeSlideOffset+=(this.options.preloadSlides*2+s)*h}else{if(nthis.options.preloadSlides*2){this.activeSlideOffset-=(this.options.preloadSlides*2+s)*h}else{this.activeSlideOffset+=(n-this.slideIndex)*h}}}this.slideIndex=n;var f=true;if(!u){f=false}else{d.each(r,function(x,y){if(!v.slides[y].isInjected()||Math.round(v.slides[y].element.position()[{x:"left",y:"top"}[v.options.direction]])!==Math.round(v.getSlideOffset(v.slideIndex+x))){f=false;return false}})}if(f){this.preloadOnCleanup=true}else{this.preloadSlides(n,q)}var w=this.getViewSize(n);var k;var t=-this.getSlideOffset(n)+Math.round(w[this.options.direction]*(1-this.options.visibleArea)/2);if(u&&!j){k=Math.abs((this.getOffset(this.elements.slides)-t)/h)}else{if(u&&j){k=0.7}}if(this.options.type==="slide"){this.modify(this.elements.slides,{offset:t},true,k,u,!u&&j)}else{if(this.options.type==="fade"){this.modify(this.slides[this.slideIndex].element,{opacity:1},true)}else{if(this.options.type==="side-slide"){this.modify(this.slides[this.slideIndex].element,{offset:p*this.slideSize});this.slides[this.slideIndex].element.position();this.modify(this.slides[this.slideIndex].element,{offset:0},true)}else{this.modify(this.slides[this.slideIndex].element,{},true)}}}if(this.autoSize){this.modify(this.elements.crop,{width:w.x,height:w.y},true,k,u)}this.elements.main.trigger({type:"rsts-slidestart",rstSlider:this})};e.prototype.getIndexFromUrl=function(){if(!this.options.deepLinkPrefix){return false}var f="#"+this.options.deepLinkPrefix;if(c.location.hash.substr(0,f.length)===f){var g=Math.abs(parseInt(c.location.hash.substr(f.length),10));if(g){if(g>this.slides.length){g=this.slides.length}return g-1}}return 0};e.prototype.stopAutoplay=function(g){var f=this;clearTimeout(this.autoplayTimeout);clearInterval(this.autoplayInterval);this.autoplayStopped=true;if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress.removeClass(this.options.cssPrefix+"progress-active")}if(this.options.autoplayRestart&&!g){this.autoplayTimeout=setTimeout(function(){f.autoplay()},this.options.autoplayRestart-this.options.autoplay)}};e.prototype.pauseAutoplay=function(){if(!this.options.autoplay||this.autoplayPaused){return}if(!this.autoplayStopped){clearTimeout(this.autoplayTimeout);clearInterval(this.autoplayInterval)}this.autoplayPaused=true;if(this.options.autoplay&&this.options.autoplayProgress&&!this.autoplayStopped){this.pauseAutoplayProgressBar()}};e.prototype.playAutoplay=function(){if(!this.options.autoplay||!this.autoplayPaused){return}this.autoplayPaused=false;if(!this.autoplayStopped){this.autoplay((1-(this.options.autoplayProgress?this.elements.progressBar.outerWidth()/this.elements.progress.width():0))*this.options.autoplay)}};e.prototype.autoplay=function(g){var f=this;if(!this.options.autoplay){return}clearTimeout(this.autoplayTimeout);clearInterval(this.autoplayInterval);this.autoplayStopped=false;if(this.autoplayPaused){this.pauseAutoplayProgressBar(0);return}g=(g||g===0)?g:(this.options.autoplay-this.options.duration);this.startAutoplayProgressBar(g);var h=function(){var j=f.getVisibleSlidesCount();var i=f.slideIndex+(Math.min(f.options.prevNextSteps,j)||j);if(i>f.slides.length-j&&!f.options.loop){if(f.slideIndexthis.slides.length-g&&this.slideIndex0){f=0}this.goTo(f)};e.prototype.readSlides=function(){var f=this;this.elements.main.children().each(function(){var g=d(this);if(g.is('h1, h2, h3, h4, h5, h6, [data-rsts-type="header"]')){if(!f.elements.header){f.elements.header=d(a.createElement("div"))}g.appendTo(f.elements.header)}else{if(g.is('[data-rsts-type="footer"]')){if(!f.elements.footer){f.elements.footer=d(a.createElement("div"))}g.appendTo(f.elements.footer)}else{f.slides.push(new b.Slide(this,f))}}});this.elements.main.empty();if(this.slides.length===0){throw new Error("No slides found")}};e.prototype.preloadSlides=function(j,k){var o=this;var p=this.getViewSizeFixed();p[this.options.direction]=this.slideSize;var n=this.getVisibleSlidesCount();var f=0;if(this.options.type==="slide"){f=Math.min(Math.floor((this.slides.length-n)/2),this.options.preloadSlides)}var m=[];for(var g=j;g<=j+n-1;g++){m.push(g>=this.slides.length?g-this.slides.length:g)}var h,l;for(g=j-f;g<=j+f+n-1;g++){l=g<0?g+this.slides.length:g>=this.slides.length?g-this.slides.length:g;h=this.slides[l];if(o.options.type==="slide"){if(!this.options.loop&&(g<0||g>=this.slides.length)){continue}if(k!==undefined&&d.inArray(l,m)===-1&&(g<0||g>=this.slides.length)&&h.isInjected()){this.preloadOnCleanup=true;continue}o.modify(h.element,{offset:o.getSlideOffset(g)})}if(!h.isInjected()){if(o.options.type==="fade"){o.modify(h.element,{opacity:0})}o.elements.slides.append(h.element);h.size(p.x,p.y)}else{if(o.options.type!=="slide"&&g===o.slideIndex&&h.element.next().length){if(o.options.type==="fade"){if(h.element.next().length===1){o.modify(h.element,{opacity:1-h.element.next().css("opacity")});o.modify(h.element.next(),{opacity:1})}else{o.modify(h.element,{opacity:0})}}o.elements.slides.append(h.element)}}}};e.prototype.cleanupSlides=function(){clearTimeout(this.cleanupSlidesTimeout);var g=this;var k=this.getVisibleSlidesCount();var l=this.options.type==="slide"?this.options.preloadSlides:0;var h=[];var m=[];for(var j=this.slideIndex-l;j<=this.slideIndex+l+k-1;j++){h.push(j<0?j+this.slides.length:j>=this.slides.length?j-this.slides.length:j)}for(j=this.slideIndex;j<=this.slideIndex+k-1;j++){m.push(j>=this.slides.length?j-this.slides.length:j)}d.each(this.slides,function(o,n){if(n.isInjected()&&d.inArray(o,h)===-1){if(g.options.type==="fade"&&g.slides[g.slideIndex].element.css("opacity")<1){return}if(g.options.type==="side-slide"){var p=g.options.direction==="x"?"left":"top";if(g.slides[g.slideIndex].element.position()[p]!==0){return}}n.element.detach()}if(d.inArray(o,m)===-1&&n.state!=="inactive"){n.setState("inactive")}});this.nav.setActive(m);d.each(m,function(n,o){g.slides[o].setState("active")});if(this.options.deepLinkPrefix&&this.getIndexFromUrl()!==this.slideIndex){if(this.slideIndex){c.location.hash="#"+this.options.deepLinkPrefix+(this.slideIndex+1)}else{if(c.history&&c.history.pushState){c.history.pushState("",a.title,c.location.pathname+c.location.search)}else{var f={x:d(c).scrollLeft(),y:d(c).scrollTop()};c.location.hash="";d(c).scrollLeft(f.x);d(c).scrollTop(f.y)}}}if(this.preloadOnCleanup){this.preloadOnCleanup=false;this.preloadSlides(this.slideIndex)}this.elements.main.trigger({type:"rsts-slidestop",rstSlider:this})};e.prototype.getSlideOffset=function(f){var g=this.getViewSizeFixed(true);return(f-this.slideIndex)*(this.slideSize+this.getGapSize())+this.activeSlideOffset};e.prototype.getVisibleSlidesCount=function(){if(!this.options.slideMaxCount&&!this.options.slideMinSize){return 1}var f=Math.round(this.getViewSizeFixed(true)[this.options.direction]*this.options.visibleArea);var h=this.getGapSize();var g=this.options.slideMaxCount;if(!g||(f-(h*(g-1)))/g=this.slides.length?f-this.slides.length:f;g=this.slides[m].size(n.x,n.y,true);h=Math.max(h||0,g[k])}n[k]=Math.max(10,h||0)}n[this.options.direction]=o;return n};e.prototype.getGapSize=function(){var f=this.options.gapSize;if(typeof f==="string"&&f.slice(-1)==="%"){f=f.split("%")[0].split(",").join(".")*this.getViewSizeFixed(true)[this.options.direction]/100}return Math.round(parseFloat(f))||0};e.prototype.resize=function(){var i=this;var l=this.getVisibleSlidesCount();var k,f;var h=!this.autoplayPaused;if(this.options.direction==="x"&&this.options.height==="css"){if(h){this.pauseAutoplay()}this.elements.view.css({display:"none"});if(this.nav.elements.main){this.nav.elements.main.css({display:"none"})}if(this.elements.header){this.elements.header.css({display:"none"})}if(this.elements.footer){this.elements.footer.css({display:"none"})}this.autoSize=this.elements.main.height()<1;this.elements.view.css({display:""});if(this.nav.elements.main){this.nav.elements.main.css({display:""})}if(this.elements.header){this.elements.header.css({display:""})}if(this.elements.footer){this.elements.footer.css({display:""})}if(h){this.playAutoplay()}}var j=this.getViewSize(this.slideIndex);this.modify(this.elements.crop,{width:j.x,height:j.y});if(this.elements.overlayPrev&&this.elements.overlayNext){if(this.options.direction==="x"){this.modify(this.elements.overlayPrev,{width:Math.round(j.x*(1-this.options.visibleArea)/2)});this.modify(this.elements.overlayNext,{width:Math.round(j.x*(1-this.options.visibleArea)/2)})}else{this.modify(this.elements.overlayPrev,{height:Math.round(j.y*(1-this.options.visibleArea)/2)});this.modify(this.elements.overlayNext,{height:Math.round(j.y*(1-this.options.visibleArea)/2)})}}var g=j[this.options.direction];j[this.options.direction]=this.slideSize;if(!this.autoSize||this.options.direction==="x"){k=j.x}if(!this.autoSize||this.options.direction==="y"){f=j.y}d.each(this.slides,function(n,m){if(m.isInjected()){m.size(k,f);if(i.options.type==="slide"){i.modify(m.element,{offset:i.getSlideOffset(n)})}}});this.preloadSlides(this.slideIndex);if(this.options.type==="slide"){this.modify(this.elements.slides,{offset:-i.getSlideOffset(this.slideIndex)+Math.round(g*(1-this.options.visibleArea)/2)})}if(l!==this.getVisibleSlidesCount()){this.nav.combineItems();this.cleanupSlides()}this.checkVisibility()};e.prototype.checkVisibility=function(){var g=!(a.hidden||a.webkitHidden);var h=false;var f=this.elements.main;var j=f.offset();var i=d(c);if(g&&j.lefti.scrollLeft()&&j.topi.scrollTop()){h=true}if(this.isVisible!==h){this.isVisible=h;if(h){this.playAutoplay()}else{this.pauseAutoplay()}}};e.prototype.getSlides=function(){return this.slides};e.prototype.setTouch=function(f){if(f!==this.isTouch){if(f){this.elements.main.addClass(this.options.cssPrefix+"touch").removeClass(this.options.cssPrefix+"no-touch")}else{this.elements.main.addClass(this.options.cssPrefix+"no-touch").removeClass(this.options.cssPrefix+"touch")}}if(f){this.lastTouchTime=new Date().getTime()}this.isTouch=f};e.prototype.setDragEvents=function(){var f=this;this.lastTouchTime=0;this.setTouch(false);var g={start:"mousedown",stop:"mouseup",move:"mousemove"};if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){g={start:"MSPointerDown",stop:"MSPointerUp",move:"MSPointerMove"};this.elements.crop.css("-ms-touch-action","pan-"+(this.options.direction==="x"?"y":"x")+" pinch-zoom double-tap-zoom");this.elements.main.on("MSPointerDown",function(h){if(h.originalEvent.pointerType===h.originalEvent.MSPOINTER_TYPE_TOUCH){f.setTouch(true)}})}else{if("ontouchstart" in c||"ontouchend" in a){g={start:g.start+" touchstart",stop:g.stop+" touchend touchcancel",move:g.move+" touchmove"};this.elements.main.on("touchstart",function(h){f.setTouch(true)})}}this.elements.crop.on(g.start,function(h){return f.onDragStart(h)});d(a).on(g.stop+".rsts",function(h){return f.onDragStop(h)});d(a).on(g.move+".rsts",function(h){return f.onDragMove(h)})};e.prototype.onDragStart=function(f){if(this.isDragging||(f.type==="mousedown"&&f.which!==1)||d(f.target).closest(".no-drag,a,button,input,select,textarea",this.elements.slides).length){return}if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){this.setTouch(f.originalEvent.pointerType===f.originalEvent.MSPOINTER_TYPE_TOUCH)}else{this.setTouch(f.type!=="mousedown"||new Date().getTime()-this.lastTouchTime<1000)}var g=this.getPositionFromEvent(f);if(!this.isTouch){f.preventDefault();this.stopAutoplay()}this.elements.main.addClass(this.options.cssPrefix+"dragging");this.isDragging=true;this.dragStartPos={x:g.x-this.elements.slides.offset().left+this.elements.crop.offset().left,y:g.y-this.elements.slides.offset().top+this.elements.crop.offset().top};this.dragLastPos=g[this.options.direction];this.dragLastDiff=0;this.touchStartPos=g;this.touchAxis="";this.modify(this.elements.slides,{offset:g[this.options.direction]-this.dragStartPos[this.options.direction]});this.onDragMove(f)};e.prototype.onDragStop=function(f){if(!this.isDragging){return}this.isDragging=false;this.elements.main.removeClass(this.options.cssPrefix+"dragging");var g=this.slideIndex+Math.floor((-this.getOffset(this.elements.slides)-this.activeSlideOffset+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2))/(this.slideSize+this.getGapSize()));if(this.dragLastDiff<=0){this.goTo(g,true)}else{this.goTo(g+1,true)}};e.prototype.onDragMove=function(j){if(!this.isDragging||(this.isTouch&&j.type==="mousemove")){return}var k=this.getPositionFromEvent(j);var g;if(this.isTouch){if(!this.touchAxis){g=Math.abs(k.x-this.touchStartPos.x)-Math.abs(k.y-this.touchStartPos.y);if(g>4){this.touchAxis="x"}else{if(g<-4){this.touchAxis="y"}}}if(this.touchAxis===this.options.direction){j.preventDefault();this.stopAutoplay()}else{if(!this.touchAxis){return}else{return this.onDragStop()}}if(j.originalEvent.touches&&j.originalEvent.touches[1]){return this.onDragStop()}}else{j.preventDefault();this.stopAutoplay()}var f=this.dragLastPos-k[this.options.direction];var i=k[this.options.direction]-this.dragStartPos[this.options.direction];var h=this.getVisibleSlidesCount();if(!this.options.loop){if(i>-this.getSlideOffset(0)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2)){i=(i*0.4)-((this.getSlideOffset(0)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2))*0.6)}if(i<-this.getSlideOffset(this.slides.length-h)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2)){i=(i*0.4)-((this.getSlideOffset(this.slides.length-h)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2))*0.6)}}this.modify(this.elements.slides,{offset:i});if(f<0||f>0){this.dragLastDiff=f}this.dragLastPos=k[this.options.direction]};e.prototype.getPositionFromEvent=function(f){var g={x:f.pageX,y:f.pageY};if(typeof g.x!=="number"){g={x:f.originalEvent.pageX,y:f.originalEvent.pageY}}if(f.originalEvent.touches&&f.originalEvent.touches[0]){g={x:f.originalEvent.touches[0].pageX,y:f.originalEvent.touches[0].pageY}}return g};return e})();b.SliderNav=(function(){function e(h){var g=this;this.slider=h;this.elements={};if(h.options.controls){this.elements.prev=d(a.createElement("a")).attr("href","").text("prev").addClass(h.options.cssPrefix+"prev").on("click",function(i){i.preventDefault();g.slider.prev()});this.elements.next=d(a.createElement("a")).attr("href","").text("next").on("click",function(i){i.preventDefault();g.slider.next()}).addClass(h.options.cssPrefix+"next");h.elements.view.append(this.elements.prev).append(this.elements.next)}if(h.options.navType!=="none"){this.elements.main=d(a.createElement("div")).addClass(h.options.cssPrefix+"nav "+h.options.cssPrefix+"nav-"+h.options.navType);this.elements.mainPrev=d(a.createElement("a")).attr("href","").text("prev").on("click",function(i){i.preventDefault();g.slider.prev()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-prev"));this.elements.mainNext=d(a.createElement("a")).attr("href","").text("next").on("click",function(i){i.preventDefault();g.slider.next()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-next"));var f=a.createElement("ul");d.each(this.slider.getSlides(),function(k,j){g.elements[k]=g.createNavItem(k,j.getData()).appendTo(f)});this.elements.mainPrev.parent().prependTo(f);this.elements.mainNext.parent().appendTo(f);this.elements.main.append(f);h.elements.main.append(this.elements.main)}}e.prototype.setActive=function(g){var f=this;var h=this.slider.getSlides();if(this.activeIndexes){d.each(this.activeIndexes,function(k,j){if(!f.elements[j]){return}f.elements[j].children("a").removeClass("active")})}if(this.elements[h.length]&&d.inArray(h.length-1,g)!==-1){g=[h.length]}this.activeIndexes=g;var i=false;d.each(this.activeIndexes,function(k,j){if(!f.elements[j]){return}if(f.elements[j][0].style.display!=="none"){i=true}f.elements[j].children("a").addClass("active")});if(!i&&this.elements[h.length]){d.each(this.activeIndexes,function(k,j){if(!f.elements[j]){return}f.elements[j].children("a").removeClass("active")});this.activeIndexes=[h.length];this.elements[h.length].children("a").addClass("active")}};e.prototype.combineItems=function(){var h=this.slider.getVisibleSlidesCount();var j=this.slider.getSlides();if(this.elements[j.length]){this.elements[j.length].remove();delete this.elements[j.length]}d.each(this.elements,function(){this.css("display","")});if(h<2||!this.slider.options.combineNavItems){return}var k;for(var g=0;this.elements[g];g++){if((g-Math.floor((h-1)/2))%h||g>j.length-h){this.elements[g].css("display","none")}else{k=g}}if(j.length%h===0){this.elements[j.length-h+Math.floor((h-1)/2)].css("display","")}else{var f=j.length-(j.length%h||h)+Math.floor((h-1)/2);this.elements[j.length]=this.createNavItem(f,j[f>=j.length?j.length-1:f].getData()).insertAfter(this.elements[j.length-1])}};e.prototype.createNavItem=function(g,h){var f=this;return d(a.createElement("li")).addClass(f.slider.options.cssPrefix+"nav-item").append(d(a.createElement("a")).attr("href","").text((f.slider.options.navType!=="numbers"&&h.name)?h.name:(h.index+1)).on("click",function(j){j.preventDefault();var i=f.slider.getVisibleSlidesCount();var k=g-Math.floor((i-1)/2);if(!f.slider.options.loop){k=Math.min(f.slider.slides.length-i,Math.max(0,k))}else{if(k<0){k+=f.slider.slides.length}else{if(k>=f.slider.slides.length){k-=f.slider.slides.length}}}f.slider.goTo(k)}))};e.prototype.getSize=function(){if(!this.elements.main||this.elements.main.css("position")==="absolute"){return{x:0,y:0}}return{x:this.elements.main.outerWidth(true),y:this.elements.main.outerHeight(true)}};return e})();d.fn.rstSlider=function(f){var e=arguments;return this.each(function(){var h=d(this);if(typeof f==="string"){var g=h.data("rstSlider");if(g&&g[f]){return g[f].apply(g,Array.prototype.slice.call(e,1))}}else{if(!h.data("rstSlider")){h.data("rstSlider",new b.Slider(h,f))}}})}})(jQuery,window,document); -/*! - * jQuery UI Effects 1.10.1 - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/category/effects-core/ - */ -(function(b){var a={};b.each(["Quad","Cubic","Quart","Quint","Expo"],function(d,c){a[c]=function(e){return Math.pow(e,d+2)}});b.extend(a,{Sine:function(c){return 1-Math.cos(c*Math.PI/2)},Circ:function(c){return 1-Math.sqrt(1-c*c)},Elastic:function(c){return c===0||c===1?c:-Math.pow(2,8*(c-1))*Math.sin(((c-1)*80-7.5)*Math.PI/15)},Back:function(c){return c*c*(3*c-2)},Bounce:function(e){var c,d=4;while(e<((c=Math.pow(2,--d))-1)/11){}return 1/Math.pow(4,3-d)-7.5625*Math.pow((c*3-2)/22-e,2)}});b.each(a,function(d,c){b.easing["easeIn"+d]=c;b.easing["easeOut"+d]=function(e){return 1-c(1-e)};b.easing["easeInOut"+d]=function(e){return e<0.5?c(e*2)/2:1-c(e*-2+2)/2}})})(jQuery); \ No newline at end of file diff --git a/assets/js/rocksolid-slider-1.3.0.js b/assets/js/rocksolid-slider-1.3.1.js similarity index 98% rename from assets/js/rocksolid-slider-1.3.0.js rename to assets/js/rocksolid-slider-1.3.1.js index fe74dc9..7588a60 100644 --- a/assets/js/rocksolid-slider-1.3.0.js +++ b/assets/js/rocksolid-slider-1.3.1.js @@ -1,4 +1,4 @@ -/*! rocksolid-slider v1.3.0 */ +/*! rocksolid-slider v1.3.1 */ (function($, window, document) { var Rst = {}; @@ -263,15 +263,15 @@ Rst.Slide = (function() { var scaleMode = image.attr('data-rsts-scale-mode') || this.slider.options.scaleMode; + var position = image.attr('data-rsts-position') + || this.slider.options.imagePosition; var originalSize = this.getOriginalSize(image); var originalProp = originalSize.x / originalSize.y; var newProp = x / y; var css = { width: originalSize.x, - height: originalSize.y, - 'margin-left': 0, - 'margin-top': 0 + height: originalSize.y }; if (scaleMode === 'fit' || scaleMode === 'crop') { @@ -282,12 +282,10 @@ Rst.Slide = (function() { ) { css.width = x; css.height = x / originalProp; - css['margin-top'] = (y - css.height) / 2; } else { css.width = y * originalProp; css.height = y; - css['margin-left'] = (x - css.width) / 2; } } @@ -297,11 +295,21 @@ Rst.Slide = (function() { css.height = y; } - else { - css['margin-top'] = (y - originalSize.y) / 2; - css['margin-left'] = (x - originalSize.x) / 2; + css['margin-top'] = (y - css.height) / 2; + css['margin-left'] = (x - css.width) / 2; + if (position === 'top' || position === 'top-left' || position === 'top-right') { + css['margin-top'] = 0; + } + else if (position === 'bottom' || position === 'bottom-left' || position === 'bottom-right') { + css['margin-top'] = y - css.height; + } + if (position === 'left' || position === 'top-left' || position === 'bottom-left') { + css['margin-left'] = 0; + } + else if (position === 'right' || position === 'top-right' || position === 'bottom-right') { + css['margin-left'] = x - css.width; } image.css(css); @@ -891,6 +899,10 @@ Rst.Slider = (function() { // use the attribute data-rsts-scale-mode to set the mode per slide // only works if width and height are not set to "auto" scaleMode: 'fit', + // image position (center, top, right, bottom, left, top-left, + // top-right, bottom-left, bottom-right) + // use the attribute data-rsts-position to set it per slide + imagePosition: 'center', // URL hash prefix or false to disable deep linking, e.g. "slider-" deepLinkPrefix: false, // true to enable keyboard arrow navigation @@ -2464,7 +2476,7 @@ Rst.SliderNav = (function() { for (var i = 0; this.elements[i]; i++) { if ( (i - Math.floor((visibleCount - 1) / 2)) % visibleCount - || i > slides.length - visibleCount + || (i - Math.floor((visibleCount - 1) / 2)) > slides.length - visibleCount ) { this.elements[i].css('display', 'none'); } diff --git a/assets/js/rocksolid-slider-1.3.1.min.js b/assets/js/rocksolid-slider-1.3.1.min.js new file mode 100644 index 0000000..72cca70 --- /dev/null +++ b/assets/js/rocksolid-slider-1.3.1.min.js @@ -0,0 +1,13 @@ +/*! rocksolid-slider v1.3.1 */ +(function(d,c,a){var b={};b.Slide=(function(){function e(i,j){var h=this;this.slider=j;this.content=d(i);this.data={name:this.content.attr("data-rsts-name")||this.content.attr("title")};if(i.nodeName==="IMG"){this.type="image"}this.type=this.content.attr("data-rsts-type")||this.type||"default";this.centerContent=this.content.attr("data-rsts-center")!==undefined?this.content.attr("data-rsts-center"):j.options.centerContent;if(this.centerContent!=="x"&&this.centerContent!=="y"){this.centerContent=!!this.centerContent}if(this.type==="image"||this.type==="video"){this.centerContent=false}this.element=d(a.createElement("div")).addClass(j.options.cssPrefix+"slide").addClass(j.options.cssPrefix+"slide-"+this.type).append(i);if(!a.createElement("video").canPlayType||this.slider.device==="iPhone"||this.slider.device==="iPod"){this.element.find("[data-rsts-background]").each(function(){if(this.nodeName!=="VIDEO"){return}var k=d(this);if(k.attr("poster")){d(a.createElement("img")).attr("src",k.attr("poster")).attr("data-rsts-background","").attr("data-rsts-scale-mode",k.attr("data-rsts-scale-mode")).insertBefore(k)}k.detach()})}this.backgrounds=this.element.find("[data-rsts-background]").attr("autoplay",true).attr("loop",true).css({position:"absolute",top:0,left:0}).prependTo(this.element);if(this.backgrounds.length){this.element.children().last().css({position:"relative"})}this.element.find("video[autoplay]").each(function(){if(this.pause){this.pause()}});if(this.type==="image"){this.data.name=this.data.name||this.element.find("img").last().attr("alt")}if(this.data.name&&j.options.captions){d(a.createElement("div")).addClass(j.options.cssPrefix+"caption").text(this.data.name).appendTo(this.element)}var g=function(){j.resize();if(j.css3Supported){j.elements.crop.css("transform","");j.elements.crop.css("transform");j.elements.crop.css("transform","translateZ(0)")}};this.element.find("img").on("load",g);this.element.find("video").on("loadedmetadata",g);var f=this.element.find("h1,h2,h3,h4,h5,h6");if(!this.data.name&&f.length){this.data.name=f.text()}if(this.type==="video"){this.data.video=this.content.attr("data-rsts-video");d(a.createElement("a")).attr("href",this.data.video).text("play").addClass(this.slider.options.cssPrefix+"video-play").on("click",function(k){k.preventDefault();h.startVideo()}).appendTo(this.element)}this.setState("inactive")}e.prototype.videoRegExp={youtube:/^https?:\/\/(?:www\.youtube\.com\/(?:watch\?v=|v\/|embed\/)|youtu\.be\/)([0-9a-z_\-]{11})(?:$|&|\/)/i,vimeo:/^https?:\/\/(?:player\.)?vimeo\.com\/(?:video\/)?([0-9]+)/i};e.prototype.isInjected=function(){return !!(this.element.get(0).parentNode&&this.element.get(0).parentNode.tagName)};e.prototype.size=function(g,i,h){var f=!g||!i;if(g&&!i){this.slider.modify(this.element,{width:g,height:""});this.resetScaledContent();if(h||this.backgrounds.length){i=this.element.outerHeight()}}else{if(i&&!g){this.slider.modify(this.element,{height:i,width:""});this.resetScaledContent();if(h||this.backgrounds.length){g=this.element.outerWidth()}}else{if(g&&i){this.slider.modify(this.element,{width:g,height:i})}else{this.resetScaledContent();g=this.element.outerWidth();i=this.element.outerHeight()}}}this.scaleContent(g,i,f);this.scaleBackground(g,i);return{x:g,y:i}};e.prototype.scaleContent=function(g,h,f){if(this.centerContent){if(this.content.css("display")==="inline"){this.content.css("display","inline-block")}if(this.centerContent!=="y"&&g){this.content.css("margin-left",Math.round((g-this.content.outerWidth())/2))}if(this.centerContent!=="x"&&h){this.content.css("margin-top",Math.round((h-this.content.outerHeight())/2))}}if(!f&&(this.type==="image"||this.type==="video")){this.scaleImage(this.element.find("img").last(),g,h)}};e.prototype.scaleBackground=function(f,h){var g=this;this.backgrounds.each(function(){g.scaleImage(d(this),f,h)})};e.prototype.scaleImage=function(f,m,l){var n=f.attr("data-rsts-scale-mode")||this.slider.options.scaleMode;var g=f.attr("data-rsts-position")||this.slider.options.imagePosition;var i=this.getOriginalSize(f);var j=i.x/i.y;var k=m/l;var h={width:i.x,height:i.y};if(n==="fit"||n==="crop"){if((j>=k&&n==="fit")||(j<=k&&n==="crop")){h.width=m;h.height=m/j}else{h.width=l*j;h.height=l}}else{if(n==="scale"){h.width=m;h.height=l}}h["margin-top"]=(l-h.height)/2;h["margin-left"]=(m-h.width)/2;if(g==="top"||g==="top-left"||g==="top-right"){h["margin-top"]=0}else{if(g==="bottom"||g==="bottom-left"||g==="bottom-right"){h["margin-top"]=l-h.height}}if(g==="left"||g==="top-left"||g==="bottom-left"){h["margin-left"]=0}else{if(g==="right"||g==="top-right"||g==="bottom-right"){h["margin-left"]=m-h.width}}f.css(h)};e.prototype.getOriginalSize=function(h){h=d(h);var g={};if(h[0].nodeName==="IMG"){if("naturalWidth" in new Image()){g.x=h[0].naturalWidth;g.y=h[0].naturalHeight}else{var f=new Image();f.src=h[0].src;g.x=f.width;g.y=f.height}}else{if(h[0].nodeName==="VIDEO"){g.x=h[0].videoWidth;g.y=h[0].videoHeight}}return{x:g.x||10,y:g.y||10}};e.prototype.resetScaledContent=function(f,h){var g=this.element.find("img").last();if(this.type==="image"||this.type==="video"){g.css({width:"",height:"","margin-left":"","margin-top":""})}if(this.centerContent){this.content.css({"margin-left":"","margin-top":""})}};e.prototype.setState=function(g){if(this.type==="video"&&this.state&&g==="inactive"&&g!==this.state){this.stopVideo()}if(this.type==="video"&&this.state&&g==="active"&&g!==this.state&&this.slider.options.videoAutoplay){this.startVideo()}if((g==="preactive"||g==="active")&&g!==this.state){this.element.find("video[autoplay]").each(function(){if(this.play){this.play()}})}else{if(g!=="active"&&g!=="preactive"&&(this.state==="active"||this.state==="preactive")){this.element.find("video").each(function(){if(this.pause){this.pause()}})}}this.state=g;var f=this.slider.options.cssPrefix;this.element.removeClass(f+"active").removeClass(f+"inactive").removeClass(f+"preactive").removeClass(f+"postactive").addClass(f+g)};e.prototype.stopVideo=function(g,f){if(this.eventNamespace){d(c).off("message."+this.eventNamespace);delete this.eventNamespace}if(this.videoElement){this.videoElement.attr("src","");this.videoElement.remove();delete this.videoElement}if(this.videoStopButton){this.videoStopButton.remove();delete this.videoStopButton}this.slider.elements.main.removeClass(this.slider.options.cssPrefix+"video-playing");if(g&&this.slider.options.autoplayRestart){this.slider.autoplay(200)}else{if(f){this.slider.stopAutoplay()}}};e.prototype.startVideo=function(){var f=this;var i,g,h;this.slider.stopAutoplay(true);if((h=this.data.video.match(this.videoRegExp.youtube))){this.element.addClass(this.slider.options.cssPrefix+"video-youtube");i=h[1];this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src","http://www.youtube.com/embed/"+i+"?autoplay=1&enablejsapi=1&wmode=opaque").attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element);g=function(){if(f.videoElement&&c.YT){new YT.Player(f.videoElement.get(0),{events:{onStateChange:function(j){if(j.data===YT.PlayerState.ENDED){f.stopVideo(true)}}}})}};if(c.YT&&YT.Player){g()}else{d(a.createElement("script")).attr("src","//www.youtube.com/iframe_api").appendTo(a.head);c.onYouTubeIframeAPIReady=function(){delete c.onYouTubeIframeAPIReady;g()}}}else{if((h=this.data.video.match(this.videoRegExp.vimeo))){this.element.addClass(this.slider.options.cssPrefix+"video-vimeo");i=h[1];this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src","http://player.vimeo.com/video/"+i+"?autoplay=1&api=1").attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element);this.eventNamespace="rsts"+new Date().getTime();d(c).on("message."+this.eventNamespace,function(j){var k=JSON.parse(j.originalEvent.data);if(k&&k.event){if(k.event==="ready"){f.videoElement.get(0).contentWindow.postMessage('{"method":"addEventListener","value":"finish"}',f.videoElement.attr("src").split("?")[0])}else{if(k.event==="finish"){f.stopVideo(true)}}}})}else{this.element.addClass(this.slider.options.cssPrefix+"video-unknown");this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src",this.data.video).attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element)}}if(this.slider.device==="iPad"){this.element.addClass(this.slider.options.cssPrefix+"video-ipad")}this.videoStopButton=d(a.createElement("a")).attr("href",this.data.video).text("stop").addClass(this.slider.options.cssPrefix+"video-stop").on("click",function(j){j.preventDefault();f.stopVideo(false,true)}).appendTo(this.element);this.slider.elements.main.addClass(this.slider.options.cssPrefix+"video-playing")};e.prototype.setIndex=function(f){this.data.index=f};e.prototype.getData=function(){return this.data};return e})();b.Slider=(function(){function e(i,h){var g=this;this.slides=[];this.elements={};this.elements.main=i;this.options=d.extend({},this.defaultOptions,h);if(this.options.height==="auto"&&this.options.direction==="y"){throw new Error('height "auto" with direction "y" ist not possible')}if(this.options.type!=="slide"){this.options.visibleArea=1;this.options.slideMaxCount=0;this.options.slideMinSize=0}this.checkCss3Support();this.readSlides();if(this.options.random){this.slides.sort(function(){return Math.random()-0.5})}d.each(this.slides,function(k){this.setIndex(k)});this.slideIndex=this.getIndexFromUrl();if(this.slideIndex===false){this.slideIndex=0}this.activeSlideOffset=0;d(c).on("hashchange.rsts",function(){var k=g.getIndexFromUrl();if(k!==false&&k!==g.slideIndex){g.goTo(k)}});this.elements.main.addClass(this.options.cssPrefix+"main").addClass(this.options.cssPrefix+"direction-"+this.options.direction).addClass(this.options.cssPrefix+"type-"+this.options.type).addClass(this.options.cssPrefix+"skin-"+this.options.skin);if(this.options.direction==="x"&&(this.options.height==="auto"||(this.options.height==="css"&&this.elements.main.height()<1))){this.autoSize=true}else{if(this.options.direction==="y"&&(this.options.width==="auto"||(this.options.width==="css"&&this.elements.main.width()<1))){this.autoSize=true}}var j=this.options.width.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.width}j=this.options.height.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.height}if(this.options.width&&this.options.width!=="css"){this.elements.main.css({width:this.options.width});if(this.options.width==="auto"){this.options.width="css"}}if(this.options.height&&this.options.height!=="css"){this.elements.main.css({height:this.options.height})}if(this.elements.header){this.elements.header.addClass(this.options.cssPrefix+"header").appendTo(this.elements.main)}this.elements.view=d(a.createElement("div")).addClass(this.options.cssPrefix+"view").appendTo(this.elements.main);this.elements.crop=d(a.createElement("div")).addClass(this.options.cssPrefix+"crop").on("scroll",function(){d(this).scrollLeft(0).scrollTop(0)}).appendTo(this.elements.view);this.elements.slides=d(a.createElement("div")).addClass(this.options.cssPrefix+"slides").appendTo(this.elements.crop);if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress=d(a.createElement("div")).addClass(this.options.cssPrefix+"progress").appendTo(this.elements.view);this.elements.progressBar=d(a.createElement("div")).appendTo(this.elements.progress)}if(this.options.visibleArea<1){this.elements.overlayPrev=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-prev").appendTo(this.elements.view);this.elements.overlayNext=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-next").appendTo(this.elements.view)}this.nav=new b.SliderNav(this);if(this.elements.footer){this.elements.footer.addClass(this.options.cssPrefix+"footer").appendTo(this.elements.main)}this.preloadSlides(this.slideIndex);this.cleanupSlides();d(c).on("resize.rsts",function(){g.resize()});this.resize();this.nav.combineItems();if(this.options.type==="slide"){this.setDragEvents()}else{this.modify(this.slides[this.slideIndex].element,{opacity:1})}if(this.css3Supported){this.elements.slides.on("transitionend webkitTransitionEnd oTransitionEnd msTransitionEnd",function(k){if((g.options.type==="slide"&&k.target===g.elements.slides.get(0))||(g.options.type!=="slide"&&k.target.parentNode===g.elements.slides.get(0))){g.cleanupSlides()}});this.elements.crop.css({transform:"translateZ(0)"})}this.autoplay();if(this.options.pauseAutoplayOnHover){this.elements.view.on("mouseenter",function(){if(!g.isTouch){g.pauseAutoplay()}});this.elements.view.on("mouseleave",function(){g.playAutoplay()})}this.isVisible=true;d(a).on("visibilitychange webkitvisibilitychange",function(k){g.checkVisibility()});var f;d(c).on("scroll",function(k){clearTimeout(f);f=setTimeout(function(){g.checkVisibility()},100)});this.checkVisibility();if(this.options.keyboard){d(a.body).on("keydown.rsts",function(m){var l=g.options.direction==="x"?37:38;var k=g.options.direction==="x"?39:40;if((m.which===l||m.which===k)&&(m.target===a.body||d(m.target).closest(g.elements.main).length)){if(m.which===l){g.prev()}else{g.next()}}})}}e.prototype.defaultOptions={type:"slide",direction:"x",visibleArea:1,random:false,loop:false,cssPrefix:"rsts-",skin:"default",width:"css",height:"css",preloadSlides:2,slideMaxCount:0,slideMinSize:0,combineNavItems:true,prevNextSteps:0,centerContent:false,gapSize:20,duration:400,autoplay:false,videoAutoplay:false,autoplayRestart:false,autoplayProgress:false,pauseAutoplayOnHover:false,navType:"bullets",controls:true,scaleMode:"fit",imagePosition:"center",deepLinkPrefix:false,keyboard:true,captions:true};e.prototype.goTo=function(n,u,g){var v=this;if(!g){this.stopAutoplay()}var s=this.getVisibleSlidesCount();var j=false;var m=0;var q=this.slideIndex;var p=n-this.slideIndex<0?-1:n===this.slideIndex?0:1;if((n<0||n>this.slides.length-1)&&this.options.loop){m=n-this.slideIndex;while(n<0){n+=this.slides.length}while(n>this.slides.length-1){n-=this.slides.length}}else{if((n<0||n>this.slides.length-s)&&!this.options.loop){if(this.options.type!=="slide"){return}j=n<0?-1:1;n=n<0?0:this.slides.length-s}}if(!j&&this.slideIndex===n&&!u){return}var o=[];for(var l=this.slideIndex;l<=this.slideIndex+s-1;l++){o.push(l>=this.slides.length?l-this.slides.length:l)}var r=[];for(l=n;l<=n+s-1;l++){r.push(l>=this.slides.length?l-this.slides.length:l)}d.each(o,function(x,y){if(d.inArray(y,r)===-1){v.slides[y].setState("postactive")}});d.each(r,function(x,y){if(d.inArray(y,o)===-1){v.slides[y].setState("preactive")}});var h=this.slideSize+this.getGapSize();if(m){this.activeSlideOffset+=h*m}else{if(n>this.slideIndex&&n-this.slideIndex-s>this.options.preloadSlides*2){this.activeSlideOffset+=(this.options.preloadSlides*2+s)*h}else{if(nthis.options.preloadSlides*2){this.activeSlideOffset-=(this.options.preloadSlides*2+s)*h}else{this.activeSlideOffset+=(n-this.slideIndex)*h}}}this.slideIndex=n;var f=true;if(!u){f=false}else{d.each(r,function(x,y){if(!v.slides[y].isInjected()||Math.round(v.slides[y].element.position()[{x:"left",y:"top"}[v.options.direction]])!==Math.round(v.getSlideOffset(v.slideIndex+x))){f=false;return false}})}if(f){this.preloadOnCleanup=true}else{this.preloadSlides(n,q)}var w=this.getViewSize(n);var k;var t=-this.getSlideOffset(n)+Math.round(w[this.options.direction]*(1-this.options.visibleArea)/2);if(u&&!j){k=Math.abs((this.getOffset(this.elements.slides)-t)/h)}else{if(u&&j){k=0.7}}if(this.options.type==="slide"){this.modify(this.elements.slides,{offset:t},true,k,u,!u&&j)}else{if(this.options.type==="fade"){this.modify(this.slides[this.slideIndex].element,{opacity:1},true)}else{if(this.options.type==="side-slide"){this.modify(this.slides[this.slideIndex].element,{offset:p*this.slideSize});this.slides[this.slideIndex].element.position();this.modify(this.slides[this.slideIndex].element,{offset:0},true)}else{this.modify(this.slides[this.slideIndex].element,{},true)}}}if(this.autoSize){this.modify(this.elements.crop,{width:w.x,height:w.y},true,k,u)}this.elements.main.trigger({type:"rsts-slidestart",rstSlider:this})};e.prototype.getIndexFromUrl=function(){if(!this.options.deepLinkPrefix){return false}var f="#"+this.options.deepLinkPrefix;if(c.location.hash.substr(0,f.length)===f){var g=Math.abs(parseInt(c.location.hash.substr(f.length),10));if(g){if(g>this.slides.length){g=this.slides.length}return g-1}}return 0};e.prototype.stopAutoplay=function(g){var f=this;clearTimeout(this.autoplayTimeout);clearInterval(this.autoplayInterval);this.autoplayStopped=true;if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress.removeClass(this.options.cssPrefix+"progress-active")}if(this.options.autoplayRestart&&!g){this.autoplayTimeout=setTimeout(function(){f.autoplay()},this.options.autoplayRestart-this.options.autoplay)}};e.prototype.pauseAutoplay=function(){if(!this.options.autoplay||this.autoplayPaused){return}if(!this.autoplayStopped){clearTimeout(this.autoplayTimeout);clearInterval(this.autoplayInterval)}this.autoplayPaused=true;if(this.options.autoplay&&this.options.autoplayProgress&&!this.autoplayStopped){this.pauseAutoplayProgressBar()}};e.prototype.playAutoplay=function(){if(!this.options.autoplay||!this.autoplayPaused){return}this.autoplayPaused=false;if(!this.autoplayStopped){this.autoplay((1-(this.options.autoplayProgress?this.elements.progressBar.outerWidth()/this.elements.progress.width():0))*this.options.autoplay)}};e.prototype.autoplay=function(g){var f=this;if(!this.options.autoplay){return}clearTimeout(this.autoplayTimeout);clearInterval(this.autoplayInterval);this.autoplayStopped=false;if(this.autoplayPaused){this.pauseAutoplayProgressBar(0);return}g=(g||g===0)?g:(this.options.autoplay-this.options.duration);this.startAutoplayProgressBar(g);var h=function(){var j=f.getVisibleSlidesCount();var i=f.slideIndex+(Math.min(f.options.prevNextSteps,j)||j);if(i>f.slides.length-j&&!f.options.loop){if(f.slideIndexthis.slides.length-g&&this.slideIndex0){f=0}this.goTo(f)};e.prototype.readSlides=function(){var f=this;this.elements.main.children().each(function(){var g=d(this);if(g.is('h1, h2, h3, h4, h5, h6, [data-rsts-type="header"]')){if(!f.elements.header){f.elements.header=d(a.createElement("div"))}g.appendTo(f.elements.header)}else{if(g.is('[data-rsts-type="footer"]')){if(!f.elements.footer){f.elements.footer=d(a.createElement("div"))}g.appendTo(f.elements.footer)}else{f.slides.push(new b.Slide(this,f))}}});this.elements.main.empty();if(this.slides.length===0){throw new Error("No slides found")}};e.prototype.preloadSlides=function(j,k){var o=this;var p=this.getViewSizeFixed();p[this.options.direction]=this.slideSize;var n=this.getVisibleSlidesCount();var f=0;if(this.options.type==="slide"){f=Math.min(Math.floor((this.slides.length-n)/2),this.options.preloadSlides)}var m=[];for(var g=j;g<=j+n-1;g++){m.push(g>=this.slides.length?g-this.slides.length:g)}var h,l;for(g=j-f;g<=j+f+n-1;g++){l=g<0?g+this.slides.length:g>=this.slides.length?g-this.slides.length:g;h=this.slides[l];if(o.options.type==="slide"){if(!this.options.loop&&(g<0||g>=this.slides.length)){continue}if(k!==undefined&&d.inArray(l,m)===-1&&(g<0||g>=this.slides.length)&&h.isInjected()){this.preloadOnCleanup=true;continue}o.modify(h.element,{offset:o.getSlideOffset(g)})}if(!h.isInjected()){if(o.options.type==="fade"){o.modify(h.element,{opacity:0})}o.elements.slides.append(h.element);h.size(p.x,p.y)}else{if(o.options.type!=="slide"&&g===o.slideIndex&&h.element.next().length){if(o.options.type==="fade"){if(h.element.next().length===1){o.modify(h.element,{opacity:1-h.element.next().css("opacity")});o.modify(h.element.next(),{opacity:1})}else{o.modify(h.element,{opacity:0})}}o.elements.slides.append(h.element)}}}};e.prototype.cleanupSlides=function(){clearTimeout(this.cleanupSlidesTimeout);var g=this;var k=this.getVisibleSlidesCount();var l=this.options.type==="slide"?this.options.preloadSlides:0;var h=[];var m=[];for(var j=this.slideIndex-l;j<=this.slideIndex+l+k-1;j++){h.push(j<0?j+this.slides.length:j>=this.slides.length?j-this.slides.length:j)}for(j=this.slideIndex;j<=this.slideIndex+k-1;j++){m.push(j>=this.slides.length?j-this.slides.length:j)}d.each(this.slides,function(o,n){if(n.isInjected()&&d.inArray(o,h)===-1){if(g.options.type==="fade"&&g.slides[g.slideIndex].element.css("opacity")<1){return}if(g.options.type==="side-slide"){var p=g.options.direction==="x"?"left":"top";if(g.slides[g.slideIndex].element.position()[p]!==0){return}}n.element.detach()}if(d.inArray(o,m)===-1&&n.state!=="inactive"){n.setState("inactive")}});this.nav.setActive(m);d.each(m,function(n,o){g.slides[o].setState("active")});if(this.options.deepLinkPrefix&&this.getIndexFromUrl()!==this.slideIndex){if(this.slideIndex){c.location.hash="#"+this.options.deepLinkPrefix+(this.slideIndex+1)}else{if(c.history&&c.history.pushState){c.history.pushState("",a.title,c.location.pathname+c.location.search)}else{var f={x:d(c).scrollLeft(),y:d(c).scrollTop()};c.location.hash="";d(c).scrollLeft(f.x);d(c).scrollTop(f.y)}}}if(this.preloadOnCleanup){this.preloadOnCleanup=false;this.preloadSlides(this.slideIndex)}this.elements.main.trigger({type:"rsts-slidestop",rstSlider:this})};e.prototype.getSlideOffset=function(f){var g=this.getViewSizeFixed(true);return(f-this.slideIndex)*(this.slideSize+this.getGapSize())+this.activeSlideOffset};e.prototype.getVisibleSlidesCount=function(){if(!this.options.slideMaxCount&&!this.options.slideMinSize){return 1}var f=Math.round(this.getViewSizeFixed(true)[this.options.direction]*this.options.visibleArea);var h=this.getGapSize();var g=this.options.slideMaxCount;if(!g||(f-(h*(g-1)))/g=this.slides.length?f-this.slides.length:f;g=this.slides[m].size(n.x,n.y,true);h=Math.max(h||0,g[k])}n[k]=Math.max(10,h||0)}n[this.options.direction]=o;return n};e.prototype.getGapSize=function(){var f=this.options.gapSize;if(typeof f==="string"&&f.slice(-1)==="%"){f=f.split("%")[0].split(",").join(".")*this.getViewSizeFixed(true)[this.options.direction]/100}return Math.round(parseFloat(f))||0};e.prototype.resize=function(){var i=this;var l=this.getVisibleSlidesCount();var k,f;var h=!this.autoplayPaused;if(this.options.direction==="x"&&this.options.height==="css"){if(h){this.pauseAutoplay()}this.elements.view.css({display:"none"});if(this.nav.elements.main){this.nav.elements.main.css({display:"none"})}if(this.elements.header){this.elements.header.css({display:"none"})}if(this.elements.footer){this.elements.footer.css({display:"none"})}this.autoSize=this.elements.main.height()<1;this.elements.view.css({display:""});if(this.nav.elements.main){this.nav.elements.main.css({display:""})}if(this.elements.header){this.elements.header.css({display:""})}if(this.elements.footer){this.elements.footer.css({display:""})}if(h){this.playAutoplay()}}var j=this.getViewSize(this.slideIndex);this.modify(this.elements.crop,{width:j.x,height:j.y});if(this.elements.overlayPrev&&this.elements.overlayNext){if(this.options.direction==="x"){this.modify(this.elements.overlayPrev,{width:Math.round(j.x*(1-this.options.visibleArea)/2)});this.modify(this.elements.overlayNext,{width:Math.round(j.x*(1-this.options.visibleArea)/2)})}else{this.modify(this.elements.overlayPrev,{height:Math.round(j.y*(1-this.options.visibleArea)/2)});this.modify(this.elements.overlayNext,{height:Math.round(j.y*(1-this.options.visibleArea)/2)})}}var g=j[this.options.direction];j[this.options.direction]=this.slideSize;if(!this.autoSize||this.options.direction==="x"){k=j.x}if(!this.autoSize||this.options.direction==="y"){f=j.y}d.each(this.slides,function(n,m){if(m.isInjected()){m.size(k,f);if(i.options.type==="slide"){i.modify(m.element,{offset:i.getSlideOffset(n)})}}});this.preloadSlides(this.slideIndex);if(this.options.type==="slide"){this.modify(this.elements.slides,{offset:-i.getSlideOffset(this.slideIndex)+Math.round(g*(1-this.options.visibleArea)/2)})}if(l!==this.getVisibleSlidesCount()){this.nav.combineItems();this.cleanupSlides()}this.checkVisibility()};e.prototype.checkVisibility=function(){var g=!(a.hidden||a.webkitHidden);var h=false;var f=this.elements.main;var j=f.offset();var i=d(c);if(g&&j.lefti.scrollLeft()&&j.topi.scrollTop()){h=true}if(this.isVisible!==h){this.isVisible=h;if(h){this.playAutoplay()}else{this.pauseAutoplay()}}};e.prototype.getSlides=function(){return this.slides};e.prototype.setTouch=function(f){if(f!==this.isTouch){if(f){this.elements.main.addClass(this.options.cssPrefix+"touch").removeClass(this.options.cssPrefix+"no-touch")}else{this.elements.main.addClass(this.options.cssPrefix+"no-touch").removeClass(this.options.cssPrefix+"touch")}}if(f){this.lastTouchTime=new Date().getTime()}this.isTouch=f};e.prototype.setDragEvents=function(){var f=this;this.lastTouchTime=0;this.setTouch(false);var g={start:"mousedown",stop:"mouseup",move:"mousemove"};if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){g={start:"MSPointerDown",stop:"MSPointerUp",move:"MSPointerMove"};this.elements.crop.css("-ms-touch-action","pan-"+(this.options.direction==="x"?"y":"x")+" pinch-zoom double-tap-zoom");this.elements.main.on("MSPointerDown",function(h){if(h.originalEvent.pointerType===h.originalEvent.MSPOINTER_TYPE_TOUCH){f.setTouch(true)}})}else{if("ontouchstart" in c||"ontouchend" in a){g={start:g.start+" touchstart",stop:g.stop+" touchend touchcancel",move:g.move+" touchmove"};this.elements.main.on("touchstart",function(h){f.setTouch(true)})}}this.elements.crop.on(g.start,function(h){return f.onDragStart(h)});d(a).on(g.stop+".rsts",function(h){return f.onDragStop(h)});d(a).on(g.move+".rsts",function(h){return f.onDragMove(h)})};e.prototype.onDragStart=function(f){if(this.isDragging||(f.type==="mousedown"&&f.which!==1)||d(f.target).closest(".no-drag,a,button,input,select,textarea",this.elements.slides).length){return}if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){this.setTouch(f.originalEvent.pointerType===f.originalEvent.MSPOINTER_TYPE_TOUCH)}else{this.setTouch(f.type!=="mousedown"||new Date().getTime()-this.lastTouchTime<1000)}var g=this.getPositionFromEvent(f);if(!this.isTouch){f.preventDefault();this.stopAutoplay()}this.elements.main.addClass(this.options.cssPrefix+"dragging");this.isDragging=true;this.dragStartPos={x:g.x-this.elements.slides.offset().left+this.elements.crop.offset().left,y:g.y-this.elements.slides.offset().top+this.elements.crop.offset().top};this.dragLastPos=g[this.options.direction];this.dragLastDiff=0;this.touchStartPos=g;this.touchAxis="";this.modify(this.elements.slides,{offset:g[this.options.direction]-this.dragStartPos[this.options.direction]});this.onDragMove(f)};e.prototype.onDragStop=function(f){if(!this.isDragging){return}this.isDragging=false;this.elements.main.removeClass(this.options.cssPrefix+"dragging");var g=this.slideIndex+Math.floor((-this.getOffset(this.elements.slides)-this.activeSlideOffset+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2))/(this.slideSize+this.getGapSize()));if(this.dragLastDiff<=0){this.goTo(g,true)}else{this.goTo(g+1,true)}};e.prototype.onDragMove=function(j){if(!this.isDragging||(this.isTouch&&j.type==="mousemove")){return}var k=this.getPositionFromEvent(j);var g;if(this.isTouch){if(!this.touchAxis){g=Math.abs(k.x-this.touchStartPos.x)-Math.abs(k.y-this.touchStartPos.y);if(g>4){this.touchAxis="x"}else{if(g<-4){this.touchAxis="y"}}}if(this.touchAxis===this.options.direction){j.preventDefault();this.stopAutoplay()}else{if(!this.touchAxis){return}else{return this.onDragStop()}}if(j.originalEvent.touches&&j.originalEvent.touches[1]){return this.onDragStop()}}else{j.preventDefault();this.stopAutoplay()}var f=this.dragLastPos-k[this.options.direction];var i=k[this.options.direction]-this.dragStartPos[this.options.direction];var h=this.getVisibleSlidesCount();if(!this.options.loop){if(i>-this.getSlideOffset(0)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2)){i=(i*0.4)-((this.getSlideOffset(0)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2))*0.6)}if(i<-this.getSlideOffset(this.slides.length-h)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2)){i=(i*0.4)-((this.getSlideOffset(this.slides.length-h)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.options.visibleArea)/2))*0.6)}}this.modify(this.elements.slides,{offset:i});if(f<0||f>0){this.dragLastDiff=f}this.dragLastPos=k[this.options.direction]};e.prototype.getPositionFromEvent=function(f){var g={x:f.pageX,y:f.pageY};if(typeof g.x!=="number"){g={x:f.originalEvent.pageX,y:f.originalEvent.pageY}}if(f.originalEvent.touches&&f.originalEvent.touches[0]){g={x:f.originalEvent.touches[0].pageX,y:f.originalEvent.touches[0].pageY}}return g};return e})();b.SliderNav=(function(){function e(h){var g=this;this.slider=h;this.elements={};if(h.options.controls){this.elements.prev=d(a.createElement("a")).attr("href","").text("prev").addClass(h.options.cssPrefix+"prev").on("click",function(i){i.preventDefault();g.slider.prev()});this.elements.next=d(a.createElement("a")).attr("href","").text("next").on("click",function(i){i.preventDefault();g.slider.next()}).addClass(h.options.cssPrefix+"next");h.elements.view.append(this.elements.prev).append(this.elements.next)}if(h.options.navType!=="none"){this.elements.main=d(a.createElement("div")).addClass(h.options.cssPrefix+"nav "+h.options.cssPrefix+"nav-"+h.options.navType);this.elements.mainPrev=d(a.createElement("a")).attr("href","").text("prev").on("click",function(i){i.preventDefault();g.slider.prev()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-prev"));this.elements.mainNext=d(a.createElement("a")).attr("href","").text("next").on("click",function(i){i.preventDefault();g.slider.next()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-next"));var f=a.createElement("ul");d.each(this.slider.getSlides(),function(k,j){g.elements[k]=g.createNavItem(k,j.getData()).appendTo(f)});this.elements.mainPrev.parent().prependTo(f);this.elements.mainNext.parent().appendTo(f);this.elements.main.append(f);h.elements.main.append(this.elements.main)}}e.prototype.setActive=function(g){var f=this;var h=this.slider.getSlides();if(this.activeIndexes){d.each(this.activeIndexes,function(k,j){if(!f.elements[j]){return}f.elements[j].children("a").removeClass("active")})}if(this.elements[h.length]&&d.inArray(h.length-1,g)!==-1){g=[h.length]}this.activeIndexes=g;var i=false;d.each(this.activeIndexes,function(k,j){if(!f.elements[j]){return}if(f.elements[j][0].style.display!=="none"){i=true}f.elements[j].children("a").addClass("active")});if(!i&&this.elements[h.length]){d.each(this.activeIndexes,function(k,j){if(!f.elements[j]){return}f.elements[j].children("a").removeClass("active")});this.activeIndexes=[h.length];this.elements[h.length].children("a").addClass("active")}};e.prototype.combineItems=function(){var h=this.slider.getVisibleSlidesCount();var j=this.slider.getSlides();if(this.elements[j.length]){this.elements[j.length].remove();delete this.elements[j.length]}d.each(this.elements,function(){this.css("display","")});if(h<2||!this.slider.options.combineNavItems){return}var k;for(var g=0;this.elements[g];g++){if((g-Math.floor((h-1)/2))%h||(g-Math.floor((h-1)/2))>j.length-h){this.elements[g].css("display","none")}else{k=g}}if(j.length%h===0){this.elements[j.length-h+Math.floor((h-1)/2)].css("display","")}else{var f=j.length-(j.length%h||h)+Math.floor((h-1)/2);this.elements[j.length]=this.createNavItem(f,j[f>=j.length?j.length-1:f].getData()).insertAfter(this.elements[j.length-1])}};e.prototype.createNavItem=function(g,h){var f=this;return d(a.createElement("li")).addClass(f.slider.options.cssPrefix+"nav-item").append(d(a.createElement("a")).attr("href","").text((f.slider.options.navType!=="numbers"&&h.name)?h.name:(h.index+1)).on("click",function(j){j.preventDefault();var i=f.slider.getVisibleSlidesCount();var k=g-Math.floor((i-1)/2);if(!f.slider.options.loop){k=Math.min(f.slider.slides.length-i,Math.max(0,k))}else{if(k<0){k+=f.slider.slides.length}else{if(k>=f.slider.slides.length){k-=f.slider.slides.length}}}f.slider.goTo(k)}))};e.prototype.getSize=function(){if(!this.elements.main||this.elements.main.css("position")==="absolute"){return{x:0,y:0}}return{x:this.elements.main.outerWidth(true),y:this.elements.main.outerHeight(true)}};return e})();d.fn.rstSlider=function(f){var e=arguments;return this.each(function(){var h=d(this);if(typeof f==="string"){var g=h.data("rstSlider");if(g&&g[f]){return g[f].apply(g,Array.prototype.slice.call(e,1))}}else{if(!h.data("rstSlider")){h.data("rstSlider",new b.Slider(h,f))}}})}})(jQuery,window,document); +/*! + * jQuery UI Effects 1.10.1 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/effects-core/ + */ +(function(b){var a={};b.each(["Quad","Cubic","Quart","Quint","Expo"],function(d,c){a[c]=function(e){return Math.pow(e,d+2)}});b.extend(a,{Sine:function(c){return 1-Math.cos(c*Math.PI/2)},Circ:function(c){return 1-Math.sqrt(1-c*c)},Elastic:function(c){return c===0||c===1?c:-Math.pow(2,8*(c-1))*Math.sin(((c-1)*80-7.5)*Math.PI/15)},Back:function(c){return c*c*(3*c-2)},Bounce:function(e){var c,d=4;while(e<((c=Math.pow(2,--d))-1)/11){}return 1/Math.pow(4,3-d)-7.5625*Math.pow((c*3-2)/22-e,2)}});b.each(a,function(d,c){b.easing["easeIn"+d]=c;b.easing["easeOut"+d]=function(e){return 1-c(1-e)};b.easing["easeInOut"+d]=function(e){return e<0.5?c(e*2)/2:1-c(e*-2+2)/2}})})(jQuery); \ No newline at end of file diff --git a/src/MadeYourDay/Contao/Module/Slider.php b/src/MadeYourDay/Contao/Module/Slider.php index aed5854..5d8c78e 100644 --- a/src/MadeYourDay/Contao/Module/Slider.php +++ b/src/MadeYourDay/Contao/Module/Slider.php @@ -215,7 +215,7 @@ protected function compile() $this->Template->options = $options; - $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rocksolid-slider/assets/js/rocksolid-slider-1.3.0.min.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rocksolid-slider/assets/js/rocksolid-slider-1.3.1.min.js|static'; $GLOBALS['TL_CSS'][] = 'system/modules/rocksolid-slider/assets/css/rocksolid-slider.min.css||static'; $skinPath = 'system/modules/rocksolid-slider/assets/css/' . (empty($this->arrData['rsts_skin']) ? 'default' : $this->arrData['rsts_skin']) . '-skin.min.css'; if (file_exists(TL_ROOT . '/' . $skinPath)) { From 67cbc4f14fa126b80410d181525dfb09cec197b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 11 Mar 2014 15:54:15 +0100 Subject: [PATCH 05/29] Added option `imagePosition` --- dca/tl_content.php | 16 ++++++++++-- dca/tl_module.php | 16 ++++++++++-- dca/tl_rocksolid_slide.php | 32 +++++++++++++++++++++--- languages/de/tl_module.php | 12 +++++++++ languages/de/tl_rocksolid_slide.php | 19 +++++++++++--- languages/en/tl_module.php | 12 +++++++++ languages/en/tl_rocksolid_slide.php | 19 +++++++++++--- src/MadeYourDay/Contao/Module/Slider.php | 2 +- templates/rsts_default.html5 | 17 +++++++++++-- templates/rsts_default.xhtml | 17 +++++++++++-- 10 files changed, 141 insertions(+), 21 deletions(-) diff --git a/dca/tl_content.php b/dca/tl_content.php index c692f06..a5173d6 100644 --- a/dca/tl_content.php +++ b/dca/tl_content.php @@ -20,7 +20,7 @@ // Load module language file $this->loadLanguageFile('tl_module'); -$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_slider'] = '{type_legend},type,headline;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_scaleMode,rsts_captions;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_prevNextSteps,rsts_slideMinSize,rsts_visibleArea,rsts_combineNavItems;{template_legend:hide},rsts_template,size;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; +$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_slider'] = '{type_legend},type,headline;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_prevNextSteps,rsts_slideMinSize,rsts_visibleArea,rsts_combineNavItems;{template_legend:hide},rsts_template,size;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_id'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_id'], @@ -228,7 +228,19 @@ 'fit' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'], 'crop' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'], 'scale' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'], + 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_none'], ), + 'eval' => array('tl_class' => 'w50 clr'), + 'sql' => "varchar(64) NOT NULL default ''", +); +// image position (center, top, right, bottom, left, top-left, top-right, bottom-left, bottom-right) +// use the attribute data-rsts-position to set it per slide +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_imagePosition'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('center', 'top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right'), + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); @@ -253,7 +265,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_captions'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50'), + 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default '1'", ); // maximum number of visible slides diff --git a/dca/tl_module.php b/dca/tl_module.php index 9fa822c..28cb241 100644 --- a/dca/tl_module.php +++ b/dca/tl_module.php @@ -12,7 +12,7 @@ * @author Martin Auswöger */ -$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_slider'] = '{title_legend},name,headline,type;{config_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_scaleMode,rsts_captions;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_prevNextSteps,rsts_slideMinSize,rsts_visibleArea,rsts_combineNavItems;{template_legend:hide},rsts_template,imgSize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_slider'] = '{title_legend},name,headline,type;{config_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_prevNextSteps,rsts_slideMinSize,rsts_visibleArea,rsts_combineNavItems;{template_legend:hide},rsts_template,imgSize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_id'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_id'], @@ -220,7 +220,19 @@ 'fit' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'], 'crop' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'], 'scale' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'], + 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_none'], ), + 'eval' => array('tl_class' => 'w50 clr'), + 'sql' => "varchar(64) NOT NULL default ''", +); +// image position (center, top, right, bottom, left, top-left, top-right, bottom-left, bottom-right) +// use the attribute data-rsts-position to set it per slide +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_imagePosition'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('center', 'top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right'), + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", ); @@ -245,7 +257,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_captions'], 'exclude' => true, 'inputType' => 'checkbox', - 'eval' => array('tl_class' => 'w50'), + 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default '1'", ); // maximum number of visible slides diff --git a/dca/tl_rocksolid_slide.php b/dca/tl_rocksolid_slide.php index bf7b70e..addcb70 100644 --- a/dca/tl_rocksolid_slide.php +++ b/dca/tl_rocksolid_slide.php @@ -90,7 +90,7 @@ ), 'palettes' => array( - 'default' => '{title_legend},title,videoURL,singleSRC,scaleMode,centerContent;{background_legend},backgroundImage,backgroundVideos,backgroundImageSize,backgroundScaleMode;{publish_legend},published,start,stop', + 'default' => '{title_legend},title,videoURL,singleSRC,scaleMode,imagePosition,centerContent;{background_legend},backgroundImage,backgroundVideos,backgroundImageSize,backgroundScaleMode,backgroundPosition;{publish_legend},published,start,stop', ), 'fields' => array( @@ -139,7 +139,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'], 'exclude' => true, 'inputType' => 'select', - 'options' => array('fit', 'crop', 'scale'), + 'options' => array('fit', 'crop', 'scale', 'none'), 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes'], 'eval' => array( 'includeBlankOption' => true, @@ -147,6 +147,18 @@ ), 'sql' => "varchar(64) NOT NULL default ''", ), + 'imagePosition' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePosition'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('center', 'top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right'), + 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions'], + 'eval' => array( + 'includeBlankOption' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default ''", + ), 'centerContent' => array( 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'], 'exclude' => true, @@ -210,8 +222,20 @@ 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'], 'exclude' => true, 'inputType' => 'select', - 'options' => array('fit', 'crop', 'scale'), - 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes'], + 'options' => array('fit', 'crop', 'scale', 'none'), + 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes'], + 'eval' => array( + 'includeBlankOption' => true, + 'tl_class' => 'w50 clr', + ), + 'sql' => "varchar(64) NOT NULL default ''", + ), + 'backgroundPosition' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundPosition'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('center', 'top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right'), + 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions'], 'eval' => array( 'includeBlankOption' => true, 'tl_class' => 'w50', diff --git a/languages/de/tl_module.php b/languages/de/tl_module.php index 945448d..e9b4e9b 100644 --- a/languages/de/tl_module.php +++ b/languages/de/tl_module.php @@ -74,6 +74,18 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'] = 'Proportional'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'] = 'Beschneiden'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'] = 'Verzerren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_none'] = 'Nicht skalieren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'][0] = 'Bildpositionierung'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'][1] = 'Position der Bilder und Hintergrundbilder.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['center'] = 'Zentriert'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['top'] = 'Oben Mitte'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['right'] = 'Rechts Mitte'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['bottom'] = 'Unten Mitte'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['left'] = 'Links Mitte'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['top-left'] = 'Oben Links'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['top-right'] = 'Oben Rechts'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['bottom-left'] = 'Unten Links'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['bottom-right'] = 'Unten Rechts'; $GLOBALS['TL_LANG']['tl_module']['rsts_deepLinkPrefix'][0] = 'Deep-Link-Prefix'; $GLOBALS['TL_LANG']['tl_module']['rsts_deepLinkPrefix'][1] = 'Beispiel: "slide-". Tragen Sie ein Prefix ein um Deep-Linking zu aktivieren.'; $GLOBALS['TL_LANG']['tl_module']['rsts_keyboard'][0] = 'Tastaturnavigation aktivieren'; diff --git a/languages/de/tl_rocksolid_slide.php b/languages/de/tl_rocksolid_slide.php index 1a48e56..0938cc9 100644 --- a/languages/de/tl_rocksolid_slide.php +++ b/languages/de/tl_rocksolid_slide.php @@ -45,6 +45,18 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['fit'] = 'Proportional'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['crop'] = 'Beschneiden'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['scale'] = 'Verzerren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['none'] = 'Nicht skalieren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePosition'][0] = 'Bildpositionierung'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePosition'][1] = 'Position des Bildes. Diese Einstellung überschreibt die Moduleinstellungen.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['center'] = 'Zentriert'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['top'] = 'Oben Mitte'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['right'] = 'Rechts Mitte'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['bottom'] = 'Unten Mitte'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['left'] = 'Links Mitte'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['top-left'] = 'Oben Links'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['top-right'] = 'Oben Rechts'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['bottom-left'] = 'Unten Links'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['bottom-right'] = 'Unten Rechts'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][0] = 'Inhalt zentrieren'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][1] = 'Zentriert den Inhalt des Slides horizontal und/oder vertikal. Diese Einstellung überschreibt die Moduleinstellungen.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['false'] = 'Nicht zentrieren'; @@ -58,11 +70,10 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'][1] = 'Wählen Sie eine oder mehrere Videodateien aus, um im Hintergrund des Slides ein Video anzuzeigen.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][0] = 'Hintergrundbild Größe'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][1] = 'Die Größe des Hintergrundbildes in Pixel.'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][0] = 'Skalierungsmodus'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][0] = 'Hintergrund-Skalierungsmodus'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][1] = 'Skalierungsmodus des Hintergrundbildes bzw. des Hintergrundvideos.'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['fit'] = 'Proportional'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['crop'] = 'Beschneiden'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['scale'] = 'Verzerren'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundPosition'][0] = 'Hintergrundposition'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundPosition'][1] = 'Position des Hintergrundbildes oder Videos. Diese Einstellung überschreibt die Moduleinstellungen.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['publish_legend'] = 'Veröffentlichung'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][0] = 'Slide veröffentlichen'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][1] = 'Den Slide auf der Webseite anzeigen.'; diff --git a/languages/en/tl_module.php b/languages/en/tl_module.php index cdd667f..c2aa49f 100644 --- a/languages/en/tl_module.php +++ b/languages/en/tl_module.php @@ -74,6 +74,18 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'] = 'Proportional'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'] = 'Cut'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'] = 'Distort'; +$GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_none'] = 'None'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'][0] = 'Image positioning'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'][1] = 'Position of images and background images.'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['center'] = 'Centered'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['top'] = 'Top Center'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['right'] = 'Right Center'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['bottom'] = 'Bottom Center'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['left'] = 'Left Center'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['top-left'] = 'Top Left'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['top-right'] = 'Top Right'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['bottom-left'] = 'Bottom Left'; +$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions']['bottom-right'] = 'Bottom Right'; $GLOBALS['TL_LANG']['tl_module']['rsts_deepLinkPrefix'][0] = 'Deep link prefix'; $GLOBALS['TL_LANG']['tl_module']['rsts_deepLinkPrefix'][1] = 'Example: "slide-". Enter a prefix to activate deep links.'; $GLOBALS['TL_LANG']['tl_module']['rsts_keyboard'][0] = 'Activate keyboard navigation'; diff --git a/languages/en/tl_rocksolid_slide.php b/languages/en/tl_rocksolid_slide.php index 1dc9e60..b68f864 100644 --- a/languages/en/tl_rocksolid_slide.php +++ b/languages/en/tl_rocksolid_slide.php @@ -45,6 +45,18 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['fit'] = 'Proportional'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['crop'] = 'Cut'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['scale'] = 'Distort'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['none'] = 'None'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePosition'][0] = 'Image position'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePosition'][1] = 'Position of the image. This setting overwrites the module settings.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['center'] = 'Centered'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['top'] = 'Top Center'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['right'] = 'Right Center'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['bottom'] = 'Bottom Center'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['left'] = 'Left Center'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['top-left'] = 'Top Left'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['top-right'] = 'Top Right'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['bottom-left'] = 'Bottom Left'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['imagePositions']['bottom-right'] = 'Bottom Right'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][0] = 'Center content'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContent'][1] = 'Centers the contents of the slide horizontally and/or vertically. This setting overwrites the module settings.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['false'] = 'Not centered'; @@ -58,11 +70,10 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundVideos'][1] = 'Choose one or more video files to display a video in the background of the slide.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][0] = 'Background image size'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundImageSize'][1] = 'The background image size in pixels.'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][0] = 'Scale mode'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][0] = 'Background scale mode'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleMode'][1] = 'Scale mode of the background image or video.'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['fit'] = 'Proportional'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['crop'] = 'Cut'; -$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundScaleModes']['scale'] = 'Distort'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundPosition'][0] = 'Background position'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['backgroundPosition'][1] = 'Position of the background image or video. This setting overwrites the module settings.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['publish_legend'] = 'Publish'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][0] = 'Publish slide'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][1] = 'Display the slide on the website.'; diff --git a/src/MadeYourDay/Contao/Module/Slider.php b/src/MadeYourDay/Contao/Module/Slider.php index 5d8c78e..d6f2414 100644 --- a/src/MadeYourDay/Contao/Module/Slider.php +++ b/src/MadeYourDay/Contao/Module/Slider.php @@ -165,7 +165,7 @@ protected function compile() $options = array(); // strings - foreach (array('type', 'direction', 'cssPrefix', 'skin', 'width', 'height', 'navType', 'scaleMode', 'deepLinkPrefix') as $key) { + foreach (array('type', 'direction', 'cssPrefix', 'skin', 'width', 'height', 'navType', 'scaleMode', 'imagePosition', 'deepLinkPrefix') as $key) { if (! empty($this->arrData['rsts_' . $key])) { $options[$key] = $this->arrData['rsts_' . $key]; } diff --git a/templates/rsts_default.html5 b/templates/rsts_default.html5 index c43b368..73ac293 100644 --- a/templates/rsts_default.html5 +++ b/templates/rsts_default.html5 @@ -32,11 +32,24 @@ $attributes[] = 'data-rsts-center="' . $slide['centerContent'] . '"'; } $attributes = implode(' ', $attributes); + $imageAttributes = array(); if (!empty($slide['scaleMode'])) { $imageAttributes[] = 'data-rsts-scale-mode="' . $slide['scaleMode'] . '"'; } + if (!empty($slide['imagePosition'])) { + $imageAttributes[] = 'data-rsts-position="' . $slide['imagePosition'] . '"'; + } $imageAttributes = implode(' ', $imageAttributes); + + $backgroundAttributes = array(); + if (!empty($slide['backgroundScaleMode'])) { + $backgroundAttributes[] = 'data-rsts-scale-mode="' . $slide['backgroundScaleMode'] . '"'; + } + if (!empty($slide['backgroundPosition'])) { + $backgroundAttributes[] = 'data-rsts-position="' . $slide['backgroundPosition'] . '"'; + } + $backgroundAttributes = implode(' ', $backgroundAttributes); ?> @@ -63,13 +76,13 @@ -