Commit 590c648d authored by frjo's avatar frjo
Browse files

#767166: Added a number of settings for slideshow and moved them to ther own sub filedset.

parent 4712f7f0
......@@ -127,14 +127,18 @@ function colorbox_admin_settings() {
'#prefix' => '<div class="colorbox-custom-settings-activate">',
'#suffix' => '</div>',
);
$js_hide = variable_get('colorbox_custom_settings_activate', 0) ? '' : ' js-hide';
$form['colorbox_custom_settings']['wrapper_start'] = array(
'#value' => '<div class="colorbox-custom-settings'. $js_hide .'">',
);
$form['colorbox_custom_settings']['colorbox_transition_type'] = array(
'#type' => 'select',
'#title' => t('Transition type'),
'#options' => array('elastic' => t('Elastic'), 'fade' => t('Fade'), 'none' => t('None')),
'#default_value' => variable_get('colorbox_transition_type', 'elastic'),
'#description' => t('The transition type.'),
'#prefix' => '<div class="colorbox-custom-settings'. $js_hide .'">',
);
$form['colorbox_custom_settings']['colorbox_transition_speed'] = array(
'#type' => 'select',
......@@ -150,13 +154,6 @@ function colorbox_admin_settings() {
'#default_value' => variable_get('colorbox_opacity', '0.90'),
'#description' => t('The overlay opacity level. Range: 0 to 1.'),
);
$form['colorbox_custom_settings']['colorbox_slideshow'] = array(
'#type' => 'radios',
'#title' => t('Slideshow'),
'#options' => array(0 => t('No'), 1 => t('Yes')),
'#default_value' => variable_get('colorbox_slideshow', 0),
'#description' => t('An automatic slideshow to a content group / gallery.'),
);
$form['colorbox_custom_settings']['colorbox_text_current'] = array(
'#type' => 'textfield',
'#title' => t('Current'),
......@@ -180,7 +177,50 @@ function colorbox_admin_settings() {
'#title' => t('Close'),
'#default_value' => variable_get('colorbox_text_close', 'Close'),
'#description' => t('Text for the close button. The "Esc" key will also close Colorbox.'),
'#suffix' => '</div>',
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Slideshow settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_slideshow'] = array(
'#type' => 'radios',
'#title' => t('Slideshow'),
'#options' => array(0 => t('No'), 1 => t('Yes')),
'#default_value' => variable_get('colorbox_slideshow', 0),
'#description' => t('An automatic slideshow to a content group / gallery.'),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_slideshowauto'] = array(
'#type' => 'radios',
'#title' => t('Slideshow autostart'),
'#options' => array(0 => t('No'), 1 => t('Yes')),
'#default_value' => variable_get('colorbox_slideshowauto', 1),
'#description' => t('If the slideshow should automatically start to play.'),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_slideshowspeed'] = array(
'#type' => 'select',
'#title' => t('Slideshow speed'),
'#options' => drupal_map_assoc(array(1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000)),
'#default_value' => variable_get('colorbox_slideshowspeed', 2500),
'#description' => t('Sets the speed of the slideshow, in milliseconds.'),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_text_start'] = array(
'#type' => 'textfield',
'#title' => t('Start slideshow'),
'#default_value' => variable_get('colorbox_text_start', 'start slideshow'),
'#description' => t('Text for the slideshow start button.'),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_text_stop'] = array(
'#type' => 'textfield',
'#title' => t('Stop slideshow'),
'#default_value' => variable_get('colorbox_text_stop', 'stop slideshow'),
'#description' => t('Text for the slideshow stop button.'),
);
$form['colorbox_custom_settings']['wrapper_stop'] = array(
'#value' => '</div>',
);
$form['colorbox_advanced_settings'] = array(
......
......@@ -145,6 +145,10 @@ function _colorbox_doheader() {
'speed' => variable_get('colorbox_transition_speed', 350),
'opacity' => variable_get('colorbox_opacity', '0.9'),
'slideshow' => variable_get('colorbox_slideshow', 0) ? TRUE : FALSE,
'slideshowauto' => variable_get('colorbox_slideshowauto', 1) ? TRUE : FALSE,
'slideshowspeed' => variable_get('colorbox_slideshowspeed', 2500),
'slideshowstart' => variable_get('colorbox_text_start', 'start slideshow'),
'slideshowstop' => variable_get('colorbox_text_stop', 'stop slideshow'),
'current' => variable_get('colorbox_text_current', '{current} of {total}'),
'previous' => variable_get('colorbox_text_previous', '« Prev'),
'next' => variable_get('colorbox_text_next', 'Next »'),
......@@ -157,6 +161,10 @@ function _colorbox_doheader() {
'speed' => 350,
'opacity' => '0.85',
'slideshow' => FALSE,
'slideshowauto' => FALSE,
'slideshowspeed' => 2500,
'slideshowstart' => '',
'slideshowstop' => '',
'current' => t('{current} of {total}'),
'previous' => t('« Prev'),
'next' => t('Next »'),
......
......@@ -6,6 +6,10 @@ Drupal.behaviors.initColorbox = function (context) {
speed:settings.speed,
opacity:settings.opacity,
slideshow:settings.slideshow,
slideshowSpeed:settings.slideshowspeed,
slideshowAuto:settings.slideshowauto,
slideshowStart:settings.slideshowstart,
slideshowStop:settings.slideshowstop,
maxWidth:'100%',
maxHeight:'100%',
current:settings.current,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment