diff --git a/lightbox.css b/lightbox.css index 0ae636976766e543fe134d0563a92297e571c529..556b41a7a2acf4a5a367c93b41fa7e16ca80967f 100644 --- a/lightbox.css +++ b/lightbox.css @@ -1,110 +1,110 @@ -#lightbox{ - position: absolute; - top: 40px; - left: 0; - width: 100%; - z-index: 100; - text-align: center; - line-height: 0; - } +#lightbox { + position: absolute; + top: 40px; + left: 0; + width: 100%; + z-index: 100; + text-align: center; + line-height: 0; +} -#lightbox a img{ border: none; } +#lightbox a img { border: none; } -#outerImageContainer{ - position: relative; - background-color: #fff; - width: 250px; - height: 250px; - margin: 0 auto; - } +#outerImageContainer { + position: relative; + background-color: #fff; + width: 250px; + height: 250px; + margin: 0 auto; +} -#imageContainer{ - padding: 10px; - } +#imageContainer { + padding: 10px; +} -#loading{ - position: absolute; - top: 40%; - left: 45%; - *left: 0%; - height: 25%; - width: 100%; - text-align: center; - line-height: 0; - } -#hoverNav{ - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - z-index: 10; - } -#imageContainer>#hoverNav{ left: 0;} -#hoverNav a{ outline: none;} +#loading { + position: absolute; + top: 40%; + left: 45%; + *left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} +#hoverNav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} +#imageContainer>#hoverNav { left: 0; } +#hoverNav a { outline: none; } -#prevLink, #nextLink{ - width: 49%; - height: 100%; - background: transparent url(images/blank.gif) no-repeat; /* Trick IE into showing hover */ - display: block; - } -#prevLink { left: 0; float: left;} -#nextLink { right: 0; float: right;} +#prevLink, #nextLink { + width: 49%; + height: 100%; + background: transparent url(images/blank.gif) no-repeat; /* Trick IE into showing hover */ + display: block; +} +#prevLink { left: 0; float: left; } +#nextLink { right: 0; float: right; } #prevLink:hover, #prevLink:visited:hover { background: url(images/prevlabel.gif) left 15% no-repeat; } #nextLink:hover, #nextLink:visited:hover { background: url(images/nextlabel.gif) right 15% no-repeat; } -#imageDataContainer{ - font: 10px Verdana, Helvetica, sans-serif; - background-color: #fff; - margin: 0 auto; - line-height: 1.4em; - } +#imageDataContainer { + font: 10px Verdana, Helvetica, sans-serif; + background-color: #fff; + margin: 0 auto; + line-height: 1.4em; +} -#imageData{ - padding:0 10px; - } -#imageData #imageDetails{ width: 70%; float: left; text-align: left; } -#imageData #caption{ font-weight: bold; } -#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; } -#imageData #bottomNavClose{ width: 66px; float: right; padding-top: 0.7em; } +#imageData { + padding: 0 10px; +} +#imageData #imageDetails { width: 70%; float: left; text-align: left; } +#imageData #caption { font-weight: bold; } +#imageData #numberDisplay { display: block; clear: left; padding-bottom: 1.0em;} +#imageData #bottomNavClose { width: 66px; float: right; padding-top: 0.7em; } #imageData #bottomNav { height: 57px; } -#overlay{ - position: absolute; - top: 0; - left: 0; - z-index: 90; - width: 100%; - height: 500px; - background-color: #000; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; - } +#overlay { + position: absolute; + top: 0; + left: 0; + z-index: 90; + width: 100%; + height: 500px; + background-color: #000; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} .clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; - } + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} * html>body .clearfix { - display: inline; - width: 100%; - } + display: inline; + width: 100%; +} * html .clearfix { - /* Hides from IE-mac \*/ - height: 1%; - /* End hide from IE-mac */ - } + /* Hides from IE-mac \*/ + height: 1%; + /* End hide from IE-mac */ +} -/*Image location mod*/ +/* Image location mod */ #bottomNavClose { display: block; background: url(images/closelabel.gif) no-repeat; @@ -121,11 +121,11 @@ height: 32px; } #bottomNavZoom { -display:block; -background: url(images/expand.gif) no-repeat; -width:34px; -height:34px; -position:relative; -float:right; -left: 66px; + display: block; + background: url(images/expand.gif) no-repeat; + width: 34px; + height: 34px; + position: relative; + float: right; + left: 66px; } diff --git a/lightbox2.module b/lightbox2.module index 8785f5b2e46fad67a6f421f21f5b046a1e2946f0..8bc0d2cda7c5f0d1f009f49ae44a876638b6310b 100644 --- a/lightbox2.module +++ b/lightbox2.module @@ -8,6 +8,7 @@ * * Module by: Mark Ashmead * Mailto: bugzie@gmail.com + * Co-maintainer: Stella Power (http://drupal.org/user/66894) * * Image Node Support: Steve McKenzie * @@ -52,96 +53,104 @@ in each set. Go nuts!

'); * Implementation of hook_nodeapi(). */ function lightbox2_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { - global $LIGHTBOX2_INCLUDE; + global $LIGHTBOX2_INCLUDE; - if ($op == "view" && !$LIGHTBOX2_INCLUDE) { - lightbox2_add_files(); - $LIGHTBOX2_INCLUDE = true; - } - elseif ($node->type == "image" && !$LIGHTBOX2_INCLUDE) { - lightbox2_add_files(); - $LIGHTBOX2_INCLUDE = true; - } + if ($op == "view" && !$LIGHTBOX2_INCLUDE) { + lightbox2_add_files(); + $LIGHTBOX2_INCLUDE = true; + } + elseif ($node->type == "image" && !$LIGHTBOX2_INCLUDE) { + lightbox2_add_files(); + $LIGHTBOX2_INCLUDE = true; + } } /** * Implementation of hook_settings(). */ function lightbox2_settings() { - // Define Lightbox2 Plus form. - $form["lightbox2_plus_options"] = array( - "#type" => "fieldset", - "#title" => t("Lightbox2 Plus"), - "#collapsible" => TRUE, - "#collapsed" => FALSE, - ); - // Add Checkbox for Lightbox2 Plus. - $form["lightbox2_plus_options"]["lightbox2_plus"] = array( - "#type" => "checkbox", - "#title" => t("Use Lightbox2 Plus"), - "#description" => t("Un-checking this box will enable Lightbox2 Lite."), - "#default_value" => variable_get("lightbox2_plus", true), - "#return_value" => true, - ); - // Define Image Node Options form. - $form["image_node_options"] = array( - "#type" => "fieldset", - "#title" => t("Lightbox2 Plus Image Node options"), - "#collapsible" => TRUE, - "#collapsed" => TRUE, - ); - // Add Checkbox for Image Node. - $form["image_node_options"]["lightbox2_image_node"] = array( - "#type" => "checkbox", - "#title" => t("Enable for Image Nodes"), - "#description" => t("Checking this box will enable automatic URL formatting for Image Nodes."), - "#default_value" => variable_get("lightbox2_image_node", true), - "#return_value" => true, - ); - // Add Checkbox for Image Node Grouping. - $form["image_node_options"]["lightbox2_image_group"] = array( - "#type" => "checkbox", - "#title" => t("Enable Grouping"), - "#description" => t("Checking this box will enable automatic grouping of Image Nodes on a page. Useful for image galleries."), - "#default_value" => variable_get("lightbox2_image_group", true), - "#return_value" => true, - ); - // Add Checkbox for Gallery2 Image Filter. - $form["image_node_options"]["lightbox2G2_filter"] = array( - "#type" => "checkbox", - "#title" => t("Enable Gallery 2 Filter"), - "#description" => t("Checking this box will enable the Gallery 2 filter."), - "#default_value" => variable_get("lightbox2G2_filter", true), - "#return_value" => true, - ); + // Define Lightbox2 Plus form. + $form["lightbox2_plus_options"] = array( + "#type" => "fieldset", + "#title" => t("Lightbox2 Plus"), + "#collapsible" => TRUE, + "#collapsed" => FALSE, + ); + + // Add Checkbox for Lightbox2 Plus. + $form["lightbox2_plus_options"]["lightbox2_plus"] = array( + "#type" => "checkbox", + "#title" => t("Use Lightbox2 Plus"), + "#description" => t("Un-checking this box will enable Lightbox2 Lite."), + "#default_value" => variable_get("lightbox2_plus", true), + "#return_value" => true, + ); + + // Define Image Node Options form. + $form["image_node_options"] = array( + "#type" => "fieldset", + "#title" => t("Lightbox2 Plus Image Node options"), + "#collapsible" => TRUE, + "#collapsed" => TRUE, + ); + + // Add Checkbox for Image Node. + $form["image_node_options"]["lightbox2_image_node"] = array( + "#type" => "checkbox", + "#title" => t("Enable for Image Nodes"), + "#description" => t("Checking this box will enable automatic URL formatting for Image Nodes."), + "#default_value" => variable_get("lightbox2_image_node", true), + "#return_value" => true, + ); + + // Add Checkbox for Image Node Grouping. + $form["image_node_options"]["lightbox2_image_group"] = array( + "#type" => "checkbox", + "#title" => t("Enable Grouping"), + "#description" => t("Checking this box will enable automatic grouping of Image Nodes on a page. Useful for image galleries."), + "#default_value" => variable_get("lightbox2_image_group", true), + "#return_value" => true, + ); + + // Add Checkbox for Gallery2 Image Filter. + $form["image_node_options"]["lightbox2G2_filter"] = array( + "#type" => "checkbox", + "#title" => t("Enable Gallery 2 Filter"), + "#description" => t("Checking this box will enable the Gallery 2 filter."), + "#default_value" => variable_get("lightbox2G2_filter", true), + "#return_value" => true, + ); - return $form; + return $form; } + /** - *Implementation of hook_filter(). + * Implementation of hook_filter(). */ function lightbox2_filter_tips($delta, $format, $long = false) { - return t('Image links from G2 are formatted for use with Lightbox.V2'); + return t('Image links from G2 are formatted for use with Lightbox.V2'); } + // Check to see if the G2 Filter is Enabled in Settings if (variable_get("lightbox2G2_filter", true)) { -function lightbox2_filter($op, $delta = 0, $format = -1, $text = '') { - switch ($op) { - case 'list': - return array(0 => t('Lightbox filter')); - case 'description': - return t('Turns g2_filter links into Lighbox.V2 appropriate links'); - case 'process': - $text = ' ' . $text . ' '; + function lightbox2_filter($op, $delta = 0, $format = -1, $text = '') { + switch ($op) { + case 'list': + return array(0 => t('Lightbox filter')); + case 'description': + return t('Turns g2_filter links into Lighbox.V2 appropriate links'); + case 'process': + $text = ' '. $text .' '; $text = preg_replace('/ShowItem/','DownloadItem',$text); $text = preg_replace('/target=""/','rel="lightbox"',$text); $text = substr($text, 1, -1); - return $text; - default: - return $text; + return $text; + default: + return $text; + } } - } } + /** * Provides a link to the CSS stylesheet associated with this module. * Provides a link to the JS file associated with this module. @@ -150,32 +159,39 @@ function lightbox2_filter($op, $delta = 0, $format = -1, $text = '') { function lightbox2_add_files() { // Load required js and css files. $path = drupal_get_path('module', 'lightbox2'); - // Check to see if Lightbox2 Plus is enabled. - if (variable_get("lightbox2_plus", true)) { - theme("add_style", $path . '/lightbox.css'); + + // Check to see if Lightbox2 Plus is enabled. + if (variable_get("lightbox2_plus", true)) { + theme("add_style", $path .'/lightbox.css'); + // Check to see if Libraries are installed correctly. if (file_exists($path .'/js/prototype.js')) { - drupal_add_js($path . '/js/prototype.js'); - // Check to see if the Image Node Option is enabled in settings. - if (variable_get("lightbox2_image_node", true) && variable_get("lightbox2_image_group", true)) { - drupal_add_js($path . "/js/image_nodes.js"); - } - elseif (variable_get("lightbox2_image_node", true)) { - drupal_add_js($path . "/js/image_nodes_nogroup.js"); - } - drupal_add_js($path . '/js/scriptaculous.js'); - drupal_add_js($path . '/js/lightbox.js'); - // Future support for non-images will go here. - //drupal_add_js($path . '/js/lightbox_docs.js'); + drupal_add_js($path .'/js/prototype.js'); + + // Check to see if the Image Node Option is enabled in settings. + if (variable_get("lightbox2_image_node", true) && variable_get("lightbox2_image_group", true)) { + drupal_add_js($path ."/js/image_nodes.js"); + } + elseif (variable_get("lightbox2_image_node", true)) { + drupal_add_js($path ."/js/image_nodes_nogroup.js"); + } + drupal_add_js($path .'/js/scriptaculous.js'); + drupal_add_js($path .'/js/lightbox.js'); + + // Future support for non-images will go here. + //drupal_add_js($path .'/js/lightbox_docs.js'); } - // Display warning message if Libraries aren't installed correctly. - else { - drupal_set_message(t('The script.aculo.us library is in not installed correctly. Please download from http://script.aculo.us/downloads, follow the instructions in the Lightbox V.2 README.TXT file to copy the files to their correct locations.'), 'error'); - } - } - // Load Lightbox Lite if Plus is not enabled. - else { - theme("add_style", $path . '/lightbox_lite.css'); - drupal_add_js($path . '/js/lightbox_lite.js'); + + // Display warning message if Libraries aren't installed correctly. + else { + drupal_set_message(t('The script.aculo.us library is in not installed correctly. Please download from http://script.aculo.us/downloads, follow the instructions in the Lightbox V.2 README.TXT file to copy the files to their correct locations.'), 'error'); } + } + + + // Load Lightbox Lite if Plus is not enabled. + else { + theme("add_style", $path .'/lightbox_lite.css'); + drupal_add_js($path .'/js/lightbox_lite.js'); + } } diff --git a/lightbox_lite.css b/lightbox_lite.css index 43fc98b10823f810839f7c1ca13780611005ba72..563b16ef600dc840c56f250853515dcbf9bd057f 100644 --- a/lightbox_lite.css +++ b/lightbox_lite.css @@ -1,26 +1,28 @@ -#lightbox{ - background-color:#eee; - padding: 10px; - border-bottom: 2px solid #666; - border-right: 2px solid #666; - } -#lightboxDetails{ - font-size: 1.2em; - padding-top: 0.6em; - } -#lightboxCaption{ float: left; } -#keyboardMsg{ float: right; } -#closeButton{ top: 5px; right: 5px; } +#lightbox { + background-color: #eee; + padding: 10px; + border-bottom: 2px solid #666; + border-right: 2px solid #666; +} -#lightbox img{ border: none; clear: both;} -#overlay img{ border: none; } +#lightboxDetails { + font-size: 1.2em; + padding-top: 0.6em; +} -#overlay{ background-image: url(/modules/lightbox2/images/overlay.png); } +#lightboxCaption { float: left; } +#keyboardMsg { float: right; } +#closeButton { top: 5px; right: 5px; } -* html #overlay{ - background-color: #333; - back\ground-color: transparent; - background-image: url(/modules/lightbox2/images/blank.gif); - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/modules/lightbox2/images/overlay.png", sizingMethod="scale"); - } - \ No newline at end of file +#lightbox img { border: none; clear: both; } +#overlay img { border: none; } + +#overlay { background-image: url(/modules/lightbox2/images/overlay.png); } + +* html #overlay { + background-color: #333; + back\ground-color: transparent; + background-image: url(/modules/lightbox2/images/blank.gif); + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/modules/lightbox2/images/overlay.png", sizingMethod="scale"); +} +