summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStella Power2009-01-02 16:51:14 (GMT)
committer Stella Power2009-01-02 16:51:14 (GMT)
commit4ed8502a92a3522dd06af8de71ede5b11abfa6fd (patch)
treeef7f911f2e017d87c3c94481cb6d612ae7a0d7b2
parent38b3939c0ebc6fe6e86a2d83786e7d7abc024bbb (diff)
Added in a variable for video grouping text.
-rw-r--r--js/lightbox.js5
-rw-r--r--js/lightbox2.js2
-rw-r--r--lightbox2.install1
-rw-r--r--lightbox2.module11
4 files changed, 17 insertions, 2 deletions
diff --git a/js/lightbox.js b/js/lightbox.js
index 7f4ddd1..25447dc 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 81050c1..b5a590b 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 93cfed0..b78a376 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 72876b0..ed51e9e 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' => '<a href="#" onclick="hideLightbox(); return FALSE;"><kbd>x</kbd></a>')),
// Automatic image handling settings.
'keys_close' => variable_get('lightbox2_keys_close', 'c x 27'),