diff --git a/js/lightbox.js b/js/lightbox.js index 7f4ddd14725adfb588a922410b2c3d5a8c2e0161..25447dc6b37ece4dbb6021e835b740cb2d611ee6 100644 --- a/js/lightbox.js +++ b/js/lightbox.js @@ -680,9 +680,12 @@ var Lightbox = { var numberDisplay = null; if (Lightbox.total > 1) { var currentImage = Lightbox.activeImage + 1; - if (!Lightbox.isLightframe && !Lightbox.isModal) { + if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) { numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } + else if (Lightbox.isVideo) { + numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); + } else { numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } diff --git a/js/lightbox2.js b/js/lightbox2.js index 81050c10a75717ff7b6960a224d61059829b4ca4..b5a590b2c53ab15edf70971e337d66a9dbcd3301 100644 --- a/js/lightbox2.js +++ b/js/lightbox2.js @@ -31,6 +31,7 @@ function lightbox2_lite_general_handler(event) { $("input[@name=lightbox2_enable_video]").attr("disabled", "disabled"); $("input[@name=lightbox2_enable_login]").attr("disabled", "disabled"); $("input[@name=lightbox2_image_count_str]").attr("disabled", "disabled"); + $("input[@name=lightbox2_video_count_str]").attr("disabled", "disabled"); $("input[@name=lightbox2_page_count_str]").attr("disabled", "disabled"); $("select[@name=lightbox2_display_image_size]").attr("disabled", "disabled"); $("select[@name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled"); @@ -56,6 +57,7 @@ function lightbox2_lite_general_handler(event) { $("input[@name=lightbox2_enable_video]").removeAttr("disabled"); $("input[@name=lightbox2_enable_login]").removeAttr("disabled"); $("input[@name=lightbox2_image_count_str]").removeAttr("disabled"); + $("input[@name=lightbox2_video_count_str]").removeAttr("disabled"); $("input[@name=lightbox2_page_count_str]").removeAttr("disabled"); $("select[@name=lightbox2_display_image_size]").removeAttr("disabled"); $("select[@name='lightbox2_trigger_image_size[]']").removeAttr("disabled"); diff --git a/lightbox2.install b/lightbox2.install index 93cfed0fdbe2ee32adf28bca91759db2355d6097..b78a37645ea79ff7c81f045f192a95b928cd8a6e 100644 --- a/lightbox2.install +++ b/lightbox2.install @@ -28,6 +28,7 @@ function lightbox2_uninstall() { variable_del('lightbox2_loop_items'); variable_del('lightbox2_image_count_str'); variable_del('lightbox2_page_count_str'); + variable_del('lightbox2_video_count_str'); variable_del('lightbox2_disable_resize'); variable_del('lightbox2_disable_zoom'); variable_del('lightbox2_enable_login'); diff --git a/lightbox2.module b/lightbox2.module index 72876b09602e9a3bdfa3e4724865f851bf8a35c6..ed51e9e27aebc8be6b73b318e18d0a2994deea23 100644 --- a/lightbox2.module +++ b/lightbox2.module @@ -300,7 +300,7 @@ function lightbox2_general_settings_form() { drupal_add_js(drupal_get_path('module', 'lightbox2') .'/js/lightbox2.js', 'module'); // Enable translation of default strings for potx. - $default_strings = array(t('View Image Details'), t('Image !current of !total'), t('Page !current of !total')); + $default_strings = array(t('View Image Details'), t('Image !current of !total'), t('Page !current of !total'), t('Video !current of !total')); // Define Lightbox2 layout fieldset. /* --------------------------------- */ @@ -370,6 +370,14 @@ function lightbox2_general_settings_form() { '#default_value' => variable_get('lightbox2_page_count_str', 'Page !current of !total'), ); + // Add text box for video count for grouping. + $form['layout_fieldset']['lightbox2_video_count_str'] = array( + '#type' => 'textfield', + '#title' => t('Video count text'), + '#description' => t('This text is used to display the count underneath video content displayed in the lightbox when using groups. Use !current as a placeholder for the number of the current video and !total for the total number of videos in the group. For example, "Video !current of !total". Leave blank for text not to appear.'), + '#default_value' => variable_get('lightbox2_video_count_str', 'Video !current of !total'), + ); + // Define Lightbox2 zoom fieldset. /* -------------------------------- */ @@ -1505,6 +1513,7 @@ function lightbox2_add_files() { 'node_link_target' => variable_get('lightbox2_node_link_target', FALSE), 'image_count' => check_plain(variable_get('lightbox2_image_count_str', 'Image !current of !total')), 'page_count' => check_plain(variable_get('lightbox2_page_count_str', 'Page !current of !total')), + 'video_count' => check_plain(variable_get('lightbox2_video_count_str', 'Video !current of !total')), 'lite_press_x_close' => t('press !x to close', array('!x' => 'x')), // Automatic image handling settings. 'keys_close' => variable_get('lightbox2_keys_close', 'c x 27'),