// MAKE THE LIGHTBOX DIVS
// Code inserts html at the bottom of the page that looks similar to this:
+ // (default layout)
//
// <div id="overlay"></div>
// <div id="lightbox">
// </div>
// </div>
+ var settings = Drupal.settings.lightbox2;
+
var Body = document.getElementsByTagName("body").item(0);
var Overlay = document.createElement("div");
var HoverNav = document.createElement("div");
HoverNav.setAttribute('id', 'hoverNav');
- ImageContainer.appendChild(HoverNav);
+ if (!settings.use_alt_layout) {
+ ImageContainer.appendChild(HoverNav);
+ }
var PrevLink = document.createElement("a");
PrevLink.setAttribute('id', 'prevLink');
var ImageData = document.createElement("div");
ImageData.setAttribute('id', 'imageData');
ImageDataContainer.appendChild(ImageData);
+ if (settings.use_alt_layout) {
+ ImageData.appendChild(HoverNav);
+ }
var ImageDetails = document.createElement("div");
ImageDetails.setAttribute('id', 'imageDetails');
var BottomNav = document.createElement("div");
BottomNav.setAttribute('id', 'bottomNav');
- ImageData.appendChild(BottomNav);
-
var BottomNavCloseLink = document.createElement("a");
BottomNavCloseLink.setAttribute('id', 'bottomNavClose');
BottomNavZoomLink.setAttribute('id', 'bottomNavZoom');
BottomNavZoomLink.setAttribute('href', '#');
BottomNav.appendChild(BottomNavZoomLink);
+ if (settings.use_alt_layout) {
+ ImageContainer.appendChild(BottomNav);
+ }
+ else {
+ ImageData.appendChild(BottomNav);
+ }
+
$("#overlay").click(function() { Lightbox.end(); } ).hide();
$('#prevLink').css({ paddingTop: Lightbox.borderSize});
$('#nextLink').css({ paddingTop: Lightbox.borderSize});
+ // Force navigation links to always be displayed
+ if (settings.force_show_nav) {
+ $('#prevLink').addClass("force_show_nav");
+ $('#nextLink').addClass("force_show_nav");
+ }
},
}
}
- $('#prevLink').css({height: imgHeight + 'px'});
- $('#nextLink').css({height: imgHeight + 'px'});
+ var settings = Drupal.settings.lightbox2;
+ if (!settings.use_alt_layout) {
+ $('#prevLink').css({height: imgHeight + 'px'});
+ $('#nextLink').css({height: imgHeight + 'px'});
+ }
$('#imageDataContainer').css({width: widthNew + 'px'});
},
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
+
+ // Add Checkbox for Alternative Layout
+ $form['lightbox2_general_options']['lightbox2_use_alt_layout'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Use Alternative Layout'),
+ '#description' => t('Enabling this option alters the layout of the lightbox elements. This doesn\'t apply when using Lightbox Lite.'),
+ '#default_value' => variable_get('lightbox2_use_alt_layout', false),
+ );
+
+ // Add Checkbox for Force Navigation display
+ $form['lightbox2_general_options']['lightbox2_force_show_nav'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Force visibility of navigation links'),
+ '#description' => t('When viewing grouped images using the default layout, the navigational links to the next and previous images are only displayed when you hover over the image. Checking this box forces these links to be displayed all the time.'),
+ '#default_value' => variable_get('lightbox2_force_show_nav', false),
+ );
// Add text box for image count for grouping
$form['lightbox2_general_options']['lightbox2_image_count_str'] = array(
'#description' => t('By default, when the image being displayed in the lightbox is larger than the browser window, it is resized to fit within the window and a zoom button is provided for users who wish to view the image in its original size. Checking this box will disable this feature and all images will be displayed without any resizing.'),
'#default_value' => variable_get('lightbox2_disable_zoom', false),
);
-
+
// Add Checkbox for Gallery2 Image Filter.
$form['lightbox2_general_options']['lightbox2G2_filter'] = array(
'#type' => 'checkbox',
// load the javascript settings
$js_settings = array(
+ 'use_alt_layout' => variable_get('lightbox2_use_alt_layout', false),
'disable_zoom' => variable_get('lightbox2_disable_zoom', false),
+ 'force_show_nav' => variable_get('lightbox2_force_show_nav', false),
'group_images' => variable_get('lightbox2_image_group', true),
'disable_for_gallery_lists' => variable_get('lightbox2_disable_nested_galleries', true),
'node_link_text' => t(variable_get('lightbox2_node_link_text', 'View Image Details')),
// Lightbox2 Plus
if (!variable_get('lightbox2_lite', false)) {
$css = $path .'/css/lightbox.css';
+ if (variable_get('lightbox2_use_alt_layout', false)) {
+ $css = $path .'/css/lightbox_alt.css';
+ }
if (function_exists('drupal_add_css')) {
drupal_add_css($css);
}